wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------+ |
Josh Boyer | 471573b | 2009-08-07 13:53:20 -0400 | [diff] [blame] | 2 | | This source code is dual-licensed. You may use it under the terms of the |
| 3 | | GNU General Public License version 2, or under the license below. |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 4 | | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 5 | | This source code has been made available to you by IBM on an AS-IS |
| 6 | | basis. Anyone receiving this source is licensed under IBM |
| 7 | | copyrights to use it in any way he or she deems fit, including |
| 8 | | copying it, modifying it, compiling it, and redistributing it either |
| 9 | | with or without modifications. No license under IBM patents or |
| 10 | | patent applications is to be implied by the copyright license. |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 11 | | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 12 | | Any user of this software should understand that IBM cannot provide |
| 13 | | technical support for this software and will not be responsible for |
| 14 | | any consequences resulting from the use of this software. |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 15 | | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 16 | | Any person who transfers this source code or any derivative work |
| 17 | | must include the IBM copyright notice, this paragraph, and the |
| 18 | | preceding two paragraphs in the transferred software. |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 19 | | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 20 | | COPYRIGHT I B M CORPORATION 1999 |
| 21 | | LICENSED MATERIAL - PROGRAM PROPERTY OF I B M |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 22 | +----------------------------------------------------------------------------*/ |
| 23 | |
| 24 | #ifndef __PPC405_H__ |
| 25 | #define __PPC405_H__ |
| 26 | |
Grant Erickson | b693341 | 2008-05-22 14:44:14 -0700 | [diff] [blame] | 27 | /* Define bits and masks for real-mode storage attribute control registers */ |
| 28 | #define PPC_128MB_SACR_BIT(addr) ((addr) >> 27) |
| 29 | #define PPC_128MB_SACR_VALUE(addr) PPC_REG_VAL(PPC_128MB_SACR_BIT(addr),1) |
| 30 | |
Stefan Roese | eff3a0a | 2007-10-31 17:55:58 +0100 | [diff] [blame] | 31 | #ifndef CONFIG_IOP480 |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 32 | #define CONFIG_SYS_DCACHE_SIZE (16 << 10) /* For AMCC 405 CPUs */ |
Stefan Roese | eff3a0a | 2007-10-31 17:55:58 +0100 | [diff] [blame] | 33 | #else |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 34 | #define CONFIG_SYS_DCACHE_SIZE (2 << 10) /* For PLX IOP480(403)*/ |
Stefan Roese | eff3a0a | 2007-10-31 17:55:58 +0100 | [diff] [blame] | 35 | #endif |
| 36 | |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 37 | /* DCR registers */ |
| 38 | #define PLB0_ACR 0x0087 |
| 39 | |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 40 | /****************************************************************************** |
| 41 | * Special for PPC405GP |
| 42 | ******************************************************************************/ |
| 43 | |
| 44 | /****************************************************************************** |
| 45 | * DMA |
| 46 | ******************************************************************************/ |
| 47 | #define DMA_DCR_BASE 0x100 |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 48 | #define DMACR0 (DMA_DCR_BASE+0x00) /* DMA channel control register 0 */ |
| 49 | #define DMACT0 (DMA_DCR_BASE+0x01) /* DMA count register 0 */ |
| 50 | #define DMADA0 (DMA_DCR_BASE+0x02) /* DMA destination address register 0 */ |
| 51 | #define DMASA0 (DMA_DCR_BASE+0x03) /* DMA source address register 0 */ |
| 52 | #define DMASB0 (DMA_DCR_BASE+0x04) /* DMA scatter/gather descriptor addr 0 */ |
| 53 | #define DMACR1 (DMA_DCR_BASE+0x08) /* DMA channel control register 1 */ |
| 54 | #define DMACT1 (DMA_DCR_BASE+0x09) /* DMA count register 1 */ |
| 55 | #define DMADA1 (DMA_DCR_BASE+0x0a) /* DMA destination address register 1 */ |
| 56 | #define DMASA1 (DMA_DCR_BASE+0x0b) /* DMA source address register 1 */ |
| 57 | #define DMASB1 (DMA_DCR_BASE+0x0c) /* DMA scatter/gather descriptor addr 1 */ |
| 58 | #define DMACR2 (DMA_DCR_BASE+0x10) /* DMA channel control register 2 */ |
| 59 | #define DMACT2 (DMA_DCR_BASE+0x11) /* DMA count register 2 */ |
| 60 | #define DMADA2 (DMA_DCR_BASE+0x12) /* DMA destination address register 2 */ |
| 61 | #define DMASA2 (DMA_DCR_BASE+0x13) /* DMA source address register 2 */ |
| 62 | #define DMASB2 (DMA_DCR_BASE+0x14) /* DMA scatter/gather descriptor addr 2 */ |
| 63 | #define DMACR3 (DMA_DCR_BASE+0x18) /* DMA channel control register 3 */ |
| 64 | #define DMACT3 (DMA_DCR_BASE+0x19) /* DMA count register 3 */ |
| 65 | #define DMADA3 (DMA_DCR_BASE+0x1a) /* DMA destination address register 3 */ |
| 66 | #define DMASA3 (DMA_DCR_BASE+0x1b) /* DMA source address register 3 */ |
| 67 | #define DMASB3 (DMA_DCR_BASE+0x1c) /* DMA scatter/gather descriptor addr 3 */ |
| 68 | #define DMASR (DMA_DCR_BASE+0x20) /* DMA status register */ |
| 69 | #define DMASGC (DMA_DCR_BASE+0x23) /* DMA scatter/gather command register */ |
| 70 | #define DMAADR (DMA_DCR_BASE+0x24) /* DMA address decode register */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 71 | |
stroese | b0ca12d | 2003-12-09 14:59:11 +0000 | [diff] [blame] | 72 | #ifndef CONFIG_405EP |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 73 | /****************************************************************************** |
| 74 | * Decompression Controller |
| 75 | ******************************************************************************/ |
| 76 | #define DECOMP_DCR_BASE 0x14 |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 77 | #define KIAR (DECOMP_DCR_BASE+0x0) /* Decompression controller addr reg */ |
| 78 | #define KIDR (DECOMP_DCR_BASE+0x1) /* Decompression controller data reg */ |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 79 | /* values for kiar register - indirect addressing of these regs */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 80 | #define KCONF 0x40 /* decompression core config register */ |
stroese | b0ca12d | 2003-12-09 14:59:11 +0000 | [diff] [blame] | 81 | #endif |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 82 | |
| 83 | /****************************************************************************** |
| 84 | * Power Management |
| 85 | ******************************************************************************/ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 86 | #ifdef CONFIG_405EX |
| 87 | #define POWERMAN_DCR_BASE 0xb0 |
| 88 | #else |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 89 | #define POWERMAN_DCR_BASE 0xb8 |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 90 | #endif |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 91 | #define CPMSR (POWERMAN_DCR_BASE+0x0) /* Power management status */ |
| 92 | #define CPMER (POWERMAN_DCR_BASE+0x1) /* Power management enable */ |
| 93 | #define CPMFR (POWERMAN_DCR_BASE+0x2) /* Power management force */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 94 | |
| 95 | /****************************************************************************** |
| 96 | * Extrnal Bus Controller |
| 97 | ******************************************************************************/ |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 98 | /* values for EBC0_CFGADDR register - indirect addressing of these regs */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 99 | #define PB0CR 0x00 /* periph bank 0 config reg */ |
| 100 | #define PB1CR 0x01 /* periph bank 1 config reg */ |
| 101 | #define PB2CR 0x02 /* periph bank 2 config reg */ |
| 102 | #define PB3CR 0x03 /* periph bank 3 config reg */ |
| 103 | #define PB4CR 0x04 /* periph bank 4 config reg */ |
stroese | b0ca12d | 2003-12-09 14:59:11 +0000 | [diff] [blame] | 104 | #ifndef CONFIG_405EP |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 105 | #define PB5CR 0x05 /* periph bank 5 config reg */ |
| 106 | #define PB6CR 0x06 /* periph bank 6 config reg */ |
| 107 | #define PB7CR 0x07 /* periph bank 7 config reg */ |
stroese | b0ca12d | 2003-12-09 14:59:11 +0000 | [diff] [blame] | 108 | #endif |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 109 | #define PB0AP 0x10 /* periph bank 0 access parameters */ |
| 110 | #define PB1AP 0x11 /* periph bank 1 access parameters */ |
| 111 | #define PB2AP 0x12 /* periph bank 2 access parameters */ |
| 112 | #define PB3AP 0x13 /* periph bank 3 access parameters */ |
| 113 | #define PB4AP 0x14 /* periph bank 4 access parameters */ |
stroese | b0ca12d | 2003-12-09 14:59:11 +0000 | [diff] [blame] | 114 | #ifndef CONFIG_405EP |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 115 | #define PB5AP 0x15 /* periph bank 5 access parameters */ |
| 116 | #define PB6AP 0x16 /* periph bank 6 access parameters */ |
| 117 | #define PB7AP 0x17 /* periph bank 7 access parameters */ |
stroese | b0ca12d | 2003-12-09 14:59:11 +0000 | [diff] [blame] | 118 | #endif |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 119 | #define PBEAR 0x20 /* periph bus error addr reg */ |
| 120 | #define PBESR0 0x21 /* periph bus error status reg 0 */ |
| 121 | #define PBESR1 0x22 /* periph bus error status reg 1 */ |
| 122 | #define EBC0_CFG 0x23 /* external bus configuration reg */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 123 | |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 124 | #ifdef CONFIG_405EP |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 125 | /****************************************************************************** |
| 126 | * Control |
| 127 | ******************************************************************************/ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 128 | #define CNTRL_DCR_BASE 0x0f0 |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 129 | #define CPC0_PLLMR0 (CNTRL_DCR_BASE+0x0) /* PLL mode register 0 */ |
| 130 | #define CPC0_BOOT (CNTRL_DCR_BASE+0x1) /* Clock status register */ |
| 131 | #define CPC0_EPCTL (CNTRL_DCR_BASE+0x3) /* EMAC to PHY control register */ |
| 132 | #define CPC0_PLLMR1 (CNTRL_DCR_BASE+0x4) /* PLL mode register 1 */ |
| 133 | #define CPC0_UCR (CNTRL_DCR_BASE+0x5) /* UART control register */ |
| 134 | #define CPC0_PCI (CNTRL_DCR_BASE+0x9) /* PCI control register */ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 135 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 136 | #define CPC0_PLLMR0 (CNTRL_DCR_BASE+0x0) /* PLL mode 0 register */ |
| 137 | #define CPC0_BOOT (CNTRL_DCR_BASE+0x1) /* Chip Clock Status register */ |
| 138 | #define CPC0_CR1 (CNTRL_DCR_BASE+0x2) /* Chip Control 1 register */ |
| 139 | #define CPC0_EPRCSR (CNTRL_DCR_BASE+0x3) /* EMAC PHY Rcv Clk Src register */ |
| 140 | #define CPC0_PLLMR1 (CNTRL_DCR_BASE+0x4) /* PLL mode 1 register */ |
| 141 | #define CPC0_UCR (CNTRL_DCR_BASE+0x5) /* UART Control register */ |
| 142 | #define CPC0_SRR (CNTRL_DCR_BASE+0x6) /* Soft Reset register */ |
| 143 | #define CPC0_JTAGID (CNTRL_DCR_BASE+0x7) /* JTAG ID register */ |
| 144 | #define CPC0_SPARE (CNTRL_DCR_BASE+0x8) /* Spare DCR */ |
| 145 | #define CPC0_PCI (CNTRL_DCR_BASE+0x9) /* PCI Control register */ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 146 | |
| 147 | /* Bit definitions */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 148 | #define PLLMR0_CPU_DIV_MASK 0x00300000 /* CPU clock divider */ |
| 149 | #define PLLMR0_CPU_DIV_BYPASS 0x00000000 |
| 150 | #define PLLMR0_CPU_DIV_2 0x00100000 |
| 151 | #define PLLMR0_CPU_DIV_3 0x00200000 |
| 152 | #define PLLMR0_CPU_DIV_4 0x00300000 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 153 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 154 | #define PLLMR0_CPU_TO_PLB_MASK 0x00030000 /* CPU:PLB Frequency Divisor */ |
| 155 | #define PLLMR0_CPU_PLB_DIV_1 0x00000000 |
| 156 | #define PLLMR0_CPU_PLB_DIV_2 0x00010000 |
| 157 | #define PLLMR0_CPU_PLB_DIV_3 0x00020000 |
| 158 | #define PLLMR0_CPU_PLB_DIV_4 0x00030000 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 159 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 160 | #define PLLMR0_OPB_TO_PLB_MASK 0x00003000 /* OPB:PLB Frequency Divisor */ |
| 161 | #define PLLMR0_OPB_PLB_DIV_1 0x00000000 |
| 162 | #define PLLMR0_OPB_PLB_DIV_2 0x00001000 |
| 163 | #define PLLMR0_OPB_PLB_DIV_3 0x00002000 |
| 164 | #define PLLMR0_OPB_PLB_DIV_4 0x00003000 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 165 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 166 | #define PLLMR0_EXB_TO_PLB_MASK 0x00000300 /* External Bus:PLB Divisor */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 167 | #define PLLMR0_EXB_PLB_DIV_2 0x00000000 |
| 168 | #define PLLMR0_EXB_PLB_DIV_3 0x00000100 |
| 169 | #define PLLMR0_EXB_PLB_DIV_4 0x00000200 |
| 170 | #define PLLMR0_EXB_PLB_DIV_5 0x00000300 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 171 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 172 | #define PLLMR0_MAL_TO_PLB_MASK 0x00000030 /* MAL:PLB Divisor */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 173 | #define PLLMR0_MAL_PLB_DIV_1 0x00000000 |
| 174 | #define PLLMR0_MAL_PLB_DIV_2 0x00000010 |
| 175 | #define PLLMR0_MAL_PLB_DIV_3 0x00000020 |
| 176 | #define PLLMR0_MAL_PLB_DIV_4 0x00000030 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 177 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 178 | #define PLLMR0_PCI_TO_PLB_MASK 0x00000003 /* PCI:PLB Frequency Divisor */ |
| 179 | #define PLLMR0_PCI_PLB_DIV_1 0x00000000 |
| 180 | #define PLLMR0_PCI_PLB_DIV_2 0x00000001 |
| 181 | #define PLLMR0_PCI_PLB_DIV_3 0x00000002 |
| 182 | #define PLLMR0_PCI_PLB_DIV_4 0x00000003 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 183 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 184 | #define PLLMR1_SSCS_MASK 0x80000000 /* Select system clock source */ |
| 185 | #define PLLMR1_PLLR_MASK 0x40000000 /* PLL reset */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 186 | #define PLLMR1_FBMUL_MASK 0x00F00000 /* PLL feedback multiplier value */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 187 | #define PLLMR1_FBMUL_DIV_16 0x00000000 |
| 188 | #define PLLMR1_FBMUL_DIV_1 0x00100000 |
| 189 | #define PLLMR1_FBMUL_DIV_2 0x00200000 |
| 190 | #define PLLMR1_FBMUL_DIV_3 0x00300000 |
| 191 | #define PLLMR1_FBMUL_DIV_4 0x00400000 |
| 192 | #define PLLMR1_FBMUL_DIV_5 0x00500000 |
| 193 | #define PLLMR1_FBMUL_DIV_6 0x00600000 |
| 194 | #define PLLMR1_FBMUL_DIV_7 0x00700000 |
| 195 | #define PLLMR1_FBMUL_DIV_8 0x00800000 |
| 196 | #define PLLMR1_FBMUL_DIV_9 0x00900000 |
| 197 | #define PLLMR1_FBMUL_DIV_10 0x00A00000 |
| 198 | #define PLLMR1_FBMUL_DIV_11 0x00B00000 |
| 199 | #define PLLMR1_FBMUL_DIV_12 0x00C00000 |
| 200 | #define PLLMR1_FBMUL_DIV_13 0x00D00000 |
| 201 | #define PLLMR1_FBMUL_DIV_14 0x00E00000 |
| 202 | #define PLLMR1_FBMUL_DIV_15 0x00F00000 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 203 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 204 | #define PLLMR1_FWDVA_MASK 0x00070000 /* PLL forward divider A value */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 205 | #define PLLMR1_FWDVA_DIV_8 0x00000000 |
| 206 | #define PLLMR1_FWDVA_DIV_7 0x00010000 |
| 207 | #define PLLMR1_FWDVA_DIV_6 0x00020000 |
| 208 | #define PLLMR1_FWDVA_DIV_5 0x00030000 |
| 209 | #define PLLMR1_FWDVA_DIV_4 0x00040000 |
| 210 | #define PLLMR1_FWDVA_DIV_3 0x00050000 |
| 211 | #define PLLMR1_FWDVA_DIV_2 0x00060000 |
| 212 | #define PLLMR1_FWDVA_DIV_1 0x00070000 |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 213 | #define PLLMR1_FWDVB_MASK 0x00007000 /* PLL forward divider B value */ |
| 214 | #define PLLMR1_TUNING_MASK 0x000003FF /* PLL tune bits */ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 215 | |
| 216 | /* Defines for CPC0_EPRCSR register */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 217 | #define CPC0_EPRCSR_E0NFE 0x80000000 |
| 218 | #define CPC0_EPRCSR_E1NFE 0x40000000 |
| 219 | #define CPC0_EPRCSR_E1RPP 0x00000080 |
| 220 | #define CPC0_EPRCSR_E0RPP 0x00000040 |
| 221 | #define CPC0_EPRCSR_E1ERP 0x00000020 |
| 222 | #define CPC0_EPRCSR_E0ERP 0x00000010 |
| 223 | #define CPC0_EPRCSR_E1PCI 0x00000002 |
| 224 | #define CPC0_EPRCSR_E0PCI 0x00000001 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 225 | |
| 226 | /* Defines for CPC0_PCI Register */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 227 | #define CPC0_PCI_SPE 0x00000010 /* PCIINT/WE select */ |
| 228 | #define CPC0_PCI_HOST_CFG_EN 0x00000008 /* PCI host config Enable */ |
| 229 | #define CPC0_PCI_ARBIT_EN 0x00000001 /* PCI Internal Arb Enabled */ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 230 | |
| 231 | /* Defines for CPC0_BOOR Register */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 232 | #define CPC0_BOOT_SEP 0x00000002 /* serial EEPROM present */ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 233 | |
| 234 | /* Defines for CPC0_PLLMR1 Register fields */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 235 | #define PLL_ACTIVE 0x80000000 |
| 236 | #define CPC0_PLLMR1_SSCS 0x80000000 |
| 237 | #define PLL_RESET 0x40000000 |
| 238 | #define CPC0_PLLMR1_PLLR 0x40000000 |
| 239 | /* Feedback multiplier */ |
| 240 | #define PLL_FBKDIV 0x00F00000 |
| 241 | #define CPC0_PLLMR1_FBDV 0x00F00000 |
| 242 | #define PLL_FBKDIV_16 0x00000000 |
| 243 | #define PLL_FBKDIV_1 0x00100000 |
| 244 | #define PLL_FBKDIV_2 0x00200000 |
| 245 | #define PLL_FBKDIV_3 0x00300000 |
| 246 | #define PLL_FBKDIV_4 0x00400000 |
| 247 | #define PLL_FBKDIV_5 0x00500000 |
| 248 | #define PLL_FBKDIV_6 0x00600000 |
| 249 | #define PLL_FBKDIV_7 0x00700000 |
| 250 | #define PLL_FBKDIV_8 0x00800000 |
| 251 | #define PLL_FBKDIV_9 0x00900000 |
| 252 | #define PLL_FBKDIV_10 0x00A00000 |
| 253 | #define PLL_FBKDIV_11 0x00B00000 |
| 254 | #define PLL_FBKDIV_12 0x00C00000 |
| 255 | #define PLL_FBKDIV_13 0x00D00000 |
| 256 | #define PLL_FBKDIV_14 0x00E00000 |
| 257 | #define PLL_FBKDIV_15 0x00F00000 |
| 258 | /* Forward A divisor */ |
| 259 | #define PLL_FWDDIVA 0x00070000 |
| 260 | #define CPC0_PLLMR1_FWDVA 0x00070000 |
| 261 | #define PLL_FWDDIVA_8 0x00000000 |
| 262 | #define PLL_FWDDIVA_7 0x00010000 |
| 263 | #define PLL_FWDDIVA_6 0x00020000 |
| 264 | #define PLL_FWDDIVA_5 0x00030000 |
| 265 | #define PLL_FWDDIVA_4 0x00040000 |
| 266 | #define PLL_FWDDIVA_3 0x00050000 |
| 267 | #define PLL_FWDDIVA_2 0x00060000 |
| 268 | #define PLL_FWDDIVA_1 0x00070000 |
| 269 | /* Forward B divisor */ |
| 270 | #define PLL_FWDDIVB 0x00007000 |
| 271 | #define CPC0_PLLMR1_FWDVB 0x00007000 |
| 272 | #define PLL_FWDDIVB_8 0x00000000 |
| 273 | #define PLL_FWDDIVB_7 0x00001000 |
| 274 | #define PLL_FWDDIVB_6 0x00002000 |
| 275 | #define PLL_FWDDIVB_5 0x00003000 |
| 276 | #define PLL_FWDDIVB_4 0x00004000 |
| 277 | #define PLL_FWDDIVB_3 0x00005000 |
| 278 | #define PLL_FWDDIVB_2 0x00006000 |
| 279 | #define PLL_FWDDIVB_1 0x00007000 |
| 280 | /* PLL tune bits */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 281 | #define PLL_TUNE_MASK 0x000003FF |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 282 | #define PLL_TUNE_2_M_3 0x00000133 /* 2 <= M <= 3 */ |
| 283 | #define PLL_TUNE_4_M_6 0x00000134 /* 3 < M <= 6 */ |
| 284 | #define PLL_TUNE_7_M_10 0x00000138 /* 6 < M <= 10 */ |
| 285 | #define PLL_TUNE_11_M_14 0x0000013C /* 10 < M <= 14 */ |
| 286 | #define PLL_TUNE_15_M_40 0x0000023E /* 14 < M <= 40 */ |
| 287 | #define PLL_TUNE_VCO_LOW 0x00000000 /* 500MHz <= VCO <= 800MHz */ |
| 288 | #define PLL_TUNE_VCO_HI 0x00000080 /* 800MHz < VCO <= 1000MHz */ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 289 | |
| 290 | /* Defines for CPC0_PLLMR0 Register fields */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 291 | /* CPU divisor */ |
| 292 | #define PLL_CPUDIV 0x00300000 |
| 293 | #define CPC0_PLLMR0_CCDV 0x00300000 |
| 294 | #define PLL_CPUDIV_1 0x00000000 |
| 295 | #define PLL_CPUDIV_2 0x00100000 |
| 296 | #define PLL_CPUDIV_3 0x00200000 |
| 297 | #define PLL_CPUDIV_4 0x00300000 |
| 298 | /* PLB divisor */ |
| 299 | #define PLL_PLBDIV 0x00030000 |
| 300 | #define CPC0_PLLMR0_CBDV 0x00030000 |
| 301 | #define PLL_PLBDIV_1 0x00000000 |
| 302 | #define PLL_PLBDIV_2 0x00010000 |
| 303 | #define PLL_PLBDIV_3 0x00020000 |
| 304 | #define PLL_PLBDIV_4 0x00030000 |
| 305 | /* OPB divisor */ |
| 306 | #define PLL_OPBDIV 0x00003000 |
| 307 | #define CPC0_PLLMR0_OPDV 0x00003000 |
| 308 | #define PLL_OPBDIV_1 0x00000000 |
| 309 | #define PLL_OPBDIV_2 0x00001000 |
| 310 | #define PLL_OPBDIV_3 0x00002000 |
| 311 | #define PLL_OPBDIV_4 0x00003000 |
| 312 | /* EBC divisor */ |
| 313 | #define PLL_EXTBUSDIV 0x00000300 |
| 314 | #define CPC0_PLLMR0_EPDV 0x00000300 |
| 315 | #define PLL_EXTBUSDIV_2 0x00000000 |
| 316 | #define PLL_EXTBUSDIV_3 0x00000100 |
| 317 | #define PLL_EXTBUSDIV_4 0x00000200 |
| 318 | #define PLL_EXTBUSDIV_5 0x00000300 |
| 319 | /* MAL divisor */ |
| 320 | #define PLL_MALDIV 0x00000030 |
| 321 | #define CPC0_PLLMR0_MPDV 0x00000030 |
| 322 | #define PLL_MALDIV_1 0x00000000 |
| 323 | #define PLL_MALDIV_2 0x00000010 |
| 324 | #define PLL_MALDIV_3 0x00000020 |
| 325 | #define PLL_MALDIV_4 0x00000030 |
| 326 | /* PCI divisor */ |
| 327 | #define PLL_PCIDIV 0x00000003 |
| 328 | #define CPC0_PLLMR0_PPFD 0x00000003 |
| 329 | #define PLL_PCIDIV_1 0x00000000 |
| 330 | #define PLL_PCIDIV_2 0x00000001 |
| 331 | #define PLL_PCIDIV_3 0x00000002 |
| 332 | #define PLL_PCIDIV_4 0x00000003 |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 333 | |
| 334 | /* |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 335 | *------------------------------------------------------------------------------ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 336 | * PLL settings for 266MHz CPU, 133MHz PLB/SDRAM, 66MHz EBC, 33MHz PCI, |
| 337 | * assuming a 33.3MHz input clock to the 405EP. |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 338 | *------------------------------------------------------------------------------ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 339 | */ |
| 340 | #define PLLMR0_266_133_66 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 341 | PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \ |
| 342 | PLL_MALDIV_1 | PLL_PCIDIV_4) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 343 | #define PLLMR1_266_133_66 (PLL_FBKDIV_8 | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 344 | PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \ |
| 345 | PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 346 | |
| 347 | #define PLLMR0_133_66_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_1 | \ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 348 | PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 349 | PLL_MALDIV_1 | PLL_PCIDIV_4) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 350 | #define PLLMR1_133_66_66_33 (PLL_FBKDIV_4 | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 351 | PLL_FWDDIVA_6 | PLL_FWDDIVB_6 | \ |
| 352 | PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 353 | #define PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 354 | PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 355 | PLL_MALDIV_1 | PLL_PCIDIV_4) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 356 | #define PLLMR1_200_100_50_33 (PLL_FBKDIV_6 | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 357 | PLL_FWDDIVA_4 | PLL_FWDDIVB_4 | \ |
| 358 | PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 359 | #define PLLMR0_266_133_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 360 | PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 361 | PLL_MALDIV_1 | PLL_PCIDIV_4) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 362 | #define PLLMR1_266_133_66_33 (PLL_FBKDIV_8 | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 363 | PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \ |
| 364 | PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW) |
stroese | 317a25f | 2004-12-16 18:03:44 +0000 | [diff] [blame] | 365 | #define PLLMR0_266_66_33_33 (PLL_CPUDIV_1 | PLL_PLBDIV_4 | \ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 366 | PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \ |
wdenk | 07d7e6b | 2004-12-16 21:44:03 +0000 | [diff] [blame] | 367 | PLL_MALDIV_1 | PLL_PCIDIV_2) |
stroese | 317a25f | 2004-12-16 18:03:44 +0000 | [diff] [blame] | 368 | #define PLLMR1_266_66_33_33 (PLL_FBKDIV_8 | \ |
wdenk | 07d7e6b | 2004-12-16 21:44:03 +0000 | [diff] [blame] | 369 | PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \ |
| 370 | PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW) |
Stefan Roese | a5d182e | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 371 | #define PLLMR0_333_111_55_37 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 372 | PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \ |
Stefan Roese | a5d182e | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 373 | PLL_MALDIV_1 | PLL_PCIDIV_3) |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 374 | #define PLLMR1_333_111_55_37 (PLL_FBKDIV_10 | \ |
Stefan Roese | a5d182e | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 375 | PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \ |
| 376 | PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI) |
| 377 | #define PLLMR0_333_111_55_111 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 378 | PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \ |
Stefan Roese | a5d182e | 2007-08-14 14:44:41 +0200 | [diff] [blame] | 379 | PLL_MALDIV_1 | PLL_PCIDIV_1) |
| 380 | #define PLLMR1_333_111_55_111 (PLL_FBKDIV_10 | \ |
| 381 | PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \ |
| 382 | PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 383 | |
| 384 | /* |
| 385 | * PLL Voltage Controlled Oscillator (VCO) definitions |
| 386 | * Maximum and minimum values (in MHz) for correct PLL operation. |
| 387 | */ |
| 388 | #define VCO_MIN 500 |
| 389 | #define VCO_MAX 1000 |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 390 | #elif defined(CONFIG_405EZ) |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 391 | #define SDR0_NAND0 0x4000 |
| 392 | #define SDR0_ULTRA0 0x4040 |
| 393 | #define SDR0_ULTRA1 0x4050 |
| 394 | #define SDR0_ICINTSTAT 0x4510 |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 395 | |
| 396 | #define SDR_NAND0_NDEN 0x80000000 |
Stefan Roese | 23d8d34 | 2007-06-06 11:42:13 +0200 | [diff] [blame] | 397 | #define SDR_NAND0_NDBTEN 0x40000000 |
| 398 | #define SDR_NAND0_NDBADR_MASK 0x30000000 |
| 399 | #define SDR_NAND0_NDBPG_MASK 0x0f000000 |
| 400 | #define SDR_NAND0_NDAREN 0x00800000 |
| 401 | #define SDR_NAND0_NDRBEN 0x00400000 |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 402 | |
| 403 | #define SDR_ULTRA0_NDGPIOBP 0x80000000 |
| 404 | #define SDR_ULTRA0_CSN_MASK 0x78000000 |
| 405 | #define SDR_ULTRA0_CSNSEL0 0x40000000 |
| 406 | #define SDR_ULTRA0_CSNSEL1 0x20000000 |
| 407 | #define SDR_ULTRA0_CSNSEL2 0x10000000 |
| 408 | #define SDR_ULTRA0_CSNSEL3 0x08000000 |
Stefan Roese | 23d8d34 | 2007-06-06 11:42:13 +0200 | [diff] [blame] | 409 | #define SDR_ULTRA0_EBCRDYEN 0x04000000 |
| 410 | #define SDR_ULTRA0_SPISSINEN 0x02000000 |
| 411 | #define SDR_ULTRA0_NFSRSTEN 0x01000000 |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 412 | |
| 413 | #define SDR_ULTRA1_LEDNENABLE 0x40000000 |
| 414 | |
| 415 | #define SDR_ICRX_STAT 0x80000000 |
| 416 | #define SDR_ICTX0_STAT 0x40000000 |
| 417 | #define SDR_ICTX1_STAT 0x20000000 |
| 418 | |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 419 | #define SDR0_PINSTP 0x40 |
Stefan Roese | 3a75ac1 | 2007-04-18 12:05:59 +0200 | [diff] [blame] | 420 | |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 421 | /****************************************************************************** |
| 422 | * Control |
| 423 | ******************************************************************************/ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 424 | /* CPR Registers */ |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 425 | #define CPR0_CLKUP 0x020 /* CPR_CLKUPD */ |
| 426 | #define CPR0_PLLC 0x040 /* CPR_PLLC */ |
| 427 | #define CPR0_PLLD 0x060 /* CPR_PLLD */ |
| 428 | #define CPC0_PRIMAD 0x080 /* CPR_PRIMAD */ |
| 429 | #define CPC0_PERD0 0x0e0 /* CPR_PERD0 */ |
| 430 | #define CPC0_PERD1 0x0e1 /* CPR_PERD1 */ |
| 431 | #define CPC0_PERC0 0x180 /* CPR_PERC0 */ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 432 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 433 | #define CPR_CLKUPD_ENPLLCH_EN 0x40000000 /* Enable CPR PLL Changes */ |
| 434 | #define CPR_CLKUPD_ENDVCH_EN 0x20000000 /* Enable CPR Sys. Div. Changes */ |
| 435 | #define CPR_PERD0_SPIDV_MASK 0x000F0000 /* SPI Clock Divider */ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 436 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 437 | #define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */ |
Stefan Roese | 87476ba | 2007-08-13 09:05:33 +0200 | [diff] [blame] | 438 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 439 | #define PLLD_FBDV_MASK 0x1F000000 /* PLL feedback divider value */ |
| 440 | #define PLLD_FWDVA_MASK 0x000F0000 /* PLL forward divider A value */ |
| 441 | #define PLLD_FWDVB_MASK 0x00000700 /* PLL forward divider B value */ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 442 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 443 | #define PRIMAD_CPUDV_MASK 0x0F000000 /* CPU Clock Divisor Mask */ |
| 444 | #define PRIMAD_PLBDV_MASK 0x000F0000 /* PLB Clock Divisor Mask */ |
| 445 | #define PRIMAD_OPBDV_MASK 0x00000F00 /* OPB Clock Divisor Mask */ |
| 446 | #define PRIMAD_EBCDV_MASK 0x0000000F /* EBC Clock Divisor Mask */ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 447 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 448 | #define PERD0_PWMDV_MASK 0xFF000000 /* PWM Divider Mask */ |
| 449 | #define PERD0_SPIDV_MASK 0x000F0000 /* SPI Divider Mask */ |
| 450 | #define PERD0_U0DV_MASK 0x0000FF00 /* UART 0 Divider Mask */ |
| 451 | #define PERD0_U1DV_MASK 0x000000FF /* UART 1 Divider Mask */ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 452 | |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 453 | #else /* #ifdef CONFIG_405EP */ |
| 454 | /****************************************************************************** |
| 455 | * Control |
| 456 | ******************************************************************************/ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 457 | #define CNTRL_DCR_BASE 0x0b0 |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 458 | #define CPC0_PLLMR (CNTRL_DCR_BASE + 0x0) /* PLL mode register */ |
| 459 | #define CPC0_CR0 (CNTRL_DCR_BASE + 0x1) /* chip control register 0 */ |
| 460 | #define CPC0_CR1 (CNTRL_DCR_BASE + 0x2) /* chip control register 1 */ |
| 461 | #define CPC0_PSR (CNTRL_DCR_BASE + 0x4) /* chip pin strapping reg */ |
Niklaus Giger | 907a304 | 2008-02-05 10:26:41 +0100 | [diff] [blame] | 462 | |
| 463 | /* CPC0_ECR/CPC0_EIRR: PPC405GPr only */ |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 464 | #define CPC0_EIRR (CNTRL_DCR_BASE + 0x6) /* ext interrupt routing reg */ |
| 465 | #define CPC0_ECR 0xaa /* edge conditioner register */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 466 | |
| 467 | /* Bit definitions */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 468 | #define PLLMR_FWD_DIV_MASK 0xE0000000 /* Forward Divisor */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 469 | #define PLLMR_FWD_DIV_BYPASS 0xE0000000 |
| 470 | #define PLLMR_FWD_DIV_3 0xA0000000 |
| 471 | #define PLLMR_FWD_DIV_4 0x80000000 |
| 472 | #define PLLMR_FWD_DIV_6 0x40000000 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 473 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 474 | #define PLLMR_FB_DIV_MASK 0x1E000000 /* Feedback Divisor */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 475 | #define PLLMR_FB_DIV_1 0x02000000 |
| 476 | #define PLLMR_FB_DIV_2 0x04000000 |
| 477 | #define PLLMR_FB_DIV_3 0x06000000 |
| 478 | #define PLLMR_FB_DIV_4 0x08000000 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 479 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 480 | #define PLLMR_TUNING_MASK 0x01F80000 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 481 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 482 | #define PLLMR_CPU_TO_PLB_MASK 0x00060000 /* CPU:PLB Frequency Divisor */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 483 | #define PLLMR_CPU_PLB_DIV_1 0x00000000 |
| 484 | #define PLLMR_CPU_PLB_DIV_2 0x00020000 |
| 485 | #define PLLMR_CPU_PLB_DIV_3 0x00040000 |
| 486 | #define PLLMR_CPU_PLB_DIV_4 0x00060000 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 487 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 488 | #define PLLMR_OPB_TO_PLB_MASK 0x00018000 /* OPB:PLB Frequency Divisor */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 489 | #define PLLMR_OPB_PLB_DIV_1 0x00000000 |
| 490 | #define PLLMR_OPB_PLB_DIV_2 0x00008000 |
| 491 | #define PLLMR_OPB_PLB_DIV_3 0x00010000 |
| 492 | #define PLLMR_OPB_PLB_DIV_4 0x00018000 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 493 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 494 | #define PLLMR_PCI_TO_PLB_MASK 0x00006000 /* PCI:PLB Frequency Divisor */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 495 | #define PLLMR_PCI_PLB_DIV_1 0x00000000 |
| 496 | #define PLLMR_PCI_PLB_DIV_2 0x00002000 |
| 497 | #define PLLMR_PCI_PLB_DIV_3 0x00004000 |
| 498 | #define PLLMR_PCI_PLB_DIV_4 0x00006000 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 499 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 500 | #define PLLMR_EXB_TO_PLB_MASK 0x00001800 /* External Bus:PLB Divisor */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 501 | #define PLLMR_EXB_PLB_DIV_2 0x00000000 |
| 502 | #define PLLMR_EXB_PLB_DIV_3 0x00000800 |
| 503 | #define PLLMR_EXB_PLB_DIV_4 0x00001000 |
| 504 | #define PLLMR_EXB_PLB_DIV_5 0x00001800 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 505 | |
| 506 | /* definitions for PPC405GPr (new mode strapping) */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 507 | #define PLLMR_FWDB_DIV_MASK 0x00000007 /* Forward Divisor B */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 508 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 509 | #define PSR_PLL_FWD_MASK 0xC0000000 |
| 510 | #define PSR_PLL_FDBACK_MASK 0x30000000 |
| 511 | #define PSR_PLL_TUNING_MASK 0x0E000000 |
| 512 | #define PSR_PLB_CPU_MASK 0x01800000 |
| 513 | #define PSR_OPB_PLB_MASK 0x00600000 |
| 514 | #define PSR_PCI_PLB_MASK 0x00180000 |
| 515 | #define PSR_EB_PLB_MASK 0x00060000 |
| 516 | #define PSR_ROM_WIDTH_MASK 0x00018000 |
| 517 | #define PSR_ROM_LOC 0x00004000 |
| 518 | #define PSR_PCI_ASYNC_EN 0x00001000 |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 519 | #define PSR_PERCLK_SYNC_MODE_EN 0x00000800 /* PPC405GPr only */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 520 | #define PSR_PCI_ARBIT_EN 0x00000400 |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 521 | #define PSR_NEW_MODE_EN 0x00000020 /* PPC405GPr only */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 522 | |
stroese | 317a25f | 2004-12-16 18:03:44 +0000 | [diff] [blame] | 523 | #ifndef CONFIG_IOP480 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 524 | /* |
| 525 | * PLL Voltage Controlled Oscillator (VCO) definitions |
| 526 | * Maximum and minimum values (in MHz) for correct PLL operation. |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 527 | */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 528 | #define VCO_MIN 400 |
| 529 | #define VCO_MAX 800 |
stroese | 317a25f | 2004-12-16 18:03:44 +0000 | [diff] [blame] | 530 | #endif /* #ifndef CONFIG_IOP480 */ |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 531 | #endif /* #ifdef CONFIG_405EP */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 532 | |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 533 | #if 0 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 534 | /****************************************************************************** |
| 535 | * Memory Access Layer |
| 536 | ******************************************************************************/ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 537 | #define MAL0_CFG (MAL_DCR_BASE + 0x00) /* MAL Config reg */ |
| 538 | #define MAL0_ESR (MAL_DCR_BASE + 0x01) /* Err Status (Read/Clear) */ |
| 539 | #define MAL0_IER (MAL_DCR_BASE + 0x02) /* Interrupt enable */ |
| 540 | #define MAL0_TXCASR (MAL_DCR_BASE + 0x04) /* TX Channel active (set) */ |
| 541 | #define MAL0_TXCARR (MAL_DCR_BASE + 0x05) /* TX Channel active (reset) */ |
| 542 | #define MAL0_TXEOBISR (MAL_DCR_BASE + 0x06) /* TX End of buffer int status */ |
| 543 | #define MAL0_TXDEIR (MAL_DCR_BASE + 0x07) /* TX Descr. Error Int reg */ |
| 544 | #define MAL0_RXCASR (MAL_DCR_BASE + 0x10) /* RX Channel active (set) */ |
| 545 | #define MAL0_RXCARR (MAL_DCR_BASE + 0x11) /* RX Channel active (reset) */ |
| 546 | #define MAL0_RXEOBISR (MAL_DCR_BASE + 0x12) /* RX End of buffer int status */ |
| 547 | #define MAL0_RXDEIR (MAL_DCR_BASE + 0x13) /* RX Descr. Error Int reg */ |
| 548 | #define MAL0_TXCTP0R (MAL_DCR_BASE + 0x20) /* TX 0 Channel table ptr */ |
| 549 | #define MAL0_TXCTP1R (MAL_DCR_BASE + 0x21) /* TX 1 Channel table ptr */ |
| 550 | #define MAL0_TXCTP2R (MAL_DCR_BASE + 0x22) /* TX 2 Channel table ptr */ |
| 551 | #define MAL0_TXCTP3R (MAL_DCR_BASE + 0x23) /* TX 3 Channel table ptr */ |
| 552 | #define MAL0_RXCTP0R (MAL_DCR_BASE + 0x40) /* RX 0 Channel table ptr */ |
| 553 | #define MAL0_RXCTP1R (MAL_DCR_BASE + 0x41) /* RX 1 Channel table ptr */ |
| 554 | #define MAL0_RXCTP2R (MAL_DCR_BASE + 0x42) /* RX 2 Channel table ptr */ |
| 555 | #define MAL0_RXCTP3R (MAL_DCR_BASE + 0x43) /* RX 3 Channel table ptr */ |
| 556 | #define MAL0_RXCTP8R (MAL_DCR_BASE + 0x48) /* RX 8 Channel table ptr */ |
| 557 | #define MAL0_RXCTP16R (MAL_DCR_BASE + 0x50) /* RX 16 Channel table ptr */ |
| 558 | #define MAL0_RXCTP24R (MAL_DCR_BASE + 0x58) /* RX 24 Channel table ptr */ |
| 559 | #define MAL0_RCBS0 (MAL_DCR_BASE + 0x60) /* RX 0 Channel buffer size */ |
| 560 | #define MAL0_RCBS1 (MAL_DCR_BASE + 0x61) /* RX 1 Channel buffer size */ |
| 561 | #define MAL0_RCBS2 (MAL_DCR_BASE + 0x62) /* RX 2 Channel buffer size */ |
| 562 | #define MAL0_RCBS3 (MAL_DCR_BASE + 0x63) /* RX 3 Channel buffer size */ |
| 563 | #define MAL0_RCBS8 (MAL_DCR_BASE + 0x68) /* RX 8 Channel buffer size */ |
| 564 | #define MAL0_RCBS16 (MAL_DCR_BASE + 0x70) /* RX 16 Channel buffer size */ |
| 565 | #define MAL0_RCBS24 (MAL_DCR_BASE + 0x78) /* RX 24 Channel buffer size */ |
Stefan Roese | 95ca5fa | 2010-09-11 09:31:43 +0200 | [diff] [blame^] | 566 | #endif |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 567 | |
| 568 | /*----------------------------------------------------------------------------- |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 569 | | UART Register Offsets |
| 570 | '----------------------------------------------------------------------------*/ |
| 571 | #define DATA_REG 0x00 |
Wolfgang Denk | 70df7bc | 2007-06-22 23:59:00 +0200 | [diff] [blame] | 572 | #define DL_LSB 0x00 |
| 573 | #define DL_MSB 0x01 |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 574 | #define INT_ENABLE 0x01 |
| 575 | #define FIFO_CONTROL 0x02 |
| 576 | #define LINE_CONTROL 0x03 |
| 577 | #define MODEM_CONTROL 0x04 |
Wolfgang Denk | 70df7bc | 2007-06-22 23:59:00 +0200 | [diff] [blame] | 578 | #define LINE_STATUS 0x05 |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 579 | #define MODEM_STATUS 0x06 |
| 580 | #define SCRATCH 0x07 |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 581 | |
| 582 | /****************************************************************************** |
| 583 | * On Chip Memory |
| 584 | ******************************************************************************/ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 585 | #if defined(CONFIG_405EZ) |
| 586 | #define OCM_DCR_BASE 0x020 |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 587 | #define OCM0_PLBCR1 (OCM_DCR_BASE + 0x00) /* OCM PLB3 Bank 1 Config */ |
| 588 | #define OCM0_PLBCR2 (OCM_DCR_BASE + 0x01) /* OCM PLB3 Bank 2 Config */ |
| 589 | #define OCM0_PLBBEAR (OCM_DCR_BASE + 0x02) /* OCM PLB3 Bus Error Add */ |
| 590 | #define OCM0_DSRC1 (OCM_DCR_BASE + 0x08) /* OCM D-side Bank 1 Config */ |
| 591 | #define OCM0_DSRC2 (OCM_DCR_BASE + 0x09) /* OCM D-side Bank 2 Config */ |
| 592 | #define OCM0_ISRC1 (OCM_DCR_BASE + 0x0A) /* OCM I-side Bank 1Config */ |
| 593 | #define OCM0_ISRC2 (OCM_DCR_BASE + 0x0B) /* OCM I-side Bank 2 Config */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 594 | #define OCM0_DISDPC (OCM_DCR_BASE + 0x0C) /* OCM D-/I-side Data Par Chk */ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 595 | #else |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 596 | #define OCM_DCR_BASE 0x018 |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 597 | #define OCM0_ISCNTL (OCM_DCR_BASE+0x01) /* OCM I-side control reg */ |
| 598 | #define OCM0_DSARC (OCM_DCR_BASE+0x02) /* OCM D-side address compare */ |
| 599 | #define OCM0_DSCNTL (OCM_DCR_BASE+0x03) /* OCM D-side control */ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 600 | #endif /* CONFIG_405EZ */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 601 | |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 602 | /****************************************************************************** |
| 603 | * GPIO macro register defines |
| 604 | ******************************************************************************/ |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 605 | #if defined(CONFIG_405EZ) |
| 606 | /* Only the 405EZ has 2 GPIOs */ |
| 607 | #define GPIO_BASE 0xEF600700 |
| 608 | #define GPIO0_OR (GPIO_BASE+0x0) |
| 609 | #define GPIO0_TCR (GPIO_BASE+0x4) |
| 610 | #define GPIO0_OSRL (GPIO_BASE+0x8) |
| 611 | #define GPIO0_OSRH (GPIO_BASE+0xC) |
| 612 | #define GPIO0_TSRL (GPIO_BASE+0x10) |
| 613 | #define GPIO0_TSRH (GPIO_BASE+0x14) |
| 614 | #define GPIO0_ODR (GPIO_BASE+0x18) |
| 615 | #define GPIO0_IR (GPIO_BASE+0x1C) |
| 616 | #define GPIO0_RR1 (GPIO_BASE+0x20) |
| 617 | #define GPIO0_RR2 (GPIO_BASE+0x24) |
| 618 | #define GPIO0_RR3 (GPIO_BASE+0x28) |
| 619 | #define GPIO0_ISR1L (GPIO_BASE+0x30) |
| 620 | #define GPIO0_ISR1H (GPIO_BASE+0x34) |
| 621 | #define GPIO0_ISR2L (GPIO_BASE+0x38) |
| 622 | #define GPIO0_ISR2H (GPIO_BASE+0x3C) |
| 623 | #define GPIO0_ISR3L (GPIO_BASE+0x40) |
| 624 | #define GPIO0_ISR3H (GPIO_BASE+0x44) |
| 625 | |
| 626 | #define GPIO1_BASE 0xEF600800 |
| 627 | #define GPIO1_OR (GPIO1_BASE+0x0) |
| 628 | #define GPIO1_TCR (GPIO1_BASE+0x4) |
| 629 | #define GPIO1_OSRL (GPIO1_BASE+0x8) |
| 630 | #define GPIO1_OSRH (GPIO1_BASE+0xC) |
| 631 | #define GPIO1_TSRL (GPIO1_BASE+0x10) |
| 632 | #define GPIO1_TSRH (GPIO1_BASE+0x14) |
| 633 | #define GPIO1_ODR (GPIO1_BASE+0x18) |
| 634 | #define GPIO1_IR (GPIO1_BASE+0x1C) |
| 635 | #define GPIO1_RR1 (GPIO1_BASE+0x20) |
| 636 | #define GPIO1_RR2 (GPIO1_BASE+0x24) |
| 637 | #define GPIO1_RR3 (GPIO1_BASE+0x28) |
| 638 | #define GPIO1_ISR1L (GPIO1_BASE+0x30) |
| 639 | #define GPIO1_ISR1H (GPIO1_BASE+0x34) |
| 640 | #define GPIO1_ISR2L (GPIO1_BASE+0x38) |
| 641 | #define GPIO1_ISR2H (GPIO1_BASE+0x3C) |
| 642 | #define GPIO1_ISR3L (GPIO1_BASE+0x40) |
| 643 | #define GPIO1_ISR3H (GPIO1_BASE+0x44) |
| 644 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 645 | #elif defined(CONFIG_405EX) |
| 646 | #define GPIO_BASE 0xEF600800 |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 647 | #define GPIO0_OR (GPIO_BASE+0x0) |
| 648 | #define GPIO0_TCR (GPIO_BASE+0x4) |
| 649 | #define GPIO0_OSRL (GPIO_BASE+0x8) |
| 650 | #define GPIO0_OSRH (GPIO_BASE+0xC) |
| 651 | #define GPIO0_TSRL (GPIO_BASE+0x10) |
| 652 | #define GPIO0_TSRH (GPIO_BASE+0x14) |
| 653 | #define GPIO0_ODR (GPIO_BASE+0x18) |
| 654 | #define GPIO0_IR (GPIO_BASE+0x1C) |
| 655 | #define GPIO0_RR1 (GPIO_BASE+0x20) |
| 656 | #define GPIO0_RR2 (GPIO_BASE+0x24) |
| 657 | #define GPIO0_ISR1L (GPIO_BASE+0x30) |
| 658 | #define GPIO0_ISR1H (GPIO_BASE+0x34) |
| 659 | #define GPIO0_ISR2L (GPIO_BASE+0x38) |
| 660 | #define GPIO0_ISR2H (GPIO_BASE+0x3C) |
| 661 | #define GPIO0_ISR3L (GPIO_BASE+0x40) |
| 662 | #define GPIO0_ISR3H (GPIO_BASE+0x44) |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 663 | |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 664 | #else /* !405EZ */ |
| 665 | |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 666 | #define GPIO_BASE 0xEF600700 |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 667 | #define GPIO0_OR (GPIO_BASE+0x0) |
| 668 | #define GPIO0_TCR (GPIO_BASE+0x4) |
| 669 | #define GPIO0_OSRH (GPIO_BASE+0x8) |
| 670 | #define GPIO0_OSRL (GPIO_BASE+0xC) |
| 671 | #define GPIO0_TSRH (GPIO_BASE+0x10) |
| 672 | #define GPIO0_TSRL (GPIO_BASE+0x14) |
| 673 | #define GPIO0_ODR (GPIO_BASE+0x18) |
| 674 | #define GPIO0_IR (GPIO_BASE+0x1C) |
| 675 | #define GPIO0_RR1 (GPIO_BASE+0x20) |
| 676 | #define GPIO0_RR2 (GPIO_BASE+0x24) |
| 677 | #define GPIO0_ISR1H (GPIO_BASE+0x30) |
| 678 | #define GPIO0_ISR1L (GPIO_BASE+0x34) |
| 679 | #define GPIO0_ISR2H (GPIO_BASE+0x38) |
| 680 | #define GPIO0_ISR2L (GPIO_BASE+0x3C) |
stroese | 434979e | 2003-05-23 11:18:02 +0000 | [diff] [blame] | 681 | |
Stefan Roese | 17ffbc8 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 682 | #endif /* CONFIG_405EZ */ |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 683 | |
Stefan Roese | 1bca919 | 2007-11-15 14:23:55 +0100 | [diff] [blame] | 684 | #define GPIO0_BASE GPIO_BASE |
| 685 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 686 | #if defined(CONFIG_405EX) |
| 687 | #define SDR0_SRST 0x0200 |
| 688 | |
Grant Erickson | be156f5 | 2008-07-09 16:31:36 -0700 | [diff] [blame] | 689 | /* |
| 690 | * Software Reset Register |
| 691 | */ |
| 692 | #define SDR0_SRST_BGO PPC_REG_VAL(0, 1) |
| 693 | #define SDR0_SRST_PLB4 PPC_REG_VAL(1, 1) |
| 694 | #define SDR0_SRST_EBC PPC_REG_VAL(2, 1) |
| 695 | #define SDR0_SRST_OPB PPC_REG_VAL(3, 1) |
| 696 | #define SDR0_SRST_UART0 PPC_REG_VAL(4, 1) |
| 697 | #define SDR0_SRST_UART1 PPC_REG_VAL(5, 1) |
| 698 | #define SDR0_SRST_IIC0 PPC_REG_VAL(6, 1) |
| 699 | #define SDR0_SRST_BGI PPC_REG_VAL(7, 1) |
| 700 | #define SDR0_SRST_GPIO PPC_REG_VAL(8, 1) |
| 701 | #define SDR0_SRST_GPT PPC_REG_VAL(9, 1) |
| 702 | #define SDR0_SRST_DMC PPC_REG_VAL(10, 1) |
| 703 | #define SDR0_SRST_RGMII PPC_REG_VAL(11, 1) |
| 704 | #define SDR0_SRST_EMAC0 PPC_REG_VAL(12, 1) |
| 705 | #define SDR0_SRST_EMAC1 PPC_REG_VAL(13, 1) |
| 706 | #define SDR0_SRST_CPM PPC_REG_VAL(14, 1) |
| 707 | #define SDR0_SRST_EPLL PPC_REG_VAL(15, 1) |
| 708 | #define SDR0_SRST_UIC PPC_REG_VAL(16, 1) |
| 709 | #define SDR0_SRST_UPRST PPC_REG_VAL(17, 1) |
| 710 | #define SDR0_SRST_IIC1 PPC_REG_VAL(18, 1) |
| 711 | #define SDR0_SRST_SCP PPC_REG_VAL(19, 1) |
| 712 | #define SDR0_SRST_UHRST PPC_REG_VAL(20, 1) |
| 713 | #define SDR0_SRST_DMA PPC_REG_VAL(21, 1) |
| 714 | #define SDR0_SRST_DMAC PPC_REG_VAL(22, 1) |
| 715 | #define SDR0_SRST_MAL PPC_REG_VAL(23, 1) |
| 716 | #define SDR0_SRST_EBM PPC_REG_VAL(24, 1) |
| 717 | #define SDR0_SRST_GPTR PPC_REG_VAL(25, 1) |
| 718 | #define SDR0_SRST_PE0 PPC_REG_VAL(26, 1) |
| 719 | #define SDR0_SRST_PE1 PPC_REG_VAL(27, 1) |
| 720 | #define SDR0_SRST_CRYP PPC_REG_VAL(28, 1) |
| 721 | #define SDR0_SRST_PKP PPC_REG_VAL(29, 1) |
| 722 | #define SDR0_SRST_AHB PPC_REG_VAL(30, 1) |
| 723 | #define SDR0_SRST_NDFC PPC_REG_VAL(31, 1) |
| 724 | |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 725 | #define SDR0_UART0 0x0120 /* UART0 Config */ |
| 726 | #define SDR0_UART1 0x0121 /* UART1 Config */ |
| 727 | #define SDR0_MFR 0x4300 /* SDR0_MFR reg */ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 728 | |
| 729 | /* Defines for CPC0_EPRCSR register */ |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 730 | #define CPC0_EPRCSR_E0NFE 0x80000000 |
| 731 | #define CPC0_EPRCSR_E1NFE 0x40000000 |
| 732 | #define CPC0_EPRCSR_E1RPP 0x00000080 |
| 733 | #define CPC0_EPRCSR_E0RPP 0x00000040 |
| 734 | #define CPC0_EPRCSR_E1ERP 0x00000020 |
| 735 | #define CPC0_EPRCSR_E0ERP 0x00000010 |
| 736 | #define CPC0_EPRCSR_E1PCI 0x00000002 |
| 737 | #define CPC0_EPRCSR_E0PCI 0x00000001 |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 738 | |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 739 | #define CPR0_CLKUPD 0x020 |
| 740 | #define CPR0_PLLC 0x040 |
| 741 | #define CPR0_PLLD 0x060 |
| 742 | #define CPR0_CPUD 0x080 |
| 743 | #define CPR0_PLBD 0x0a0 |
Niklaus Giger | a9a9b1f | 2009-10-04 20:04:19 +0200 | [diff] [blame] | 744 | #define CPR0_OPBD0 0x0c0 |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 745 | #define CPR0_PERD 0x0e0 |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 746 | |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 747 | #define SDR0_PINSTP 0x0040 |
| 748 | #define SDR0_SDCS0 0x0060 |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 749 | |
| 750 | #define SDR0_SDCS_SDD (0x80000000 >> 31) |
| 751 | |
| 752 | /* CUST0 Customer Configuration Register0 */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 753 | #define SDR0_CUST0 0x4000 |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 754 | #define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */ |
| 755 | #define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */ |
| 756 | #define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */ |
| 757 | #define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 758 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 759 | #define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */ |
| 760 | #define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */ |
| 761 | #define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 762 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 763 | #define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */ |
| 764 | #define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width= 16 Bit */ |
| 765 | #define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width= 8 Bit */ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 766 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 767 | #define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */ |
| 768 | #define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((unsigned long)(n))&0xF)<<24) |
| 769 | #define SDR0_CUST0_NDFC_BP_DECODE(n) ((((unsigned long)(n))>>24)&0x0F) |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 770 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 771 | #define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */ |
| 772 | #define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((unsigned long)(n))&0x3)<<22) |
| 773 | #define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((unsigned long)(n))>>22)&0x03) |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 774 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 775 | #define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */ |
| 776 | #define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */ |
| 777 | #define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 778 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 779 | #define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */ |
| 780 | #define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */ |
| 781 | #define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */ |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 782 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 783 | #define SDR0_CUST0_NDRSC_MASK 0x0000FFF0 /* NDFC Device Reset Count Mask */ |
| 784 | #define SDR0_CUST0_NDRSC_ENCODE(n) ((((unsigned long)(n))&0xFFF)<<4) |
| 785 | #define SDR0_CUST0_NDRSC_DECODE(n) ((((unsigned long)(n))>>4)&0xFFF) |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 786 | |
Niklaus Giger | 3c8ef44 | 2009-10-04 20:04:22 +0200 | [diff] [blame] | 787 | #define SDR0_CUST0_CHIPSELGAT_MASK 0x0000000F /* Chip Sel Gating Mask */ |
| 788 | #define SDR0_CUST0_CHIPSELGAT_DIS 0x00000000 /* Chip Sel Gating Disable */ |
| 789 | #define SDR0_CUST0_CHIPSELGAT_ENALL 0x0000000F /* All Chip Sel Gating Enable */ |
| 790 | #define SDR0_CUST0_CHIPSELGAT_EN0 0x00000008 /* Chip Sel0 Gating Enable */ |
| 791 | #define SDR0_CUST0_CHIPSELGAT_EN1 0x00000004 /* Chip Sel1 Gating Enable */ |
| 792 | #define SDR0_CUST0_CHIPSELGAT_EN2 0x00000002 /* Chip Sel2 Gating Enable */ |
| 793 | #define SDR0_CUST0_CHIPSELGAT_EN3 0x00000001 /* Chip Sel3 Gating Enable */ |
Stefan Roese | e971ead | 2007-12-08 14:47:34 +0100 | [diff] [blame] | 794 | |
| 795 | #define SDR0_PFC0 0x4100 |
| 796 | #define SDR0_PFC1 0x4101 |
| 797 | #define SDR0_PFC1_U1ME 0x02000000 |
| 798 | #define SDR0_PFC1_U0ME 0x00080000 |
| 799 | #define SDR0_PFC1_U0IM 0x00040000 |
| 800 | #define SDR0_PFC1_SIS 0x00020000 |
| 801 | #define SDR0_PFC1_DMAAEN 0x00010000 |
| 802 | #define SDR0_PFC1_DMADEN 0x00008000 |
| 803 | #define SDR0_PFC1_USBEN 0x00004000 |
| 804 | #define SDR0_PFC1_AHBSWAP 0x00000020 |
| 805 | #define SDR0_PFC1_USBBIGEN 0x00000010 |
| 806 | #define SDR0_PFC1_GPT_FREQ 0x0000000f |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 807 | #endif |
| 808 | |
wdenk | 0442ed8 | 2002-11-03 10:24:00 +0000 | [diff] [blame] | 809 | #endif /* __PPC405_H__ */ |