* [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C
@ 2026-07-22 1:36 Fabio Estevam via U-Boot
2026-07-22 1:36 ` [PATCH v2 2/5] rockchip: rk3399: Remove ROC-PC regulator overrides Fabio Estevam via U-Boot
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Fabio Estevam via U-Boot @ 2026-07-22 1:36 UTC (permalink / raw)
To: u-boot; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
From: Fabio Estevam <festevam@nabladev.com>
Add the JEDEC ID for the XMC XM25QH128C SPI NOR flash.
This is a 128Mbit device using 64KiB sectors and supporting 4KiB
erase, dual read and quad read, matching the other XM25QH128 variants.
Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
Changes since v1:
- None.
drivers/mtd/spi/spi-nor-ids.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
index 31a2ba49a87c..90aa1025176c 100644
--- a/drivers/mtd/spi/spi-nor-ids.c
+++ b/drivers/mtd/spi/spi-nor-ids.c
@@ -673,6 +673,7 @@ const struct flash_info spi_nor_ids[] = {
{ INFO("XM25QH64A", 0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ INFO("XM25QH64C", 0x204017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ INFO("XM25QH128A", 0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+ { INFO("XM25QH128C", 0x204018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ INFO("XM25QU128C", 0x204118, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ INFO("XM25QH256C", 0x204019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
{ INFO("XM25QU256C", 0x204119, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 2/5] rockchip: rk3399: Remove ROC-PC regulator overrides
2026-07-22 1:36 [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Fabio Estevam via U-Boot
@ 2026-07-22 1:36 ` Fabio Estevam via U-Boot
2026-07-22 13:53 ` Quentin Schulz via U-Boot
2026-07-22 1:36 ` [PATCH v2 3/5] rockchip: rk3399: Add ROC-PC-PLUS board detection Fabio Estevam via U-Boot
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam via U-Boot @ 2026-07-22 1:36 UTC (permalink / raw)
To: u-boot; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
From: Fabio Estevam <festevam@nabladev.com>
The upstream devicetree already describes dc_12v as the output of the
MP8859 regulator and drives the USB hub reset through the vcc5v0_host
regulator pinctrl state.
Remove the legacy fixed-regulator overrides and rely on the upstream
regulator descriptions.
Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
Changes since v1:
- Newly introduced.
arch/arm/dts/rk3399-roc-pc-u-boot.dtsi | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
index 883d399a06a3..a85e9549c83e 100644
--- a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
@@ -10,30 +10,6 @@
config {
sysreset-gpio = <&gpio1 RK_PA6 GPIO_ACTIVE_HIGH>;
};
-
- vcc_hub_en: vcc_hub_en-regulator {
- compatible = "regulator-fixed";
- enable-active-high;
- gpio = <&gpio2 RK_PA4 GPIO_ACTIVE_HIGH>;
- pinctrl-names = "default";
- pinctrl-0 = <&hub_rst>;
- regulator-name = "vcc_hub_en";
- regulator-always-on;
- };
-};
-
-/*
- * should be placed inside mp8859, but not until mp8859 has
- * its own dt-binding.
- */
-&dc_12v {
- compatible = "regulator-fixed";
- regulator-name = "dc_12v";
- regulator-always-on;
- regulator-boot-on;
- regulator-min-microvolt = <12000000>;
- regulator-max-microvolt = <12000000>;
- vin-supply = <&vcc_vbus_typec0>;
};
&gpio4 {
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 3/5] rockchip: rk3399: Add ROC-PC-PLUS board detection
2026-07-22 1:36 [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Fabio Estevam via U-Boot
2026-07-22 1:36 ` [PATCH v2 2/5] rockchip: rk3399: Remove ROC-PC regulator overrides Fabio Estevam via U-Boot
@ 2026-07-22 1:36 ` Fabio Estevam via U-Boot
2026-07-22 14:07 ` Quentin Schulz via U-Boot
2026-07-22 1:36 ` [PATCH v2 4/5] rockchip: rk3399: Enable UMS on ROC-PC-PLUS Fabio Estevam via U-Boot
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam via U-Boot @ 2026-07-22 1:36 UTC (permalink / raw)
To: u-boot; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
From: Fabio Estevam <festevam@nabladev.com>
The ROC-RK3399-PC has an MP8859 regulator on I2C7 at address 0x66,
while the ROC-RK3399-PC-PLUS does not. Probe for the regulator in SPL
and use the result to select the matching devicetree from the U-Boot
FIT. Fall back to the original board if the I2C bus cannot be probed.
Build both devicetrees from the existing roc-pc-rk3399_defconfig and
enable the XMC SPI NOR driver used by the Plus variant. Set fdtfile
from the selected U-Boot devicetree so the matching Linux devicetree
is used as well.
Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
Changes since v1:
- Added run-time board time detection.
arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi | 3 ++
arch/arm/dts/rk3399-roc-pc-u-boot.dtsi | 8 +++++
board/firefly/roc-pc-rk3399/roc-pc-rk3399.c | 37 +++++++++++++++++++++
configs/roc-pc-rk3399_defconfig | 3 ++
doc/board/rockchip/rockchip.rst | 2 +-
5 files changed, 52 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
diff --git a/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
new file mode 100644
index 000000000000..c80529a62b97
--- /dev/null
+++ b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include "rk3399-roc-pc-u-boot.dtsi"
diff --git a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
index a85e9549c83e..e7e4a2c89072 100644
--- a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
@@ -12,6 +12,14 @@
};
};
+&i2c7 {
+ bootph-pre-ram;
+};
+
+&i2c7_xfer {
+ bootph-pre-ram;
+};
+
&gpio4 {
bootph-pre-ram;
};
diff --git a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
index 6937a27176f9..60a3ba43cdbd 100644
--- a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
+++ b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
@@ -5,14 +5,24 @@
#include <dm.h>
#include <env.h>
+#include <fdtdec.h>
+#include <i2c.h>
+#include <image.h>
#include <log.h>
#include <spl_gpio.h>
+#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/arch-rockchip/cru.h>
#include <asm/arch-rockchip/gpio.h>
#include <asm/arch-rockchip/grf_rk3399.h>
+#define ROC_PC_MP8859_BUS "i2c@ff160000"
+#define ROC_PC_MP8859_ADDR 0x66
+#define ROC_PC_PLUS_FDTFILE "rockchip/rk3399-roc-pc-plus.dtb"
+
+DECLARE_GLOBAL_DATA_PTR;
+
#ifdef CONFIG_XPL_BUILD
#define PMUGRF_BASE 0xff320000
@@ -54,4 +64,31 @@ void led_setup(void)
spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1);
}
+static bool is_roc_pc_plus(void)
+{
+ struct udevice *bus, *dev;
+
+ if (uclass_get_device_by_name(UCLASS_I2C, ROC_PC_MP8859_BUS, &bus))
+ return false;
+
+ return dm_i2c_probe(bus, ROC_PC_MP8859_ADDR, 0, &dev);
+}
+
+int board_fit_config_name_match(const char *name)
+{
+ if (is_roc_pc_plus())
+ return strcmp(name, ROC_PC_PLUS_FDTFILE);
+
+ return strcmp(name, CONFIG_DEFAULT_FDT_FILE);
+}
+
#endif
+
+int rk_board_late_init(void)
+{
+ if (!fdt_node_check_compatible(gd->fdt_blob, 0,
+ "firefly,roc-rk3399-pc-plus"))
+ env_set("fdtfile", ROC_PC_PLUS_FDTFILE);
+
+ return 0;
+}
diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index 1df5cb03adbb..6ef447e0e715 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -3,12 +3,14 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
CONFIG_COUNTER_FREQUENCY=24000000
CONFIG_ARCH_ROCKCHIP=y
CONFIG_SPL_GPIO=y
+CONFIG_SPL_I2C=y
CONFIG_NR_DRAM_BANKS=1
CONFIG_SF_DEFAULT_SPEED=30000000
CONFIG_ENV_SIZE=0x8000
CONFIG_ENV_OFFSET=0x3F8000
CONFIG_ENV_SECT_SIZE=0x1000
CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3399-roc-pc"
+CONFIG_OF_LIST="rockchip/rk3399-roc-pc rockchip/rk3399-roc-pc-plus"
CONFIG_DM_RESET=y
CONFIG_ROCKCHIP_RK3399=y
CONFIG_ROCKCHIP_SPI_IMAGE=y
@@ -48,6 +50,7 @@ CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_XMC=y
CONFIG_SPI_FLASH_WINBOND=y
CONFIG_DM_ETH_PHY=y
CONFIG_ETH_DESIGNWARE=y
diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
index 9351a5b8eae7..b565aea311e9 100644
--- a/doc/board/rockchip/rockchip.rst
+++ b/doc/board/rockchip/rockchip.rst
@@ -81,7 +81,7 @@ List of mainline supported Rockchip boards:
- 96boards RK3399 Ficus (ficus-rk3399)
- 96boards Rock960 (rock960-rk3399)
- Firefly-RK3399 (firefly_rk3399)
- - Firefly ROC-RK3399-PC
+ - Firefly ROC-RK3399-PC/ROC-RK3399-PC-PLUS (roc-pc-rk3399)
- FriendlyElec NanoPC-T4 (nanopc-t4-rk3399)
- FriendlyElec NanoPi M4 (nanopi-m4-rk3399)
- FriendlyElec NanoPi M4B (nanopi-m4b-rk3399)
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 4/5] rockchip: rk3399: Enable UMS on ROC-PC-PLUS
2026-07-22 1:36 [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Fabio Estevam via U-Boot
2026-07-22 1:36 ` [PATCH v2 2/5] rockchip: rk3399: Remove ROC-PC regulator overrides Fabio Estevam via U-Boot
2026-07-22 1:36 ` [PATCH v2 3/5] rockchip: rk3399: Add ROC-PC-PLUS board detection Fabio Estevam via U-Boot
@ 2026-07-22 1:36 ` Fabio Estevam via U-Boot
2026-07-22 15:01 ` Quentin Schulz via U-Boot
2026-07-22 1:36 ` [PATCH v2 5/5] rockchip: roc-pc-rk3399: Enable redundant environment Fabio Estevam via U-Boot
2026-07-22 10:52 ` [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Quentin Schulz via U-Boot
4 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam via U-Boot @ 2026-07-22 1:36 UTC (permalink / raw)
To: u-boot; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
From: Fabio Estevam <festevam@nabladev.com>
Describe the USB3 OTG controller as a USB role switch and make
peripheral mode the default when no external role provider has selected
host mode. This retains OTG operation and both PHYs inherited from the
SoC devicetree.
Enable the ums command so the onboard eMMC can be exposed as USB mass
storage to a host.
Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
Changes since v1:
- Add the same OTG description as submitted upstream:
https://lore.kernel.org/linux-arm-kernel/20260721030043.84691-1-festevam@gmail.com/
arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi | 6 ++++++
configs/roc-pc-rk3399_defconfig | 1 +
2 files changed, 7 insertions(+)
diff --git a/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
index c80529a62b97..73027335446e 100644
--- a/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
@@ -1,3 +1,9 @@
// SPDX-License-Identifier: GPL-2.0+
#include "rk3399-roc-pc-u-boot.dtsi"
+
+&usbdrd_dwc3_0 {
+ dr_mode = "otg";
+ role-switch-default-mode = "peripheral";
+ usb-role-switch;
+};
diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index 6ef447e0e715..127b71e97917 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -36,6 +36,7 @@ CONFIG_CMD_BOOTZ=y
CONFIG_CMD_GPT=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_TIME=y
CONFIG_SPL_OF_CONTROL=y
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 5/5] rockchip: roc-pc-rk3399: Enable redundant environment
2026-07-22 1:36 [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Fabio Estevam via U-Boot
` (2 preceding siblings ...)
2026-07-22 1:36 ` [PATCH v2 4/5] rockchip: rk3399: Enable UMS on ROC-PC-PLUS Fabio Estevam via U-Boot
@ 2026-07-22 1:36 ` Fabio Estevam via U-Boot
2026-07-22 14:12 ` Quentin Schulz via U-Boot
2026-07-22 10:52 ` [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Quentin Schulz via U-Boot
4 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam via U-Boot @ 2026-07-22 1:36 UTC (permalink / raw)
To: u-boot; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
From: Fabio Estevam <festevam@nabladev.com>
Use the final 64 KiB of the first 4 MiB of SPI NOR for two 32 KiB
U-Boot environment copies. Place the primary copy at 0x3f0000 and
the redundant copy at 0x3f8000.
Both copies are aligned to the 4 KiB erase-sector size and together
occupy 0x3f0000 through 0x3fffff. Redundancy protects the environment
against power loss or an interrupted update.
Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
Changes since v1:
- Improved the commit log.
configs/roc-pc-rk3399_defconfig | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index 127b71e97917..8ded89c6388b 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -7,7 +7,7 @@ CONFIG_SPL_I2C=y
CONFIG_NR_DRAM_BANKS=1
CONFIG_SF_DEFAULT_SPEED=30000000
CONFIG_ENV_SIZE=0x8000
-CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ENV_OFFSET=0x3F0000
CONFIG_ENV_SECT_SIZE=0x1000
CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3399-roc-pc"
CONFIG_OF_LIST="rockchip/rk3399-roc-pc rockchip/rk3399-roc-pc-plus"
@@ -19,6 +19,7 @@ CONFIG_SYS_LOAD_ADDR=0x800800
CONFIG_SF_DEFAULT_BUS=1
CONFIG_DEBUG_UART_BASE=0xFF1A0000
CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_ENV_OFFSET_REDUND=0x3F8000
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_DEBUG_UART=y
@@ -42,6 +43,7 @@ CONFIG_CMD_TIME=y
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_REDUNDANT=y
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C
2026-07-22 1:36 [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Fabio Estevam via U-Boot
` (3 preceding siblings ...)
2026-07-22 1:36 ` [PATCH v2 5/5] rockchip: roc-pc-rk3399: Enable redundant environment Fabio Estevam via U-Boot
@ 2026-07-22 10:52 ` Quentin Schulz via U-Boot
4 siblings, 0 replies; 10+ messages in thread
From: Quentin Schulz via U-Boot @ 2026-07-22 10:52 UTC (permalink / raw)
To: Fabio Estevam
Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam, Vignesh R,
Takahiro Kuwano
+Cc SPI-NOR maintainer and reviewer
On 7/22/26 3:36 AM, Fabio Estevam via U-Boot wrote:
> From: Fabio Estevam <festevam@nabladev.com>
>
> Add the JEDEC ID for the XMC XM25QH128C SPI NOR flash.
>
> This is a 128Mbit device using 64KiB sectors and supporting 4KiB
> erase, dual read and quad read, matching the other XM25QH128 variants.
>
> Signed-off-by: Fabio Estevam <festevam@nabladev.com>
> ---
> Changes since v1:
> - None.
>
> drivers/mtd/spi/spi-nor-ids.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
> index 31a2ba49a87c..90aa1025176c 100644
> --- a/drivers/mtd/spi/spi-nor-ids.c
> +++ b/drivers/mtd/spi/spi-nor-ids.c
> @@ -673,6 +673,7 @@ const struct flash_info spi_nor_ids[] = {
> { INFO("XM25QH64A", 0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> { INFO("XM25QH64C", 0x204017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> { INFO("XM25QH128A", 0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> + { INFO("XM25QH128C", 0x204018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> { INFO("XM25QU128C", 0x204118, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> { INFO("XM25QH256C", 0x204019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
> { INFO("XM25QU256C", 0x204119, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 2/5] rockchip: rk3399: Remove ROC-PC regulator overrides
2026-07-22 1:36 ` [PATCH v2 2/5] rockchip: rk3399: Remove ROC-PC regulator overrides Fabio Estevam via U-Boot
@ 2026-07-22 13:53 ` Quentin Schulz via U-Boot
0 siblings, 0 replies; 10+ messages in thread
From: Quentin Schulz via U-Boot @ 2026-07-22 13:53 UTC (permalink / raw)
To: Fabio Estevam; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
Hi Fabio,
On 7/22/26 3:36 AM, Fabio Estevam via U-Boot wrote:
> From: Fabio Estevam <festevam@nabladev.com>
>
> The upstream devicetree already describes dc_12v as the output of the
> MP8859 regulator and drives the USB hub reset through the vcc5v0_host
> regulator pinctrl state.
>
> Remove the legacy fixed-regulator overrides and rely on the upstream
> regulator descriptions.
>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Thanks!
Quentin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/5] rockchip: rk3399: Add ROC-PC-PLUS board detection
2026-07-22 1:36 ` [PATCH v2 3/5] rockchip: rk3399: Add ROC-PC-PLUS board detection Fabio Estevam via U-Boot
@ 2026-07-22 14:07 ` Quentin Schulz via U-Boot
0 siblings, 0 replies; 10+ messages in thread
From: Quentin Schulz via U-Boot @ 2026-07-22 14:07 UTC (permalink / raw)
To: Fabio Estevam; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
Hi Fabio,
On 7/22/26 3:36 AM, Fabio Estevam via U-Boot wrote:
> From: Fabio Estevam <festevam@nabladev.com>
>
> The ROC-RK3399-PC has an MP8859 regulator on I2C7 at address 0x66,
> while the ROC-RK3399-PC-PLUS does not. Probe for the regulator in SPL
The ROC-RK3399-PC-Pro also doesn't have one, so we'll need to figure out
a way to differentiate them too (the day someone upstreams support for
it :), we don't need to think about it today fortunately).
> and use the result to select the matching devicetree from the U-Boot
> FIT. Fall back to the original board if the I2C bus cannot be probed.
>
> Build both devicetrees from the existing roc-pc-rk3399_defconfig and
> enable the XMC SPI NOR driver used by the Plus variant. Set fdtfile
> from the selected U-Boot devicetree so the matching Linux devicetree
> is used as well.
>
> Signed-off-by: Fabio Estevam <festevam@nabladev.com>
> ---
> Changes since v1:
> - Added run-time board time detection.
>
> arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi | 3 ++
> arch/arm/dts/rk3399-roc-pc-u-boot.dtsi | 8 +++++
> board/firefly/roc-pc-rk3399/roc-pc-rk3399.c | 37 +++++++++++++++++++++
> configs/roc-pc-rk3399_defconfig | 3 ++
> doc/board/rockchip/rockchip.rst | 2 +-
> 5 files changed, 52 insertions(+), 1 deletion(-)
> create mode 100644 arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
>
> diff --git a/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
> new file mode 100644
> index 000000000000..c80529a62b97
> --- /dev/null
> +++ b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
> @@ -0,0 +1,3 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
> +#include "rk3399-roc-pc-u-boot.dtsi"
> diff --git a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
> index a85e9549c83e..e7e4a2c89072 100644
> --- a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
> @@ -12,6 +12,14 @@
> };
> };
>
> +&i2c7 {
> + bootph-pre-ram;
> +};
> +
> +&i2c7_xfer {
> + bootph-pre-ram;
> +};
> +
> &gpio4 {
> bootph-pre-ram;
> };
> diff --git a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
> index 6937a27176f9..60a3ba43cdbd 100644
> --- a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
> +++ b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
> @@ -5,14 +5,24 @@
>
> #include <dm.h>
> #include <env.h>
> +#include <fdtdec.h>
> +#include <i2c.h>
> +#include <image.h>
> #include <log.h>
> #include <spl_gpio.h>
> +#include <asm/global_data.h>
> #include <asm/io.h>
>
> #include <asm/arch-rockchip/cru.h>
> #include <asm/arch-rockchip/gpio.h>
> #include <asm/arch-rockchip/grf_rk3399.h>
>
> +#define ROC_PC_MP8859_BUS "i2c@ff160000"
> +#define ROC_PC_MP8859_ADDR 0x66
> +#define ROC_PC_PLUS_FDTFILE "rockchip/rk3399-roc-pc-plus.dtb"
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> #ifdef CONFIG_XPL_BUILD
>
> #define PMUGRF_BASE 0xff320000
> @@ -54,4 +64,31 @@ void led_setup(void)
> spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1);
> }
>
> +static bool is_roc_pc_plus(void)
> +{
> + struct udevice *bus, *dev;
> +
> + if (uclass_get_device_by_name(UCLASS_I2C, ROC_PC_MP8859_BUS, &bus))
> + return false;
> +
> + return dm_i2c_probe(bus, ROC_PC_MP8859_ADDR, 0, &dev);
> +}
> +
> +int board_fit_config_name_match(const char *name)
> +{
> + if (is_roc_pc_plus())
> + return strcmp(name, ROC_PC_PLUS_FDTFILE);
> +
> + return strcmp(name, CONFIG_DEFAULT_FDT_FILE);
> +}
> +
> #endif
> +
> +int rk_board_late_init(void)
> +{
> + if (!fdt_node_check_compatible(gd->fdt_blob, 0,
> + "firefly,roc-rk3399-pc-plus"))
> + env_set("fdtfile", ROC_PC_PLUS_FDTFILE);
include/configs/rk3399_common.h sets fdtfile to CONFIG_DEFAULT_FDT_FILE
(which is rockchip/rk3399-roc-pc.dtb for
configs/roc-pc-rk3399_defconfig) by default so *not* setting it for the
roc-rk3399-pc case means it'll use the default. We just hope someone
doesn't save the environment on e.g. an SD card when having booted from
a ROC-RK3399-PC-Plus and then insert it in a ROC-RK3399-PC... so maybe
really set fdtfile for the roc-rk3399-pc case. What do you think?
Looks good to me otherwise, thanks!
Quentin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 5/5] rockchip: roc-pc-rk3399: Enable redundant environment
2026-07-22 1:36 ` [PATCH v2 5/5] rockchip: roc-pc-rk3399: Enable redundant environment Fabio Estevam via U-Boot
@ 2026-07-22 14:12 ` Quentin Schulz via U-Boot
0 siblings, 0 replies; 10+ messages in thread
From: Quentin Schulz via U-Boot @ 2026-07-22 14:12 UTC (permalink / raw)
To: Fabio Estevam; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
Hi Fabio,
On 7/22/26 3:36 AM, Fabio Estevam via U-Boot wrote:
> From: Fabio Estevam <festevam@nabladev.com>
>
> Use the final 64 KiB of the first 4 MiB of SPI NOR for two 32 KiB
> U-Boot environment copies. Place the primary copy at 0x3f0000 and
> the redundant copy at 0x3f8000.
>
Why do we need to move primary? Forgot to ask in v1 :)
This is fine otherwise, just being curious.
Thanks!
Quentin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/5] rockchip: rk3399: Enable UMS on ROC-PC-PLUS
2026-07-22 1:36 ` [PATCH v2 4/5] rockchip: rk3399: Enable UMS on ROC-PC-PLUS Fabio Estevam via U-Boot
@ 2026-07-22 15:01 ` Quentin Schulz via U-Boot
0 siblings, 0 replies; 10+ messages in thread
From: Quentin Schulz via U-Boot @ 2026-07-22 15:01 UTC (permalink / raw)
To: Fabio Estevam; +Cc: djw, sjg, kever.yang, u-boot, trini, Fabio Estevam
Hi Fabio,
On 7/22/26 3:36 AM, Fabio Estevam via U-Boot wrote:
> From: Fabio Estevam <festevam@nabladev.com>
>
> Describe the USB3 OTG controller as a USB role switch and make
> peripheral mode the default when no external role provider has selected
> host mode. This retains OTG operation and both PHYs inherited from the
> SoC devicetree.
>
> Enable the ums command so the onboard eMMC can be exposed as USB mass
> storage to a host.
>
> Signed-off-by: Fabio Estevam <festevam@nabladev.com>
> ---
> Changes since v1:
> - Add the same OTG description as submitted upstream:
> https://lore.kernel.org/linux-arm-kernel/20260721030043.84691-1-festevam@gmail.com/
>
Thank you for sending this to the Linux kernel ML!
> arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi | 6 ++++++
> configs/roc-pc-rk3399_defconfig | 1 +
> 2 files changed, 7 insertions(+)
>
> diff --git a/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
> index c80529a62b97..73027335446e 100644
> --- a/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi
> @@ -1,3 +1,9 @@
> // SPDX-License-Identifier: GPL-2.0+
>
> #include "rk3399-roc-pc-u-boot.dtsi"
> +
> +&usbdrd_dwc3_0 {
> + dr_mode = "otg";
> + role-switch-default-mode = "peripheral";
> + usb-role-switch;
> +};
Since this is not an important bug fix, I would prefer we wait it
appears in devicetree-rebasing and cherry-pick then.
If there's a v3 (please note this series here is actually v3, you forgot
to bump the version :) ), please drop it.
Cheers,
Quentin
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-07-22 15:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 1:36 [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Fabio Estevam via U-Boot
2026-07-22 1:36 ` [PATCH v2 2/5] rockchip: rk3399: Remove ROC-PC regulator overrides Fabio Estevam via U-Boot
2026-07-22 13:53 ` Quentin Schulz via U-Boot
2026-07-22 1:36 ` [PATCH v2 3/5] rockchip: rk3399: Add ROC-PC-PLUS board detection Fabio Estevam via U-Boot
2026-07-22 14:07 ` Quentin Schulz via U-Boot
2026-07-22 1:36 ` [PATCH v2 4/5] rockchip: rk3399: Enable UMS on ROC-PC-PLUS Fabio Estevam via U-Boot
2026-07-22 15:01 ` Quentin Schulz via U-Boot
2026-07-22 1:36 ` [PATCH v2 5/5] rockchip: roc-pc-rk3399: Enable redundant environment Fabio Estevam via U-Boot
2026-07-22 14:12 ` Quentin Schulz via U-Boot
2026-07-22 10:52 ` [PATCH v2 1/5] mtd: spi-nor-ids: Add XMC XM25QH128C Quentin Schulz via U-Boot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.