RPXsuper.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. #ifndef __CONFIG_H
  2. #define __CONFIG_H
  3. /*****************************************************************************
  4. *
  5. * These settings must match the way _your_ board is set up
  6. *
  7. *****************************************************************************/
  8. /* for the AY-Revision which does not use the HRCW */
  9. #define CFG_DEFAULT_IMMR 0x00010000
  10. /* What is the oscillator's (UX2) frequency in Hz? */
  11. #define CONFIG_8260_CLKIN (66 * 1000 * 1000)
  12. /* How is switch S2 set? We really only want the MODCK[1-3] bits, so
  13. * only the 3 least significant bits are important.
  14. */
  15. #define CFG_SBC_S2 0x04
  16. /* What should MODCK_H be? It is dependent on the oscillator
  17. * frequency, MODCK[1-3], and desired CPM and core frequencies.
  18. * Some example values (all frequencies are in MHz):
  19. *
  20. * MODCK_H MODCK[1-3] Osc CPM Core
  21. * 0x2 0x2 33 133 133
  22. * 0x2 0x4 33 133 200
  23. * 0x5 0x5 66 133 133
  24. * 0x5 0x7 66 133 200
  25. */
  26. #define CFG_SBC_MODCK_H 0x06
  27. #define CFG_SBC_BOOT_LOW 1 /* only for HRCW */
  28. #undef CFG_SBC_BOOT_LOW
  29. /* What should the base address of the main FLASH be and how big is
  30. * it (in MBytes)? This must contain TEXT_BASE from board/sbc8260/config.mk
  31. * The main FLASH is whichever is connected to *CS0. U-Boot expects
  32. * this to be the SIMM.
  33. */
  34. #define CFG_FLASH0_BASE 0x80000000
  35. #define CFG_FLASH0_SIZE 16
  36. /* What should the base address of the secondary FLASH be and how big
  37. * is it (in Mbytes)? The secondary FLASH is whichever is connected
  38. * to *CS6. U-Boot expects this to be the on board FLASH. If you don't
  39. * want it enabled, don't define these constants.
  40. */
  41. #define CFG_FLASH1_BASE 0
  42. #define CFG_FLASH1_SIZE 0
  43. #undef CFG_FLASH1_BASE
  44. #undef CFG_FLASH1_SIZE
  45. /* What should be the base address of SDRAM DIMM and how big is
  46. * it (in Mbytes)?
  47. */
  48. #define CFG_SDRAM0_BASE 0x00000000
  49. #define CFG_SDRAM0_SIZE 64
  50. /* What should be the base address of SDRAM DIMM and how big is
  51. * it (in Mbytes)?
  52. */
  53. #define CFG_SDRAM1_BASE 0x04000000
  54. #define CFG_SDRAM1_SIZE 32
  55. /* What should be the base address of the LEDs and switch S0?
  56. * If you don't want them enabled, don't define this.
  57. */
  58. #define CFG_LED_BASE 0x00000000
  59. /*
  60. * select serial console configuration
  61. *
  62. * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  63. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  64. * for SCC).
  65. *
  66. * if CONFIG_CONS_NONE is defined, then the serial console routines must
  67. * defined elsewhere.
  68. */
  69. #define CONFIG_CONS_ON_SMC /* define if console on SMC */
  70. #undef CONFIG_CONS_ON_SCC /* define if console on SCC */
  71. #undef CONFIG_CONS_NONE /* define if console on neither */
  72. #define CONFIG_CONS_INDEX 1 /* which SMC/SCC channel for console */
  73. /*
  74. * select ethernet configuration
  75. *
  76. * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  77. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  78. * for FCC)
  79. *
  80. * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  81. * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
  82. * from CONFIG_COMMANDS to remove support for networking.
  83. */
  84. #undef CONFIG_ETHER_ON_SCC /* define if ethernet on SCC */
  85. #define CONFIG_ETHER_ON_FCC /* define if ethernet on FCC */
  86. #undef CONFIG_ETHER_NONE /* define if ethernet on neither */
  87. #define CONFIG_ETHER_INDEX 3 /* which SCC/FCC channel for ethernet */
  88. #if ( CONFIG_ETHER_INDEX == 3 )
  89. /*
  90. * - Rx-CLK is CLK15
  91. * - Tx-CLK is CLK16
  92. * - RAM for BD/Buffers is on the 60x Bus (see 28-13)
  93. * - Enable Half Duplex in FSMR
  94. */
  95. # define CFG_CMXFCR_MASK (CMXFCR_FC3|CMXFCR_RF3CS_MSK|CMXFCR_TF3CS_MSK)
  96. # define CFG_CMXFCR_VALUE (CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16)
  97. # define CFG_CPMFCR_RAMTYPE 0
  98. /*#define CFG_FCC_PSMR (FCC_PSMR_FDE|FCC_PSMR_LPB) */
  99. # define CFG_FCC_PSMR 0
  100. #else /* CONFIG_ETHER_INDEX */
  101. # error "on RPX Super ethernet must be FCC3"
  102. #endif /* CONFIG_ETHER_INDEX */
  103. #define CONFIG_HARD_I2C 1 /* I2C with hardware support */
  104. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
  105. #define CFG_I2C_SLAVE 0x7F
  106. /* Define this to reserve an entire FLASH sector (256 KB) for
  107. * environment variables. Otherwise, the environment will be
  108. * put in the same sector as U-Boot, and changing variables
  109. * will erase U-Boot temporarily
  110. */
  111. #define CFG_ENV_IN_OWN_SECT
  112. /* Define to allow the user to overwrite serial and ethaddr */
  113. #define CONFIG_ENV_OVERWRITE
  114. /* What should the console's baud rate be? */
  115. #define CONFIG_BAUDRATE 115200
  116. /* Ethernet MAC address */
  117. #define CONFIG_ETHADDR 08:00:22:50:70:63
  118. #define CONFIG_IPADDR 192.168.1.99
  119. #define CONFIG_SERVERIP 192.168.1.3
  120. /* Set to a positive value to delay for running BOOTCOMMAND */
  121. #define CONFIG_BOOTDELAY -1
  122. /* undef this to save memory */
  123. #define CFG_LONGHELP
  124. /* Monitor Command Prompt */
  125. #define CFG_PROMPT "=> "
  126. /* What U-Boot subsytems do you want enabled? */
  127. #define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
  128. CFG_CMD_IMMAP | \
  129. CFG_CMD_ASKENV | \
  130. CFG_CMD_ECHO | \
  131. CFG_CMD_I2C | \
  132. CFG_CMD_REGINFO & \
  133. ~CFG_CMD_KGDB )
  134. /* Where do the internal registers live? */
  135. #define CFG_IMMR 0xF0000000
  136. /* Where do the on board registers (CS4) live? */
  137. #define CFG_REGS_BASE 0xFA000000
  138. /*****************************************************************************
  139. *
  140. * You should not have to modify any of the following settings
  141. *
  142. *****************************************************************************/
  143. #define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
  144. #define CONFIG_RPXSUPER 1 /* on an Embedded Planet RPX Super Board */
  145. #define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_early_init_f */
  146. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  147. #include <cmd_confdefs.h>
  148. /*
  149. * Miscellaneous configurable options
  150. */
  151. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  152. # define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  153. #else
  154. # define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  155. #endif
  156. /* Print Buffer Size */
  157. #define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT)+16)
  158. #define CFG_MAXARGS 8 /* max number of command args */
  159. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  160. #define CFG_MEMTEST_START 0x04000000 /* memtest works on */
  161. #define CFG_MEMTEST_END 0x06000000 /* 64-96 MB in SDRAM */
  162. #define CONFIG_CLOCKS_IN_MHZ 1 /* clocks passsed to Linux in MHz */
  163. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  164. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  165. /* valid baudrates */
  166. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  167. /*
  168. * Low Level Configuration Settings
  169. * (address mappings, register initial values, etc.)
  170. * You should know what you are doing if you make changes here.
  171. */
  172. #define CFG_FLASH_BASE CFG_FLASH0_BASE
  173. #define CFG_SDRAM_BASE CFG_SDRAM0_BASE
  174. /*-----------------------------------------------------------------------
  175. * Hard Reset Configuration Words
  176. */
  177. #if defined(CFG_SBC_BOOT_LOW)
  178. # define CFG_SBC_HRCW_BOOT_FLAGS (HRCW_CIP | HRCW_BMS)
  179. #else
  180. # define CFG_SBC_HRCW_BOOT_FLAGS (0)
  181. #endif /* defined(CFG_SBC_BOOT_LOW) */
  182. /* get the HRCW ISB field from CFG_IMMR */
  183. #define CFG_SBC_HRCW_IMMR ( ((CFG_IMMR & 0x10000000) >> 10) |\
  184. ((CFG_IMMR & 0x01000000) >> 7) |\
  185. ((CFG_IMMR & 0x00100000) >> 4) )
  186. #define CFG_HRCW_MASTER (HRCW_BPS11 |\
  187. HRCW_DPPC11 |\
  188. CFG_SBC_HRCW_IMMR |\
  189. HRCW_MMR00 |\
  190. HRCW_LBPC11 |\
  191. HRCW_APPC10 |\
  192. HRCW_CS10PC00 |\
  193. (CFG_SBC_MODCK_H & HRCW_MODCK_H1111) |\
  194. CFG_SBC_HRCW_BOOT_FLAGS)
  195. /* no slaves */
  196. #define CFG_HRCW_SLAVE1 0
  197. #define CFG_HRCW_SLAVE2 0
  198. #define CFG_HRCW_SLAVE3 0
  199. #define CFG_HRCW_SLAVE4 0
  200. #define CFG_HRCW_SLAVE5 0
  201. #define CFG_HRCW_SLAVE6 0
  202. #define CFG_HRCW_SLAVE7 0
  203. /*-----------------------------------------------------------------------
  204. * Definitions for initial stack pointer and data area (in DPRAM)
  205. */
  206. #define CFG_INIT_RAM_ADDR CFG_IMMR
  207. #define CFG_INIT_RAM_END 0x4000 /* End of used area in DPRAM */
  208. #define CFG_GBL_DATA_SIZE 128 /* bytes reserved for initial data */
  209. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  210. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  211. /*-----------------------------------------------------------------------
  212. * Start addresses for the final memory configuration
  213. * (Set up by the startup code)
  214. * Please note that CFG_SDRAM_BASE _must_ start at 0
  215. * Note also that the logic that sets CFG_RAMBOOT is platform dependent.
  216. */
  217. #define CFG_MONITOR_BASE (CFG_FLASH0_BASE + 0x00F00000)
  218. #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
  219. # define CFG_RAMBOOT
  220. #endif
  221. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  222. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  223. /*
  224. * For booting Linux, the board info and command line data
  225. * have to be in the first 8 MB of memory, since this is
  226. * the maximum mapped by the Linux kernel during initialization.
  227. */
  228. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  229. /*-----------------------------------------------------------------------
  230. * FLASH and environment organization
  231. */
  232. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  233. #define CFG_MAX_FLASH_SECT 71 /* max number of sectors on one chip */
  234. #define CFG_FLASH_ERASE_TOUT 8000 /* Timeout for Flash Erase (in ms) */
  235. #define CFG_FLASH_WRITE_TOUT 1 /* Timeout for Flash Write (in ms) */
  236. #ifndef CFG_RAMBOOT
  237. # define CFG_ENV_IS_IN_FLASH 1
  238. # ifdef CFG_ENV_IN_OWN_SECT
  239. # define CFG_ENV_ADDR (CFG_MONITOR_BASE + 0x40000)
  240. # define CFG_ENV_SECT_SIZE 0x40000
  241. # else
  242. # define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_MONITOR_LEN - CFG_ENV_SECT_SIZE)
  243. # define CFG_ENV_SIZE 0x1000 /* Total Size of Environment Sector */
  244. # define CFG_ENV_SECT_SIZE 0x10000 /* see README - env sect real size */
  245. # endif /* CFG_ENV_IN_OWN_SECT */
  246. #else
  247. # define CFG_ENV_IS_IN_NVRAM 1
  248. # define CFG_ENV_ADDR (CFG_MONITOR_BASE - 0x1000)
  249. # define CFG_ENV_SIZE 0x200
  250. #endif /* CFG_RAMBOOT */
  251. /*-----------------------------------------------------------------------
  252. * Cache Configuration
  253. */
  254. #define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  255. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  256. # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  257. #endif
  258. /*-----------------------------------------------------------------------
  259. * HIDx - Hardware Implementation-dependent Registers 2-11
  260. *-----------------------------------------------------------------------
  261. * HID0 also contains cache control - initially enable both caches and
  262. * invalidate contents, then the final state leaves only the instruction
  263. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  264. * but Soft reset does not.
  265. *
  266. * HID1 has only read-only information - nothing to set.
  267. */
  268. #define CFG_HID0_INIT (/*HID0_ICE |*/\
  269. /*HID0_DCE |*/\
  270. HID0_ICFI |\
  271. HID0_DCI |\
  272. HID0_IFEM |\
  273. HID0_ABE)
  274. #define CFG_HID0_FINAL (/*HID0_ICE |*/\
  275. HID0_IFEM |\
  276. HID0_ABE |\
  277. HID0_EMCP)
  278. #define CFG_HID2 0
  279. /*-----------------------------------------------------------------------
  280. * RMR - Reset Mode Register
  281. *-----------------------------------------------------------------------
  282. */
  283. #define CFG_RMR 0
  284. /*-----------------------------------------------------------------------
  285. * BCR - Bus Configuration 4-25
  286. *-----------------------------------------------------------------------
  287. */
  288. #define CFG_BCR (BCR_EBM |\
  289. BCR_PLDP |\
  290. BCR_EAV |\
  291. BCR_NPQM0)
  292. /*-----------------------------------------------------------------------
  293. * SIUMCR - SIU Module Configuration 4-31
  294. *-----------------------------------------------------------------------
  295. */
  296. #define CFG_SIUMCR (SIUMCR_L2CPC01 |\
  297. SIUMCR_APPC10 |\
  298. SIUMCR_CS10PC01)
  299. /*-----------------------------------------------------------------------
  300. * SYPCR - System Protection Control 11-9
  301. * SYPCR can only be written once after reset!
  302. *-----------------------------------------------------------------------
  303. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  304. */
  305. #define CFG_SYPCR (SYPCR_SWTC |\
  306. SYPCR_BMT |\
  307. SYPCR_PBME |\
  308. SYPCR_LBME |\
  309. SYPCR_SWRI |\
  310. SYPCR_SWP)
  311. /*-----------------------------------------------------------------------
  312. * TMCNTSC - Time Counter Status and Control 4-40
  313. *-----------------------------------------------------------------------
  314. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  315. * and enable Time Counter
  316. */
  317. #define CFG_TMCNTSC (TMCNTSC_SEC |\
  318. TMCNTSC_ALR |\
  319. TMCNTSC_TCF |\
  320. TMCNTSC_TCE)
  321. /*-----------------------------------------------------------------------
  322. * PISCR - Periodic Interrupt Status and Control 4-42
  323. *-----------------------------------------------------------------------
  324. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  325. * Periodic timer
  326. */
  327. #define CFG_PISCR (PISCR_PS |\
  328. PISCR_PTF |\
  329. PISCR_PTE)
  330. /*-----------------------------------------------------------------------
  331. * SCCR - System Clock Control 9-8
  332. *-----------------------------------------------------------------------
  333. */
  334. #define CFG_SCCR (SCCR_DFBRG01)
  335. /*-----------------------------------------------------------------------
  336. * RCCR - RISC Controller Configuration 13-7
  337. *-----------------------------------------------------------------------
  338. */
  339. #define CFG_RCCR 0
  340. /*
  341. * Init Memory Controller:
  342. *
  343. * Bank Bus Machine PortSz Device
  344. * ---- --- ------- ------ ------
  345. * 0 60x GPCM 64 bit FLASH (BGA - 16MB AMD AM29DL323DB90)
  346. * 1 60x SDRAM 64 bit SDRAM (BGA - 64MB Hitachi HM5225325FBP-B60)
  347. * 2 Local SDRAM 32 bit SDRAM (BGA - 32MB Hitachi HM5225325FBP-B60)
  348. * 3 unused
  349. * 4 60x GPCM 8 bit Board Regs, LEDs, switches
  350. * 5 unused
  351. * 6 unused
  352. * 7 unused
  353. * 8 PCMCIA
  354. * 9 unused
  355. * 10 unused
  356. * 11 unused
  357. */
  358. /* Bank 0 - FLASH
  359. *
  360. */
  361. #define CFG_BR0_PRELIM ((CFG_FLASH0_BASE & BRx_BA_MSK) |\
  362. BRx_PS_64 |\
  363. BRx_DECC_NONE |\
  364. BRx_MS_GPCM_P |\
  365. BRx_V)
  366. #define CFG_OR0_PRELIM (MEG_TO_AM(CFG_FLASH0_SIZE) |\
  367. ORxG_CSNT |\
  368. ORxG_ACS_DIV1 |\
  369. ORxG_SCY_6_CLK |\
  370. ORxG_EHTR)
  371. /* Bank 1 - SDRAM
  372. *
  373. */
  374. #define CFG_BR1_PRELIM ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
  375. BRx_PS_64 |\
  376. BRx_MS_SDRAM_P |\
  377. BRx_V)
  378. #define CFG_OR1_PRELIM (MEG_TO_AM(CFG_SDRAM0_SIZE) |\
  379. ORxS_BPD_4 |\
  380. ORxS_ROWST_PBI0_A8 |\
  381. ORxS_NUMR_12 |\
  382. ORxS_IBID)
  383. #define CFG_PSDMR 0x014DA412
  384. #define CFG_PSRT 0x79
  385. /* Bank 2 - SDRAM
  386. *
  387. */
  388. #define CFG_BR2_PRELIM ((CFG_SDRAM1_BASE & BRx_BA_MSK) |\
  389. BRx_PS_32 |\
  390. BRx_MS_SDRAM_L |\
  391. BRx_V)
  392. #define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM1_SIZE) |\
  393. ORxS_BPD_4 |\
  394. ORxS_ROWST_PBI0_A9 |\
  395. ORxS_NUMR_12)
  396. #define CFG_LSDMR 0x0169A512
  397. #define CFG_LSRT 0x79
  398. #define CFG_MPTPR (0x0800 & MPTPR_PTP_MSK)
  399. /* Bank 4 - On board registers
  400. *
  401. */
  402. #define CFG_BR4_PRELIM ((CFG_REGS_BASE & BRx_BA_MSK) |\
  403. BRx_PS_8 |\
  404. BRx_MS_GPCM_P |\
  405. BRx_V)
  406. #define CFG_OR4_PRELIM (ORxG_AM_MSK |\
  407. ORxG_CSNT |\
  408. ORxG_ACS_DIV1 |\
  409. ORxG_SCY_5_CLK |\
  410. ORxG_TRLX)
  411. /*
  412. * Internal Definitions
  413. *
  414. * Boot Flags
  415. */
  416. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  417. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  418. #endif /* __CONFIG_H */