[openwrt/openwrt] uboot-sifiveu: drop PWM-related patches

LEDE Commits lede-commits at lists.infradead.org
Fri May 2 14:40:47 PDT 2025


wigyori pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a0f45a4f3fcfff015e93264a9fbdc43b2e2a7e0b

commit a0f45a4f3fcfff015e93264a9fbdc43b2e2a7e0b
Author: Zoltan HERPAI <wigyori at uid0.hu>
AuthorDate: Fri May 2 22:46:53 2025 +0200

    uboot-sifiveu: drop PWM-related patches
    
    These are dropped from later SDK releases, and don't compile
    with the recent GCC14 updates as well.
    
    Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
---
 ...e-spl-Initialized-the-PWM-setting-in-the-.patch | 117 ---------------------
 ...e-Set-LED-s-color-to-purple-in-the-U-boot.patch |  62 -----------
 ...e-Set-LED-s-color-to-blue-before-jumping-.patch |  32 ------
 ...e-spl-Set-remote-thermal-of-TMP451-to-85-.patch |  67 ------------
 4 files changed, 278 deletions(-)

diff --git a/package/boot/uboot-sifiveu/patches/0001-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch b/package/boot/uboot-sifiveu/patches/0001-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch
deleted file mode 100644
index 233df7acb6..0000000000
--- a/package/boot/uboot-sifiveu/patches/0001-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-From 2ba4e6d78e0a63e5d491f9b01b498899e58cb58d Mon Sep 17 00:00:00 2001
-From: Vincent Chen <vincent.chen at sifive.com>
-Date: Mon, 15 Nov 2021 03:31:04 -0800
-Subject: [PATCH 1/5] board: sifive: spl: Initialized the PWM setting in the
- SPL stage
-
-LEDs and multiple fans can be controlled by SPL. This patch ensures
-that all fans have been enabled in the SPL stage. In addition, the
-LED's color will be set to yellow.
-
-Upstream-Status: Pending
-Signed-off-by: Vincent Chen <vincent.chen at sifive.com>
----
- arch/riscv/include/asm/arch-fu740/eeprom.h | 15 ++++++
- board/sifive/unmatched/Makefile            |  1 +
- board/sifive/unmatched/pwm.c               | 57 ++++++++++++++++++++++
- board/sifive/unmatched/spl.c               |  2 +
- 4 files changed, 75 insertions(+)
- create mode 100644 arch/riscv/include/asm/arch-fu740/eeprom.h
- create mode 100644 board/sifive/unmatched/pwm.c
-
---- /dev/null
-+++ b/arch/riscv/include/asm/arch-fu740/eeprom.h
-@@ -0,0 +1,15 @@
-+/* SPDX-License-Identifier: GPL-2.0 */
-+/*
-+ * Copyright (C) 2021 SiFive, Inc.
-+ *
-+ * Zong Li <zong.li at sifve.com>
-+ */
-+
-+#ifndef _ASM_RISCV_EEPROM_H
-+#define _ASM_RISCV_EEPROM_H
-+
-+#define PCB_REVISION_REV3	0x3
-+
-+u8 get_pcb_revision_from_eeprom(void);
-+
-+#endif /* _ASM_RISCV_EEPROM_H */
---- a/board/sifive/unmatched/Makefile
-+++ b/board/sifive/unmatched/Makefile
-@@ -9,3 +9,4 @@ obj-y += spl.o
- else
- obj-y += unmatched.o
- endif
-+obj-y += pwm.o
---- /dev/null
-+++ b/board/sifive/unmatched/pwm.c
-@@ -0,0 +1,57 @@
-+// SPDX-License-Identifier: GPL-2.0+
-+/*
-+ * Copyright (c) 2021, SiFive Inc
-+ *
-+ * Authors:
-+ *   Vincent Chen <vincent.chen at sifive.com>
-+ *   David Abdurachmanov <david.abdurachmanov at sifive.com>
-+ */
-+
-+#include <linux/io.h>
-+#include <asm/arch/eeprom.h>
-+
-+struct pwm_sifive_regs {
-+	unsigned int cfg;	/* PWM configuration register */
-+	unsigned int pad0;	/* Reserved */
-+	unsigned int cnt;	/* PWM count register */
-+	unsigned int pad1;	/* Reserved */
-+	unsigned int pwms;	/* Scaled PWM count register */
-+	unsigned int pad2;	/* Reserved */
-+	unsigned int pad3;	/* Reserved */
-+	unsigned int pad4;	/* Reserved */
-+	unsigned int cmp0;	/* PWM 0 compare register */
-+	unsigned int cmp1;	/* PWM 1 compare register */
-+	unsigned int cmp2;	/* PWM 2 compare register */
-+	unsigned int cmp3;	/* PWM 3 compare register */
-+};
-+
-+#define PWM0_BASE		0x10020000
-+#define PWM1_BASE		0x10021000
-+#define PWM_CFG_INIT		0x1000
-+#define PWM_CMP_ENABLE_VAL	0x0
-+#define PWM_CMP_DISABLE_VAL	0xffff
-+
-+void pwm_device_init(void)
-+{
-+	struct pwm_sifive_regs *pwm0, *pwm1;
-+	pwm0 = (struct pwm_sifive_regs *)PWM0_BASE;
-+	pwm1 = (struct pwm_sifive_regs *)PWM1_BASE;
-+	writel(PWM_CMP_DISABLE_VAL, (void *)&pwm0->cmp0);
-+	/* Set the 3-color PWM LEDs to yellow in SPL */
-+	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm0->cmp1);
-+	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm0->cmp2);
-+	writel(PWM_CMP_DISABLE_VAL, (void *)&pwm0->cmp3);
-+	writel(PWM_CFG_INIT, (void *)&pwm0->cfg);
-+
-+	writel(PWM_CMP_DISABLE_VAL, (void *)&pwm0->cmp3);
-+	/* Turn on all the fans, (J21), (J23) and (J24), on the unmatched board */
-+	/* The SoC fan(J21) on the rev3 board cannot be controled by PWM_COMP0,
-+	   so here sets the initial value of PWM_COMP0 as DISABLE */
-+	if (get_pcb_revision_from_eeprom() == PCB_REVISION_REV3)
-+		writel(PWM_CMP_DISABLE_VAL, (void *)&pwm1->cmp1);
-+	else
-+		writel(PWM_CMP_ENABLE_VAL, (void *)&pwm1->cmp1);
-+	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm1->cmp2);
-+	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm1->cmp3);
-+	writel(PWM_CFG_INIT, (void *)&pwm1->cfg);
-+}
---- a/board/sifive/unmatched/spl.c
-+++ b/board/sifive/unmatched/spl.c
-@@ -90,6 +90,8 @@ int spl_board_init_f(void)
- 		goto end;
- 	}
- 
-+	pwm_device_init();
-+
- 	ret = spl_gemgxl_init();
- 	if (ret) {
- 		debug("Gigabit ethernet PHY (VSC8541) init failed: %d\n", ret);
diff --git a/package/boot/uboot-sifiveu/patches/0002-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch b/package/boot/uboot-sifiveu/patches/0002-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch
deleted file mode 100644
index 6235f6cb2d..0000000000
--- a/package/boot/uboot-sifiveu/patches/0002-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 0dfab8fab80107aa4ad7d41a8ff47e5ff59632f9 Mon Sep 17 00:00:00 2001
-From: Vincent Chen <vincent.chen at sifive.com>
-Date: Mon, 24 Jan 2022 02:42:02 -0800
-Subject: [PATCH 2/5] board: sifive: Set LED's color to purple in the U-boot
- stage
-
-Set LED's color to purple in the U-boot stage. Because there are still
-some functions to be executed before board_early_init_f(), it means
-the LED's is not changed to purple instantly when entering the U-boot
-stage.
-
-Upstream-Status: Pending
-Signed-off-by: Vincent Chen <vincent.chen at sifive.com>
----
- board/sifive/unmatched/pwm.c       | 7 +++++++
- board/sifive/unmatched/unmatched.c | 6 ++++++
- configs/sifive_unmatched_defconfig | 1 +
- 3 files changed, 14 insertions(+)
-
---- a/board/sifive/unmatched/pwm.c
-+++ b/board/sifive/unmatched/pwm.c
-@@ -36,6 +36,7 @@ void pwm_device_init(void)
- 	struct pwm_sifive_regs *pwm0, *pwm1;
- 	pwm0 = (struct pwm_sifive_regs *)PWM0_BASE;
- 	pwm1 = (struct pwm_sifive_regs *)PWM1_BASE;
-+#ifdef CONFIG_SPL_BUILD
- 	writel(PWM_CMP_DISABLE_VAL, (void *)&pwm0->cmp0);
- 	/* Set the 3-color PWM LEDs to yellow in SPL */
- 	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm0->cmp1);
-@@ -54,4 +55,10 @@ void pwm_device_init(void)
- 	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm1->cmp2);
- 	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm1->cmp3);
- 	writel(PWM_CFG_INIT, (void *)&pwm1->cfg);
-+#else
-+	/* Set the 3-color PWM LEDs to purple in U-boot */
-+	writel(PWM_CMP_DISABLE_VAL, (void *)&pwm0->cmp1);
-+	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm0->cmp2);
-+	writel(PWM_CMP_ENABLE_VAL, (void *)&pwm0->cmp3);
-+#endif
- }
---- a/board/sifive/unmatched/unmatched.c
-+++ b/board/sifive/unmatched/unmatched.c
-@@ -22,6 +22,12 @@ void *board_fdt_blob_setup(int *err)
- 	return (ulong *)&_end;
- }
- 
-+int board_early_init_f(void)
-+{
-+	pwm_device_init();
-+	return 0;
-+}
-+
- int board_init(void)
- {
- 	/* enable all cache ways */
---- a/configs/sifive_unmatched_defconfig
-+++ b/configs/sifive_unmatched_defconfig
-@@ -63,3 +63,4 @@ CONFIG_DM_SCSI=y
- CONFIG_USB=y
- CONFIG_USB_XHCI_HCD=y
- CONFIG_USB_XHCI_PCI=y
-+CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch b/package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch
deleted file mode 100644
index 3a381444a1..0000000000
--- a/package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 1a48019dd4b69dd76551217a61cc4cab9e92fd39 Mon Sep 17 00:00:00 2001
-From: Vincent Chen <vincent.chen at sifive.com>
-Date: Mon, 15 Nov 2021 03:39:07 -0800
-Subject: [PATCH 3/5] board: sifive: Set LED's color to blue before jumping to
- Linux
-
-The LED's color wil be changed from purple to blue before executing
-the sysboot command. Because the sysboot command includes the image loading
-from the boot partition, It means the LED's color is blue when executing
-"Retrieving file: /Image.gz".
-
-Upstream-Status: Pending
-Signed-off-by: Vincent Chen <vincent.chen at sifive.com>
----
- include/configs/sifive-unmatched.h | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
---- a/include/configs/sifive-unmatched.h
-+++ b/include/configs/sifive-unmatched.h
-@@ -48,6 +48,11 @@
- 	"type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \
- 	"partitions=" PARTS_DEFAULT "\0" \
- 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
--	BOOTENV
-+	"setled_blue=mw.l 0x10020024 0x0000ffff; mw.l 0x10020028 0x0000ffff; mw.l 0x1002002c 0x0\0" \
-+	BOOTENV \
-+	"boot_extlinux=" \
-+		"run setled_blue; " \
-+		"sysboot ${devtype} ${devnum}:${distro_bootpart} any " \
-+			"${scriptaddr} ${prefix}${boot_syslinux_conf};\0"
- 
- #endif /* __SIFIVE_UNMATCHED_H */
diff --git a/package/boot/uboot-sifiveu/patches/0004-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch b/package/boot/uboot-sifiveu/patches/0004-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch
deleted file mode 100644
index 1db843c153..0000000000
--- a/package/boot/uboot-sifiveu/patches/0004-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 877afdf63129caa64d70d4a1252eec44778cfa0e Mon Sep 17 00:00:00 2001
-From: Vincent Chen <vincent.chen at sifive.com>
-Date: Mon, 24 Jan 2022 02:57:40 -0800
-Subject: [PATCH 4/5] board: sifive: spl: Set remote thermal of TMP451 to 85
- deg C
-
- for the unmatched board
-
-For TMP451 on the unmatched board, the default value of the remote
-thermal threshold is 108 deg C. This commit initilizes it to 85 deg C at SPL.
-
-Upstream-Status: Pending
-Signed-off-by: Vincent Chen <vincent.chen at sifive.com>
-Signed-off-by: Thomas Perrot <thomas.perrot at bootlin.com>
----
- board/sifive/unmatched/spl.c | 26 ++++++++++++++++++++++++++
- 1 file changed, 26 insertions(+)
-
---- a/board/sifive/unmatched/spl.c
-+++ b/board/sifive/unmatched/spl.c
-@@ -10,6 +10,8 @@
- #include <spl.h>
- #include <misc.h>
- #include <log.h>
-+#include <config.h>
-+#include <i2c.h>
- #include <linux/delay.h>
- #include <linux/io.h>
- #include <asm/gpio.h>
-@@ -26,6 +28,24 @@
- #define MODE_SELECT_SD		0xb
- #define MODE_SELECT_MASK	GENMASK(3, 0)
- 
-+#define TMP451_REMOTE_THERM_LIMIT_REG_OFFSET	0x19
-+#define TMP451_REMOTE_THERM_LIMIT_INIT_VALUE	0x55
-+
-+static inline int init_tmp451_remote_therm_limit(void)
-+{
-+	struct udevice *dev;
-+	unsigned char r_therm_limit = TMP451_REMOTE_THERM_LIMIT_INIT_VALUE;
-+	int ret;
-+
-+	ret = i2c_get_chip_for_busnum(0, 0x4c, 0x1, &dev);
-+
-+	if (!ret)
-+		ret = dm_i2c_write(dev, TMP451_REMOTE_THERM_LIMIT_REG_OFFSET,
-+				   &r_therm_limit,
-+				   sizeof(unsigned char));
-+	return ret;
-+}
-+
- static inline int spl_reset_device_by_gpio(const char *label, int pin, int low_width)
- {
- 	int ret;
-@@ -92,6 +112,12 @@ int spl_board_init_f(void)
- 
- 	pwm_device_init();
- 
-+	ret = init_tmp451_remote_therm_limit();
-+	if (ret) {
-+		debug("TMP451 remote THERM limit init failed: %d\n", ret);
-+		goto end;
-+	}
-+
- 	ret = spl_gemgxl_init();
- 	if (ret) {
- 		debug("Gigabit ethernet PHY (VSC8541) init failed: %d\n", ret);




More information about the lede-commits mailing list