2 * (C) Copyright 2009-2010
3 * Michael Weiß, ifm ecomatic gmbh, michael.weiss@ifm.com
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * pdm360ng board configuration file
31 #define CONFIG_PDM360NG 1
34 * Memory map for the PDM360NG board:
36 * 0x0000_0000 - 0x1FFF_FFFF DDR RAM (512 MB)
37 * 0x2000_0000 - 0x3FFF_FFFF reserved (DDR RAM (512 MB)
38 * 0x5000_0000 - 0x5001_FFFF SRAM (128 KB)
39 * 0x5004_0000 - 0x5005_FFFF MRAM (CS2) (128 KB)
40 * 0x8000_0000 - 0x803F_FFFF IMMR (4 MB)
41 * 0xF000_0000 - 0xF7FF_FFFF NOR FLASH (CS0) (128 MB)
42 * 0xF800_0000 - 0xFFFF_FFFF NOR FLASH (CS1) (128 MB) optional
46 * High Level Configuration Options
48 #define CONFIG_E300 1 /* E300 Family */
49 #define CONFIG_MPC512X 1 /* MPC512X family */
50 #define CONFIG_FSL_DIU_FB 1 /* FSL DIU */
52 #define CONFIG_SYS_TEXT_BASE 0xF0000000
54 /* Used for silent command in environment */
55 #define CONFIG_SYS_DEVICE_NULLDEV
56 #define CONFIG_SILENT_CONSOLE
61 #if defined(CONFIG_VIDEO)
62 #define CONFIG_CFB_CONSOLE
63 #define CONFIG_VGA_AS_SINGLE_DEVICE
64 #define CONFIG_SPLASH_SCREEN
65 #define CONFIG_VIDEO_LOGO
66 #define CONFIG_VIDEO_BMP_RLE8
67 #define CONFIG_VIDEO_XRES 800
68 #define CONFIG_VIDEO_YRES 480
71 #define CONFIG_SYS_MPC512X_CLKIN 33333333 /* in Hz */
73 #define CONFIG_BOARD_EARLY_INIT_F /* call board_early_init_f() */
74 #define CONFIG_MISC_INIT_R
76 #define CONFIG_SYS_IMMR 0x80000000
77 #define CONFIG_SYS_DIU_ADDR ((CONFIG_SYS_IMMR) + 0x2100)
83 /* DDR is system memory */
84 #define CONFIG_SYS_DDR_BASE 0x00000000
85 #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
86 #define CONFIG_SYS_MAX_RAM_SIZE 0x40000000
88 /* DDR pin mux and slew rate */
89 #define CONFIG_SYS_IOCTRL_MUX_DDR 0x00000012
91 /* Manually set all parameters as there's no SPD etc. */
93 * DDR Controller Configuration for Micron DDR2 SDRAM MT47H128M8-3
96 * [31:31] MDDRC Soft Reset: Diabled
97 * [30:30] DRAM CKE pin: Enabled
98 * [29:29] DRAM CLK: Enabled
99 * [28:28] Command Mode: Enabled (For initialization only)
100 * [27:25] DRAM Row Select: dram_row[15:0] = magenta_address[25:10]
101 * [24:21] DRAM Bank Select: dram_bank[1:0] = magenta_address[11:10]
102 * [20:19] Read Test: DON'T USE
103 * [18:18] Self Refresh: Enabled
104 * [17:17] 16bit Mode: Disabled
105 * [16:13] Read Delay: 3
106 * [12:12] Half DQS Delay: Disabled
107 * [11:11] Quarter DQS Delay: Disabled
108 * [10:08] Write Delay: 2
109 * [07:07] Early ODT: Disabled
110 * [06:06] On DIE Termination: Enabled
111 * [05:05] FIFO Overflow Clear: DON'T USE here
112 * [04:04] FIFO Underflow Clear: DON'T USE here
113 * [03:03] FIFO Overflow Pending: DON'T USE here
114 * [02:02] FIFO Underlfow Pending: DON'T USE here
115 * [01:01] FIFO Overlfow Enabled: Enabled
116 * [00:00] FIFO Underflow Enabled: Enabled
118 * [31:16] DRAM Refresh Time: 0 CSB clocks
119 * [15:8] DRAM Command Time: 0 CSB clocks
120 * [07:00] DRAM Precharge Time: 0 CSB clocks
124 * [20:17] DRAM tWRT1:
131 * [22:19] DRAM tRTW1:
137 #define CONFIG_SYS_MDDRC_SYS_CFG 0xEA804A40
138 #define CONFIG_SYS_MDDRC_TIME_CFG0 0x030C3D2E
139 #define CONFIG_SYS_MDDRC_TIME_CFG1 0x68EC1168
140 #define CONFIG_SYS_MDDRC_TIME_CFG2 0x34310864
143 * Alternative 1: small RAM (128 MB) configuration
145 #define CONFIG_SYS_MDDRC_SYS_CFG_ALT1 0xE8604A40
146 #define CONFIG_SYS_MDDRC_TIME_CFG0_ALT1 0x030C3D2E
147 #define CONFIG_SYS_MDDRC_TIME_CFG1_ALT1 0x3CEC1168
148 #define CONFIG_SYS_MDDRC_TIME_CFG2_ALT1 0x33310863
150 #define CONFIG_SYS_MDDRC_SYS_CFG_EN 0xF0000000
152 #define CONFIG_SYS_DDRCMD_NOP 0x01380000
153 #define CONFIG_SYS_DDRCMD_PCHG_ALL 0x01100400
154 #define CONFIG_SYS_DDRCMD_EM2 0x01020000 /* EMR2 */
155 #define CONFIG_SYS_DDRCMD_EM3 0x01030000 /* EMR3 */
156 /* EMR with 150 ohm ODT todo: verify */
157 #define CONFIG_SYS_DDRCMD_EN_DLL 0x01010040
158 #define CONFIG_SYS_DDRCMD_RES_DLL 0x01000100
159 #define CONFIG_SYS_DDRCMD_RFSH 0x01080000
160 #define CONFIG_SYS_MICRON_INIT_DEV_OP 0x01000432
161 /* EMR with 150 ohm ODT todo: verify */
162 #define CONFIG_SYS_DDRCMD_OCD_DEFAULT 0x010107C0
163 /* EMR new command with 150 ohm ODT todo: verify */
164 #define CONFIG_SYS_DDRCMD_OCD_EXIT 0x01010440
166 /* DDR Priority Manager Configuration */
167 #define CONFIG_SYS_MDDRCGRP_PM_CFG1 0x00077777
168 #define CONFIG_SYS_MDDRCGRP_PM_CFG2 0x00000000
169 #define CONFIG_SYS_MDDRCGRP_HIPRIO_CFG 0x00000001
170 #define CONFIG_SYS_MDDRCGRP_LUT0_MU 0xFFEEDDCC
171 #define CONFIG_SYS_MDDRCGRP_LUT0_ML 0xBBAAAAAA
172 #define CONFIG_SYS_MDDRCGRP_LUT1_MU 0x66666666
173 #define CONFIG_SYS_MDDRCGRP_LUT1_ML 0x55555555
174 #define CONFIG_SYS_MDDRCGRP_LUT2_MU 0x44444444
175 #define CONFIG_SYS_MDDRCGRP_LUT2_ML 0x44444444
176 #define CONFIG_SYS_MDDRCGRP_LUT3_MU 0x55555555
177 #define CONFIG_SYS_MDDRCGRP_LUT3_ML 0x55555558
178 #define CONFIG_SYS_MDDRCGRP_LUT4_MU 0x11111111
179 #define CONFIG_SYS_MDDRCGRP_LUT4_ML 0x11111122
180 #define CONFIG_SYS_MDDRCGRP_LUT0_AU 0xaaaaaaaa
181 #define CONFIG_SYS_MDDRCGRP_LUT0_AL 0xaaaaaaaa
182 #define CONFIG_SYS_MDDRCGRP_LUT1_AU 0x66666666
183 #define CONFIG_SYS_MDDRCGRP_LUT1_AL 0x66666666
184 #define CONFIG_SYS_MDDRCGRP_LUT2_AU 0x11111111
185 #define CONFIG_SYS_MDDRCGRP_LUT2_AL 0x11111111
186 #define CONFIG_SYS_MDDRCGRP_LUT3_AU 0x11111111
187 #define CONFIG_SYS_MDDRCGRP_LUT3_AL 0x11111111
188 #define CONFIG_SYS_MDDRCGRP_LUT4_AU 0x11111111
189 #define CONFIG_SYS_MDDRCGRP_LUT4_AL 0x11111111
192 * NOR FLASH on the Local Bus
194 #define CONFIG_SYS_FLASH_CFI /* use Common Flash Interface */
195 #define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
196 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
198 #define CONFIG_SYS_FLASH_BASE 0xF0000000 /* start of FLASH-Bank0 */
199 #define CONFIG_SYS_FLASH_SIZE 0x08000000 /* max size of a Bank */
200 /* start of FLASH-Bank1 */
201 #define CONFIG_SYS_FLASH1_BASE (CONFIG_SYS_FLASH_BASE + \
202 CONFIG_SYS_FLASH_SIZE)
203 #define CONFIG_SYS_MAX_FLASH_SECT 512 /* max sectors per device */
204 #define CONFIG_SYS_MAX_FLASH_BANKS 2 /* number of banks */
205 #define CONFIG_SYS_FLASH_BANKS_LIST \
206 {CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH1_BASE}
208 #define CONFIG_SYS_SRAM_BASE 0x50000000
209 #define CONFIG_SYS_SRAM_SIZE 0x00020000 /* 128 KB */
211 /* ALE active low, data size 4 bytes */
212 #define CONFIG_SYS_CS0_CFG 0x05059350
213 /* ALE active low, data size 4 bytes */
214 #define CONFIG_SYS_CS1_CFG 0x05059350
216 #define CONFIG_SYS_MRAM_BASE 0x50040000
217 #define CONFIG_SYS_MRAM_SIZE 0x00020000
218 /* ALE active low, data size 4 bytes */
219 #define CONFIG_SYS_CS2_CFG 0x05059110
221 /* alt. CS timing for CS0, CS1, CS2 */
222 #define CONFIG_SYS_CS_ALETIMING 0x00000007
227 #define CONFIG_CMD_NAND /* enable NAND support */
228 #define CONFIG_NAND_MPC5121_NFC
229 #define CONFIG_SYS_NAND_BASE 0x40000000
231 #define CONFIG_SYS_MAX_NAND_DEVICE 1
232 #define NAND_MAX_CHIPS CONFIG_SYS_MAX_NAND_DEVICE
233 #define CONFIG_SYS_NAND_SELECT_DEVICE /* driver supports mutipl. chips */
236 * Configuration parameters for MPC5121 NAND driver
238 #define CONFIG_FSL_NFC_WIDTH 1
239 #define CONFIG_FSL_NFC_WRITE_SIZE 2048
240 #define CONFIG_FSL_NFC_SPARE_SIZE 64
241 #define CONFIG_FSL_NFC_CHIPS CONFIG_SYS_MAX_NAND_DEVICE
244 * Dynamic MTD partition support
246 #define CONFIG_CMD_MTDPARTS
247 #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
248 #define CONFIG_FLASH_CFI_MTD
249 #define MTDIDS_DEFAULT "nor0=f0000000.flash,nor1=f8000000.flash," \
255 #define MTDPARTS_DEFAULT "mtdparts=f0000000.flash:512k(u-boot)," \
256 "256k(environment1)," \
257 "256k(environment2)," \
258 "256k(splash-factory)," \
259 "2m(FIT: recovery)," \
260 "4608k(fs-recovery)," \
261 "256k(splash-customer),"\
262 "5m(FIT: kernel+dtb)," \
263 "64m(rootfs squash)ro," \
265 "f8000000.flash:-(unused);" \
266 "MPC5121 NAND:1024m(extended-userfs)"
269 * Override partitions in device tree using info
270 * in "mtdparts" environment variable
272 #ifdef CONFIG_CMD_MTDPARTS
273 #define CONFIG_FDT_FIXUP_PARTITIONS
276 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* Start of monitor */
277 #define CONFIG_SYS_MONITOR_LEN (512 * 1024) /* 512 kB for monitor */
278 #ifdef CONFIG_FSL_DIU_FB
279 #define CONFIG_SYS_MALLOC_LEN (6 * 1024 * 1024) /* for malloc */
281 #define CONFIG_SYS_MALLOC_LEN (512 * 1024)
287 #define CONFIG_CONS_INDEX 1
290 * Serial console configuration
292 #define CONFIG_PSC_CONSOLE 6 /* console is on PSC6 */
293 #if CONFIG_PSC_CONSOLE != 6
294 #error CONFIG_PSC_CONSOLE must be 6
297 #define CONSOLE_FIFO_TX_SIZE FIFOC_PSC6_TX_SIZE
298 #define CONSOLE_FIFO_TX_ADDR FIFOC_PSC6_TX_ADDR
299 #define CONSOLE_FIFO_RX_SIZE FIFOC_PSC6_RX_SIZE
300 #define CONSOLE_FIFO_RX_ADDR FIFOC_PSC6_RX_ADDR
303 * Used PSC UART devices
305 #define CONFIG_SERIAL_MULTI
306 #define CONFIG_SYS_PSC1
307 #define CONFIG_SYS_PSC4
308 #define CONFIG_SYS_PSC6
311 * Co-processor communication parameters
313 #define CONFIG_SYS_PDM360NG_COPROC_READ_DELAY 5000
314 #define CONFIG_SYS_PDM360NG_COPROC_BAUDRATE 38400
319 #define CONFIG_HARD_I2C /* I2C with hardware support */
320 #define CONFIG_I2C_MULTI_BUS
321 #define CONFIG_I2C_CMD_TREE
322 /* I2C speed and slave address */
323 #define CONFIG_SYS_I2C_SPEED 100000
324 #define CONFIG_SYS_I2C_SLAVE 0x7F
327 * EEPROM configuration
329 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* 16-bit EEPROM addr */
330 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* ST AT24C01 */
331 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 /* 10ms of delay */
332 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-Byte Write Mode */
337 #define CONFIG_SYS_I2C_EEPROM_BUS_NUM 0
338 #define CONFIG_SYS_I2C_EEPROM_MAC_OFFSET 0x10
340 * Enabled only to delete "ethaddr" before testing
341 * "ethaddr" setting from EEPROM
343 #define CONFIG_ENV_OVERWRITE
346 * Ethernet configuration
348 #define CONFIG_MPC512x_FEC 1
349 #define CONFIG_NET_MULTI
350 #define CONFIG_PHY_ADDR 0x1F
351 #define CONFIG_MII 1 /* MII PHY management */
352 #define CONFIG_FEC_AN_TIMEOUT 1
353 #define CONFIG_HAS_ETH0
356 * Configure on-board RTC
358 #define CONFIG_RTC_M41T62 /* use M41T00 rtc via i2c */
359 #define CONFIG_SYS_I2C_RTC_ADDR 0x68 /* at address 0x68 */
364 #define CONFIG_ENV_IS_IN_FLASH 1
365 /* This has to be a multiple of the Flash sector size */
366 #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
367 CONFIG_SYS_MONITOR_LEN)
368 #define CONFIG_ENV_SIZE 0x2000
369 #define CONFIG_ENV_SECT_SIZE 0x40000 /* one sector (256K) for env */
371 /* Address and size of Redundant Environment Sector */
372 #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
373 #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
375 #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
376 #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
378 #include <config_cmd_default.h>
380 #define CONFIG_CMD_ASKENV
381 #define CONFIG_CMD_DATE
382 #define CONFIG_CMD_DHCP
383 #define CONFIG_CMD_EEPROM
384 #define CONFIG_CMD_I2C
385 #define CONFIG_CMD_MII
386 #define CONFIG_CMD_PING
387 #define CONFIG_CMD_REGINFO
390 #define CONFIG_CMD_BMP
394 * Miscellaneous configurable options
396 #define CONFIG_SYS_LONGHELP /* undef to save memory */
397 #define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
398 #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
400 #ifdef CONFIG_CMD_KGDB
401 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
403 #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
406 /* Print Buffer Size */
407 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
408 /* Max number of command args */
409 #define CONFIG_SYS_MAXARGS 16
410 /* Boot Argument Buffer Size */
411 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
412 /* Decrementer freq: 1ms ticks */
413 #define CONFIG_SYS_HZ 1000
416 * For booting Linux, the board info and command line data
417 * have to be in the first 256 MB of memory, since this is
418 * the maximum mapped by the Linux kernel during initialization.
420 /* Initial Memory map for Linux */
421 #define CONFIG_SYS_BOOTMAPSZ (256 << 20)
423 /* Cache Configuration */
424 #define CONFIG_SYS_DCACHE_SIZE 32768
425 #define CONFIG_SYS_CACHELINE_SIZE 32
426 #ifdef CONFIG_CMD_KGDB
427 /* log base 2 of the above value */
428 #define CONFIG_SYS_CACHELINE_SHIFT 5
431 #define CONFIG_SYS_HID0_INIT 0x000000000
432 #define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | HID0_ICE)
433 #define CONFIG_SYS_HID2 HID2_HBE
435 #define CONFIG_HIGH_BATS 1 /* High BATs supported */
437 #ifdef CONFIG_CMD_KGDB
438 #define CONFIG_KGDB_BAUDRATE 230400 /* speed of kgdb serial port */
439 #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
442 #ifdef CONFIG_SERIAL_MULTI
444 #define CONFIG_POST (CONFIG_SYS_POST_COPROC)
448 * Environment Configuration
450 #define CONFIG_TIMESTAMP
452 #define CONFIG_HOSTNAME pdm360ng
453 /* default location for tftp and bootm */
454 #define CONFIG_LOADADDR 400000
456 #define CONFIG_BOOTDELAY 5 /* -1 disables auto-boot */
458 #define CONFIG_PREBOOT "echo;" \
459 "echo PDM360NG SAMPLE;" \
462 #define CONFIG_BOOTCOMMAND "run env_cont"
464 #define CONFIG_OF_LIBFDT 1
465 #define CONFIG_OF_BOARD_SETUP 1
466 #define CONFIG_OF_SUPPORT_OLD_DEVICE_TREES 1
468 #define CONFIG_FIT_VERBOSE
470 #define OF_CPU "PowerPC,5121@0"
471 #define OF_SOC_COMPAT "fsl,mpc5121-immr"
472 #define OF_TBCLK (bd->bi_busfreq / 4)
473 #define OF_STDOUT_PATH "/soc@80000000/serial@11600"
476 * Include common options for all mpc5121 boards
478 #include "mpc5121-common.h"
480 #endif /* __CONFIG_H */