Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82EC1C433EF for ; Tue, 14 Jun 2022 02:58:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5033F844B7; Tue, 14 Jun 2022 04:58:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="lvgJd5iA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CFBF8844AB; Tue, 14 Jun 2022 04:57:51 +0200 (CEST) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2C200844A7 for ; Tue, 14 Jun 2022 04:57:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x731.google.com with SMTP id p63so5473944qkd.10 for ; Mon, 13 Jun 2022 19:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oRra7obiXs//N1CcjgjznBTwrPzj0TIq9GZdjsrdHSM=; b=lvgJd5iArcmkijJoS4tCIClIu2odqWDqrmJEjSmEFnwx9J80ghH0BR68o5OAOCSBhZ VftUVGf8sMruiHZEWvFMz1aIMcdGGKhHrMiyBpZaUCePd0L6rwBk14dqHKjc0LPrRMx4 i8zonWBPTsR81MvSl3JeTc25LPJ/FpaRHOElw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oRra7obiXs//N1CcjgjznBTwrPzj0TIq9GZdjsrdHSM=; b=B6H7jGQmXymwWHf/LTxQycEwLWloOzK6swni2cD55JKPmY0Q0YJib8n7lu9dgjJDcY wh3uwOFB+Hq0iwClMDEUcIuG05rMiavDFfGcv6M2LseCx+oeGwye+RWWF0uKmYIdSifH z1dtiJqA33t9sLAHbgSA1a1lCqxLW/BQMiNpgXbkIQGiwAaSiKC6KAMlaZ3aQRfYCmmq OHru5+ZarX7SCpyd5s+hCdJQ/H4uoREVoqVin6k1l2kzMc3rL0UV/n2dZ+QHNT+ZH2Cd 1qa1sX+68rptPkrIZV1AnyzXiFUfVMtFYRHwS5khVsGQry+DY74NklpDK7CarKY7ZOXW PGww== X-Gm-Message-State: AOAM53103Q7jlWQa67fnfaQrxcW/Vswu2XXDx308KdG1FDZgspGyUE+I 1FtBTokVefb+DS5Q32YlH2+3odsnIsAl+A== X-Google-Smtp-Source: ABdhPJw0HIltzkO/sj4CdZmBt6DcFnbYLPM/q9V4/9RnXC/WrYPBKTYK426T7DR9NQN0nI5t6YwGvg== X-Received: by 2002:a37:510:0:b0:6a6:ab9e:1b80 with SMTP id 16-20020a370510000000b006a6ab9e1b80mr2428219qkf.770.1655175466547; Mon, 13 Jun 2022 19:57:46 -0700 (PDT) Received: from bill-the-cat.lan (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id x7-20020a05622a000700b002f90a33c78csm6443778qtw.67.2022.06.13.19.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 19:57:46 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Tim Harvey Subject: [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT Date: Mon, 13 Jun 2022 22:57:37 -0400 Message-Id: <20220614025737.3708141-8-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220614025737.3708141-1-trini@konsulko.com> References: <20220614025737.3708141-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.5 at phobos.denx.de X-Virus-Status: Clean Move the environment text over from being set via CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over to plain text in board/gateworks/gw_ventana/gw_ventana.env. This lets us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a single environment file now. Cc: Tim Harvey Signed-off-by: Tom Rini --- board/gateworks/gw_ventana/gw_ventana.env | 145 +++++++++++++++++++++ include/configs/gw_ventana.h | 148 ---------------------- 2 files changed, 145 insertions(+), 148 deletions(-) create mode 100644 board/gateworks/gw_ventana/gw_ventana.env diff --git a/board/gateworks/gw_ventana/gw_ventana.env b/board/gateworks/gw_ventana/gw_ventana.env new file mode 100644 index 000000000000..9a316c74f215 --- /dev/null +++ b/board/gateworks/gw_ventana/gw_ventana.env @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2013 Gateworks Corporation + */ + +splashpos=m,m +splashimage=CONFIG_SYS_LOAD_ADDR +usb_pgood_delay=2000 +console=ttymxc1 +bootdevs=usb mmc sata flash +hwconfig=_UNKNOWN_ + +disk=0 +part=1 + +fdt_high=0xffffffff +fdt_addr=0x18000000 +initrd_high=0xffffffff +fixfdt=fdt addr ${fdt_addr} +bootdir=boot +loadfdt= + if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then + echo Loaded DTB from ${bootdir}/${fdt_file}; + run fixfdt; + elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then + echo Loaded DTB from ${bootdir}/${fdt_file1}; + run fixfdt; + elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then + echo Loaded DTB from ${bootdir}/${fdt_file2}; + run fixfdt; + fi + +fs=ext4 +script=6x_bootscript-ventana +loadscript= + if ${fsload} ${loadaddr} ${bootdir}/${script}; then + source ${loadaddr}; + fi + +uimage=uImage +mmc_root=mmcblk0p1 +mmc_boot= + setenv fsload "${fs}load mmc ${disk}:${part}"; + mmc dev ${disk} && mmc rescan && + setenv dtype mmc; run loadscript; + if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then + setenv bootargs console=${console},${baudrate} + root=/dev/${mmc_root} rootfstype=${fs} + rootwait rw ${video} ${extra}; + if run loadfdt; then + bootm ${loadaddr} - ${fdt_addr}; + else + bootm; + fi; + fi + +sata_boot= + setenv fsload "${fs}load sata ${disk}:${part}"; + sata init && + setenv dtype sata; run loadscript; + if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then + setenv bootargs console=${console},${baudrate} + root=/dev/sda1 rootfstype=${fs} + rootwait rw ${video} ${extra}; + if run loadfdt; then + bootm ${loadaddr} - ${fdt_addr}; + else + bootm; + fi; + fi + +usb_boot= + setenv fsload "${fs}load usb ${disk}:${part}"; + usb start && usb dev ${disk} && + setenv dtype usb; run loadscript; + if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then + setenv bootargs console=${console},${baudrate} + root=/dev/sda1 rootfstype=${fs} + rootwait rw ${video} ${extra}; + if run loadfdt; then + bootm ${loadaddr} - ${fdt_addr}; + else + bootm; + fi; + fi + +#ifdef CONFIG_SPI_FLASH +image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin +image_uboot=ventana/u-boot_spi.imx + +spi_koffset=0x90000 +spi_klen=0x200000 + +spi_updateuboot=echo Updating uboot from + ${serverip}:${image_uboot}...; + tftpboot ${loadaddr} ${image_uboot} && + sf probe && sf erase 0 80000 && + sf write ${loadaddr} 400 ${filesize} +spi_update=echo Updating OS from ${serverip}:${image_os} + to ${spi_koffset} ...; + tftp ${loadaddr} ${image_os} && + sf probe && + sf update ${loadaddr} ${spi_koffset} ${filesize} + +flash_boot= + if sf probe && + sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then + setenv bootargs console=${console},${baudrate} + root=/dev/mtdblock3 + rootfstype=squashfs,jffs2 + ${video} ${extra}; + bootm; + fi +#else +image_rootfs=openwrt-imx6-ventana-rootfs.ubi +nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; + tftp ${loadaddr} ${image_rootfs} && + nand erase.part rootfs && + nand write ${loadaddr} rootfs ${filesize} + +flash_boot= + setenv fsload 'ubifsload'; + ubi part rootfs; + if ubi check boot; then + ubifsmount ubi0:boot; + setenv root ubi0:rootfs ubi.mtd=2 + rootfstype=squashfs,ubifs; + setenv bootdir; + elif ubi check rootfs; then + ubifsmount ubi0:rootfs; + setenv root ubi0:rootfs ubi.mtd=2 + rootfstype=ubifs; + fi; + setenv dtype nand; run loadscript; + if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then + setenv bootargs console=${console},${baudrate} + root=${root} ${video} ${extra}; + if run loadfdt; then + ubifsumount; + bootm ${loadaddr} - ${fdt_addr}; + else + ubifsumount; bootm; + fi; + fi +#endif diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h index 77f41502220a..47a72fc8fce5 100644 --- a/include/configs/gw_ventana.h +++ b/include/configs/gw_ventana.h @@ -76,152 +76,4 @@ #define CONFIG_IPADDR 192.168.1.1 #define CONFIG_SERVERIP 192.168.1.146 -#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \ - "splashpos=m,m\0" \ - "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ - "usb_pgood_delay=2000\0" \ - "console=ttymxc1\0" \ - "bootdevs=usb mmc sata flash\0" \ - "hwconfig=_UNKNOWN_\0" \ - "video=\0" \ - \ - "disk=0\0" \ - "part=1\0" \ - \ - "fdt_high=0xffffffff\0" \ - "fdt_addr=0x18000000\0" \ - "initrd_high=0xffffffff\0" \ - "fixfdt=" \ - "fdt addr ${fdt_addr}\0" \ - "bootdir=boot\0" \ - "loadfdt=" \ - "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \ - "echo Loaded DTB from ${bootdir}/${fdt_file}; " \ - "run fixfdt; " \ - "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \ - "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \ - "run fixfdt; " \ - "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \ - "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \ - "run fixfdt; " \ - "fi\0" \ - \ - "fs=ext4\0" \ - "script=6x_bootscript-ventana\0" \ - "loadscript=" \ - "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \ - "source ${loadaddr}; " \ - "fi\0" \ - \ - "uimage=uImage\0" \ - "mmc_root=mmcblk0p1\0" \ - "mmc_boot=" \ - "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \ - "mmc dev ${disk} && mmc rescan && " \ - "setenv dtype mmc; run loadscript; " \ - "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \ - "setenv bootargs console=${console},${baudrate} " \ - "root=/dev/${mmc_root} rootfstype=${fs} " \ - "rootwait rw ${video} ${extra}; " \ - "if run loadfdt; then " \ - "bootm ${loadaddr} - ${fdt_addr}; " \ - "else " \ - "bootm; " \ - "fi; " \ - "fi\0" \ - \ - "sata_boot=" \ - "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \ - "sata init && " \ - "setenv dtype sata; run loadscript; " \ - "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \ - "setenv bootargs console=${console},${baudrate} " \ - "root=/dev/sda1 rootfstype=${fs} " \ - "rootwait rw ${video} ${extra}; " \ - "if run loadfdt; then " \ - "bootm ${loadaddr} - ${fdt_addr}; " \ - "else " \ - "bootm; " \ - "fi; " \ - "fi\0" \ - "usb_boot=" \ - "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \ - "usb start && usb dev ${disk} && " \ - "setenv dtype usb; run loadscript; " \ - "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \ - "setenv bootargs console=${console},${baudrate} " \ - "root=/dev/sda1 rootfstype=${fs} " \ - "rootwait rw ${video} ${extra}; " \ - "if run loadfdt; then " \ - "bootm ${loadaddr} - ${fdt_addr}; " \ - "else " \ - "bootm; " \ - "fi; " \ - "fi\0" - -#ifdef CONFIG_SPI_FLASH - #define CONFIG_EXTRA_ENV_SETTINGS \ - CONFIG_EXTRA_ENV_SETTINGS_COMMON \ - "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \ - "image_uboot=ventana/u-boot_spi.imx\0" \ - \ - "spi_koffset=0x90000\0" \ - "spi_klen=0x200000\0" \ - \ - "spi_updateuboot=echo Updating uboot from " \ - "${serverip}:${image_uboot}...; " \ - "tftpboot ${loadaddr} ${image_uboot} && " \ - "sf probe && sf erase 0 80000 && " \ - "sf write ${loadaddr} 400 ${filesize}\0" \ - "spi_update=echo Updating OS from ${serverip}:${image_os} " \ - "to ${spi_koffset} ...; " \ - "tftp ${loadaddr} ${image_os} && " \ - "sf probe && " \ - "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \ - \ - "flash_boot=" \ - "if sf probe && " \ - "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \ - "setenv bootargs console=${console},${baudrate} " \ - "root=/dev/mtdblock3 " \ - "rootfstype=squashfs,jffs2 " \ - "${video} ${extra}; " \ - "bootm; " \ - "fi\0" -#else - #define CONFIG_EXTRA_ENV_SETTINGS \ - CONFIG_EXTRA_ENV_SETTINGS_COMMON \ - \ - "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \ - "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \ - "tftp ${loadaddr} ${image_rootfs} && " \ - "nand erase.part rootfs && " \ - "nand write ${loadaddr} rootfs ${filesize}\0" \ - \ - "flash_boot=" \ - "setenv fsload 'ubifsload'; " \ - "ubi part rootfs; " \ - "if ubi check boot; then " \ - "ubifsmount ubi0:boot; " \ - "setenv root ubi0:rootfs ubi.mtd=2 " \ - "rootfstype=squashfs,ubifs; " \ - "setenv bootdir; " \ - "elif ubi check rootfs; then " \ - "ubifsmount ubi0:rootfs; " \ - "setenv root ubi0:rootfs ubi.mtd=2 " \ - "rootfstype=ubifs; " \ - "fi; " \ - "setenv dtype nand; run loadscript; " \ - "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \ - "setenv bootargs console=${console},${baudrate} " \ - "root=${root} ${video} ${extra}; " \ - "if run loadfdt; then " \ - "ubifsumount; " \ - "bootm ${loadaddr} - ${fdt_addr}; " \ - "else " \ - "ubifsumount; bootm; " \ - "fi; " \ - "fi\0" -#endif - #endif /* __CONFIG_H */ -- 2.25.1