pdm360ng.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. /*
  2. * (C) Copyright 2009-2010
  3. * Michael Weiß, ifm ecomatic gmbh, michael.weiss@ifm.com
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /*
  8. * pdm360ng board configuration file
  9. */
  10. #ifndef __CONFIG_H
  11. #define __CONFIG_H
  12. #define CONFIG_PDM360NG 1
  13. /*
  14. * Memory map for the PDM360NG board:
  15. *
  16. * 0x0000_0000 - 0x1FFF_FFFF DDR RAM (512 MB)
  17. * 0x2000_0000 - 0x3FFF_FFFF reserved (DDR RAM (512 MB)
  18. * 0x5000_0000 - 0x5001_FFFF SRAM (128 KB)
  19. * 0x5004_0000 - 0x5005_FFFF MRAM (CS2) (128 KB)
  20. * 0x8000_0000 - 0x803F_FFFF IMMR (4 MB)
  21. * 0xF000_0000 - 0xF7FF_FFFF NOR FLASH (CS0) (128 MB)
  22. * 0xF800_0000 - 0xFFFF_FFFF NOR FLASH (CS1) (128 MB) optional
  23. */
  24. /*
  25. * High Level Configuration Options
  26. */
  27. #define CONFIG_E300 1 /* E300 Family */
  28. #define CONFIG_FSL_DIU_FB 1 /* FSL DIU */
  29. #define CONFIG_SYS_TEXT_BASE 0xF0000000
  30. /* Used for silent command in environment */
  31. #define CONFIG_SYS_DEVICE_NULLDEV
  32. /* Video */
  33. #if defined(CONFIG_VIDEO)
  34. #define CONFIG_SPLASH_SCREEN
  35. #define CONFIG_VIDEO_LOGO
  36. #define CONFIG_VIDEO_BMP_RLE8
  37. #endif
  38. #define CONFIG_SYS_MPC512X_CLKIN 33333333 /* in Hz */
  39. #define CONFIG_MISC_INIT_R
  40. #define CONFIG_SYS_IMMR 0x80000000
  41. #define CONFIG_SYS_DIU_ADDR ((CONFIG_SYS_IMMR) + 0x2100)
  42. /*
  43. * DDR Setup
  44. */
  45. /* DDR is system memory */
  46. #define CONFIG_SYS_DDR_BASE 0x00000000
  47. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
  48. #define CONFIG_SYS_MAX_RAM_SIZE 0x40000000
  49. /* DDR pin mux and slew rate */
  50. #define CONFIG_SYS_IOCTRL_MUX_DDR 0x00000012
  51. /* Manually set all parameters as there's no SPD etc. */
  52. /*
  53. * DDR Controller Configuration for Micron DDR2 SDRAM MT47H128M8-3
  54. *
  55. * SYS_CFG:
  56. * [31:31] MDDRC Soft Reset: Diabled
  57. * [30:30] DRAM CKE pin: Enabled
  58. * [29:29] DRAM CLK: Enabled
  59. * [28:28] Command Mode: Enabled (For initialization only)
  60. * [27:25] DRAM Row Select: dram_row[15:0] = magenta_address[25:10]
  61. * [24:21] DRAM Bank Select: dram_bank[1:0] = magenta_address[11:10]
  62. * [20:19] Read Test: DON'T USE
  63. * [18:18] Self Refresh: Enabled
  64. * [17:17] 16bit Mode: Disabled
  65. * [16:13] Read Delay: 3
  66. * [12:12] Half DQS Delay: Disabled
  67. * [11:11] Quarter DQS Delay: Disabled
  68. * [10:08] Write Delay: 2
  69. * [07:07] Early ODT: Disabled
  70. * [06:06] On DIE Termination: Enabled
  71. * [05:05] FIFO Overflow Clear: DON'T USE here
  72. * [04:04] FIFO Underflow Clear: DON'T USE here
  73. * [03:03] FIFO Overflow Pending: DON'T USE here
  74. * [02:02] FIFO Underlfow Pending: DON'T USE here
  75. * [01:01] FIFO Overlfow Enabled: Enabled
  76. * [00:00] FIFO Underflow Enabled: Enabled
  77. * TIME_CFG0
  78. * [31:16] DRAM Refresh Time: 0 CSB clocks
  79. * [15:8] DRAM Command Time: 0 CSB clocks
  80. * [07:00] DRAM Precharge Time: 0 CSB clocks
  81. * TIME_CFG1
  82. * [31:26] DRAM tRFC:
  83. * [25:21] DRAM tWR1:
  84. * [20:17] DRAM tWRT1:
  85. * [16:11] DRAM tDRR:
  86. * [10:05] DRAM tRC:
  87. * [04:00] DRAM tRAS:
  88. * TIME_CFG2
  89. * [31:28] DRAM tRCD:
  90. * [27:23] DRAM tFAW:
  91. * [22:19] DRAM tRTW1:
  92. * [18:15] DRAM tCCD:
  93. * [14:10] DRAM tRTP:
  94. * [09:05] DRAM tRP:
  95. * [04:00] DRAM tRPA
  96. */
  97. #define CONFIG_SYS_MDDRC_SYS_CFG 0xEA804A40
  98. #define CONFIG_SYS_MDDRC_TIME_CFG0 0x030C3D2E
  99. #define CONFIG_SYS_MDDRC_TIME_CFG1 0x68EC1168
  100. #define CONFIG_SYS_MDDRC_TIME_CFG2 0x34310864
  101. /*
  102. * Alternative 1: small RAM (128 MB) configuration
  103. */
  104. #define CONFIG_SYS_MDDRC_SYS_CFG_ALT1 0xE8604A40
  105. #define CONFIG_SYS_MDDRC_TIME_CFG0_ALT1 0x030C3D2E
  106. #define CONFIG_SYS_MDDRC_TIME_CFG1_ALT1 0x3CEC1168
  107. #define CONFIG_SYS_MDDRC_TIME_CFG2_ALT1 0x33310863
  108. #define CONFIG_SYS_MDDRC_SYS_CFG_EN 0xF0000000
  109. #define CONFIG_SYS_DDRCMD_NOP 0x01380000
  110. #define CONFIG_SYS_DDRCMD_PCHG_ALL 0x01100400
  111. #define CONFIG_SYS_DDRCMD_EM2 0x01020000 /* EMR2 */
  112. #define CONFIG_SYS_DDRCMD_EM3 0x01030000 /* EMR3 */
  113. /* EMR with 150 ohm ODT todo: verify */
  114. #define CONFIG_SYS_DDRCMD_EN_DLL 0x01010040
  115. #define CONFIG_SYS_DDRCMD_RES_DLL 0x01000100
  116. #define CONFIG_SYS_DDRCMD_RFSH 0x01080000
  117. #define CONFIG_SYS_MICRON_INIT_DEV_OP 0x01000432
  118. /* EMR with 150 ohm ODT todo: verify */
  119. #define CONFIG_SYS_DDRCMD_OCD_DEFAULT 0x010107C0
  120. /* EMR new command with 150 ohm ODT todo: verify */
  121. #define CONFIG_SYS_DDRCMD_OCD_EXIT 0x01010440
  122. /* DDR Priority Manager Configuration */
  123. #define CONFIG_SYS_MDDRCGRP_PM_CFG1 0x00077777
  124. #define CONFIG_SYS_MDDRCGRP_PM_CFG2 0x00000000
  125. #define CONFIG_SYS_MDDRCGRP_HIPRIO_CFG 0x00000001
  126. #define CONFIG_SYS_MDDRCGRP_LUT0_MU 0xFFEEDDCC
  127. #define CONFIG_SYS_MDDRCGRP_LUT0_ML 0xBBAAAAAA
  128. #define CONFIG_SYS_MDDRCGRP_LUT1_MU 0x66666666
  129. #define CONFIG_SYS_MDDRCGRP_LUT1_ML 0x55555555
  130. #define CONFIG_SYS_MDDRCGRP_LUT2_MU 0x44444444
  131. #define CONFIG_SYS_MDDRCGRP_LUT2_ML 0x44444444
  132. #define CONFIG_SYS_MDDRCGRP_LUT3_MU 0x55555555
  133. #define CONFIG_SYS_MDDRCGRP_LUT3_ML 0x55555558
  134. #define CONFIG_SYS_MDDRCGRP_LUT4_MU 0x11111111
  135. #define CONFIG_SYS_MDDRCGRP_LUT4_ML 0x11111122
  136. #define CONFIG_SYS_MDDRCGRP_LUT0_AU 0xaaaaaaaa
  137. #define CONFIG_SYS_MDDRCGRP_LUT0_AL 0xaaaaaaaa
  138. #define CONFIG_SYS_MDDRCGRP_LUT1_AU 0x66666666
  139. #define CONFIG_SYS_MDDRCGRP_LUT1_AL 0x66666666
  140. #define CONFIG_SYS_MDDRCGRP_LUT2_AU 0x11111111
  141. #define CONFIG_SYS_MDDRCGRP_LUT2_AL 0x11111111
  142. #define CONFIG_SYS_MDDRCGRP_LUT3_AU 0x11111111
  143. #define CONFIG_SYS_MDDRCGRP_LUT3_AL 0x11111111
  144. #define CONFIG_SYS_MDDRCGRP_LUT4_AU 0x11111111
  145. #define CONFIG_SYS_MDDRCGRP_LUT4_AL 0x11111111
  146. /*
  147. * NOR FLASH on the Local Bus
  148. */
  149. #define CONFIG_SYS_FLASH_CFI /* use Common Flash Interface */
  150. #define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
  151. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  152. #define CONFIG_SYS_FLASH_BASE 0xF0000000 /* start of FLASH-Bank0 */
  153. #define CONFIG_SYS_FLASH_SIZE 0x08000000 /* max size of a Bank */
  154. /* start of FLASH-Bank1 */
  155. #define CONFIG_SYS_FLASH1_BASE (CONFIG_SYS_FLASH_BASE + \
  156. CONFIG_SYS_FLASH_SIZE)
  157. #define CONFIG_SYS_MAX_FLASH_SECT 512 /* max sectors per device */
  158. #define CONFIG_SYS_MAX_FLASH_BANKS 2 /* number of banks */
  159. #define CONFIG_SYS_FLASH_BANKS_LIST \
  160. {CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH1_BASE}
  161. #define CONFIG_SYS_SRAM_BASE 0x50000000
  162. #define CONFIG_SYS_SRAM_SIZE 0x00020000 /* 128 KB */
  163. #define CONFIG_SYS_CS1_START CONFIG_SYS_FLASH1_BASE
  164. #define CONFIG_SYS_CS1_SIZE CONFIG_SYS_FLASH_SIZE
  165. /* ALE active low, data size 4 bytes */
  166. #define CONFIG_SYS_CS0_CFG 0x05059350
  167. /* ALE active low, data size 4 bytes */
  168. #define CONFIG_SYS_CS1_CFG 0x05059350
  169. #define CONFIG_SYS_MRAM_BASE 0x50040000
  170. #define CONFIG_SYS_MRAM_SIZE 0x00020000
  171. #define CONFIG_SYS_CS2_START CONFIG_SYS_MRAM_BASE
  172. #define CONFIG_SYS_CS2_SIZE CONFIG_SYS_MRAM_SIZE
  173. /* ALE active low, data size 4 bytes */
  174. #define CONFIG_SYS_CS2_CFG 0x05059110
  175. /* alt. CS timing for CS0, CS1, CS2 */
  176. #define CONFIG_SYS_CS_ALETIMING 0x00000007
  177. /*
  178. * NAND FLASH
  179. */
  180. #define CONFIG_CMD_NAND /* enable NAND support */
  181. #define CONFIG_NAND_MPC5121_NFC
  182. #define CONFIG_SYS_NAND_BASE 0x40000000
  183. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  184. #define CONFIG_SYS_NAND_SELECT_DEVICE /* driver supports mutipl. chips */
  185. /*
  186. * Configuration parameters for MPC5121 NAND driver
  187. */
  188. #define CONFIG_FSL_NFC_WIDTH 1
  189. #define CONFIG_FSL_NFC_WRITE_SIZE 2048
  190. #define CONFIG_FSL_NFC_SPARE_SIZE 64
  191. #define CONFIG_FSL_NFC_CHIPS CONFIG_SYS_MAX_NAND_DEVICE
  192. /*
  193. * Dynamic MTD partition support
  194. */
  195. #define CONFIG_CMD_MTDPARTS
  196. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  197. #define CONFIG_FLASH_CFI_MTD
  198. #define MTDIDS_DEFAULT "nor0=f0000000.flash,nor1=f8000000.flash," \
  199. "nand0=MPC5121 NAND"
  200. /*
  201. * Flash layout
  202. */
  203. #define MTDPARTS_DEFAULT "mtdparts=f0000000.flash:512k(u-boot)," \
  204. "256k(environment1)," \
  205. "256k(environment2)," \
  206. "256k(splash-factory)," \
  207. "2m(FIT: recovery)," \
  208. "4608k(fs-recovery)," \
  209. "256k(splash-customer),"\
  210. "5m(FIT: kernel+dtb)," \
  211. "64m(rootfs squash)ro," \
  212. "51m(userfs ubi);" \
  213. "f8000000.flash:-(unused);" \
  214. "MPC5121 NAND:1024m(extended-userfs)"
  215. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* Start of monitor */
  216. #define CONFIG_SYS_MONITOR_LEN (512 * 1024) /* 512 kB for monitor */
  217. #ifdef CONFIG_FSL_DIU_FB
  218. #define CONFIG_SYS_MALLOC_LEN (6 * 1024 * 1024) /* for malloc */
  219. #else
  220. #define CONFIG_SYS_MALLOC_LEN (512 * 1024)
  221. #endif
  222. /*
  223. * Serial Port
  224. */
  225. #define CONFIG_CONS_INDEX 1
  226. /*
  227. * Serial console configuration
  228. */
  229. #define CONFIG_PSC_CONSOLE 6 /* console is on PSC6 */
  230. #if CONFIG_PSC_CONSOLE != 6
  231. #error CONFIG_PSC_CONSOLE must be 6
  232. #endif
  233. #define CONSOLE_FIFO_TX_SIZE FIFOC_PSC6_TX_SIZE
  234. #define CONSOLE_FIFO_TX_ADDR FIFOC_PSC6_TX_ADDR
  235. #define CONSOLE_FIFO_RX_SIZE FIFOC_PSC6_RX_SIZE
  236. #define CONSOLE_FIFO_RX_ADDR FIFOC_PSC6_RX_ADDR
  237. /*
  238. * Clocks in use
  239. */
  240. #define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \
  241. CLOCK_SCCR1_LPC_EN | \
  242. CLOCK_SCCR1_NFC_EN | \
  243. CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \
  244. CLOCK_SCCR1_PSCFIFO_EN | \
  245. CLOCK_SCCR1_DDR_EN | \
  246. CLOCK_SCCR1_FEC_EN | \
  247. CLOCK_SCCR1_TPR_EN)
  248. #define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \
  249. CLOCK_SCCR2_SPDIF_EN | \
  250. CLOCK_SCCR2_DIU_EN | \
  251. CLOCK_SCCR2_I2C_EN)
  252. /*
  253. * Used PSC UART devices
  254. */
  255. #define CONFIG_SYS_PSC1
  256. #define CONFIG_SYS_PSC4
  257. #define CONFIG_SYS_PSC6
  258. /*
  259. * Co-processor communication parameters
  260. */
  261. #define CONFIG_SYS_PDM360NG_COPROC_READ_DELAY 5000
  262. #define CONFIG_SYS_PDM360NG_COPROC_BAUDRATE 38400
  263. /*
  264. * I2C
  265. */
  266. #define CONFIG_HARD_I2C /* I2C with hardware support */
  267. #define CONFIG_I2C_MULTI_BUS
  268. #define CONFIG_I2C_CMD_TREE
  269. /* I2C speed and slave address */
  270. #define CONFIG_SYS_I2C_SPEED 100000
  271. #define CONFIG_SYS_I2C_SLAVE 0x7F
  272. /*
  273. * IIM - IC Identification Module
  274. */
  275. #undef CONFIG_FSL_IIM
  276. /*
  277. * EEPROM configuration
  278. */
  279. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* 16-bit EEPROM addr */
  280. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* ST AT24C01 */
  281. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 /* 10ms of delay */
  282. #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-Byte Write Mode */
  283. /*
  284. * MAC addr in EEPROM
  285. */
  286. #define CONFIG_SYS_I2C_EEPROM_BUS_NUM 0
  287. #define CONFIG_SYS_I2C_EEPROM_MAC_OFFSET 0x10
  288. /*
  289. * Enabled only to delete "ethaddr" before testing
  290. * "ethaddr" setting from EEPROM
  291. */
  292. #define CONFIG_ENV_OVERWRITE
  293. /*
  294. * Ethernet configuration
  295. */
  296. #define CONFIG_MPC512x_FEC 1
  297. #define CONFIG_PHY_ADDR 0x1F
  298. #define CONFIG_MII 1 /* MII PHY management */
  299. #define CONFIG_FEC_AN_TIMEOUT 1
  300. #define CONFIG_HAS_ETH0
  301. /*
  302. * Configure on-board RTC
  303. */
  304. #define CONFIG_RTC_M41T62 /* use M41T00 rtc via i2c */
  305. #define CONFIG_SYS_I2C_RTC_ADDR 0x68 /* at address 0x68 */
  306. /*
  307. * Environment
  308. */
  309. #define CONFIG_ENV_IS_IN_FLASH 1
  310. /* This has to be a multiple of the Flash sector size */
  311. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
  312. CONFIG_SYS_MONITOR_LEN)
  313. #define CONFIG_ENV_SIZE 0x2000
  314. #define CONFIG_ENV_SECT_SIZE 0x40000 /* one sector (256K) for env */
  315. /* Address and size of Redundant Environment Sector */
  316. #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
  317. #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
  318. #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
  319. #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
  320. #define CONFIG_CMD_DATE
  321. #define CONFIG_CMD_EEPROM
  322. #define CONFIG_CMD_REGINFO
  323. #undef CONFIG_CMD_FUSE
  324. #ifdef CONFIG_VIDEO
  325. #define CONFIG_CMD_BMP
  326. #endif
  327. /*
  328. * Miscellaneous configurable options
  329. */
  330. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  331. #define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
  332. #ifdef CONFIG_CMD_KGDB
  333. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  334. #else
  335. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  336. #endif
  337. /* Print Buffer Size */
  338. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  339. /* Max number of command args */
  340. #define CONFIG_SYS_MAXARGS 16
  341. /* Boot Argument Buffer Size */
  342. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  343. /* Decrementer freq: 1ms ticks */
  344. /*
  345. * For booting Linux, the board info and command line data
  346. * have to be in the first 256 MB of memory, since this is
  347. * the maximum mapped by the Linux kernel during initialization.
  348. */
  349. /* Initial Memory map for Linux */
  350. #define CONFIG_SYS_BOOTMAPSZ (256 << 20)
  351. /* Cache Configuration */
  352. #define CONFIG_SYS_DCACHE_SIZE 32768
  353. #define CONFIG_SYS_CACHELINE_SIZE 32
  354. #ifdef CONFIG_CMD_KGDB
  355. /* log base 2 of the above value */
  356. #define CONFIG_SYS_CACHELINE_SHIFT 5
  357. #endif
  358. #define CONFIG_SYS_HID0_INIT 0x000000000
  359. #define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | HID0_ICE)
  360. #define CONFIG_SYS_HID2 HID2_HBE
  361. #define CONFIG_HIGH_BATS 1 /* High BATs supported */
  362. #ifdef CONFIG_CMD_KGDB
  363. #define CONFIG_KGDB_BAUDRATE 230400 /* speed of kgdb serial port */
  364. #endif
  365. /* POST support */
  366. #define CONFIG_POST (CONFIG_SYS_POST_COPROC)
  367. /*
  368. * Environment Configuration
  369. */
  370. #define CONFIG_TIMESTAMP
  371. #define CONFIG_HOSTNAME pdm360ng
  372. /* default location for tftp and bootm */
  373. #define CONFIG_LOADADDR 400000
  374. #define CONFIG_PREBOOT "echo;" \
  375. "echo PDM360NG SAMPLE;" \
  376. "echo"
  377. #define CONFIG_BOOTCOMMAND "run env_cont"
  378. #define CONFIG_OF_SUPPORT_OLD_DEVICE_TREES 1
  379. #define OF_CPU "PowerPC,5121@0"
  380. #define OF_SOC_COMPAT "fsl,mpc5121-immr"
  381. #define OF_TBCLK (bd->bi_busfreq / 4)
  382. #define OF_STDOUT_PATH "/soc@80000000/serial@11600"
  383. /*
  384. * Include common options for all mpc5121 boards
  385. */
  386. #include "mpc5121-common.h"
  387. #endif /* __CONFIG_H */