* [04:00] DRAM tRPA
*/
#ifdef CONFIG_MPC5121ADS_REV2
-#define CONFIG_SYS_MDDRC_SYS_CFG 0xF8604A00
-#define CONFIG_SYS_MDDRC_SYS_CFG_RUN 0xE8604A00
+#define CONFIG_SYS_MDDRC_SYS_CFG 0xE8604A00
#define CONFIG_SYS_MDDRC_TIME_CFG1 0x54EC1168
#define CONFIG_SYS_MDDRC_TIME_CFG2 0x35210864
#else
-#define CONFIG_SYS_MDDRC_SYS_CFG 0xFA804A00
-#define CONFIG_SYS_MDDRC_SYS_CFG_RUN 0xEA804A00
-#define CONFIG_SYS_MDDRC_TIME_CFG1 0x68EC1168
-#define CONFIG_SYS_MDDRC_TIME_CFG2 0x34310864
+#define CONFIG_SYS_MDDRC_SYS_CFG 0xEA804A00
+#define CONFIG_SYS_MDDRC_TIME_CFG1 0x68EC1168
+#define CONFIG_SYS_MDDRC_TIME_CFG2 0x34310864
#endif
-#define CONFIG_SYS_MDDRC_SYS_CFG_EN 0xF0000000
-#define CONFIG_SYS_MDDRC_TIME_CFG0 0x00003D2E
-#define CONFIG_SYS_MDDRC_TIME_CFG0_RUN 0x06183D2E
-
-#define CONFIG_SYS_MICRON_NOP 0x01380000
-#define CONFIG_SYS_MICRON_PCHG_ALL 0x01100400
-#define CONFIG_SYS_MICRON_EM2 0x01020000
-#define CONFIG_SYS_MICRON_EM3 0x01030000
-#define CONFIG_SYS_MICRON_EN_DLL 0x01010000
-#define CONFIG_SYS_MICRON_RFSH 0x01080000
-#define CONFIG_SYS_MICRON_INIT_DEV_OP 0x01000432
-#define CONFIG_SYS_MICRON_OCD_DEFAULT 0x01010780
+#define CONFIG_SYS_MDDRC_TIME_CFG0 0x06183D2E
+
+#define CONFIG_SYS_MDDRC_SYS_CFG_ELPIDA 0xEA802B00
+#define CONFIG_SYS_MDDRC_TIME_CFG1_ELPIDA 0x690e1189
+#define CONFIG_SYS_MDDRC_TIME_CFG2_ELPIDA 0x35310864
+
+#define CONFIG_SYS_DDRCMD_NOP 0x01380000
+#define CONFIG_SYS_DDRCMD_PCHG_ALL 0x01100400
+#define CONFIG_SYS_DDRCMD_EM2 0x01020000
+#define CONFIG_SYS_DDRCMD_EM3 0x01030000
+#define CONFIG_SYS_DDRCMD_EN_DLL 0x01010000
+#define CONFIG_SYS_DDRCMD_RFSH 0x01080000
+
+#define DDRCMD_EMR_OCD(pr, ohm) ( \
+ (1 << 24) | /* MDDRC Command Request */ \
+ (1 << 16) | /* MODE Reg BA[2:0] */ \
+ (0 << 12) | /* Outputs 0=Enabled */ \
+ (0 << 11) | /* RDQS */ \
+ (1 << 10) | /* DQS# */ \
+ (pr << 7) | /* OCD prog 7=deflt,0=exit */ \
+ /* ODT Rtt[1:0] 0=0,1=75,2=150,3=50 */ \
+ ((ohm & 0x2) << 5)| /* Rtt1 */ \
+ (0 << 3) | /* additive posted CAS# */ \
+ ((ohm & 0x1) << 2)| /* Rtt0 */ \
+ (0 << 0) | /* Output Drive Strength */ \
+ (0 << 0)) /* DLL Enable 0=Normal */
+
+#define CONFIG_SYS_DDRCMD_OCD_DEFAULT DDRCMD_EMR_OCD(7, 0)
+#define CONFIG_SYS_ELPIDA_OCD_EXIT DDRCMD_EMR_OCD(0, 0)
+
+#define DDRCMD_MODE_REG(cas, wr) ( \
+ (1 << 24) | /* MDDRC Command Request */ \
+ (0 << 16) | /* MODE Reg BA[2:0] */ \
+ ((wr-1) << 9)| /* Write Recovery */ \
+ (cas << 4) | /* CAS */ \
+ (0 << 3) | /* Burst Type:0=Sequential,1=Interleaved */ \
+ (2 << 0)) /* 4 or 8 Burst Length:0x2=4 0x3=8 */
+
+#define CONFIG_SYS_MICRON_INIT_DEV_OP DDRCMD_MODE_REG(3, 3)
+#define CONFIG_SYS_ELPIDA_INIT_DEV_OP DDRCMD_MODE_REG(4, 4)
+#define CONFIG_SYS_ELPIDA_RES_DLL (DDRCMD_MODE_REG(4, 4) | (1 << 8))
/* DDR Priority Manager Configuration */
#define CONFIG_SYS_MDDRCGRP_PM_CFG1 0x00077777
/*
* NAND FLASH
- * drivers/mtd/nand/mpc5121_mpc.c (rev 2 silicon only)
+ * drivers/mtd/nand/mpc5121_nfc.c (rev 2 silicon only)
*/
-#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NAND /* enable NAND support */
+#define CONFIG_JFFS2_NAND /* with JFFS2 on it */
#define CONFIG_NAND_MPC5121_NFC
#define CONFIG_SYS_NAND_BASE 0x40000000
#define NAND_MAX_CHIPS CONFIG_SYS_MAX_NAND_DEVICE
#define CONFIG_SYS_NAND_SELECT_DEVICE /* driver supports mutipl. chips */
-#define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */
-
/*
* Configuration parameters for MPC5121 NAND driver
*/
#include <config_cmd_default.h>
#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_EXT2
#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_JFFS2
#define CONFIG_CMD_MII
#define CONFIG_CMD_NFS
#define CONFIG_CMD_PING
#define CONFIG_CMD_REGINFO
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_DATE
+
#undef CONFIG_CMD_FUSE
-#define CONFIG_CMD_IDE
-#define CONFIG_CMD_EXT2
#if defined(CONFIG_PCI)
#define CONFIG_CMD_PCI
#endif
-#if defined(CONFIG_CMD_IDE)
+/*
+ * Dynamic MTD partition support
+ */
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_FLASH_CFI_MTD
+#define MTDIDS_DEFAULT "nor0=fc000000.flash,nand0=mpc5121.nand"
+
+/*
+ * NOR flash layout:
+ *
+ * FC000000 - FEABFFFF 42.75 MiB User Data
+ * FEAC0000 - FFABFFFF 16 MiB Root File System
+ * FFAC0000 - FFEBFFFF 4 MiB Linux Kernel
+ * FFEC0000 - FFEFFFFF 256 KiB Device Tree
+ * FFF00000 - FFFFFFFF 1 MiB U-Boot (up to 512 KiB) and 2 x * env
+ *
+ * NAND flash layout: one big partition
+ */
+#define MTDPARTS_DEFAULT "mtdparts=fc000000.flash:43776k(user)," \
+ "16m(rootfs)," \
+ "4m(kernel)," \
+ "256k(dtb)," \
+ "1m(u-boot);" \
+ "mpc5121.nand:-(data)"
+
+
+#if defined(CONFIG_CMD_IDE) || defined(CONFIG_CMD_EXT2)
#define CONFIG_DOS_PARTITION
#define CONFIG_MAC_PARTITION
#define CONFIG_ISO_PARTITION
"fdt_addr_r=880000\0" \
"ramdisk_addr_r=900000\0" \
"u-boot_addr=FFF00000\0" \
- "kernel_addr=FFC40000\0" \
+ "kernel_addr=FFAC0000\0" \
"fdt_addr=FFEC0000\0" \
- "ramdisk_addr=FC040000\0" \
+ "ramdisk_addr=FEAC0000\0" \
"ramdiskfile=mpc5121ads/uRamdisk\0" \
"u-boot=mpc5121ads/u-boot.bin\0" \
"bootfile=mpc5121ads/uImage\0" \