Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Uwe Zeisberger | f30c226 | 2006-10-03 23:01:26 +0200 | [diff] [blame] | 2 | * linux/drivers/serial/cpm_uart/cpm_uart_cpm1.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | * Driver for CPM (SCC/SMC) serial ports |
| 5 | * |
| 6 | * definitions for cpm1 |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | #ifndef CPM_UART_CPM1_H |
| 11 | #define CPM_UART_CPM1_H |
| 12 | |
Jochen Friedrich | b5677d8 | 2008-01-25 15:31:42 +0100 | [diff] [blame] | 13 | #include <asm/cpm1.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
| 15 | /* defines for IRQs */ |
Scott Wood | 7ae8703 | 2007-07-17 17:59:06 -0500 | [diff] [blame] | 16 | #ifndef CONFIG_PPC_CPM_NEW_BINDING |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #define SMC1_IRQ (CPM_IRQ_OFFSET + CPMVEC_SMC1) |
| 18 | #define SMC2_IRQ (CPM_IRQ_OFFSET + CPMVEC_SMC2) |
| 19 | #define SCC1_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC1) |
| 20 | #define SCC2_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC2) |
| 21 | #define SCC3_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC3) |
| 22 | #define SCC4_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC4) |
Scott Wood | 7ae8703 | 2007-07-17 17:59:06 -0500 | [diff] [blame] | 23 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | static inline void cpm_set_brg(int brg, int baud) |
| 26 | { |
| 27 | cpm_setbrg(brg, baud); |
| 28 | } |
| 29 | |
Scott Wood | c1dcfd9 | 2007-07-24 15:53:07 -0500 | [diff] [blame] | 30 | static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | { |
Scott Wood | c1dcfd9 | 2007-07-24 15:53:07 -0500 | [diff] [blame] | 32 | out_8(&sup->scc_genscc.scc_rfcr, SMC_EB); |
| 33 | out_8(&sup->scc_genscc.scc_tfcr, SMC_EB); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | } |
| 35 | |
Scott Wood | c1dcfd9 | 2007-07-24 15:53:07 -0500 | [diff] [blame] | 36 | static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | { |
Scott Wood | c1dcfd9 | 2007-07-24 15:53:07 -0500 | [diff] [blame] | 38 | out_8(&up->smc_rfcr, SMC_EB); |
| 39 | out_8(&up->smc_tfcr, SMC_EB); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | } |
| 41 | |
Scott Wood | c1dcfd9 | 2007-07-24 15:53:07 -0500 | [diff] [blame] | 42 | #define DPRAM_BASE ((u8 __iomem __force *)cpm_dpram_addr(0)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
| 44 | #endif |