taihu.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. /*
  2. * (C) Copyright 2000-2005
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * (C) Copyright 2005-2007
  6. * Beijing UD Technology Co., Ltd., taihusupport@amcc.com
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. #ifndef __CONFIG_H
  27. #define __CONFIG_H
  28. #define CONFIG_405EP 1 /* this is a PPC405 CPU */
  29. #define CONFIG_4xx 1 /* member of PPC4xx family */
  30. #define CONFIG_TAIHU 1 /* on a taihu board */
  31. #define CONFIG_BOARD_EARLY_INIT_F 1 /* call board_early_init_f */
  32. #define CONFIG_SYS_CLK_FREQ 33000000 /* external frequency to pll */
  33. #define CONFIG_NO_SERIAL_EEPROM
  34. /*----------------------------------------------------------------------------*/
  35. #ifdef CONFIG_NO_SERIAL_EEPROM
  36. /*
  37. !-------------------------------------------------------------------------------
  38. ! PLL settings for 333MHz CPU, 111MHz PLB/SDRAM, 55MHz EBC, 33MHz PCI,
  39. ! assuming a 33MHz input clock to the 405EP from the C9531.
  40. !-------------------------------------------------------------------------------
  41. */
  42. #define PLLMR0_333_111_55_37 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
  43. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  44. PLL_MALDIV_1 | PLL_PCIDIV_3)
  45. #define PLLMR1_333_111_55_37 (PLL_FBKDIV_10 | \
  46. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  47. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
  48. #define PLLMR0_333_111_55_111 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
  49. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  50. PLL_MALDIV_1 | PLL_PCIDIV_1)
  51. #define PLLMR1_333_111_55_111 (PLL_FBKDIV_10 | \
  52. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  53. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
  54. #define PLLMR0_DEFAULT PLLMR0_333_111_55_37
  55. #define PLLMR1_DEFAULT PLLMR1_333_111_55_37
  56. #define PLLMR0_DEFAULT_PCI66 PLLMR0_333_111_55_111
  57. #define PLLMR1_DEFAULT_PCI66 PLLMR1_333_111_55_111
  58. #endif
  59. /*----------------------------------------------------------------------------*/
  60. #define CFG_ENV_IS_IN_FLASH 1 /* use FLASH for environment vars */
  61. #define CONFIG_ENV_OVERWRITE 1
  62. #define CONFIG_PREBOOT "echo;" \
  63. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  64. "echo"
  65. #undef CONFIG_BOOTARGS
  66. #define CONFIG_EXTRA_ENV_SETTINGS \
  67. "bootfile=/tftpboot/taihu/uImage\0" \
  68. "rootpath=/opt/eldk/ppc_4xx\0" \
  69. "netdev=eth0\0" \
  70. "nfsargs=setenv bootargs root=/dev/nfs rw " \
  71. "nfsroot=${serverip}:${rootpath}\0" \
  72. "ramargs=setenv bootargs root=/dev/ram rw\0" \
  73. "addip=setenv bootargs ${bootargs} " \
  74. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  75. ":${hostname}:${netdev}:off panic=1\0" \
  76. "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
  77. "flash_nfs=run nfsargs addip addtty;" \
  78. "bootm ${kernel_addr}\0" \
  79. "flash_self=run ramargs addip addtty;" \
  80. "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  81. "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;" \
  82. "bootm\0" \
  83. "kernel_addr=FC000000\0" \
  84. "ramdisk_addr=FC180000\0" \
  85. "load=tftp 200000 /tftpboot/taihu/u-boot.bin\0" \
  86. "update=protect off FFFC0000 FFFFFFFF;era FFFC0000 FFFFFFFF;" \
  87. "cp.b 200000 FFFC0000 40000\0" \
  88. "upd=run load;run update\0" \
  89. ""
  90. #define CONFIG_BOOTCOMMAND "run flash_self"
  91. #if 0
  92. #define CONFIG_BOOTDELAY -1 /* autoboot disabled */
  93. #else
  94. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  95. #endif
  96. #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
  97. #define CFG_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
  98. #define CONFIG_MII 1 /* MII PHY management */
  99. #define CONFIG_PHY_ADDR 0x14 /* PHY address */
  100. #define CONFIG_HAS_ETH1
  101. #define CONFIG_PHY1_ADDR 0x10 /* EMAC1 PHY address */
  102. #define CONFIG_NET_MULTI 1
  103. #define CFG_RX_ETH_BUFFER 16 /* Number of ethernet rx buffers & descriptors */
  104. #define CONFIG_PHY_RESET 1
  105. /*
  106. * BOOTP options
  107. */
  108. #define CONFIG_BOOTP_BOOTFILESIZE
  109. #define CONFIG_BOOTP_BOOTPATH
  110. #define CONFIG_BOOTP_GATEWAY
  111. #define CONFIG_BOOTP_HOSTNAME
  112. /*
  113. * Command line configuration.
  114. */
  115. #include <config_cmd_default.h>
  116. #define CONFIG_CMD_ASKENV
  117. #define CONFIG_CMD_CACHE
  118. #define CONFIG_CMD_DHCP
  119. #define CONFIG_CMD_EEPROM
  120. #define CONFIG_CMD_ELF
  121. #define CONFIG_CMD_I2C
  122. #define CONFIG_CMD_IRQ
  123. #define CONFIG_CMD_MII
  124. #define CONFIG_CMD_NET
  125. #define CONFIG_CMD_PCI
  126. #define CONFIG_CMD_PING
  127. #define CONFIG_CMD_REGINFO
  128. #define CONFIG_CMD_SDRAM
  129. #define CONFIG_CMD_SPI
  130. #undef CONFIG_WATCHDOG /* watchdog disabled */
  131. #undef CONFIG_SPD_EEPROM /* use SPD EEPROM for setup */
  132. #define CFG_SDRAM_SIZE_PER_BANK 0x04000000 /* 64MB */
  133. #define CFG_SDRAM_BANKS 2
  134. /*
  135. * SDRAM configuration (please see cpu/ppc/sdram.[ch])
  136. */
  137. #define CONFIG_SDRAM_BANK0 1 /* init onboard SDRAM bank 0 */
  138. #define CONFIG_SDRAM_BANK1 1 /* init onboard SDRAM bank 1 */
  139. /* SDRAM timings used in datasheet */
  140. #define CFG_SDRAM_CL 3 /* CAS latency */
  141. #define CFG_SDRAM_tRP 20 /* PRECHARGE command period */
  142. #define CFG_SDRAM_tRC 66 /* ACTIVE-to-ACTIVE command period */
  143. #define CFG_SDRAM_tRCD 20 /* ACTIVE-to-READ delay */
  144. #define CFG_SDRAM_tRFC 66 /* Auto refresh period */
  145. /*
  146. * Miscellaneous configurable options
  147. */
  148. #define CFG_LONGHELP /* undef to save memory */
  149. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  150. #if defined(CONFIG_CMD_KGDB)
  151. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  152. #else
  153. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  154. #endif
  155. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* print buffer Size */
  156. #define CFG_MAXARGS 16 /* max number of command args */
  157. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  158. #define CFG_MEMTEST_START 0x0400000 /* memtest works on */
  159. #define CFG_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
  160. /*
  161. * If CFG_EXT_SERIAL_CLOCK, then the UART divisor is 1.
  162. * If CFG_405_UART_ERRATA_59, then UART divisor is 31.
  163. * Otherwise, UART divisor is determined by CPU Clock and CFG_BASE_BAUD value.
  164. * The Linux BASE_BAUD define should match this configuration.
  165. * baseBaud = cpuClock/(uartDivisor*16)
  166. * If CFG_405_UART_ERRATA_59 and 200MHz CPU clock,
  167. * set Linux BASE_BAUD to 403200.
  168. */
  169. #undef CONFIG_SERIAL_SOFTWARE_FIFO
  170. #undef CFG_EXT_SERIAL_CLOCK /* external serial clock */
  171. #undef CFG_405_UART_ERRATA_59 /* 405GP/CR Rev. D silicon */
  172. #define CFG_BASE_BAUD 691200
  173. #define CONFIG_BAUDRATE 115200
  174. #define CONFIG_UART1_CONSOLE 1
  175. /* The following table includes the supported baudrates */
  176. #define CFG_BAUDRATE_TABLE \
  177. {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
  178. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  179. #define CFG_EXTBDINFO 1 /* To use extended board_into (bd_t) */
  180. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  181. #define CONFIG_AUTO_COMPLETE 1 /* add autocompletion support */
  182. #define CONFIG_LOOPW 1 /* enable loopw command */
  183. #define CONFIG_ZERO_BOOTDELAY_CHECK /* check for keypress on bootdelay==0 */
  184. #define CONFIG_VERSION_VARIABLE 1 /* include version env variable */
  185. /*-----------------------------------------------------------------------
  186. * I2C stuff
  187. *-----------------------------------------------------------------------
  188. */
  189. #define CONFIG_HARD_I2C 1 /* I2C with hardware support */
  190. #undef CONFIG_SOFT_I2C /* I2C bit-banged */
  191. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
  192. #define CFG_I2C_SLAVE 0x7F
  193. #define CFG_I2C_NOPROBES { 0x69 } /* avoid iprobe hangup (why?) */
  194. #define CFG_EEPROM_PAGE_WRITE_DELAY_MS 6 /* 24C02 requires 5ms delay */
  195. #define CFG_I2C_EEPROM_ADDR 0x50 /* I2C boot EEPROM (24C02W) */
  196. #define CFG_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
  197. #define CONFIG_SOFT_SPI
  198. #define SPI_SCL spi_scl
  199. #define SPI_SDA spi_sda
  200. #define SPI_READ spi_read()
  201. #define SPI_DELAY udelay(2)
  202. #ifndef __ASSEMBLY__
  203. void spi_scl(int);
  204. void spi_sda(int);
  205. unsigned char spi_read(void);
  206. #endif
  207. /* standard dtt sensor configuration */
  208. #define CONFIG_DTT_DS1775 1
  209. #define CONFIG_DTT_SENSORS { 0 }
  210. #define CFG_I2C_DTT_ADDR 0x49
  211. /*-----------------------------------------------------------------------
  212. * PCI stuff
  213. *-----------------------------------------------------------------------
  214. */
  215. #define PCI_HOST_ADAPTER 0 /* configure ar pci adapter */
  216. #define PCI_HOST_FORCE 1 /* configure as pci host */
  217. #define PCI_HOST_AUTO 2 /* detected via arbiter enable */
  218. #define CONFIG_PCI /* include pci support */
  219. #define CONFIG_PCI_HOST PCI_HOST_FORCE /* select pci host function */
  220. #define CONFIG_PCI_PNP /* do pci plug-and-play */
  221. /* resource configuration */
  222. #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
  223. #define CFG_PCI_SUBSYS_VENDORID 0x10e8 /* AMCC */
  224. #define CFG_PCI_SUBSYS_DEVICEID 0xcafe /* Whatever */
  225. #define CFG_PCI_CLASSCODE 0x0600 /* PCI Class Code: bridge/host */
  226. #define CFG_PCI_PTM1LA 0x00000000 /* point to sdram */
  227. #define CFG_PCI_PTM1MS 0x80000001 /* 2GB, enable hard-wired to 1 */
  228. #define CFG_PCI_PTM1PCI 0x00000000 /* Host: use this pci address */
  229. #define CFG_PCI_PTM2LA 0x00000000 /* disabled */
  230. #define CFG_PCI_PTM2MS 0x00000000 /* disabled */
  231. #define CFG_PCI_PTM2PCI 0x04000000 /* Host: use this pci address */
  232. #define CONFIG_EEPRO100 1
  233. /*-----------------------------------------------------------------------
  234. * Start addresses for the final memory configuration
  235. * (Set up by the startup code)
  236. * Please note that CFG_SDRAM_BASE _must_ start at 0
  237. */
  238. #define CFG_SDRAM_BASE 0x00000000
  239. #define CFG_FLASH_BASE 0xFFE00000
  240. #define CFG_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Monitor */
  241. #define CFG_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc() */
  242. #define CFG_MONITOR_BASE (-CFG_MONITOR_LEN)
  243. /*
  244. * For booting Linux, the board info and command line data
  245. * have to be in the first 8 MB of memory, since this is
  246. * the maximum mapped by the Linux kernel during initialization.
  247. */
  248. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  249. /*-----------------------------------------------------------------------
  250. * FLASH organization
  251. */
  252. #define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */
  253. #define CFG_MAX_FLASH_SECT 256 /* max number of sectors on one chip */
  254. #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  255. #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  256. #define CFG_FLASH_ADDR0 0x555
  257. #define CFG_FLASH_ADDR1 0x2aa
  258. #define CFG_FLASH_WORD_SIZE unsigned short
  259. #ifdef CFG_ENV_IS_IN_FLASH
  260. #define CFG_ENV_SECT_SIZE 0x10000 /* size of one complete sector */
  261. #define CFG_ENV_ADDR (CFG_MONITOR_BASE-CFG_ENV_SECT_SIZE)
  262. #define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
  263. /* Address and size of Redundant Environment Sector */
  264. #define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR-CFG_ENV_SECT_SIZE)
  265. #define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
  266. #endif /* CFG_ENV_IS_IN_FLASH */
  267. /*-----------------------------------------------------------------------
  268. * NVRAM organization
  269. */
  270. #define CFG_NVRAM_BASE_ADDR 0xf0000000 /* NVRAM base address */
  271. #define CFG_NVRAM_SIZE 0x1ff8 /* NVRAM size */
  272. #ifdef CFG_ENV_IS_IN_NVRAM
  273. #define CFG_ENV_SIZE 0x0ff8 /* Size of Environment vars */
  274. #define CFG_ENV_ADDR \
  275. (CFG_NVRAM_BASE_ADDR+CFG_NVRAM_SIZE-CFG_ENV_SIZE) /* Env*/
  276. #endif
  277. /*-----------------------------------------------------------------------
  278. * PPC405 GPIO Configuration
  279. */
  280. #define CFG_440_GPIO_TABLE { /* GPIO Alternate1 */ \
  281. { \
  282. /* GPIO Core 0 */ \
  283. { GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO0 PerBLast SPI CS */ \
  284. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO1 TS1E */ \
  285. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO2 TS2E */ \
  286. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO3 TS1O */ \
  287. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO4 TS2O */ \
  288. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO5 TS3 */ \
  289. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO6 TS4 */ \
  290. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO7 TS5 */ \
  291. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO8 TS6 */ \
  292. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO9 TrcClk */ \
  293. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO10 PerCS1 */ \
  294. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO11 PerCS2 */ \
  295. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO12 PerCS3 */ \
  296. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO13 PerCS4 */ \
  297. { GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO14 PerAddr03 SPI SCLK */ \
  298. { GPIO_BASE, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO15 PerAddr04 SPI DI */ \
  299. { GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO16 PerAddr05 SPI DO */ \
  300. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO17 IRQ0 PCI INTA */ \
  301. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO18 IRQ1 PCI INTB */ \
  302. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO19 IRQ2 PCI INTC */ \
  303. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO20 IRQ3 PCI INTD */ \
  304. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO21 IRQ4 USB */ \
  305. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO22 IRQ5 EBC */ \
  306. { GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO23 IRQ6 unused */ \
  307. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO24 UART0_DCD UART1 */ \
  308. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO25 UART0_DSR */ \
  309. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO26 UART0_RI */ \
  310. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO27 UART0_DTR */ \
  311. { GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO28 UART1_Rx UART0 */ \
  312. { GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO29 UART1_Tx */ \
  313. { GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO30 RejectPkt0 User LED1 */ \
  314. { GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO31 RejectPkt1 User LED2 */ \
  315. } \
  316. }
  317. /*-----------------------------------------------------------------------
  318. * Cache Configuration
  319. */
  320. #define CFG_DCACHE_SIZE 16384 /* For IBM 405EP CPU */
  321. #define CFG_CACHELINE_SIZE 32
  322. #define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  323. /*
  324. * Init Memory Controller:
  325. *
  326. * BR0/1 and OR0/1 (FLASH)
  327. */
  328. #define FLASH_BASE0_PRELIM CFG_FLASH_BASE /* FLASH bank #0 */
  329. #define FLASH_BASE1_PRELIM 0xFC000000 /* FLASH bank #1 */
  330. /*-----------------------------------------------------------------------
  331. * Definitions for initial stack pointer and data area (in data cache)
  332. */
  333. /* use on chip memory (OCM) for temperary stack until sdram is tested */
  334. #define CFG_TEMP_STACK_OCM 1
  335. /* On Chip Memory location */
  336. #define CFG_OCM_DATA_ADDR 0xF8000000
  337. #define CFG_OCM_DATA_SIZE 0x1000
  338. #define CFG_INIT_RAM_ADDR CFG_OCM_DATA_ADDR /* inside of SDRAM */
  339. #define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE /* End of used area in RAM */
  340. #define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
  341. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  342. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  343. /*-----------------------------------------------------------------------
  344. * External Bus Controller (EBC) Setup
  345. */
  346. /* Memory Bank 0 (Flash/SRAM) initialization */
  347. #define CFG_EBC_PB0AP 0x03815600
  348. #define CFG_EBC_PB0CR 0xFFE3A000 /* BAS=0xFFE,BS=2MB,BU=R/W,BW=16bit */
  349. /* Memory Bank 1 (NVRAM/RTC) initialization */
  350. #define CFG_EBC_PB1AP 0x05815600
  351. #define CFG_EBC_PB1CR 0xFC0BA000 /* BAS=0xFc0,BS=32MB,BU=R/W,BW=16bit */
  352. /* Memory Bank 2 (USB device) initialization */
  353. #define CFG_EBC_PB2AP 0x03016600
  354. #define CFG_EBC_PB2CR 0x50018000 /* BAS=0x500,BS=1MB,BU=R/W,BW=8bit */
  355. /* Memory Bank 3 (LCM and D-flip-flop) initialization */
  356. #define CFG_EBC_PB3AP 0x158FF600
  357. #define CFG_EBC_PB3CR 0x50118000 /* BAS=0x501,BS=1MB,BU=R/W,BW=8bit */
  358. /* Memory Bank 4 (not install) initialization */
  359. #define CFG_EBC_PB4AP 0x158FF600
  360. #define CFG_EBC_PB4CR 0x5021A000
  361. /*-----------------------------------------------------------------------
  362. * Definitions for GPIO setup (PPC405EP specific)
  363. *
  364. * GPIO0[0] - External Bus Controller BLAST output
  365. * GPIO0[1-9] - Instruction trace outputs
  366. * GPIO0[10-13] - External Bus Controller CS_1 - CS_4 outputs
  367. * GPIO0[14-16] - External Bus Controller ABUS3-ABUS5 outputs
  368. * GPIO0[17-23] - External Interrupts IRQ0 - IRQ6 inputs
  369. * GPIO0[24-27] - UART0 control signal inputs/outputs
  370. * GPIO0[28-29] - UART1 data signal input/output
  371. * GPIO0[30-31] - EMAC0 and EMAC1 reject packet inputs
  372. */
  373. #define CFG_GPIO0_OSRH 0x15555550 /* output select high/low */
  374. #define CFG_GPIO0_OSRL 0x00000110
  375. #define CFG_GPIO0_ISR1H 0x00000001 /* input select high/low */
  376. #define CFG_GPIO0_ISR1L 0x15545440
  377. #define CFG_GPIO0_TSRH 0x00000000 /* three-state select high/low */
  378. #define CFG_GPIO0_TSRL 0x00000000
  379. #define CFG_GPIO0_TCR 0xFFFE8117 /* three-state control */
  380. #define CFG_GPIO0_ODR 0x00000000 /* open drain */
  381. #define GPIO0 0 /* GPIO controller 0 */
  382. /* the GPIO macros in include/ppc405.h for High/Low registers are backwards */
  383. #define GPIOx_OSL (GPIO0_OSRH-GPIO_BASE)
  384. #define GPIOx_TSL (GPIO0_TSRH-GPIO_BASE)
  385. #define GPIOx_IS1L (GPIO0_ISR1H-GPIO_BASE)
  386. #define GPIOx_IS2L (GPIO0_ISR1H-GPIO_BASE)
  387. #define GPIOx_IS3L (GPIO0_ISR1H-GPIO_BASE)
  388. #define GPIO_OS(x) (x+GPIOx_OSL) /* GPIO output select */
  389. #define GPIO_TS(x) (x+GPIOx_TSL) /* GPIO three-state select */
  390. #define GPIO_IS1(x) (x+GPIOx_IS1L) /* GPIO input select */
  391. #define GPIO_IS2(x) (x+GPIOx_IS1L)
  392. #define GPIO_IS3(x) (x+GPIOx_IS1L)
  393. #define CPLD_REG0_ADDR 0x50100000
  394. #define CPLD_REG1_ADDR 0x50100001
  395. /*
  396. * Internal Definitions
  397. *
  398. * Boot Flags
  399. */
  400. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  401. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  402. #if defined(CONFIG_CMD_KGDB)
  403. #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
  404. #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
  405. #endif
  406. #endif /* __CONFIG_H */