board: MCR3000: Modernise the settings to properly work on lastest u-boot version
Both U-boot and Linux kernel have grown over the last releases
and don't fit anymore in the 2M EPROM of the board.
So, rework the setup to allow storing the Linux kernel image
on the UBIFS NAND Flash.
Also add support to FIT images as this is what the Linux kernel
look like nowadays.
Also increase CFG_SYS_BOOTMAPSZ to 32Mbytes and define
CONFIG_SYS_BOOTM_LEN with the same value, otherwise it defaults
to 8M which is not sufficient anymore with nowadays Linux kernels.
And set the netmask to 255.255.255.0 as a class C address is used.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: FRANJOU Stephane <stephane.franjou@csgroup.eu>
diff --git a/board/cssi/mcr3000/mcr3000.env b/board/cssi/mcr3000/mcr3000.env
index 542d90e..372ab09 100644
--- a/board/cssi/mcr3000/mcr3000.env
+++ b/board/cssi/mcr3000/mcr3000.env
@@ -2,13 +2,13 @@
sdram_type=SDRAM
flash_type=AM29LV160DB
-loadaddr=0x400000
-filename=uImage.lzma
-nfsroot=/opt/ofs
+loadaddr=0x1200000
+filename=mcr3000.itb
dhcp_ip=ip=:::::eth0:dhcp
console_args=console=ttyCPM0,115200N8
-flashboot=setenv bootargs ${console_args} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:mcr3k:eth0:off;${ofl_args}; bootm 0x04060000 - 0x04050000
-tftpboot=setenv bootargs ${console_args} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:mcr3k:eth0:off ${ofl_args}; tftp ${loadaddr} ${filename};tftp 0xf00000 mcr3000.dtb;bootm ${loadaddr} - 0xf00000
-netboot=dhcp ${loadaddr} ${filename};tftp 0xf00000 mcr3000.dtb;setenv bootargs root=/dev/nfs rw ${console_args} ${dhcp_ip};bootm ${loadaddr} - 0xf00000
-nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${nfsroot} ${console_args} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:mcr3k:eth0:off;bootm 0x04060000 - 0x04050000
-dhcpboot=dhcp ${loadaddr} ${filename};tftp 0xf00000 mcr3000.dtb;setenv bootargs ${console_args} ${dhcp_ip} ${ofl_args}; bootm ${loadaddr} - 0xf00000
+loadkernel=ubi part nand0;ubifsmount ubi0;ubifsload ${loadaddr} /boot/${filename};ubifsumount; ubi detach
+bootcmd=run flashboot
+flashboot=setenv bootargs ${console_args} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:mcr3k:eth0:off;${ofl_args}; run loadkernel; bootm ${loadaddr}
+tftpboot=setenv bootargs ${console_args} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:mcr3k:eth0:off ${ofl_args}; tftp ${loadaddr} ${filename}; bootm ${loadaddr}
+dhcpboot=dhcp ${loadaddr} ${filename};setenv bootargs ${console_args} ${dhcp_ip} ${ofl_args}; bootm ${loadaddr}
+update=echo 'Updating ubi image'; if tftp 0x2000 $ubifile; then nand erase.chip; nand write 0x2000 0x00 $filesize; fi
diff --git a/configs/MCR3000_defconfig b/configs/MCR3000_defconfig
index 3e16ffc..f96e9f0 100644
--- a/configs/MCR3000_defconfig
+++ b/configs/MCR3000_defconfig
@@ -20,6 +20,7 @@
CONFIG_SYS_SCCR_MASK=0x60000000
CONFIG_SYS_DER=0x2002000F
CONFIG_SYS_MONITOR_LEN=327680
+CONFIG_FIT=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_SYS_MONITOR_BASE=0x04000000
CONFIG_BOOTDELAY=5
@@ -36,11 +37,12 @@
CONFIG_SYS_PBSIZE=278
# CONFIG_CMD_BDI is not set
# CONFIG_CMD_CONSOLE is not set
-CONFIG_SYS_BOOTM_LEN=0x800000
+CONFIG_SYS_BOOTM_LEN=0x2000000
# CONFIG_CMD_IMI is not set
CONFIG_CMD_ASKENV=y
# CONFIG_CMD_LOADB is not set
# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MTD=y
CONFIG_CMD_NAND=y
# CONFIG_CMD_ECHO is not set
# CONFIG_CMD_ITEST is not set
@@ -51,6 +53,8 @@
CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
# CONFIG_CMD_SLEEP is not set
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
CONFIG_OF_CONTROL=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_FLASH=y
@@ -58,7 +62,7 @@
CONFIG_USE_IPADDR=y
CONFIG_IPADDR="192.168.0.3"
CONFIG_USE_NETMASK=y
-CONFIG_NETMASK="255.0.0.0"
+CONFIG_NETMASK="255.255.255.0"
CONFIG_USE_SERVERIP=y
CONFIG_SERVERIP="192.168.0.1"
CONFIG_SYS_BR0_PRELIM_BOOL=y
@@ -87,6 +91,7 @@
CONFIG_SYS_OR7_PRELIM=0xFFFF810A
# CONFIG_MMC is not set
CONFIG_MTD=y
+CONFIG_DM_MTD=y
CONFIG_MTD_NOR_FLASH=y
CONFIG_FLASH_CFI_DRIVER=y
CONFIG_FLASH_SHOW_PROGRESS=0
@@ -97,5 +102,4 @@
# CONFIG_PCI is not set
CONFIG_DM_SERIAL=y
CONFIG_WDT=y
-CONFIG_SHA256=y
CONFIG_LZMA=y
diff --git a/include/configs/mcr3000.h b/include/configs/mcr3000.h
index 8d78fd3..6b16b05 100644
--- a/include/configs/mcr3000.h
+++ b/include/configs/mcr3000.h
@@ -23,10 +23,10 @@
/*
* For booting Linux, the board info and command line data
- * have to be in the first 8 MB of memory, since this is
+ * have to be in the first 32 MB of memory, since this is
* the maximum mapped by the Linux kernel during initialization.
*/
-#define CFG_SYS_BOOTMAPSZ (8 << 20)
+#define CFG_SYS_BOOTMAPSZ (32 << 20)
/* Environment Configuration */