From patchwork Mon Jan 30 14:34:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 1734059 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P59km47MTz23hg for ; Tue, 31 Jan 2023 01:37:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5A05E855F5; Mon, 30 Jan 2023 15:37:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E9D8085518; Mon, 30 Jan 2023 15:36:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 06722855F5 for ; Mon, 30 Jan 2023 15:35:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=christophe.leroy@csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4P59hj0XKMz9slN; Mon, 30 Jan 2023 15:35:49 +0100 (CET) Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hy0k1V8vLQqU; Mon, 30 Jan 2023 15:35:48 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4P59hc3D5yz9slF; Mon, 30 Jan 2023 15:35:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5BEB48B763; Mon, 30 Jan 2023 15:35:44 +0100 (CET) Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id LWY5Hz6B9cN6; Mon, 30 Jan 2023 15:35:44 +0100 (CET) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.5.114]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 221998B770; Mon, 30 Jan 2023 15:35:44 +0100 (CET) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 30UEYPMl3633477 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 15:34:25 +0100 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 30UEYP6u3633476; Mon, 30 Jan 2023 15:34:25 +0100 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Jagan Teki , Tom Rini Cc: Christophe Leroy , u-boot@lists.denx.de, FRANJOU Stephane Subject: [PATCH 2/7] board: MCR3000: Modernise the settings to properly work on lastest u-boot version Date: Mon, 30 Jan 2023 15:34:01 +0100 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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 CONFIG_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. Signed-off-by: Christophe Leroy Reviewed-by: FRANJOU Stephane --- configs/MCR3000_defconfig | 8 ++++++-- include/configs/MCR3000.h | 42 ++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/configs/MCR3000_defconfig b/configs/MCR3000_defconfig index 6c41d7c88d1..2e9d8c24329 100644 --- a/configs/MCR3000_defconfig +++ b/configs/MCR3000_defconfig @@ -20,6 +20,7 @@ CONFIG_SYS_SCCR=0x00C20000 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 @@ -35,11 +36,12 @@ CONFIG_HUSH_PARSER=y 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 @@ -50,6 +52,8 @@ CONFIG_CMD_MII=y 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 @@ -80,6 +84,7 @@ CONFIG_SYS_BR7_PRELIM=0x1C000001 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_SYS_FLASH_CFI=y @@ -89,5 +94,4 @@ CONFIG_MPC8XX_FEC=y # 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 b0809332bb5..62c3404415c 100644 --- a/include/configs/MCR3000.h +++ b/include/configs/MCR3000.h @@ -12,45 +12,40 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "sdram_type=SDRAM\0" \ "flash_type=AM29LV160DB\0" \ - "loadaddr=0x400000\0" \ - "filename=uImage.lzma\0" \ - "nfsroot=/opt/ofs\0" \ + "loadaddr=0x1200000\0" \ + "filename=mcr3000.itb\0" \ "dhcp_ip=ip=:::::eth0:dhcp\0" \ "console_args=console=ttyCPM0,115200N8\0" \ + "loadkernel=ubi part nand0;ubifsmount ubi0;" \ + "ubifsload ${loadaddr} /boot/${filename};" \ + "ubifsumount; ubi detach\0" \ + "bootcmd=run flashboot\0" \ "flashboot=setenv bootargs " \ "${console_args} " \ "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \ "mcr3k:eth0:off;" \ "${ofl_args}; " \ - "bootm 0x04060000 - 0x04050000\0" \ + "run loadkernel; " \ + "bootm ${loadaddr}\0" \ "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\0" \ - "netboot=dhcp ${loadaddr} ${filename};" \ - "tftp 0xf00000 mcr3000.dtb;" \ - "setenv bootargs " \ - "root=/dev/nfs rw " \ - "${console_args} " \ - "${dhcp_ip};" \ - "bootm ${loadaddr} - 0xf00000\0" \ - "nfsboot=setenv bootargs " \ - "root=/dev/nfs rw nfsroot=${serverip}:${nfsroot} " \ - "${console_args} " \ - "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \ - "mcr3k:eth0:off;" \ - "bootm 0x04060000 - 0x04050000\0" \ + "bootm ${loadaddr}\0" \ "dhcpboot=dhcp ${loadaddr} ${filename};" \ - "tftp 0xf00000 mcr3000.dtb;" \ "setenv bootargs " \ "${console_args} " \ "${dhcp_ip} " \ "${ofl_args}; " \ - "bootm ${loadaddr} - 0xf00000\0" + "bootm ${loadaddr}\0" \ + "update=echo 'Updating ubi image'; " \ + "if tftp 0x2000 $ubifile; then " \ + "nand erase.chip; " \ + "nand write 0x2000 0x00 $filesize; " \ + "fi;\0 " + #define CONFIG_IPADDR 192.168.0.3 #define CONFIG_SERVERIP 192.168.0.1 @@ -70,10 +65,11 @@ /* * 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 CONFIG_SYS_BOOTMAPSZ (8 << 20) +#define CONFIG_SYS_BOOTMAPSZ (32 << 20) + /* Environment Configuration */