* [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot
@ 2026-08-17 9:31 Linus Walleij
2026-08-17 9:31 ` [PATCH v2 1/8] pinctrl: Add compact Nomadik pin controller Linus Walleij
` (7 more replies)
0 siblings, 8 replies; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
Switch the U8500 Stemmy configuration to the upstream Samsung Janice
device tree and enable booting an EFI system from the external SD card.
Add compact DB8500 pinctrl support for applying the default states from
the upstream device trees. Extend the PL180 driver to configure Ux500
signal direction and the SD card supply voltages.
The upstream device trees describe the SD card supplies through the
AB8500 or AB8505 PMIC. Add support for the AUX3 regulator used as
vmmc-supply, using the existing AB8500 PMIC driver for register access.
Enable fixed regulators for the vqmmc level shifters used on the other
supported Samsung boards.
Add a U-Boot overlay for Golden's duplicate regulator names.
The same support is intended for the Codina, Codina TMO, Gavini, Golden,
Kyle and Skomer device trees, while Janice remains the default for now.
This has been tested successfully to boot PostmarketOS using the EFI
boot flow, with some minimal changes to the PostmarketOS to use
systemd-boot and compile in the right kernel configs.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
Changes in v2:
- Use the new mailing list address, no other changes.
- Link to v1: https://patch.msgid.link/20260817-ux500-external-sdcard-v1-0-ce1a2d3aa91d@kernel.org
---
Linus Walleij (8):
pinctrl: Add compact Nomadik pin controller
mmc: arm_pl180: Configure Ux500 signal direction
mmc: arm_pl180: Set initial supply voltages
power: regulator: Add AB8500 AUX3 support
configs: stemmy: Enable SD card regulators
configs: stemmy: Boot EFI from external SD card
arm: u8500: Switch Stemmy to upstream Janice device tree
arm: u8500: Give Golden panel regulators unique names
MAINTAINERS | 2 +
arch/arm/Kconfig | 5 +
arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi | 11 +
arch/arm/dts/u8500-u-boot.dtsi | 20 ++
configs/stemmy_defconfig | 8 +-
drivers/mmc/arm_pl180_mmci.c | 47 +++++
drivers/pinctrl/Kconfig | 7 +
drivers/pinctrl/Makefile | 1 +
drivers/pinctrl/pinctrl-nomadik.c | 235 ++++++++++++++++++++++
drivers/power/pmic/ab8500.c | 1 +
drivers/power/regulator/Kconfig | 7 +
drivers/power/regulator/Makefile | 1 +
drivers/power/regulator/ab8500.c | 111 ++++++++++
13 files changed, 453 insertions(+), 3 deletions(-)
---
base-commit: 0b581a9612e46310ee52bf8359165950d38b2a2b
change-id: 20260813-ux500-external-sdcard-a49778d77b21
Best regards,
--
Linus Walleij <linusw@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 1/8] pinctrl: Add compact Nomadik pin controller
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
@ 2026-08-17 9:31 ` Linus Walleij
2026-08-17 15:57 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 2/8] mmc: arm_pl180: Configure Ux500 signal direction Linus Walleij
` (6 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
Add the minimal pin control support needed to consume default states from
the upstream DB8500 device trees. Resolve the nine Nomadik GPIO banks
through nomadik-gpio-chips and apply the mux, direction, value, pull and
low-EMI settings directly to their registers.
Only the DB8500 binding and default-state configuration needed by
U-Boot are supported. There is no GPIO ownership or sleep-state
handling.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
MAINTAINERS | 1 +
arch/arm/Kconfig | 2 +
drivers/pinctrl/Kconfig | 7 ++
drivers/pinctrl/Makefile | 1 +
drivers/pinctrl/pinctrl-nomadik.c | 235 ++++++++++++++++++++++++++++++++++++++
5 files changed, 246 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index eb48eea55c5a..a5d6b5be29dc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -787,6 +787,7 @@ S: Maintained
F: arch/arm/dts/ste-*
F: arch/arm/mach-u8500/
F: drivers/gpio/nmk_gpio.c
+F: drivers/pinctrl/pinctrl-nomadik.c
F: drivers/phy/phy-ab8500-usb.c
F: drivers/power/pmic/ab8500.c
F: drivers/timer/nomadik-mtu-timer.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1b474a346bf2..5b02ff18bd0e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1278,6 +1278,8 @@ config ARCH_U8500
imply DM_RTC
imply NOMADIK_GPIO
imply NOMADIK_MTU_TIMER
+ imply PINCTRL
+ imply PINCTRL_NOMADIK
imply PHY
imply PL01X_SERIAL
imply PMIC_AB8500
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index fd30aaeeaa89..04785a927fec 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -75,6 +75,13 @@ config PINCONF_RECURSIVE
configuration; you can save memory footprint when this feature is
no needed.
+config PINCTRL_NOMADIK
+ bool "Nomadik pin control driver"
+ depends on PINCTRL_FULL
+ help
+ Enable pin multiplexing and configuration support for the Nomadik
+ GPIO blocks in the ST-Ericsson DB8500.
+
config SPL_PINCTRL
bool "Support pin controllers in SPL"
depends on SPL && SPL_DM
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index 91149796bb5f..23219626e392 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_PINCTRL_K210) += pinctrl-k210.o
obj-$(CONFIG_PINCTRL_MESON) += meson/
obj-$(CONFIG_PINCTRL_MSCC) += mscc/
obj-$(CONFIG_PINCTRL_MTK) += mediatek/
+obj-$(CONFIG_PINCTRL_NOMADIK) += pinctrl-nomadik.o
obj-$(CONFIG_PINCTRL_PIC32) += pinctrl_pic32.o
obj-$(CONFIG_PINCTRL_QCOM) += qcom/
obj-$(CONFIG_PINCTRL_QE) += pinctrl-qe-io.o
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
new file mode 100644
index 000000000000..56ec7edcca48
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -0,0 +1,235 @@
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (C) 2026 Linus Walleij <linusw@kernel.org> */
+
+#include <dm.h>
+#include <dm/pinctrl.h>
+#include <vsprintf.h>
+#include <asm/io.h>
+
+#define NMK_GPIO_BANKS 9
+#define NMK_GPIO_PER_BANK 32
+
+#define NMK_INPUT_NOPULL 0
+#define NMK_INPUT_PULLUP 1
+#define NMK_INPUT_PULLDOWN 2
+#define NMK_OUTPUT_LOW 0
+#define NMK_OUTPUT_HIGH 1
+
+struct nmk_gpio_regs {
+ u32 dat;
+ u32 dats;
+ u32 datc;
+ u32 pdis;
+ u32 dir;
+ u32 dirs;
+ u32 dirc;
+ u32 slpm;
+ u32 afsla;
+ u32 afslb;
+ u32 lowemi;
+};
+
+struct nmk_pinctrl_priv {
+ struct nmk_gpio_regs *bank[NMK_GPIO_BANKS];
+};
+
+enum nmk_alt {
+ NMK_ALT_GPIO,
+ NMK_ALT_A,
+ NMK_ALT_B,
+ NMK_ALT_C,
+};
+
+static int nmk_pinctrl_parse_pin(const char *name, unsigned int *pin)
+{
+ char *end;
+
+ if (strncmp(name, "GPIO", 4))
+ return -EINVAL;
+
+ *pin = dectoul(name + 4, &end);
+ if (end == name + 4 || *end != '_' ||
+ *pin >= NMK_GPIO_BANKS * NMK_GPIO_PER_BANK)
+ return -EINVAL;
+
+ return 0;
+}
+
+static struct nmk_gpio_regs *
+nmk_pinctrl_bank(struct udevice *dev, unsigned int pin)
+{
+ struct nmk_pinctrl_priv *priv = dev_get_priv(dev);
+
+ return priv->bank[pin / NMK_GPIO_PER_BANK];
+}
+
+static void nmk_pinctrl_set_mux(struct udevice *dev, unsigned int pin,
+ unsigned int alt)
+{
+ struct nmk_gpio_regs *regs = nmk_pinctrl_bank(dev, pin);
+ u32 mask = BIT(pin % NMK_GPIO_PER_BANK);
+ u32 val;
+
+ val = readl(®s->afsla);
+ if (alt & NMK_ALT_A)
+ val |= mask;
+ else
+ val &= ~mask;
+ writel(val, ®s->afsla);
+
+ val = readl(®s->afslb);
+ if (alt & NMK_ALT_B)
+ val |= mask;
+ else
+ val &= ~mask;
+ writel(val, ®s->afslb);
+}
+
+static int nmk_pinctrl_set_config(struct udevice *dev, ofnode node,
+ unsigned int pin)
+{
+ struct nmk_gpio_regs *regs = nmk_pinctrl_bank(dev, pin);
+ u32 mask = BIT(pin % NMK_GPIO_PER_BANK);
+ u32 val;
+
+ if (!ofnode_read_u32(node, "ste,input", &val)) {
+ writel(mask, ®s->dirc);
+ if (val == NMK_INPUT_NOPULL) {
+ setbits_le32(®s->pdis, mask);
+ } else {
+ clrbits_le32(®s->pdis, mask);
+ if (val == NMK_INPUT_PULLUP)
+ writel(mask, ®s->dats);
+ else if (val == NMK_INPUT_PULLDOWN)
+ writel(mask, ®s->datc);
+ else
+ return -EINVAL;
+ }
+ }
+
+ if (!ofnode_read_u32(node, "ste,output", &val)) {
+ if (val == NMK_OUTPUT_HIGH)
+ writel(mask, ®s->dats);
+ else if (val == NMK_OUTPUT_LOW)
+ writel(mask, ®s->datc);
+ else
+ return -EINVAL;
+ writel(mask, ®s->dirs);
+ }
+
+ if (!ofnode_read_u32(node, "ste,lowemi", &val)) {
+ if (val)
+ setbits_le32(®s->lowemi, mask);
+ else
+ clrbits_le32(®s->lowemi, mask);
+ }
+
+ return 0;
+}
+
+static int nmk_pinctrl_get_alt(ofnode node, unsigned int *alt)
+{
+ const char *group;
+
+ if (ofnode_read_string_index(node, "groups", 0, &group))
+ return -EINVAL;
+
+ if (strstr(group, "_a_"))
+ *alt = NMK_ALT_A;
+ else if (strstr(group, "_b_"))
+ *alt = NMK_ALT_B;
+ else if (strstr(group, "_c_"))
+ *alt = NMK_ALT_C;
+ else
+ return -EINVAL;
+
+ return 0;
+}
+
+static int nmk_pinctrl_set_state(struct udevice *dev, struct udevice *config)
+{
+ unsigned int alt = NMK_ALT_GPIO;
+ ofnode node;
+ int count;
+ int ret;
+ int i;
+
+ dev_for_each_subnode(node, config) {
+ if (ofnode_read_string(node, "function")) {
+ ret = nmk_pinctrl_get_alt(node, &alt);
+ if (ret)
+ return ret;
+ }
+ }
+
+ dev_for_each_subnode(node, config) {
+ ofnode cfg;
+
+ count = ofnode_read_string_count(node, "pins");
+ if (count < 0)
+ continue;
+
+ cfg = ofnode_parse_phandle(node, "ste,config", 0);
+ if (!ofnode_valid(cfg))
+ cfg = node;
+
+ for (i = 0; i < count; i++) {
+ const char *name;
+ unsigned int pin;
+
+ ret = ofnode_read_string_index(node, "pins", i, &name);
+ if (ret)
+ return ret;
+ ret = nmk_pinctrl_parse_pin(name, &pin);
+ if (ret)
+ return ret;
+ ret = nmk_pinctrl_set_config(dev, cfg, pin);
+ if (ret)
+ return ret;
+ nmk_pinctrl_set_mux(dev, pin, alt);
+ }
+ }
+
+ return 0;
+}
+
+static int nmk_pinctrl_probe(struct udevice *dev)
+{
+ struct nmk_pinctrl_priv *priv = dev_get_priv(dev);
+ struct ofnode_phandle_args args;
+ fdt_addr_t addr;
+ int ret;
+ int i;
+
+ for (i = 0; i < NMK_GPIO_BANKS; i++) {
+ ret = dev_read_phandle_with_args(dev, "nomadik-gpio-chips",
+ NULL, 0, i, &args);
+ if (ret)
+ return ret;
+
+ addr = ofnode_get_addr(args.node);
+ if (addr == FDT_ADDR_T_NONE)
+ return -EINVAL;
+ priv->bank[i] = (struct nmk_gpio_regs *)addr;
+ }
+
+ return 0;
+}
+
+static const struct pinctrl_ops nmk_pinctrl_ops = {
+ .set_state = nmk_pinctrl_set_state,
+};
+
+static const struct udevice_id nmk_pinctrl_ids[] = {
+ { .compatible = "stericsson,db8500-pinctrl" },
+ { }
+};
+
+U_BOOT_DRIVER(pinctrl_nomadik) = {
+ .name = "pinctrl_nomadik",
+ .id = UCLASS_PINCTRL,
+ .of_match = nmk_pinctrl_ids,
+ .probe = nmk_pinctrl_probe,
+ .priv_auto = sizeof(struct nmk_pinctrl_priv),
+ .ops = &nmk_pinctrl_ops,
+};
--
2.55.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 2/8] mmc: arm_pl180: Configure Ux500 signal direction
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
2026-08-17 9:31 ` [PATCH v2 1/8] pinctrl: Add compact Nomadik pin controller Linus Walleij
@ 2026-08-17 9:31 ` Linus Walleij
2026-08-17 15:59 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 3/8] mmc: arm_pl180: Set initial supply voltages Linus Walleij
` (5 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
The Ux500 MMCI variant can control external level-shifter signal
directions through the power register. Parse the standard ST MMCI
device tree properties and set the corresponding direction and
feedback-clock bits.
This is required by the external SD card slot on Samsung Janice, where
commands cannot reach the card unless the direction controls are set.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
drivers/mmc/arm_pl180_mmci.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index f00b0ff0dc95..af21b814641e 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -427,6 +427,19 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
host->version2 = false; /* ARM variant */
}
+ if (dev_read_bool(dev, "st,sig-dir-dat0"))
+ host->pwr_init |= SDI_PWR_DAT0DIREN;
+ if (dev_read_bool(dev, "st,sig-dir-dat2"))
+ host->pwr_init |= SDI_PWR_DAT2DIREN;
+ if (dev_read_bool(dev, "st,sig-dir-dat31"))
+ host->pwr_init |= SDI_PWR_DAT31DIREN;
+ if (dev_read_bool(dev, "st,sig-dir-dat74"))
+ host->pwr_init |= SDI_PWR_DAT74DIREN;
+ if (dev_read_bool(dev, "st,sig-dir-cmd"))
+ host->pwr_init |= SDI_PWR_CMDDIREN;
+ if (dev_read_bool(dev, "st,sig-pin-fbclk"))
+ host->pwr_init |= SDI_PWR_FBCLKEN;
+
gpio_request_by_name(dev, "cd-gpios", 0, &host->cd_gpio, GPIOD_IS_IN);
ret = mmc_of_parse(dev, cfg);
--
2.55.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 3/8] mmc: arm_pl180: Set initial supply voltages
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
2026-08-17 9:31 ` [PATCH v2 1/8] pinctrl: Add compact Nomadik pin controller Linus Walleij
2026-08-17 9:31 ` [PATCH v2 2/8] mmc: arm_pl180: Configure Ux500 signal direction Linus Walleij
@ 2026-08-17 9:31 ` Linus Walleij
2026-08-17 16:15 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 4/8] power: regulator: Add AB8500 AUX3 support Linus Walleij
` (4 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
Obtain the optional vmmc and vqmmc regulators and configure them for
the normal SD voltage range before card initialization.
The Ux500 boards supply their SD cards from AB8500 or AB8505 AUX3,
whose highest voltage selector is 2.91 V. Request that exact voltage
for the Ux500 MMCI variant while retaining the normal 3.3 V target for
other PL180 implementations.
Ignore the unsupported set-value operation for fixed regulators; their
voltage is already described by their fixed constraints.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
drivers/mmc/arm_pl180_mmci.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index af21b814641e..654608b7e74c 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -16,6 +16,7 @@
#include <log.h>
#include <malloc.h>
#include <mmc.h>
+#include <power/regulator.h>
#include <dm/device_compat.h>
#include <dm.h>
@@ -28,11 +29,22 @@
#define MMC_CLOCK_MAX 48000000
#define MMC_CLOCK_MIN 400000
+#define SD_VOLTAGE_MIN_UV 2700000
+#define SD_VOLTAGE_UV 3300000
+#define SD_VOLTAGE_MAX_UV 3600000
+#define UX500_SD_VOLTAGE_UV 2910000
+
struct arm_pl180_mmc_plat {
struct mmc_config cfg;
struct mmc mmc;
};
+static int arm_pl180_set_supply_voltage(struct udevice *supply, int target_uV)
+{
+ return regulator_set_value_clamp(supply, SD_VOLTAGE_MIN_UV,
+ target_uV, SD_VOLTAGE_MAX_UV);
+}
+
static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd)
{
u32 hoststatus, statusmask;
@@ -385,6 +397,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
struct pl180_mmc_host *host = dev_get_priv(dev);
struct mmc_config *cfg = &pdata->cfg;
struct clk clk;
+ int supply_uV = SD_VOLTAGE_UV;
u32 periphid;
int ret;
@@ -422,6 +435,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
cfg->voltages = VOLTAGE_WINDOW_MMC;
cfg->f_min = host->clock_in / (2 + SDI_CLKCR_CLKDIV_INIT_V2);
host->version2 = true;
+ supply_uV = UX500_SD_VOLTAGE_UV;
break;
default:
host->version2 = false; /* ARM variant */
@@ -440,6 +454,26 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
if (dev_read_bool(dev, "st,sig-pin-fbclk"))
host->pwr_init |= SDI_PWR_FBCLKEN;
+ if (CONFIG_IS_ENABLED(DM_REGULATOR)) {
+ ret = device_get_supply_regulator(dev, "vmmc-supply",
+ &mmc->vmmc_supply);
+ if (!ret) {
+ ret = arm_pl180_set_supply_voltage(mmc->vmmc_supply,
+ supply_uV);
+ if (ret && ret != -ENOSYS)
+ return ret;
+ }
+
+ ret = device_get_supply_regulator(dev, "vqmmc-supply",
+ &mmc->vqmmc_supply);
+ if (!ret) {
+ ret = arm_pl180_set_supply_voltage(mmc->vqmmc_supply,
+ supply_uV);
+ if (ret && ret != -ENOSYS)
+ return ret;
+ }
+ }
+
gpio_request_by_name(dev, "cd-gpios", 0, &host->cd_gpio, GPIOD_IS_IN);
ret = mmc_of_parse(dev, cfg);
--
2.55.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 4/8] power: regulator: Add AB8500 AUX3 support
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
` (2 preceding siblings ...)
2026-08-17 9:31 ` [PATCH v2 3/8] mmc: arm_pl180: Set initial supply voltages Linus Walleij
@ 2026-08-17 9:31 ` Linus Walleij
2026-08-17 16:21 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 5/8] configs: stemmy: Enable SD card regulators Linus Walleij
` (3 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
Add regulator support for LDO AUX3 on AB8500 and AB8505 PMICs.
AUX3 supplies the removable SD card on the upstream Ux500 Samsung
device trees, and both PMIC variants use the same control registers.
Imply the regulator core for ARCH_U8500 so the driver can instantiate
from the upstream device trees.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
MAINTAINERS | 1 +
arch/arm/Kconfig | 2 +
drivers/power/pmic/ab8500.c | 1 +
drivers/power/regulator/Kconfig | 7 +++
drivers/power/regulator/Makefile | 1 +
drivers/power/regulator/ab8500.c | 111 +++++++++++++++++++++++++++++++++++++++
6 files changed, 123 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index a5d6b5be29dc..8e78a7f224fa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -790,6 +790,7 @@ F: drivers/gpio/nmk_gpio.c
F: drivers/pinctrl/pinctrl-nomadik.c
F: drivers/phy/phy-ab8500-usb.c
F: drivers/power/pmic/ab8500.c
+F: drivers/power/regulator/ab8500.c
F: drivers/timer/nomadik-mtu-timer.c
F: drivers/usb/musb-new/ux500.c
F: drivers/video/mcde_simple.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5b02ff18bd0e..62aa9e8cc565 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1275,6 +1275,7 @@ config ARCH_U8500
imply ARM_PL180_MMCI
imply CLK
imply DM_PMIC
+ imply DM_REGULATOR
imply DM_RTC
imply NOMADIK_GPIO
imply NOMADIK_MTU_TIMER
@@ -1283,6 +1284,7 @@ config ARCH_U8500
imply PHY
imply PL01X_SERIAL
imply PMIC_AB8500
+ imply REGULATOR_AB8500
imply RTC_PL031
imply SYS_THUMB_BUILD
imply SYSRESET_SYSCON
diff --git a/drivers/power/pmic/ab8500.c b/drivers/power/pmic/ab8500.c
index 9ba096711e14..b9fae7000b78 100644
--- a/drivers/power/pmic/ab8500.c
+++ b/drivers/power/pmic/ab8500.c
@@ -253,6 +253,7 @@ static int ab8500_probe(struct udevice *dev)
static const struct udevice_id ab8500_ids[] = {
{ .compatible = "stericsson,ab8500" },
+ { .compatible = "stericsson,ab8505" },
{ }
};
diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index 00a25acfdf99..a27fe4925cf9 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -16,6 +16,13 @@ config DM_REGULATOR
for this purpose if PMIC I/O driver is implemented or dm_scan_fdt_dev()
otherwise. Detailed information can be found in the header file.
+config REGULATOR_AB8500
+ bool "ST-Ericsson AB8500/AB8505 regulator support"
+ depends on DM_REGULATOR && PMIC_AB8500
+ help
+ Enable LDO AUX3 regulator support for AB8500 and AB8505 PMICs.
+ This supply is used to power removable SD cards on Ux500 boards.
+
config SPL_DM_REGULATOR
bool "Enable regulators for SPL"
depends on DM_REGULATOR && SPL_POWER
diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
index a40c9d340d98..a500a3da98d4 100644
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -5,6 +5,7 @@
#
obj-$(CONFIG_$(PHASE_)DM_REGULATOR) += regulator-uclass.o
+obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
obj-$(CONFIG_REGULATOR_AS3722) += as3722_regulator.o
obj-$(CONFIG_$(PHASE_)REGULATOR_AXP) += axp_regulator.o
diff --git a/drivers/power/regulator/ab8500.c b/drivers/power/regulator/ab8500.c
new file mode 100644
index 000000000000..03beb0834d53
--- /dev/null
+++ b/drivers/power/regulator/ab8500.c
@@ -0,0 +1,111 @@
+// SPDX-License-Identifier: GPL-2.0+
+/* ST-Ericsson AB8500/AB8505 LDO AUX3 regulator */
+
+#include <dm.h>
+#include <dm/device-internal.h>
+#include <dm/lists.h>
+#include <linux/errno.h>
+#include <power/ab8500.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+
+#define AB8500_VAUX3_REGU AB8500_REGU_CTRL2(0x0a)
+#define AB8500_VAUX3_SEL AB8500_REGU_CTRL2(0x21)
+#define AB8500_VAUX3_EN_MASK GENMASK(1, 0)
+#define AB8500_VAUX3_EN BIT(0)
+#define AB8500_VAUX3_SEL_MASK GENMASK(2, 0)
+
+static const int ab8500_vaux3_voltages[] = {
+ 1200000, 1500000, 1800000, 2100000,
+ 2500000, 2750000, 2790000, 2910000,
+};
+
+static struct udevice *ab8500_regulator_pmic(struct udevice *dev)
+{
+ return dev->parent->parent;
+}
+
+static int ab8500_regulator_get_value(struct udevice *dev)
+{
+ int ret;
+
+ ret = pmic_reg_read(ab8500_regulator_pmic(dev), AB8500_VAUX3_SEL);
+ if (ret < 0)
+ return ret;
+ ret &= AB8500_VAUX3_SEL_MASK;
+
+ return ab8500_vaux3_voltages[ret];
+}
+
+static int ab8500_regulator_set_value(struct udevice *dev, int uV)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(ab8500_vaux3_voltages); i++) {
+ if (ab8500_vaux3_voltages[i] == uV)
+ return pmic_clrsetbits(ab8500_regulator_pmic(dev),
+ AB8500_VAUX3_SEL,
+ AB8500_VAUX3_SEL_MASK, i);
+ }
+
+ return -EINVAL;
+}
+
+static int ab8500_regulator_get_enable(struct udevice *dev)
+{
+ int ret;
+
+ ret = pmic_reg_read(ab8500_regulator_pmic(dev), AB8500_VAUX3_REGU);
+ if (ret < 0)
+ return ret;
+
+ return (ret & AB8500_VAUX3_EN_MASK) == AB8500_VAUX3_EN;
+}
+
+static int ab8500_regulator_set_enable(struct udevice *dev, bool enable)
+{
+ return pmic_clrsetbits(ab8500_regulator_pmic(dev), AB8500_VAUX3_REGU,
+ AB8500_VAUX3_EN_MASK,
+ enable ? AB8500_VAUX3_EN : 0);
+}
+
+static const struct dm_regulator_ops ab8500_regulator_ops = {
+ .get_value = ab8500_regulator_get_value,
+ .set_value = ab8500_regulator_set_value,
+ .get_enable = ab8500_regulator_get_enable,
+ .set_enable = ab8500_regulator_set_enable,
+};
+
+U_BOOT_DRIVER(ab8500_ldo_aux3) = {
+ .name = "ab8500_ldo_aux3",
+ .id = UCLASS_REGULATOR,
+ .ops = &ab8500_regulator_ops,
+};
+
+static int ab8500_regulators_bind(struct udevice *dev)
+{
+ struct driver *drv = lists_driver_lookup_name("ab8500_ldo_aux3");
+ ofnode node;
+
+ dev_for_each_subnode(node, dev) {
+ if (!strcmp(ofnode_get_name(node), "ab8500_ldo_aux3"))
+ return device_bind_with_driver_data(dev, drv,
+ ofnode_get_name(node), 0,
+ node, NULL);
+ }
+
+ return -ENODEV;
+}
+
+static const struct udevice_id ab8500_regulator_ids[] = {
+ { .compatible = "stericsson,ab8500-regulator" },
+ { .compatible = "stericsson,ab8505-regulator" },
+ { }
+};
+
+U_BOOT_DRIVER(ab8500_regulators) = {
+ .name = "ab8500_regulators",
+ .id = UCLASS_NOP,
+ .of_match = ab8500_regulator_ids,
+ .bind = ab8500_regulators_bind,
+};
--
2.55.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 5/8] configs: stemmy: Enable SD card regulators
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
` (3 preceding siblings ...)
2026-08-17 9:31 ` [PATCH v2 4/8] power: regulator: Add AB8500 AUX3 support Linus Walleij
@ 2026-08-17 9:31 ` Linus Walleij
2026-08-17 16:24 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 6/8] configs: stemmy: Boot EFI from external SD card Linus Walleij
` (2 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
Have ARCH_U8500 imply the fixed regulator driver needed by level
shifters on the supported boards. The architecture already enables the
regulator core and Nomadik GPIO driver.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
arch/arm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 62aa9e8cc565..2a01ac9b7675 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1276,6 +1276,7 @@ config ARCH_U8500
imply CLK
imply DM_PMIC
imply DM_REGULATOR
+ imply DM_REGULATOR_FIXED
imply DM_RTC
imply NOMADIK_GPIO
imply NOMADIK_MTU_TIMER
--
2.55.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 6/8] configs: stemmy: Boot EFI from external SD card
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
` (4 preceding siblings ...)
2026-08-17 9:31 ` [PATCH v2 5/8] configs: stemmy: Enable SD card regulators Linus Walleij
@ 2026-08-17 9:31 ` Linus Walleij
2026-08-17 16:29 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 7/8] arm: u8500: Switch Stemmy to upstream Janice device tree Linus Walleij
2026-08-17 9:31 ` [PATCH v2 8/8] arm: u8500: Give Golden panel regulators unique names Linus Walleij
7 siblings, 1 reply; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
Replace the fastboot-only command with standard bootflow scanning and
enable the EFI loader so the removable SD card can provide the default
ARM EFI executable. Filesystem probing is handled by the standard boot
framework and does not require the FAT command.
Disable mkeficapsule because generating capsule tools is unrelated to
running EFI payloads and adds a host GnuTLS build dependency.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
configs/stemmy_defconfig | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/configs/stemmy_defconfig b/configs/stemmy_defconfig
index 631ccababf1c..57e794c5c88b 100644
--- a/configs/stemmy_defconfig
+++ b/configs/stemmy_defconfig
@@ -14,10 +14,10 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x100000
CONFIG_DEFAULT_DEVICE_TREE="ste-ux500-samsung-stemmy"
CONFIG_SYS_BOOTM_LEN=0x4000000
CONFIG_SYS_LOAD_ADDR=0x100000
-# CONFIG_EFI_LOADER is not set
+CONFIG_BOOTSTD_FULL=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="run fastbootcmd"
+CONFIG_BOOTCOMMAND="bootflow scan -lb"
CONFIG_SYS_CBSIZE=256
CONFIG_SYS_PBSIZE=276
CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -43,3 +43,4 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x685d
CONFIG_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MCDE_SIMPLE=y
+# CONFIG_TOOLS_MKEFICAPSULE is not set
--
2.55.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 7/8] arm: u8500: Switch Stemmy to upstream Janice device tree
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
` (5 preceding siblings ...)
2026-08-17 9:31 ` [PATCH v2 6/8] configs: stemmy: Boot EFI from external SD card Linus Walleij
@ 2026-08-17 9:31 ` Linus Walleij
2026-08-17 16:45 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 8/8] arm: u8500: Give Golden panel regulators unique names Linus Walleij
7 siblings, 1 reply; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
Use the upstream Samsung Janice device tree as the initial target for
the Stemmy configuration. This also prepares the board to share the
upstream Ux500 Samsung device trees with Linux.
U-Boot does not yet implement the U8500 clock providers used by the
upstream device tree. Add a U-Boot-specific overlay with the known MTU
clock rate and a fixed input clock for the external SD controller.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
arch/arm/dts/u8500-u-boot.dtsi | 20 ++++++++++++++++++++
configs/stemmy_defconfig | 3 ++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/u8500-u-boot.dtsi b/arch/arm/dts/u8500-u-boot.dtsi
new file mode 100644
index 000000000000..41eaad7f78b9
--- /dev/null
+++ b/arch/arm/dts/u8500-u-boot.dtsi
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+/ {
+ /* FIXME: Remove this when the U8500 clock driver is implemented */
+ sdmmcclk: sdmmcclk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <100000000>;
+ };
+
+ soc {
+ mtu@a03c6000 {
+ clock-frequency = <133000000>;
+ };
+
+ mmc@80126000 {
+ clocks = <&sdmmcclk>;
+ };
+ };
+};
diff --git a/configs/stemmy_defconfig b/configs/stemmy_defconfig
index 57e794c5c88b..1f512416c9f4 100644
--- a/configs/stemmy_defconfig
+++ b/configs/stemmy_defconfig
@@ -11,7 +11,8 @@ CONFIG_SYS_MALLOC_F_LEN=0x400
CONFIG_NR_DRAM_BANKS=2
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x100000
-CONFIG_DEFAULT_DEVICE_TREE="ste-ux500-samsung-stemmy"
+CONFIG_DEFAULT_DEVICE_TREE="st/ste-ux500-samsung-janice"
+CONFIG_OF_UPSTREAM=y
CONFIG_SYS_BOOTM_LEN=0x4000000
CONFIG_SYS_LOAD_ADDR=0x100000
CONFIG_BOOTSTD_FULL=y
--
2.55.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 8/8] arm: u8500: Give Golden panel regulators unique names
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
` (6 preceding siblings ...)
2026-08-17 9:31 ` [PATCH v2 7/8] arm: u8500: Switch Stemmy to upstream Janice device tree Linus Walleij
@ 2026-08-17 9:31 ` Linus Walleij
2026-08-17 16:47 ` Stephan Gerhold
7 siblings, 1 reply; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 9:31 UTC (permalink / raw)
To: u-boot, Tom Rini, Stefan Hansson, Stephan Gerhold; +Cc: Linus Walleij
The Golden device tree gives both fixed panel supplies the same
regulator-name. U-Boot requires regulator names to be unique and aborts
driver-model initialization when binding the second supply.
Add a U-Boot overlay assigning distinct names to the 1.8 V and 3.0 V
supplies. Include the common U8500 overlay since a board-specific
overlay takes precedence over it.
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi b/arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi
new file mode 100644
index 000000000000..647b3f73c413
--- /dev/null
+++ b/arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "u8500-u-boot.dtsi"
+
+&panel_reg_1v8 {
+ regulator-name = "panel-fixed-supply-1v8";
+};
+
+&panel_reg_3v0 {
+ regulator-name = "panel-fixed-supply-3v0";
+};
--
2.55.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/8] pinctrl: Add compact Nomadik pin controller
2026-08-17 9:31 ` [PATCH v2 1/8] pinctrl: Add compact Nomadik pin controller Linus Walleij
@ 2026-08-17 15:57 ` Stephan Gerhold
0 siblings, 0 replies; 19+ messages in thread
From: Stephan Gerhold @ 2026-08-17 15:57 UTC (permalink / raw)
To: Linus Walleij; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 11:31:50AM +0200, Linus Walleij wrote:
> Add the minimal pin control support needed to consume default states from
> the upstream DB8500 device trees. Resolve the nine Nomadik GPIO banks
> through nomadik-gpio-chips and apply the mux, direction, value, pull and
> low-EMI settings directly to their registers.
>
> Only the DB8500 binding and default-state configuration needed by
> U-Boot are supported. There is no GPIO ownership or sleep-state
> handling.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
> ---
> MAINTAINERS | 1 +
> arch/arm/Kconfig | 2 +
> drivers/pinctrl/Kconfig | 7 ++
> drivers/pinctrl/Makefile | 1 +
> drivers/pinctrl/pinctrl-nomadik.c | 235 ++++++++++++++++++++++++++++++++++++++
> 5 files changed, 246 insertions(+)
>
> [....]
> diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
> new file mode 100644
> index 000000000000..56ec7edcca48
> --- /dev/null
> +++ b/drivers/pinctrl/pinctrl-nomadik.c
> @@ -0,0 +1,235 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/* Copyright (C) 2026 Linus Walleij <linusw@kernel.org> */
> +
> +#include <dm.h>
> +#include <dm/pinctrl.h>
> +#include <vsprintf.h>
> +#include <asm/io.h>
> +
> +#define NMK_GPIO_BANKS 9
> +#define NMK_GPIO_PER_BANK 32
> +
> +#define NMK_INPUT_NOPULL 0
> +#define NMK_INPUT_PULLUP 1
> +#define NMK_INPUT_PULLDOWN 2
> +#define NMK_OUTPUT_LOW 0
> +#define NMK_OUTPUT_HIGH 1
Can we somehow reuse the defines in
dts/upstream/include/dt-bindings/pinctrl/nomadik.h for this?
Looks fine to me otherwise!
Thanks,
Stephan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/8] mmc: arm_pl180: Configure Ux500 signal direction
2026-08-17 9:31 ` [PATCH v2 2/8] mmc: arm_pl180: Configure Ux500 signal direction Linus Walleij
@ 2026-08-17 15:59 ` Stephan Gerhold
0 siblings, 0 replies; 19+ messages in thread
From: Stephan Gerhold @ 2026-08-17 15:59 UTC (permalink / raw)
To: Linus Walleij; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 11:31:51AM +0200, Linus Walleij wrote:
> The Ux500 MMCI variant can control external level-shifter signal
> directions through the power register. Parse the standard ST MMCI
> device tree properties and set the corresponding direction and
> feedback-clock bits.
>
> This is required by the external SD card slot on Samsung Janice, where
> commands cannot reach the card unless the direction controls are set.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
> drivers/mmc/arm_pl180_mmci.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
> index f00b0ff0dc95..af21b814641e 100644
> --- a/drivers/mmc/arm_pl180_mmci.c
> +++ b/drivers/mmc/arm_pl180_mmci.c
> @@ -427,6 +427,19 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
> host->version2 = false; /* ARM variant */
> }
>
> + if (dev_read_bool(dev, "st,sig-dir-dat0"))
> + host->pwr_init |= SDI_PWR_DAT0DIREN;
> + if (dev_read_bool(dev, "st,sig-dir-dat2"))
> + host->pwr_init |= SDI_PWR_DAT2DIREN;
> + if (dev_read_bool(dev, "st,sig-dir-dat31"))
> + host->pwr_init |= SDI_PWR_DAT31DIREN;
> + if (dev_read_bool(dev, "st,sig-dir-dat74"))
> + host->pwr_init |= SDI_PWR_DAT74DIREN;
> + if (dev_read_bool(dev, "st,sig-dir-cmd"))
> + host->pwr_init |= SDI_PWR_CMDDIREN;
> + if (dev_read_bool(dev, "st,sig-pin-fbclk"))
> + host->pwr_init |= SDI_PWR_FBCLKEN;
> +
> gpio_request_by_name(dev, "cd-gpios", 0, &host->cd_gpio, GPIOD_IS_IN);
>
> ret = mmc_of_parse(dev, cfg);
>
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 3/8] mmc: arm_pl180: Set initial supply voltages
2026-08-17 9:31 ` [PATCH v2 3/8] mmc: arm_pl180: Set initial supply voltages Linus Walleij
@ 2026-08-17 16:15 ` Stephan Gerhold
0 siblings, 0 replies; 19+ messages in thread
From: Stephan Gerhold @ 2026-08-17 16:15 UTC (permalink / raw)
To: Linus Walleij; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 11:31:52AM +0200, Linus Walleij wrote:
> Obtain the optional vmmc and vqmmc regulators and configure them for
> the normal SD voltage range before card initialization.
>
> The Ux500 boards supply their SD cards from AB8500 or AB8505 AUX3,
> whose highest voltage selector is 2.91 V. Request that exact voltage
> for the Ux500 MMCI variant while retaining the normal 3.3 V target for
> other PL180 implementations.
>
> Ignore the unsupported set-value operation for fixed regulators; their
> voltage is already described by their fixed constraints.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
> ---
> drivers/mmc/arm_pl180_mmci.c | 34 ++++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
> index af21b814641e..654608b7e74c 100644
> --- a/drivers/mmc/arm_pl180_mmci.c
> +++ b/drivers/mmc/arm_pl180_mmci.c
> @@ -16,6 +16,7 @@
> #include <log.h>
> #include <malloc.h>
> #include <mmc.h>
> +#include <power/regulator.h>
> #include <dm/device_compat.h>
> #include <dm.h>
>
> @@ -28,11 +29,22 @@
> #define MMC_CLOCK_MAX 48000000
> #define MMC_CLOCK_MIN 400000
>
> +#define SD_VOLTAGE_MIN_UV 2700000
> +#define SD_VOLTAGE_UV 3300000
> +#define SD_VOLTAGE_MAX_UV 3600000
> +#define UX500_SD_VOLTAGE_UV 2910000
> +
> struct arm_pl180_mmc_plat {
> struct mmc_config cfg;
> struct mmc mmc;
> };
>
> +static int arm_pl180_set_supply_voltage(struct udevice *supply, int target_uV)
> +{
> + return regulator_set_value_clamp(supply, SD_VOLTAGE_MIN_UV,
> + target_uV, SD_VOLTAGE_MAX_UV);
> +}
> +
> static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd)
> {
> u32 hoststatus, statusmask;
> @@ -385,6 +397,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
> struct pl180_mmc_host *host = dev_get_priv(dev);
> struct mmc_config *cfg = &pdata->cfg;
> struct clk clk;
> + int supply_uV = SD_VOLTAGE_UV;
> u32 periphid;
> int ret;
>
> @@ -422,6 +435,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
> cfg->voltages = VOLTAGE_WINDOW_MMC;
> cfg->f_min = host->clock_in / (2 + SDI_CLKCR_CLKDIV_INIT_V2);
> host->version2 = true;
> + supply_uV = UX500_SD_VOLTAGE_UV;
> break;
Do we need to differentiate between MMC and SD here and for the voltage
below? There seems to be the magic number VOLTAGE_WINDOW_MMC /
VOLTAGE_WINDOW_SD here, which I have set to MMC in the Ux500 case above.
The other platforms have it set to VOLTAGE_WINDOW_SD...
If I'm reading this correctly this voltage is sent to the card to let
it pick the preferred voltage, but it doesn't look like U-Boot is
designed to act on that signal...
Thanks,
Stephan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 4/8] power: regulator: Add AB8500 AUX3 support
2026-08-17 9:31 ` [PATCH v2 4/8] power: regulator: Add AB8500 AUX3 support Linus Walleij
@ 2026-08-17 16:21 ` Stephan Gerhold
0 siblings, 0 replies; 19+ messages in thread
From: Stephan Gerhold @ 2026-08-17 16:21 UTC (permalink / raw)
To: Linus Walleij; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 11:31:53AM +0200, Linus Walleij wrote:
> Add regulator support for LDO AUX3 on AB8500 and AB8505 PMICs.
> AUX3 supplies the removable SD card on the upstream Ux500 Samsung
> device trees, and both PMIC variants use the same control registers.
>
> Imply the regulator core for ARCH_U8500 so the driver can instantiate
> from the upstream device trees.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
> ---
> MAINTAINERS | 1 +
> arch/arm/Kconfig | 2 +
> drivers/power/pmic/ab8500.c | 1 +
> drivers/power/regulator/Kconfig | 7 +++
> drivers/power/regulator/Makefile | 1 +
> drivers/power/regulator/ab8500.c | 111 +++++++++++++++++++++++++++++++++++++++
> 6 files changed, 123 insertions(+)
>
> [...]
> diff --git a/drivers/power/regulator/ab8500.c b/drivers/power/regulator/ab8500.c
> new file mode 100644
> index 000000000000..03beb0834d53
> --- /dev/null
> +++ b/drivers/power/regulator/ab8500.c
> @@ -0,0 +1,111 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/* ST-Ericsson AB8500/AB8505 LDO AUX3 regulator */
> +
> +#include <dm.h>
> +#include <dm/device-internal.h>
> +#include <dm/lists.h>
> +#include <linux/errno.h>
> +#include <power/ab8500.h>
> +#include <power/pmic.h>
> +#include <power/regulator.h>
> +
> +#define AB8500_VAUX3_REGU AB8500_REGU_CTRL2(0x0a)
> +#define AB8500_VAUX3_SEL AB8500_REGU_CTRL2(0x21)
> +#define AB8500_VAUX3_EN_MASK GENMASK(1, 0)
> +#define AB8500_VAUX3_EN BIT(0)
Nitpick: Can you call this _REGU_EN maybe to make it clear that this
belongs to the REGU register?
> +#define AB8500_VAUX3_SEL_MASK GENMASK(2, 0)
> +
> +static const int ab8500_vaux3_voltages[] = {
> + 1200000, 1500000, 1800000, 2100000,
> + 2500000, 2750000, 2790000, 2910000,
> +};
> +
> +static struct udevice *ab8500_regulator_pmic(struct udevice *dev)
> +{
> + return dev->parent->parent;
> +}
> +
> +static int ab8500_regulator_get_value(struct udevice *dev)
> +{
> + int ret;
> +
> + ret = pmic_reg_read(ab8500_regulator_pmic(dev), AB8500_VAUX3_SEL);
> + if (ret < 0)
> + return ret;
> + ret &= AB8500_VAUX3_SEL_MASK;
> +
> + return ab8500_vaux3_voltages[ret];
> +}
> +
> +static int ab8500_regulator_set_value(struct udevice *dev, int uV)
> +{
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(ab8500_vaux3_voltages); i++) {
> + if (ab8500_vaux3_voltages[i] == uV)
> + return pmic_clrsetbits(ab8500_regulator_pmic(dev),
> + AB8500_VAUX3_SEL,
> + AB8500_VAUX3_SEL_MASK, i);
> + }
> +
> + return -EINVAL;
> +}
> +
> +static int ab8500_regulator_get_enable(struct udevice *dev)
> +{
> + int ret;
> +
> + ret = pmic_reg_read(ab8500_regulator_pmic(dev), AB8500_VAUX3_REGU);
> + if (ret < 0)
> + return ret;
> +
> + return (ret & AB8500_VAUX3_EN_MASK) == AB8500_VAUX3_EN;
> +}
> +
> +static int ab8500_regulator_set_enable(struct udevice *dev, bool enable)
> +{
> + return pmic_clrsetbits(ab8500_regulator_pmic(dev), AB8500_VAUX3_REGU,
> + AB8500_VAUX3_EN_MASK,
> + enable ? AB8500_VAUX3_EN : 0);
> +}
> +
> +static const struct dm_regulator_ops ab8500_regulator_ops = {
> + .get_value = ab8500_regulator_get_value,
> + .set_value = ab8500_regulator_set_value,
> + .get_enable = ab8500_regulator_get_enable,
> + .set_enable = ab8500_regulator_set_enable,
> +};
> +
> +U_BOOT_DRIVER(ab8500_ldo_aux3) = {
> + .name = "ab8500_ldo_aux3",
> + .id = UCLASS_REGULATOR,
> + .ops = &ab8500_regulator_ops,
> +};
> +
> +static int ab8500_regulators_bind(struct udevice *dev)
> +{
> + struct driver *drv = lists_driver_lookup_name("ab8500_ldo_aux3");
> + ofnode node;
> +
> + dev_for_each_subnode(node, dev) {
> + if (!strcmp(ofnode_get_name(node), "ab8500_ldo_aux3"))
> + return device_bind_with_driver_data(dev, drv,
> + ofnode_get_name(node), 0,
> + node, NULL);
> + }
dev_read_subnode(node, "ab8500_ldo_aux3") and
device_bind_driver_to_node() instead of lists_driver_lookup_name() +
device_bind_with_driver_data() should be a bit simpler.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 5/8] configs: stemmy: Enable SD card regulators
2026-08-17 9:31 ` [PATCH v2 5/8] configs: stemmy: Enable SD card regulators Linus Walleij
@ 2026-08-17 16:24 ` Stephan Gerhold
0 siblings, 0 replies; 19+ messages in thread
From: Stephan Gerhold @ 2026-08-17 16:24 UTC (permalink / raw)
To: Linus Walleij; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 11:31:54AM +0200, Linus Walleij wrote:
> Have ARCH_U8500 imply the fixed regulator driver needed by level
> shifters on the supported boards. The architecture already enables the
> regulator core and Nomadik GPIO driver.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
Nitpick: "arm: u8500: ..." or something like that might be a better
$subject prefix for this.
Anyway:
Reviewed-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
> arch/arm/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 62aa9e8cc565..2a01ac9b7675 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1276,6 +1276,7 @@ config ARCH_U8500
> imply CLK
> imply DM_PMIC
> imply DM_REGULATOR
> + imply DM_REGULATOR_FIXED
> imply DM_RTC
> imply NOMADIK_GPIO
> imply NOMADIK_MTU_TIMER
>
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 6/8] configs: stemmy: Boot EFI from external SD card
2026-08-17 9:31 ` [PATCH v2 6/8] configs: stemmy: Boot EFI from external SD card Linus Walleij
@ 2026-08-17 16:29 ` Stephan Gerhold
0 siblings, 0 replies; 19+ messages in thread
From: Stephan Gerhold @ 2026-08-17 16:29 UTC (permalink / raw)
To: Linus Walleij; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 11:31:55AM +0200, Linus Walleij wrote:
> Replace the fastboot-only command with standard bootflow scanning and
> enable the EFI loader so the removable SD card can provide the default
> ARM EFI executable. Filesystem probing is handled by the standard boot
> framework and does not require the FAT command.
>
> Disable mkeficapsule because generating capsule tools is unrelated to
> running EFI payloads and adds a host GnuTLS build dependency.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
I think it would be nice to keep Fastboot as a fallback, e.g. when a
button is pressed during boot. Some people may want that for updating
U-Boot itself.
I had this mapped to the Volume Down button in my original change:
https://github.com/stericsson-mainline/u-boot/commit/3a499aabe598004da889c507095edf8d9b21244e
Nowdays it's a bit easier to do this without extra C code using
button_cmd, see e.g.
https://git.u-boot-project.org/u-boot/u-boot/-/commit/359e1d4a57e06ab662ca7e008e881da27e9d3562
Thanks,
Stephan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 7/8] arm: u8500: Switch Stemmy to upstream Janice device tree
2026-08-17 9:31 ` [PATCH v2 7/8] arm: u8500: Switch Stemmy to upstream Janice device tree Linus Walleij
@ 2026-08-17 16:45 ` Stephan Gerhold
2026-08-17 20:54 ` Linus Walleij
0 siblings, 1 reply; 19+ messages in thread
From: Stephan Gerhold @ 2026-08-17 16:45 UTC (permalink / raw)
To: Linus Walleij; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 11:31:56AM +0200, Linus Walleij wrote:
> Use the upstream Samsung Janice device tree as the initial target for
> the Stemmy configuration. This also prepares the board to share the
> upstream Ux500 Samsung device trees with Linux.
>
> U-Boot does not yet implement the U8500 clock providers used by the
> upstream device tree. Add a U-Boot-specific overlay with the known MTU
> clock rate and a fixed input clock for the external SD controller.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
Hm okay so you're basically dropping support for the internal eMMC in
this patch? Can we support both? BOOTSTD should be able to scan multiple
storages for boot targets.
I'm also not really sure about selecting Janice as "default" device tree
here. Do you expect users to change this setting when they want to build
stemmy for another board?
I wonder if we could continue using a single generic binary for all
boards using CONFIG_MULTI_DTB_FIT. We should have "fw_mach" in
board/ste/stemmy/stemmy.c that should tell us which device we are
running on, which seems to be mostly(?) unique:
https://github.com/stericsson-mainline/android_kernel/blob/9508895090960012f916561b2ede5eaf8124fabd/arch/arm/tools/mach-types#L3956-L3965
I'm not sure about codina-tmo, you would need to check which number the
bootloader passes.
If these numbers are unique, it should be easy to implement
board_fit_config_name_match().
Thanks,
Stephan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 8/8] arm: u8500: Give Golden panel regulators unique names
2026-08-17 9:31 ` [PATCH v2 8/8] arm: u8500: Give Golden panel regulators unique names Linus Walleij
@ 2026-08-17 16:47 ` Stephan Gerhold
2026-08-17 20:36 ` Linus Walleij
0 siblings, 1 reply; 19+ messages in thread
From: Stephan Gerhold @ 2026-08-17 16:47 UTC (permalink / raw)
To: Linus Walleij; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 11:31:57AM +0200, Linus Walleij wrote:
> The Golden device tree gives both fixed panel supplies the same
> regulator-name. U-Boot requires regulator names to be unique and aborts
> driver-model initialization when binding the second supply.
>
> Add a U-Boot overlay assigning distinct names to the 1.8 V and 3.0 V
> supplies. Include the common U8500 overlay since a board-specific
> overlay takes precedence over it.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
I think it's a bit awkward to have multiple regulators with the same
name, even on Linux when looking at debugfs for example.
Can you make this change on the Linux side and backport it here?
Or maybe we can use the regulator names from the schematics if we have
that (I don't remember :') ).
Thanks,
Stephan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 8/8] arm: u8500: Give Golden panel regulators unique names
2026-08-17 16:47 ` Stephan Gerhold
@ 2026-08-17 20:36 ` Linus Walleij
0 siblings, 0 replies; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 20:36 UTC (permalink / raw)
To: Stephan Gerhold; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 6:47 PM Stephan Gerhold
<stephan.gerhold@linaro.org> wrote:
> I think it's a bit awkward to have multiple regulators with the same
> name, even on Linux when looking at debugfs for example.
>
> Can you make this change on the Linux side and backport it here?
You're right of course:
https://lore.kernel.org/linux-arm-kernel/20260817-ux500-dts-fixes-v1-1-24379c6c2495@kernel.org/T/#u
I don't know if U-Boot backport device tree changes? Isn't it like
a scripted upstream sync?
> Or maybe we can use the regulator names from the schematics if we have
> that (I don't remember :') ).
No we don't have them...
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 7/8] arm: u8500: Switch Stemmy to upstream Janice device tree
2026-08-17 16:45 ` Stephan Gerhold
@ 2026-08-17 20:54 ` Linus Walleij
0 siblings, 0 replies; 19+ messages in thread
From: Linus Walleij @ 2026-08-17 20:54 UTC (permalink / raw)
To: Stephan Gerhold; +Cc: u-boot, Tom Rini, Stefan Hansson
On Mon, Aug 17, 2026 at 6:45 PM Stephan Gerhold
<stephan.gerhold@linaro.org> wrote:
> Hm okay so you're basically dropping support for the internal eMMC in
> this patch? Can we support both? BOOTSTD should be able to scan multiple
> storages for boot targets.
Yeah just laziness on my part, I'll fix it up.
> I'm also not really sure about selecting Janice as "default" device tree
> here. Do you expect users to change this setting when they want to build
> stemmy for another board?
I have a script that loops over the Samsung device trees,
and recompiles U-Boot for each of them.
https://dflund.se/~triad/krad/makefiles/ux500-uboot.mak
> I wonder if we could continue using a single generic binary for all
> boards using CONFIG_MULTI_DTB_FIT. We should have "fw_mach" in
> board/ste/stemmy/stemmy.c that should tell us which device we are
> running on, which seems to be mostly(?) unique:
>
> https://github.com/stericsson-mainline/android_kernel/blob/9508895090960012f916561b2ede5eaf8124fabd/arch/arm/tools/mach-types#L3956-L3965
>
> I'm not sure about codina-tmo, you would need to check which number the
> bootloader passes.
>
> If these numbers are unique, it should be easy to implement
> board_fit_config_name_match().
I see the appeal of the ambition to have a "one size fits (pun!) all"
U-Boot.
But as it is, some of the DTS attributes on the external SD card are
different between the platforms, so we would need to modify the
U-Boot internal Stemmy device tree for those, copying over yet
properties from the device trees and into the boardfile.
For example Janice and Codina uses a regulator for
vqmmc-supply, and those using the "sd_level_translator"
for vqmmc-supply actually use different GPIO pins on say
Gavini compared to Codina or Golden.
The pin direction settings on the MMC host vary. (Some of
these were really tricky to get right.)
So I think no, if we want external SD card boot we need
per-device compiled U-Boot binaries with the unique device
trees.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-08-17 20:55 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17 9:31 [PATCH v2 0/8] arm: u8500: Enable upstream DT based SD card boot Linus Walleij
2026-08-17 9:31 ` [PATCH v2 1/8] pinctrl: Add compact Nomadik pin controller Linus Walleij
2026-08-17 15:57 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 2/8] mmc: arm_pl180: Configure Ux500 signal direction Linus Walleij
2026-08-17 15:59 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 3/8] mmc: arm_pl180: Set initial supply voltages Linus Walleij
2026-08-17 16:15 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 4/8] power: regulator: Add AB8500 AUX3 support Linus Walleij
2026-08-17 16:21 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 5/8] configs: stemmy: Enable SD card regulators Linus Walleij
2026-08-17 16:24 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 6/8] configs: stemmy: Boot EFI from external SD card Linus Walleij
2026-08-17 16:29 ` Stephan Gerhold
2026-08-17 9:31 ` [PATCH v2 7/8] arm: u8500: Switch Stemmy to upstream Janice device tree Linus Walleij
2026-08-17 16:45 ` Stephan Gerhold
2026-08-17 20:54 ` Linus Walleij
2026-08-17 9:31 ` [PATCH v2 8/8] arm: u8500: Give Golden panel regulators unique names Linus Walleij
2026-08-17 16:47 ` Stephan Gerhold
2026-08-17 20:36 ` Linus Walleij
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.