uboot-mediatek: update to version 2023.07.02
authorDaniel Golle <daniel@makrotopia.org>
Sat, 22 Jul 2023 14:50:27 +0000 (15:50 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sat, 29 Jul 2023 14:07:11 +0000 (15:07 +0100)
Release 2023.07 got tagged wrongly and replaced by follow-up release
2023.07.02.

Now using upstream DTS for BPi-R3.
Removed two patches which made it upstream, refreshed the rest.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
28 files changed:
package/boot/uboot-mediatek/Makefile
package/boot/uboot-mediatek/patches/000-mtk-20-configs-mt7622-enable-environment-for-mt7622_rfb.patch
package/boot/uboot-mediatek/patches/001-pinctrl-mediatek-set-R1-R0-in-case-pullen-pullsel-su.patch [deleted file]
package/boot/uboot-mediatek/patches/100-02-drivers-mtd-add-support-for-MediaTek-SPI-NAND-flash-.patch
package/boot/uboot-mediatek/patches/100-06-mtd-add-core-facility-code-of-NMBM.patch
package/boot/uboot-mediatek/patches/100-08-common-board_r-add-support-to-initialize-NMBM-after-.patch
package/boot/uboot-mediatek/patches/100-09-cmd-add-nmbm-command.patch
package/boot/uboot-mediatek/patches/100-13-cmd-add-a-new-command-for-NAND-flash-debugging.patch
package/boot/uboot-mediatek/patches/100-14-mtd-spi-nor-add-support-to-read-flash-unique-ID.patch
package/boot/uboot-mediatek/patches/100-18-board-mt7629-add-support-for-booting-from-SPI-NAND.patch
package/boot/uboot-mediatek/patches/100-19-board-mt7622-use-new-spi-nand-driver.patch
package/boot/uboot-mediatek/patches/100-20-board-mt7981-add-reference-board-using-new-spi-nand-.patch
package/boot/uboot-mediatek/patches/100-21-mtd-spi-nor-add-more-flash-ids.patch
package/boot/uboot-mediatek/patches/100-22-mtd-spi-nand-backport-from-upstream-kernel.patch
package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch
package/boot/uboot-mediatek/patches/103-mt7988-enable-pstore.patch [new file with mode: 0644]
package/boot/uboot-mediatek/patches/110-no-kwbimage.patch
package/boot/uboot-mediatek/patches/120-use-xz-instead-of-lzma.patch
package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
package/boot/uboot-mediatek/patches/212-cmd-bootmenu-hack-restore-ansi.patch [deleted file]
package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch
package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch
package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch
package/boot/uboot-mediatek/patches/305-mt7988-generic-reset-button-ignore-env.patch [new file with mode: 0644]
package/boot/uboot-mediatek/patches/403-add-bananapi_bpi-r64-snand.patch
package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch
package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch
package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch

index 55965e64dbb8e2811a4d772ffcb8834259a18e81..ed8c4ae6cd74e0f948d17c6e7c8b7eb14a1f31ef 100644 (file)
@@ -1,8 +1,8 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
-PKG_VERSION:=2023.04
-PKG_HASH:=e31cac91545ff41b71cec5d8c22afd695645cd6e2a442ccdacacd60534069341
+PKG_VERSION:=2023.07.02
+PKG_HASH:=6b6a48581c14abb0f95bd87c1af4d740922406d7b801002a9f94727fdde021d5
 PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host
 
 include $(INCLUDE_DIR)/u-boot.mk
index cd9004844c02c3de758859735f6bac33e320eb43..60eda91124b18e3d17fc67410890c5a291dbf7dd 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  CONFIG_SYS_PROMPT="MT7622> "
  CONFIG_DEBUG_UART_BASE=0x11002000
  CONFIG_DEBUG_UART_CLOCK=25000000
-@@ -24,6 +26,9 @@ CONFIG_CMD_SF_TEST=y
+@@ -25,6 +27,9 @@ CONFIG_CMD_SF_TEST=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_SMC=y
  CONFIG_ENV_OVERWRITE=y
diff --git a/package/boot/uboot-mediatek/patches/001-pinctrl-mediatek-set-R1-R0-in-case-pullen-pullsel-su.patch b/package/boot/uboot-mediatek/patches/001-pinctrl-mediatek-set-R1-R0-in-case-pullen-pullsel-su.patch
deleted file mode 100644 (file)
index 988c78c..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-From patchwork Wed Apr 12 20:36:43 2023
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
-X-Patchwork-Id: 1768270
-Return-Path: <u-boot-bounces@lists.denx.de>
-X-Original-To: incoming@patchwork.ozlabs.org
-Delivered-To: patchwork-incoming@legolas.ozlabs.org
-Date: Wed, 12 Apr 2023 21:36:43 +0100
-From: Daniel Golle <daniel@makrotopia.org>
-To: u-boot@lists.denx.de, Sam Shih <sam.shih@mediatek.com>,
- GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
- Chunfeng Yun <chunfeng.yun@mediatek.com>,
- Weijie Gao <weijie.gao@mediatek.com>, Ryder Lee <ryder.lee@mediatek.com>,
- Frank Wunderlich <frank-w@public-files.de>
-Cc: Steven Liu =?utf-8?b?KOWKieS6uuixqik=?= <steven.liu@mediatek.com>,
- John Crispin <john@phrozen.org>
-Subject: [PATCH] pinctrl: mediatek: set R1/R0 in case pullen/pullsel succeeded
-Message-ID: <ZDcWW7kLSLn1GMZ1@makrotopia.org>
-MIME-Version: 1.0
-Content-Disposition: inline
-X-BeenThere: u-boot@lists.denx.de
-X-Mailman-Version: 2.1.39
-Precedence: list
-List-Id: U-Boot discussion <u-boot.lists.denx.de>
-Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
-
-Commit dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and
-related functions") changed the logic deciding to set R0 and R1
-registers for V1 devices.
-
-Before:
-       /* Also set PUPD/R0/R1 if the pin has them */
-       err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PUPD, !pullup);
-       if (err != -EINVAL) {
-               mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R0, r0);
-               mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R1, r1);
-       }
-
-After:
-       /* try pupd_r1_r0 if pullen_pullsel return error */
-       err = mtk_pinconf_bias_set_pullen_pullsel(dev, pin, disable, pullup,
-                                                 val);
-       if (err)
-               return mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable,
-                                                      pullup, val);
-
-Tracing mtk_pinconf_bias_set_pullen_pullsel shows that the function
-always either returns 0 in case of success or -EINVAL in case any error
-has occurred. Hence the logic responsible of the decision to program R0
-and R1 has been inverted.
-
-This leads to problems on BananaPi R2 (MT7623N) when booting from
-SDMMC, it turns out accessing eMMC no longer works since
-U-Boot 2022.07:
-
-MT7623> mmc dev 0
-Card did not respond to voltage select! : -110
-
-The problem wasn't detected for a long time as both eMMC and SDMMC work
-fine if they are used to boot from, and hence R0 and R1 were already
-setup by the bootrom and/or preloader.
-
-Fix the logic to restore the originally intended and correct behavior
-and also change the descriptive comment accordingly.
-
-Fixes: dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and related functions")
-Signed-off-by: Daniel Golle <daniel@makrotopia.org>
----
- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
-+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
-@@ -349,10 +349,10 @@ int mtk_pinconf_bias_set_v1(struct udevi
- {
-       int err;
--      /* try pupd_r1_r0 if pullen_pullsel return error */
-+      /* set pupd_r1_r0 if pullen_pullsel succeeded */
-       err = mtk_pinconf_bias_set_pullen_pullsel(dev, pin, disable, pullup,
-                                                 val);
--      if (err)
-+      if (!err)
-               return mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable,
-                                                      pullup, val);
index a6c59d1f6664bb18e3119eadcf028fc50884c054..311c051344017db463a75e22646f12ac7caf9d32 100644 (file)
@@ -49,7 +49,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  config SYS_NAND_MAX_OOBFREE
 --- a/drivers/mtd/Makefile
 +++ b/drivers/mtd/Makefile
-@@ -38,3 +38,5 @@ obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_SUPPOR
+@@ -39,3 +39,5 @@ obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_SUPPOR
  obj-$(CONFIG_SPL_UBI) += ubispl/
  
  endif
index bf04f5b6e49a74986258482204d235ef90ff54f6..23634e642532884cbef795f1d9fc14ad6a8fb630 100644 (file)
@@ -31,16 +31,16 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/drivers/mtd/Kconfig
 +++ b/drivers/mtd/Kconfig
-@@ -272,4 +272,6 @@ source "drivers/mtd/spi/Kconfig"
+@@ -274,4 +274,6 @@ source "drivers/mtd/ubi/Kconfig"
  
- source "drivers/mtd/ubi/Kconfig"
+ source "drivers/mtd/nvmxip/Kconfig"
  
 +source "drivers/mtd/nmbm/Kconfig"
 +
  endmenu
 --- a/drivers/mtd/Makefile
 +++ b/drivers/mtd/Makefile
-@@ -40,3 +40,4 @@ obj-$(CONFIG_SPL_UBI) += ubispl/
+@@ -41,3 +41,4 @@ obj-$(CONFIG_SPL_UBI) += ubispl/
  endif
  
  obj-$(CONFIG_MTK_SPI_NAND) += mtk-snand/
index 1d8139e6726f96735610c28c5513e4d830ad3399..93fc32cf9ec5020c90f133f506fe92dc5ab289e0 100644 (file)
@@ -34,7 +34,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  #if defined(CONFIG_CMD_ONENAND)
  /* go init the NAND */
  static int initr_onenand(void)
-@@ -703,6 +717,9 @@ static init_fnc_t init_sequence_r[] = {
+@@ -696,6 +710,9 @@ static init_fnc_t init_sequence_r[] = {
  #ifdef CONFIG_CMD_ONENAND
        initr_onenand,
  #endif
index 6b319384d516a8f88d9940be8575f41e26a3f324..35d8f115f60e0cc75b390b70975192b4cc636109 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/cmd/Kconfig
 +++ b/cmd/Kconfig
-@@ -1352,6 +1352,12 @@ config CMD_NAND_TORTURE
+@@ -1353,6 +1353,12 @@ config CMD_NAND_TORTURE
  
  endif # CMD_NAND
  
@@ -30,7 +30,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
        depends on NVME
 --- a/cmd/Makefile
 +++ b/cmd/Makefile
-@@ -123,6 +123,7 @@ obj-y += legacy-mtd-utils.o
+@@ -125,6 +125,7 @@ obj-y += legacy-mtd-utils.o
  endif
  obj-$(CONFIG_CMD_MUX) += mux.o
  obj-$(CONFIG_CMD_NAND) += nand.o
index 31f26be053647f71088c2c77dbfc053e9c2eef16..f3831e07f7dfbeb7eee51f7433540fb589e20612 100644 (file)
@@ -26,7 +26,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/cmd/Kconfig
 +++ b/cmd/Kconfig
-@@ -1352,6 +1352,14 @@ config CMD_NAND_TORTURE
+@@ -1353,6 +1353,14 @@ config CMD_NAND_TORTURE
  
  endif # CMD_NAND
  
@@ -43,7 +43,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
        bool "nmbm"
 --- a/cmd/Makefile
 +++ b/cmd/Makefile
-@@ -123,6 +123,7 @@ obj-y += legacy-mtd-utils.o
+@@ -125,6 +125,7 @@ obj-y += legacy-mtd-utils.o
  endif
  obj-$(CONFIG_CMD_MUX) += mux.o
  obj-$(CONFIG_CMD_NAND) += nand.o
index 3d79731dd14530838237e653327a406f0eb1422c..d9a645d20efec9aceb1b101737c6674b7095d82a 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/drivers/mtd/spi/spi-nor-core.c
 +++ b/drivers/mtd/spi/spi-nor-core.c
-@@ -2818,6 +2818,100 @@ static int spi_nor_init_params(struct sp
+@@ -2848,6 +2848,100 @@ static int spi_nor_init_params(struct sp
        return 0;
  }
  
@@ -114,7 +114,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  static int spi_nor_hwcaps2cmd(u32 hwcaps, const int table[][2], size_t size)
  {
        size_t i;
-@@ -3930,6 +4024,7 @@ int spi_nor_scan(struct spi_nor *nor)
+@@ -4045,6 +4139,7 @@ int spi_nor_scan(struct spi_nor *nor)
        nor->write = spi_nor_write_data;
        nor->read_reg = spi_nor_read_reg;
        nor->write_reg = spi_nor_write_reg;
index 797d925e17309556ed1342a24b15bd2e3f90957e..93a940b943f7c8b7e65579382f24d822e8c8b0f6 100644 (file)
@@ -23,7 +23,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 +++ b/arch/arm/dts/mt7629-rfb-u-boot.dtsi
 @@ -40,3 +40,11 @@
  &snfi {
-       u-boot,dm-pre-reloc;
+       bootph-all;
  };
 +
 +&pinctrl {
index 03555d4a4b77e90b6e4d32e2ab6ece7d4fd16712..6202ddf3b015d709c621d63cdf4d7863edfea629 100644 (file)
@@ -55,7 +55,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
                reg = <0x11014000 0x1000>;
 --- a/configs/mt7622_rfb_defconfig
 +++ b/configs/mt7622_rfb_defconfig
-@@ -21,6 +21,7 @@ CONFIG_SYS_MAXARGS=8
+@@ -22,6 +22,7 @@ CONFIG_SYS_MAXARGS=8
  CONFIG_SYS_PBSIZE=1049
  CONFIG_CMD_BOOTMENU=y
  CONFIG_CMD_MMC=y
@@ -63,7 +63,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  CONFIG_CMD_PCI=y
  CONFIG_CMD_SF_TEST=y
  CONFIG_CMD_PING=y
-@@ -40,6 +41,10 @@ CONFIG_SYSCON=y
+@@ -41,6 +42,10 @@ CONFIG_SYSCON=y
  CONFIG_CLK=y
  CONFIG_MMC_HS200_SUPPORT=y
  CONFIG_MMC_MTK=y
index cf2019fcba6874e9e5b247fb163a6a5f17e7212a..cb3f1ff2af518211e6033dfda97bf36dcea80472 100644 (file)
@@ -18,14 +18,14 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1288,6 +1288,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1308,6 +1308,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7623n-bananapi-bpi-r2.dtb \
        mt7629-rfb.dtb \
        mt7981-rfb.dtb \
 +      mt7981-snfi-nand-rfb.dtb \
        mt7981-emmc-rfb.dtb \
        mt7981-sd-rfb.dtb \
-       mt7986a-rfb.dtb \
+       mt7986a-bpi-r3-sd.dtb \
 --- /dev/null
 +++ b/arch/arm/dts/mt7981-snfi-nand-rfb.dts
 @@ -0,0 +1,132 @@
index 08334248218df5790eacc6b2777d660afdc7e0c0..bd68677eb063f094ef54004ba8133dabaf34cea1 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/drivers/mtd/spi/spi-nor-core.c
 +++ b/drivers/mtd/spi/spi-nor-core.c
-@@ -672,6 +672,7 @@ static int set_4byte(struct spi_nor *nor
+@@ -673,6 +673,7 @@ static int set_4byte(struct spi_nor *nor
        case SNOR_MFR_ISSI:
        case SNOR_MFR_MACRONIX:
        case SNOR_MFR_WINBOND:
index 1c83479d0db1370b23ee666ed5ddbdb196821f29..358461a2b706741024b3273fe6ff70d1f0869bf9 100644 (file)
@@ -207,8 +207,8 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 -      ret = spinand_manufacturer_detect(spinand);
 +      ret = spinand_id_detect(spinand);
        if (ret) {
-               dev_err(spinand->slave->dev, "unknown raw ID %*phN\n",
-                       SPINAND_MAX_ID_LEN, spinand->id.data);
+               dev_err(spinand->slave->dev, "unknown raw ID %02x %02x %02x %02x\n",
+                       spinand->id.data[0], spinand->id.data[1],
 --- a/drivers/mtd/nand/spi/gigadevice.c
 +++ b/drivers/mtd/nand/spi/gigadevice.c
 @@ -22,8 +22,13 @@
index 1709680ebbce60b70b8879b6e0fe91085cbbad71..0c68f429c6b0c4c44c628c41cc63aad5e2f6bda4 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/drivers/mmc/Kconfig
 +++ b/drivers/mmc/Kconfig
-@@ -823,6 +823,14 @@ config MMC_MTK
+@@ -820,6 +820,14 @@ config MMC_MTK
          This is needed if support for any SD/SDIO/MMC devices is required.
          If unsure, say N.
  
@@ -32,7 +32,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  config FSL_SDHC_V2_3
 --- a/drivers/mmc/Makefile
 +++ b/drivers/mmc/Makefile
-@@ -84,3 +84,7 @@ obj-$(CONFIG_RENESAS_SDHI)           += tmio-comm
+@@ -83,3 +83,7 @@ obj-$(CONFIG_RENESAS_SDHI)           += tmio-comm
  obj-$(CONFIG_MMC_BCM2835)             += bcm2835_sdhost.o
  obj-$(CONFIG_MMC_MTK)                 += mtk-sd.o
  obj-$(CONFIG_MMC_SDHCI_F_SDH30)               += f_sdh30.o
diff --git a/package/boot/uboot-mediatek/patches/103-mt7988-enable-pstore.patch b/package/boot/uboot-mediatek/patches/103-mt7988-enable-pstore.patch
new file mode 100644 (file)
index 0000000..a34dcdd
--- /dev/null
@@ -0,0 +1,33 @@
+--- a/arch/arm/dts/mt7988.dtsi
++++ b/arch/arm/dts/mt7988.dtsi
+@@ -61,6 +61,30 @@
+               #clock-cells = <0>;
+       };
++      psci {
++              compatible  = "arm,psci-0.2";
++              method      = "smc";
++      };
++
++      reserved-memory {
++              #address-cells = <2>;
++              #size-cells = <2>;
++              ranges;
++
++              /* 64 KiB reserved for ramoops/pstore */
++              ramoops@42ff0000 {
++                      compatible = "ramoops";
++                      reg = <0 0x42ff0000 0 0x10000>;
++                      record-size = <0x1000>;
++              };
++
++              /* 320 KiB reserved for ARM Trusted Firmware (BL31+BL32) */
++              secmon_reserved: secmon@43000000 {
++                      reg = <0 0x43000000 0 0x50000>;
++                      no-map;
++              };
++      };
++
+       hwver: hwver {
+               compatible = "mediatek,hwver", "syscon";
+               reg = <0 0x8000000 0 0x1000>;
index 76921b757e0d48ccd090b0afab41d0eba9b99e84..2d61d6f4a7ecb3ca799e5a8c0812bc16d5b12717 100644 (file)
@@ -1,6 +1,6 @@
 --- a/tools/Makefile
 +++ b/tools/Makefile
-@@ -115,7 +115,6 @@ dumpimage-mkimage-objs := aisimage.o \
+@@ -116,7 +116,6 @@ dumpimage-mkimage-objs := aisimage.o \
                        imximage.o \
                        imx8image.o \
                        imx8mimage.o \
index 7fda30a756b6d5790c83650dd6fc21121445d749..411f99467b74d013bc26085c5339c3c0b37b0e69 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -1067,7 +1067,7 @@ quiet_cmd_pad_cat = CAT     $@
+@@ -1070,7 +1070,7 @@ quiet_cmd_pad_cat = CAT     $@
  cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }
  
  quiet_cmd_lzma = LZMA    $@
index fcbb6b28a060fbe252596924aaf8ba98f1d9b40b..574259fb395764ae32a384b341bb15e4b2d50e80 100644 (file)
                   int arch, int ph_type, int bootstage_id,
 --- a/include/image.h
 +++ b/include/image.h
-@@ -1046,6 +1046,7 @@ int fit_parse_subimage(const char *spec,
+@@ -1047,6 +1047,7 @@ int fit_parse_subimage(const char *spec,
                ulong *addr, const char **image_name);
  
  int fit_get_subimage_count(const void *fit, int images_noffset);
diff --git a/package/boot/uboot-mediatek/patches/212-cmd-bootmenu-hack-restore-ansi.patch b/package/boot/uboot-mediatek/patches/212-cmd-bootmenu-hack-restore-ansi.patch
deleted file mode 100644 (file)
index cdb1477..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/common/menu.c
-+++ b/common/menu.c
-@@ -15,7 +15,7 @@
- #include "menu.h"
--#define ansi 0
-+#define ansi 1
- /*
-  * Internally, each item in a menu is represented by a struct menu_item.
index 37956727b26ba62fe80694359cc0263c424b0a9d..d91b9904cbd0e9ffe1eef2adfb03a638dace853f 100644 (file)
@@ -1,6 +1,6 @@
 --- a/cmd/Kconfig
 +++ b/cmd/Kconfig
-@@ -601,6 +601,12 @@ config CMD_ENV_EXISTS
+@@ -602,6 +602,12 @@ config CMD_ENV_EXISTS
          Check if a variable is defined in the environment for use in
          shell scripting.
  
@@ -76,7 +76,7 @@
  #if defined(CONFIG_CMD_ENV_CALLBACK)
  static int print_static_binding(const char *var_name, const char *callback_name,
                                void *priv)
-@@ -1231,6 +1285,9 @@ static struct cmd_tbl cmd_env_sub[] = {
+@@ -1228,6 +1282,9 @@ static struct cmd_tbl cmd_env_sub[] = {
        U_BOOT_CMD_MKENT(load, 1, 0, do_env_load, "", ""),
  #endif
        U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""),
@@ -86,7 +86,7 @@
  #if defined(CONFIG_CMD_RUN)
        U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
  #endif
-@@ -1322,6 +1379,9 @@ static char env_help_text[] =
+@@ -1319,6 +1376,9 @@ static char env_help_text[] =
  #if defined(CONFIG_CMD_NVEDIT_EFI)
        "env print -e [-guid guid] [-n] [name ...] - print UEFI environment\n"
  #endif
@@ -96,7 +96,7 @@
  #if defined(CONFIG_CMD_RUN)
        "env run var [...] - run commands in an environment variable\n"
  #endif
-@@ -1431,6 +1491,17 @@ U_BOOT_CMD(
+@@ -1428,6 +1488,17 @@ U_BOOT_CMD(
  );
  #endif
  
index 873d80f6f9dcf135f34430e10966891e30892b5a..f087bec72a67f34fa11911828de9732af5940f47 100644 (file)
@@ -16,7 +16,7 @@ Reviewed-by: Tom Rini <trini@konsulko.com>
 
 --- a/boot/image-fdt.c
 +++ b/boot/image-fdt.c
-@@ -636,6 +636,12 @@ int image_setup_libfdt(struct bootm_head
+@@ -637,6 +637,12 @@ int image_setup_libfdt(struct bootm_head
                                        images->fit_uname_cfg,
                                        strlen(images->fit_uname_cfg) + 1, 1);
  
index d34ed6f2ae55aaedcdf0b7042a3acfeb0c5f303e..89cdf60f95073b871030a68e8f7ab6a971a37c11 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -2000,26 +2000,7 @@ endif
+@@ -2006,26 +2006,7 @@ endif
  # Check dtc and pylibfdt, if DTC is provided, else build them
  PHONY += scripts_dtc
  scripts_dtc: scripts_basic
diff --git a/package/boot/uboot-mediatek/patches/305-mt7988-generic-reset-button-ignore-env.patch b/package/boot/uboot-mediatek/patches/305-mt7988-generic-reset-button-ignore-env.patch
new file mode 100644 (file)
index 0000000..2bbc5c1
--- /dev/null
@@ -0,0 +1,46 @@
+--- a/board/mediatek/mt7988/mt7988_rfb.c
++++ b/board/mediatek/mt7988/mt7988_rfb.c
+@@ -4,7 +4,43 @@
+  * Author: Sam Shih <sam.shih@mediatek.com>
+  */
++#include <common.h>
++#include <config.h>
++#include <dm.h>
++#include <button.h>
++#include <env.h>
++#include <init.h>
++#include <asm/global_data.h>
++#include <linux/delay.h>
++
++#ifndef CONFIG_RESET_BUTTON_LABEL
++#define CONFIG_RESET_BUTTON_LABEL "reset"
++#endif
++
+ int board_init(void)
+ {
+       return 0;
+ }
++
++int board_late_init(void)
++{
++      gd->env_valid = 1; //to load environment variable from persistent store
++      struct udevice *dev;
++
++      gd->env_valid = ENV_VALID;
++      if (!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev)) {
++              puts("reset button found\n");
++#ifdef CONFIG_RESET_BUTTON_SETTLE_DELAY
++              if (CONFIG_RESET_BUTTON_SETTLE_DELAY > 0) {
++                      button_get_state(dev);
++                      mdelay(CONFIG_RESET_BUTTON_SETTLE_DELAY);
++              }
++#endif
++              if (button_get_state(dev) == BUTTON_ON) {
++                      puts("button pushed, resetting environment\n");
++                      gd->env_valid = ENV_INVALID;
++              }
++      }
++      env_relocate();
++      return 0;
++}
index a414f0a8b5cbc0cd82155b37c2fcc82e4e851553..c9da03c725400db3e9a84a2e08032f5d1aa5f614 100644 (file)
 +&snand {
 +      pinctrl-names = "default";
 +      pinctrl-0 = <&snfi_pins>;
++      quad-spi;
        status = "okay";
 -
 -      spi-flash@0{
 -              compatible = "jedec,spi-nor";
 -              reg = <0>;
--              u-boot,dm-pre-reloc;
+-              bootph-all;
 -      };
-+      quad-spi;
  };
  
  &uart0 {
index 3fc2c554bb0beb25ec7b0347521b8888fb40a42c..bc9b3f400108c7e84c1cf98f678f3cb70d2f8ac4 100644 (file)
 +};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1285,6 +1285,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1305,6 +1305,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7622-rfb.dtb \
        mt7623a-unielec-u7623-02-emmc.dtb \
        mt7622-bananapi-bpi-r64.dtb \
index 1955958b9b0b04a636d6311954319cf54caf3512..7d37b1adc6b582b1ca870e4d184311bec12e8cd0 100644 (file)
 +};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1286,6 +1286,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1306,6 +1306,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7623a-unielec-u7623-02-emmc.dtb \
        mt7622-bananapi-bpi-r64.dtb \
        mt7622-linksys-e8450-ubi.dtb \
  #ifdef CONFIG_MMC
  static int initr_mmc(void)
  {
-@@ -720,6 +735,9 @@ static init_fnc_t init_sequence_r[] = {
+@@ -713,6 +728,9 @@ static init_fnc_t init_sequence_r[] = {
  #ifdef CONFIG_NMBM_MTD
        initr_nmbm,
  #endif
index bcd29b974e52e975ab456a0af4c12788f8bc5f41..98010a330477bc359101e0a28cb753c867b83323 100644 (file)
@@ -1,14 +1,3 @@
---- a/arch/arm/dts/Makefile
-+++ b/arch/arm/dts/Makefile
-@@ -1293,6 +1293,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
-       mt7981-snfi-nand-rfb.dtb \
-       mt7981-emmc-rfb.dtb \
-       mt7981-sd-rfb.dtb \
-+      mt7986a-bpi-r3-sd.dtb \
-+      mt7986a-bpi-r3-emmc.dtb \
-       mt7986a-rfb.dtb \
-       mt7986b-rfb.dtb \
-       mt7986a-sd-rfb.dtb \
 --- /dev/null
 +++ b/configs/mt7986a_bpi-r3-emmc_defconfig
 @@ -0,0 +1,196 @@
 +CONFIG_USE_SERVERIP=y
 +CONFIG_SERVERIP="192.168.1.254"
 --- /dev/null
-+++ b/arch/arm/dts/mt7986a-bpi-r3-emmc.dts
-@@ -0,0 +1,33 @@
-+// SPDX-License-Identifier: GPL-2.0
-+/*
-+ * Copyright (c) 2021 MediaTek Inc.
-+ * Author: Sam Shih <sam.shih@mediatek.com>
-+ */
-+
-+/dts-v1/;
-+#include "mt7986a-bpi-r3-sd.dts"
-+#include <dt-bindings/gpio/gpio.h>
-+/ {
-+      reg_1p8v: regulator-1p8v {
-+              compatible = "regulator-fixed";
-+              regulator-name = "fixed-1.8V";
-+              regulator-min-microvolt = <1800000>;
-+              regulator-max-microvolt = <1800000>;
-+              regulator-boot-on;
-+              regulator-always-on;
-+      };
-+};
-+
-+&mmc0 {
-+      pinctrl-names = "default";
-+      pinctrl-0 = <&mmc0_pins_default>;
-+      bus-width = <8>;
-+      max-frequency = <200000000>;
-+      cap-mmc-highspeed;
-+      cap-mmc-hw-reset;
-+      vmmc-supply = <&reg_3p3v>;
-+      vqmmc-supply = <&reg_1p8v>;
-+      non-removable;
-+      status = "okay";
-+};
-+
---- /dev/null
-+++ b/arch/arm/dts/mt7986a-bpi-r3-sd.dts
-@@ -0,0 +1,272 @@
-+// SPDX-License-Identifier: GPL-2.0
-+/*
-+ * Copyright (c) 2021 MediaTek Inc.
-+ * Author: Sam Shih <sam.shih@mediatek.com>
-+ */
-+
-+/dts-v1/;
-+#include <dt-bindings/input/linux-event-codes.h>
-+#include "mt7986.dtsi"
-+#include <dt-bindings/gpio/gpio.h>
-+
-+/ {
-+      #address-cells = <1>;
-+      #size-cells = <1>;
-+      model = "BananaPi BPi-R3";
-+      compatible = "mediatek,mt7986", "mediatek,mt7986-sd-rfb";
-+
-+      chosen {
-+              stdout-path = &uart0;
-+              tick-timer = &timer0;
-+      };
-+
-+      reg_3p3v: regulator-3p3v {
-+              compatible = "regulator-fixed";
-+              regulator-name = "fixed-3.3V";
-+              regulator-min-microvolt = <3300000>;
-+              regulator-max-microvolt = <3300000>;
-+              regulator-boot-on;
-+              regulator-always-on;
-+      };
-+
-+      keys {
-+              compatible = "gpio-keys";
-+/*
-+              factory {
-+                      label = "reset";
-+                      gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
-+              };
-+*/
-+              wps {
-+                      label = "reset";
-+                      gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
-+                      linux,code = <KEY_RESTART>;
-+              };
-+      };
-+
-+      leds {
-+              compatible = "gpio-leds";
-+
-+              led_status_green: green {
-+                      label = "green:status";
-+                      gpios = <&gpio 69 GPIO_ACTIVE_HIGH>;
-+              };
-+
-+              led_status_blue: blue {
-+                      label = "blue:status";
-+                      gpios = <&gpio 86 GPIO_ACTIVE_HIGH>;
-+              };
-+      };
-+
-+};
-+
-+&uart0 {
-+      mediatek,force-highspeed;
-+      status = "okay";
-+};
-+
-+&uart1 {
-+      pinctrl-names = "default";
-+      pinctrl-0 = <&uart1_pins>;
-+      status = "disabled";
-+};
-+
-+&eth {
-+      status = "okay";
-+      mediatek,gmac-id = <0>;
-+      phy-mode = "sgmii";
-+      mediatek,switch = "mt7531";
-+      reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
-+
-+      fixed-link {
-+              speed = <1000>;
-+              full-duplex;
-+      };
-+};
-+
-+&pinctrl {
-+      spic_pins: spi1-pins-func-1 {
-+              mux {
-+                      function = "spi";
-+                      groups = "spi1_2";
-+              };
-+      };
-+
-+      uart1_pins: spi1-pins-func-3 {
-+              mux {
-+                      function = "uart";
-+                      groups = "uart1_2";
-+              };
-+      };
-+
-+      pwm_pins: pwm0-pins-func-1 {
-+              mux {
-+                      function = "pwm";
-+                      groups = "pwm0";
-+              };
-+      };
-+
-+      mmc0_pins_default: mmc0default {
-+              mux {
-+                      function = "flash";
-+                      groups =  "emmc_51";
-+              };
-+
-+              conf-cmd-dat {
-+                      pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
-+                             "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
-+                             "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
-+                      input-enable;
-+                      drive-strength = <MTK_DRIVE_4mA>;
-+                      bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
-+              };
-+
-+              conf-clk {
-+                      pins = "EMMC_CK";
-+                      drive-strength = <MTK_DRIVE_6mA>;
-+                      bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
-+              };
-+
-+              conf-dsl {
-+                      pins = "EMMC_DSL";
-+                      bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
-+              };
-+
-+              conf-rst {
-+                      pins = "EMMC_RSTB";
-+                      drive-strength = <MTK_DRIVE_4mA>;
-+                      bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
-+              };
-+      };
-+
-+      spi_flash_pins: spi0-pins-func-1 {
-+              mux {
-+                      function = "flash";
-+                      groups = "spi0", "spi0_wp_hold";
-+              };
-+
-+              conf-pu {
-+                      pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
-+                      drive-strength = <MTK_DRIVE_8mA>;
-+                      bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
-+              };
-+
-+              conf-pd {
-+                      pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
-+                      drive-strength = <MTK_DRIVE_8mA>;
-+                      bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
-+              };
-+      };
-+};
-+
-+&pwm {
-+      pinctrl-names = "default";
-+      pinctrl-0 = <&pwm_pins>;
-+      status = "okay";
-+};
-+
-+&spi0 {
-+      #address-cells = <1>;
-+      #size-cells = <0>;
-+      pinctrl-names = "default";
-+      pinctrl-0 = <&spi_flash_pins>;
-+      status = "okay";
-+      must_tx;
-+      enhance_timing;
-+      dma_ext;
-+      ipm_design;
-+      support_quad;
-+      tick_dly = <1>;
-+      sample_sel = <0>;
-+
-+      spi_nor@0 {
-+              compatible = "jedec,spi-nor";
-+              reg = <0>;
-+              spi-max-frequency = <52000000>;
-+
-+              partitions {
-+                      compatible = "fixed-partitions";
-+                      #address-cells = <1>;
-+                      #size-cells = <1>;
-+
-+                      partition@0 {
-+                              label = "bl2";
-+                              reg = <0x0 0x40000>;
-+                      };
-+
-+                      partition@40000 {
-+                              label = "u-boot-env";
-+                              reg = <0x40000 0x40000>;
-+                      };
-+
-+                      partition@80000 {
-+                              label = "reserved";
-+                              reg = <0x80000 0x80000>;
-+                      };
-+
-+                      partition@100000 {
-+                              label = "fip";
-+                              reg = <0x100000 0x80000>;
-+                      };
-+
-+                      partition@180000 {
-+                              label = "recovery";
-+                              reg = <0x180000 0xa80000>;
-+                      };
-+
-+                      partition@c00000 {
-+                              label = "fit";
-+                              reg = <0xc00000 0x1400000>;
-+                      };
-+              };
-+      };
-+
-+      spi_nand@1 {
-+              compatible = "spi-nand";
-+              reg = <1>;
-+              spi-max-frequency = <52000000>;
-+
-+              partitions {
-+                      compatible = "fixed-partitions";
-+                      #address-cells = <1>;
-+                      #size-cells = <1>;
-+
-+                      partition@0 {
-+                              label = "bl2";
-+                              reg = <0x0 0x80000>;
-+                      };
-+
-+                      partition@80000 {
-+                              label = "factory";
-+                              reg = <0x80000 0x300000>;
-+                      };
-+
-+                      partition@380000 {
-+                              label = "fip";
-+                              reg = <0x380000 0x200000>;
-+                      };
-+
-+                      partition@580000 {
-+                              label = "ubi";
-+                              reg = <0x580000 0x7a80000>;
-+                      };
-+              };
-+      };
-+};
-+
-+&watchdog {
-+      status = "disabled";
-+};
-+
-+&mmc0 {
-+      pinctrl-names = "default";
-+      pinctrl-0 = <&mmc0_pins_default>;
-+      bus-width = <4>;
-+      max-frequency = <52000000>;
-+      cap-sd-highspeed;
-+      r_smpl = <1>;
-+      vmmc-supply = <&reg_3p3v>;
-+      vqmmc-supply = <&reg_3p3v>;
-+      status = "okay";
-+};
-+
---- /dev/null
 +++ b/bananapi_bpi-r3_sdmmc_env
 @@ -0,0 +1,80 @@
 +ipaddr=192.168.1.1