Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 2 | /* |
Greg Ungerer | 5b2e6555 | 2010-11-02 12:05:29 +1000 | [diff] [blame] | 3 | * m54xxsim.h -- ColdFire 547x/548x System Integration Unit support. |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
Greg Ungerer | 5b2e6555 | 2010-11-02 12:05:29 +1000 | [diff] [blame] | 6 | #ifndef m54xxsim_h |
| 7 | #define m54xxsim_h |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 8 | |
Greg Ungerer | 733f31b | 2010-11-02 17:40:37 +1000 | [diff] [blame] | 9 | #define CPU_NAME "COLDFIRE(m54xx)" |
| 10 | #define CPU_INSTR_PER_JIFFY 2 |
Greg Ungerer | ce3de78 | 2011-03-09 14:19:08 +1000 | [diff] [blame] | 11 | #define MCF_BUSCLK (MCF_CLK / 2) |
Greg Ungerer | 81d3335 | 2016-08-25 23:10:59 +1000 | [diff] [blame] | 12 | #define MACHINE MACH_M54XX |
Greg Ungerer | cbd5b98 | 2016-08-25 23:12:22 +1000 | [diff] [blame] | 13 | #define FPUTYPE FPU_COLDFIRE |
Greg Ungerer | 8cf4a97 | 2016-08-26 15:59:30 +1000 | [diff] [blame] | 14 | #define IOMEMBASE MCF_MBAR |
| 15 | #define IOMEMSIZE 0x01000000 |
Greg Ungerer | 7fc82b6 | 2010-11-02 17:13:27 +1000 | [diff] [blame] | 16 | |
Greg Ungerer | 3d46140 | 2010-11-09 10:40:44 +1000 | [diff] [blame] | 17 | #include <asm/m54xxacr.h> |
| 18 | |
Greg Ungerer | 733f31b | 2010-11-02 17:40:37 +1000 | [diff] [blame] | 19 | #define MCFINT_VECBASE 64 |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 20 | |
| 21 | /* |
| 22 | * Interrupt Controller Registers |
| 23 | */ |
Greg Ungerer | 254eef7 | 2011-03-05 22:17:17 +1000 | [diff] [blame] | 24 | #define MCFICM_INTC0 (MCF_MBAR + 0x700) /* Base for Interrupt Ctrl 0 */ |
| 25 | |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 26 | #define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */ |
| 27 | #define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */ |
| 28 | #define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */ |
| 29 | #define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */ |
| 30 | #define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */ |
| 31 | #define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */ |
| 32 | #define MCFINTC_IRLR 0x18 /* */ |
| 33 | #define MCFINTC_IACKL 0x19 /* */ |
| 34 | #define MCFINTC_ICR0 0x40 /* Base ICR register */ |
| 35 | |
| 36 | /* |
Greg Ungerer | 5701542 | 2010-11-03 12:50:30 +1000 | [diff] [blame] | 37 | * UART module. |
| 38 | */ |
Greg Ungerer | bbbeeaf | 2011-12-24 00:46:37 +1000 | [diff] [blame] | 39 | #define MCFUART_BASE0 (MCF_MBAR + 0x8600) /* Base address UART0 */ |
| 40 | #define MCFUART_BASE1 (MCF_MBAR + 0x8700) /* Base address UART1 */ |
| 41 | #define MCFUART_BASE2 (MCF_MBAR + 0x8800) /* Base address UART2 */ |
| 42 | #define MCFUART_BASE3 (MCF_MBAR + 0x8900) /* Base address UART3 */ |
Greg Ungerer | 5701542 | 2010-11-03 12:50:30 +1000 | [diff] [blame] | 43 | |
| 44 | /* |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 45 | * Define system peripheral IRQ usage. |
| 46 | */ |
Greg Ungerer | bbbeeaf | 2011-12-24 00:46:37 +1000 | [diff] [blame] | 47 | #define MCF_IRQ_TIMER (MCFINT_VECBASE + 54) /* Slice Timer 0 */ |
| 48 | #define MCF_IRQ_PROFILER (MCFINT_VECBASE + 53) /* Slice Timer 1 */ |
Steven King | 2d24b53 | 2014-06-30 09:53:19 -0700 | [diff] [blame] | 49 | #define MCF_IRQ_I2C0 (MCFINT_VECBASE + 40) |
Greg Ungerer | bbbeeaf | 2011-12-24 00:46:37 +1000 | [diff] [blame] | 50 | #define MCF_IRQ_UART0 (MCFINT_VECBASE + 35) |
| 51 | #define MCF_IRQ_UART1 (MCFINT_VECBASE + 34) |
| 52 | #define MCF_IRQ_UART2 (MCFINT_VECBASE + 33) |
| 53 | #define MCF_IRQ_UART3 (MCFINT_VECBASE + 32) |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 54 | |
| 55 | /* |
Greg Ungerer | f2f41c6 | 2012-09-17 16:51:20 +1000 | [diff] [blame] | 56 | * Slice Timer support. |
| 57 | */ |
| 58 | #define MCFSLT_TIMER0 (MCF_MBAR + 0x900) /* Base addr TIMER0 */ |
| 59 | #define MCFSLT_TIMER1 (MCF_MBAR + 0x910) /* Base addr TIMER1 */ |
| 60 | |
| 61 | /* |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 62 | * Generic GPIO support |
| 63 | */ |
Steven King | 83c6bdb | 2014-05-21 16:00:33 -0700 | [diff] [blame] | 64 | #define MCFGPIO_PODR (MCF_MBAR + 0xA00) |
| 65 | #define MCFGPIO_PDDR (MCF_MBAR + 0xA10) |
| 66 | #define MCFGPIO_PPDR (MCF_MBAR + 0xA20) |
| 67 | #define MCFGPIO_SETR (MCF_MBAR + 0xA20) |
| 68 | #define MCFGPIO_CLRR (MCF_MBAR + 0xA30) |
| 69 | |
| 70 | #define MCFGPIO_PIN_MAX 136 /* 128 gpio + 8 eport */ |
| 71 | #define MCFGPIO_IRQ_MAX 8 |
| 72 | #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 73 | |
| 74 | /* |
Greg Ungerer | 57b4814 | 2011-03-11 17:06:58 +1000 | [diff] [blame] | 75 | * EDGE Port support. |
| 76 | */ |
| 77 | #define MCFEPORT_EPPAR (MCF_MBAR + 0xf00) /* Pin assignment */ |
| 78 | #define MCFEPORT_EPDDR (MCF_MBAR + 0xf04) /* Data direction */ |
| 79 | #define MCFEPORT_EPIER (MCF_MBAR + 0xf05) /* Interrupt enable */ |
| 80 | #define MCFEPORT_EPDR (MCF_MBAR + 0xf08) /* Port data (w) */ |
| 81 | #define MCFEPORT_EPPDR (MCF_MBAR + 0xf09) /* Port data (r) */ |
| 82 | #define MCFEPORT_EPFR (MCF_MBAR + 0xf0c) /* Flags */ |
| 83 | |
| 84 | /* |
Greg Ungerer | 632306f | 2012-09-18 14:34:04 +1000 | [diff] [blame] | 85 | * Pin Assignment register definitions |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 86 | */ |
Greg Ungerer | 632306f | 2012-09-18 14:34:04 +1000 | [diff] [blame] | 87 | #define MCFGPIO_PAR_FBCTL (MCF_MBAR + 0xA40) |
| 88 | #define MCFGPIO_PAR_FBCS (MCF_MBAR + 0xA42) |
| 89 | #define MCFGPIO_PAR_DMA (MCF_MBAR + 0xA43) |
| 90 | #define MCFGPIO_PAR_FECI2CIRQ (MCF_MBAR + 0xA44) |
| 91 | #define MCFGPIO_PAR_PCIBG (MCF_MBAR + 0xA48) /* PCI bus grant */ |
| 92 | #define MCFGPIO_PAR_PCIBR (MCF_MBAR + 0xA4A) /* PCI */ |
| 93 | #define MCFGPIO_PAR_PSC0 (MCF_MBAR + 0xA4F) |
| 94 | #define MCFGPIO_PAR_PSC1 (MCF_MBAR + 0xA4E) |
| 95 | #define MCFGPIO_PAR_PSC2 (MCF_MBAR + 0xA4D) |
| 96 | #define MCFGPIO_PAR_PSC3 (MCF_MBAR + 0xA4C) |
| 97 | #define MCFGPIO_PAR_DSPI (MCF_MBAR + 0xA50) |
| 98 | #define MCFGPIO_PAR_TIMER (MCF_MBAR + 0xA52) |
| 99 | |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 100 | #define MCF_PAR_SDA (0x0008) |
| 101 | #define MCF_PAR_SCL (0x0004) |
| 102 | #define MCF_PAR_PSC_TXD (0x04) |
| 103 | #define MCF_PAR_PSC_RXD (0x08) |
Philippe De Muyter | ea49f8ff | 2010-09-20 13:11:11 +0200 | [diff] [blame] | 104 | #define MCF_PAR_PSC_CTS_GPIO (0x00) |
| 105 | #define MCF_PAR_PSC_CTS_BCLK (0x80) |
| 106 | #define MCF_PAR_PSC_CTS_CTS (0xC0) |
| 107 | #define MCF_PAR_PSC_RTS_GPIO (0x00) |
| 108 | #define MCF_PAR_PSC_RTS_FSYNC (0x20) |
| 109 | #define MCF_PAR_PSC_RTS_RTS (0x30) |
| 110 | #define MCF_PAR_PSC_CANRX (0x40) |
| 111 | |
Steven King | 2d24b53 | 2014-06-30 09:53:19 -0700 | [diff] [blame] | 112 | #define MCF_PAR_FECI2CIRQ (MCF_MBAR + 0x00000a44) /* FEC/I2C/IRQ */ |
| 113 | #define MCF_PAR_FECI2CIRQ_SDA (1 << 3) |
| 114 | #define MCF_PAR_FECI2CIRQ_SCL (1 << 2) |
| 115 | |
| 116 | /* |
| 117 | * I2C module. |
| 118 | */ |
| 119 | #define MCFI2C_BASE0 (MCF_MBAR + 0x8f00) |
| 120 | #define MCFI2C_SIZE0 0x40 |
| 121 | |
Greg Ungerer | 5b2e6555 | 2010-11-02 12:05:29 +1000 | [diff] [blame] | 122 | #endif /* m54xxsim_h */ |