arm: u8500: Enable upstream DT based SD card boot
Subsystems (3)
Linus Walleij
maintainerv5 cover arm: u8500: Enable upstream DT based SD card boot
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.
Backport the pending Linux DTS fixes for Golden's duplicate regulator name and GPIO key labels. These patches are pending but I am also the Ux500 maintainer upstream and I will apply them. I put some backporting placeholders into the patches since I can't apply v7.4 material before v7.3-rc1 is out in a week. (Then I can provide hashes, if this is necessary.)
The seven supported device trees are packaged into a FIT appended to U-Boot. The Samsung firmware machine ID selects the matching tree at runtime. Codina TMO shares the Codina machine ID and is distinguished by board ID. This keeps the board-specific SD supplies, level-shifter GPIOs and MMCI signal-direction settings in their respective device trees while using a single U-Boot binary.
This has been tested successfully to boot PostmarketOS on all the known Sansung Ux500 devices using the EFI boot flow, with some minimal changes to the PostmarketOS to use systemd-boot and compile in the right EFI kernel configs and EFI stub.
---
Changes in v5:
- Replace Golden U-Boot overlays with pending Linux DTS backports.
- Add a regulator clamp API in a separate preparatory patch.
- Select the closest supported initial SD supply voltage.
- Support the AB8505 VAUX3 3.05 V selector override.
- Recognize normal and low-power VAUX3 states as enabled.
- Recognize the alternate Gavini firmware machine ID 3296.
- Boot tested on all Ux500 devices including Gavini and Kyle.
- Link to v4: https://patch.msgid.link/[email protected]
Changes in v4:
- Package all seven Stemmy device trees in an appended FIT.
- Select the Stemmy device tree using the firmware machine and board IDs.
- Print the firmware machine and board IDs for diagnostics.
- Link to v3: https://patch.msgid.link/[email protected]
Changes in v3:
- Disable unsupported DDR mode on the internal eMMC controller.
- Gate idle PL180 card clocks and honor clock-disable requests.
- Shut down PL180 card supplies at OS handoff.
- Skip global EFI boot entries when scanning the external SD card.
- Disable the unused WLAN SDIO controller in U-Boot.
- Remove the obsolete downstream Stemmy and DBx500 device trees.
- Provide a fixed clock for the internal eMMC controller.
- Enter fastboot when the volume-down button is held.
- Use standard DM helpers to bind the AB8500 AUX3 regulator.
- Select 3.3 V supplies for eMMC-only PL180 hosts.
- Use Nomadik DT-binding macros in the pinctrl driver.
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- Use the new mailing list address, no other changes.
- Link to v1: https://patch.msgid.link/[email protected]
---
Linus Walleij (13):
pinctrl: Add compact Nomadik pin controller
mmc: arm_pl180: Configure Ux500 signal direction
mmc: arm_pl180: Gate idle card clocks
power: regulator: Add driver voltage clamp callback
mmc: arm_pl180: Set initial supply voltages
mmc: arm_pl180: Power down card supplies at OS handoff
power: regulator: Add AB8500 AUX3 support
arm: u8500: Enable SD card regulators
configs: stemmy: Boot EFI from external SD card
arm: u8500: Switch Stemmy to upstream Janice device tree
ARM: dts: ux500: Make panel regulators have unique names
ARM: dts: ux500: Harmonize GPIO key names
arm: u8500: Package Stemmy device trees in FIT
MAINTAINERS | 2 + arch/arm/Kconfig | 6 + arch/arm/dts/Makefile | 1 - arch/arm/dts/ste-dbx5x0-u-boot.dtsi | 38 - arch/arm/dts/ste-dbx5x0.dtsi | 1144 -------------------- arch/arm/dts/ste-ux500-samsung-stemmy.dts | 36 - arch/arm/dts/u8500-u-boot.dtsi | 30 + board/ste/stemmy/Kconfig | 6 + board/ste/stemmy/stemmy.c | 77 +- configs/stemmy_defconfig | 7 +- drivers/mmc/arm_pl180_mmci.c | 81 +- drivers/pinctrl/Kconfig | 7 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-nomadik.c | 230 ++++ drivers/power/pmic/ab8500.c | 1 + drivers/power/regulator/Kconfig | 7 + drivers/power/regulator/Makefile | 1 + drivers/power/regulator/ab8500.c | 168 +++ drivers/power/regulator/regulator-uclass.c | 2 + .../src/arm/st/ste-ux500-samsung-golden.dts | 10 +- include/power/regulator.h | 6 + 21 files changed, 627 insertions(+), 1234 deletions(-)
---
base-commit: 0b581a9612e46310ee52bf8359165950d38b2a2b
change-id: 20260813-ux500-external-sdcard-a49778d77b21
Best regards,
Signature · 1 line
Linus Walleij <[email protected]>
Linus Walleij
maintainerPATCH v5 1/13 pinctrl: Add compact Nomadik pin controller
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.
--- MAINTAINERS | 1 + arch/arm/Kconfig | 2 + drivers/pinctrl/Kconfig | 7 ++ drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-nomadik.c | 230 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 241 insertions(+)
MAINTAINERS +1 -0
@@ -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
arch/arm/Kconfig +2 -0
@@ -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
drivers/pinctrl/Kconfig +7 -0
@@ -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
drivers/pinctrl/Makefile +1 -0
@@ -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
drivers/pinctrl/pinctrl-nomadik.c new file +230 -0
230 lines not on this page · raw message
Signature · 1 line
2.55.0
Re: [PATCH v5 01/13] pinctrl: Add compact Nomadik pin controller
Quoted 10 lines · 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 <[email protected]>
Thanks!
Quoted 303 lines
--- MAINTAINERS | 1 + arch/arm/Kconfig | 2 + drivers/pinctrl/Kconfig | 7 ++ drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-nomadik.c | 230 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 241 insertions(+)MAINTAINERS +1
-0@@ -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.carch/arm/Kconfig +2
-0@@ -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_AB8500drivers/pinctrl/Kconfig +7
-0@@ -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_DMdrivers/pinctrl/Makefile +1
-0@@ -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.odrivers/pinctrl/pinctrl-nomadik.c new file +230
-0@@ -0,0 +1,230 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2026 Linus Walleij <[email protected]> */ + +#include <dm.h> +#include <dm/pinctrl.h> +#include <dt-bindings/pinctrl/nomadik.h> +#include <vsprintf.h> +#include <asm/io.h> + +#define NMK_GPIO_BANKS 9 +#define NMK_GPIO_PER_BANK 32 + +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 ==INPUT_NOPULL ) { +setbits_le32 (®s->pdis, mask); + }else { +clrbits_le32 (®s->pdis, mask); +if (val ==INPUT_PULLUP ) +writel (mask, ®s->dats); +else if (val ==INPUT_PULLDOWN ) +writel (mask, ®s->datc); +else +return -EINVAL ; + } + } + +if (!ofnode_read_u32 (node,"ste,output" , &val)) { +if (val ==OUTPUT_HIGH ) +writel (mask, ®s->dats); +else if (val ==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, +};Signature · 2 lines
-- 2.55.0
Linus Walleij
maintainerPATCH v5 2/13 mmc: arm_pl180: Configure Ux500 signal direction
In reply to Linus WalleijThe 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.
--- drivers/mmc/arm_pl180_mmci.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/mmc/arm_pl180_mmci.c +13 -0
@@ -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);
Signature · 1 line
2.55.0
Linus Walleij
maintainerPATCH v5 3/13 mmc: arm_pl180: Gate idle card clocks
In reply to Linus WalleijThe MMC core uses mmc->clk_disable to request that the card clock is stopped, but the PL180 driver leaves SDI_CLKCR_CLKEN unchanged. This can leave inactive hosts driving their card clocks.
Honor clk_disable when programming the clock control register. Also enable the PL180 power-save mode so the clock stops automatically while the bus is idle.
--- drivers/mmc/arm_pl180_mmci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/mmc/arm_pl180_mmci.c +7 -2
@@ -294,6 +294,11 @@ static int host_set_ios(struct mmc *dev)u32 sdi_clkcr; sdi_clkcr =readl (&host->base->clock); + sdi_clkcr |=SDI_CLKCR_PWRSAV ; +if (dev->clk_disable) + sdi_clkcr &= ~SDI_CLKCR_CLKEN ; +else + sdi_clkcr |=SDI_CLKCR_CLKEN ;/* Ramp up the clock rate */ if (dev->clock) {
@@ -400,7 +405,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev) host->pwr_init =INIT_PWR ; host->clkdiv_init =SDI_CLKCR_CLKDIV_INIT_V1 |SDI_CLKCR_CLKEN | -SDI_CLKCR_HWFC_EN ; +SDI_CLKCR_PWRSAV |SDI_CLKCR_HWFC_EN ; host->clock_in =clk_get_rate (&clk); cfg->name = dev->name;
@@ -418,7 +423,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev)case UX500V2_MMCI_ID : host->pwr_init =SDI_PWR_OPD |SDI_PWR_PWRCTRL_ON ; host->clkdiv_init =SDI_CLKCR_CLKDIV_INIT_V2 |SDI_CLKCR_CLKEN | -SDI_CLKCR_HWFC_EN ; +SDI_CLKCR_PWRSAV |SDI_CLKCR_HWFC_EN ; cfg->voltages =VOLTAGE_WINDOW_MMC ; cfg->f_min = host->clock_in / (2 +SDI_CLKCR_CLKDIV_INIT_V2 ); host->version2 = true;
Signature · 1 line
2.55.0
Re: [PATCH v5 03/13] mmc: arm_pl180: Gate idle card clocks
Quoted 7 lines · Linus Walleij
The MMC core uses
mmc->clk_disableto request that the card clock is stopped, but the PL180 driver leavesSDI_CLKCR_CLKENunchanged. This can leave inactive hosts driving their card clocks.Honor
clk_disablewhen programming the clock control register. Also enable the PL180 power-save mode so the clock stops automatically while the bus is idle.
I'm not so sure about enabling PWRSAV, given that even Linux keeps that disabled. See mmci_set_clkreg():
clk |= MCI_CLK_ENABLE; /* This hasn't proven to be worthwhile */ /* clk |= MCI_CLK_PWRSAVE; */
Which is BTW your own change from 2009. :-)
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=a6a6464a0ecd20c5f1594a4fe5b24af6181b7366
The clk_disable part looks fine to me.
Thanks,
Stephan
Linus Walleij
maintainerRe: [PATCH v5 03/13] mmc: arm_pl180: Gate idle card clocks
Quoted 9 lines · Stephan Gerhold
I'm not so sure about enabling PWRSAV, given that even Linux keeps that disabled. See
mmci_set_clkreg():clk |= MCI_CLK_ENABLE; /* This hasn't proven to be worthwhile */ /* clk |= MCI_CLK_PWRSAVE; */Which is BTW your own change from 2009. :-)
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=a6a6464a0ecd20c5f1594a4fe5b24af6181b7366
Yeah I dug in my old mail archive and I remember why this happened like that actually.
I had a very sensitive Ampèremeter connected to the Ux500 prototype platform and it didn't show any power improvement at all. The actual clock gating at the clock source however did... it may be a bit dependent on the interconnect and that's why I left it commented out, but let's drop it.
Yours,
Linus Walleij
Linus Walleij
maintainerPATCH v5 4/13 power: regulator: Add driver voltage clamp callback
In reply to Linus WalleijThe regulator core can clamp a requested voltage against device tree constraints, but it cannot account for discrete values supported by the hardware.
Add an optional set_value_clamp() driver callback. Apply the regulator constraints in the core before asking the driver to select the closest supported voltage in the resulting range. Drivers without the callback retain the existing behavior.
--- drivers/power/regulator/regulator-uclass.c | 2 ++ include/power/regulator.h | 6 ++++++ 2 files changed, 8 insertions(+)
drivers/power/regulator/regulator-uclass.c +2 -0
@@ -134,6 +134,8 @@ int regulator_set_value_clamp(struct udevice *dev,if (uc_pdata->max_uV != -ENODATA ) max_uV =min (max_uV, uc_pdata->max_uV); uV =clamp (target_uV, min_uV, max_uV); +if (ops->set_value_clamp) +return ops->set_value_clamp (dev, min_uV, uV, max_uV);return regulator_set_value (dev, uV); }
include/power/regulator.h +6 -0
@@ -195,13 +195,19 @@ struct dm_regulator_ops {* The regulator output value function calls operates on a micro Volts. * * get/set_value - get/set output value of the given output number +* set_value_clamp - set the closest supported value within a range * @dev - regulator device * Sets: * @uV - set the output value [micro Volts] +* @min_uV - minimum acceptable output value [micro Volts] +* @target_uV - preferred output value [micro Volts] +* @max_uV - maximum acceptable output value [micro Volts] * @return output value [uV] on success or negative errno if fail. */ int (*get_value)(struct udevice *dev);int (*set_value)(struct udevice *dev,int uV); +int (*set_value_clamp)(struct udevice *dev,int min_uV, +int target_uV,int max_uV);/** * The regulator suspend output value function calls operates
Signature · 1 line
2.55.0
Linus Walleij
maintainerPATCH v5 5/13 mmc: arm_pl180: Set initial supply voltages
In reply to Linus WalleijObtain the optional vmmc and vqmmc regulators and configure them for the normal SD voltage range before card initialization.
Request the standard 3.3 V target within the allowed 2.7-3.6 V range. The regulator clamp operation lets regulators with discrete selectors choose the closest supported voltage. This selects 2.91 V on AB8500 and 3.05 V on AB8505.
Ignore the unsupported set-value operation for fixed regulators; their voltage is already described by their fixed constraints.
--- drivers/mmc/arm_pl180_mmci.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
drivers/mmc/arm_pl180_mmci.c +29 -0
@@ -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,21 @@#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 +struct arm_pl180_mmc_plat {struct mmc_config cfg;struct mmc mmc; }; +static int arm_pl180_set_supply_voltage (struct udevice *supply) +{ +return regulator_set_value_clamp (supply,SD_VOLTAGE_MIN_UV , +SD_VOLTAGE_UV ,SD_VOLTAGE_MAX_UV ); +} +static int wait_for_command_end (struct mmc *dev,struct mmc_cmd *cmd) {u32 hoststatus, statusmask;
@@ -445,6 +456,24 @@ 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); +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); +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);
Signature · 1 line
2.55.0
Linus Walleij
maintainerPATCH v5 6/13 mmc: arm_pl180: Power down card supplies at OS handoff
In reply to Linus WalleijPL180 card supplies remain enabled after probing and while U-Boot is running. They are no longer needed once control is handed to the operating system.
Mark the driver for removal during OS preparation and disable its VMMC and VQMMC supplies from the remove callback.
--- drivers/mmc/arm_pl180_mmci.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
drivers/mmc/arm_pl180_mmci.c +30 -0
@@ -44,6 +44,20 @@ static int arm_pl180_set_supply_voltage(struct udevice *supply) SD_VOLTAGE_UV, SD_VOLTAGE_MAX_UV); } +static int arm_pl180_disable_supply (struct udevice *supply) +{ +int ret; + +if (!supply) +return 0 ; + + ret =regulator_set_enable_if_allowed (supply, false); +if (ret == -ENOSYS ) +return 0 ; + +return ret; +} +static int wait_for_command_end (struct mmc *dev,struct mmc_cmd *cmd) {u32 hoststatus, statusmask;
@@ -488,6 +502,20 @@ static int arm_pl180_mmc_probe(struct udevice *dev)return 0 ; } +static int arm_pl180_mmc_remove (struct udevice *dev) +{ +struct mmc *mmc =mmc_get_mmc_dev (dev); +int ret, vmmc_ret; + + ret =arm_pl180_disable_supply (mmc->vqmmc_supply); +if (mmc->vmmc_supply != mmc->vqmmc_supply) + vmmc_ret =arm_pl180_disable_supply (mmc->vmmc_supply); +else + vmmc_ret =0 ; + +return ret ? ret : vmmc_ret; +} +int arm_pl180_mmc_bind (struct udevice *dev) {struct arm_pl180_mmc_plat *plat =dev_get_plat (dev);
@@ -551,8 +579,10 @@ U_BOOT_DRIVER(arm_pl180_mmc) = { .of_match = arm_pl180_mmc_match, .ops = &arm_pl180_dm_mmc_ops, .probe = arm_pl180_mmc_probe, + .remove = arm_pl180_mmc_remove, .of_to_plat = arm_pl180_mmc_of_to_plat, .bind = arm_pl180_mmc_bind, .priv_auto = sizeof(struct pl180_mmc_host), .plat_auto = sizeof(struct arm_pl180_mmc_plat), + .flags = DM_FLAG_OS_PREPARE, };
Signature · 1 line
2.55.0
Re: [PATCH v5 06/13] mmc: arm_pl180: Power down card supplies at OS handoff
Quoted 8 lines · Linus Walleij
PL180 card supplies remain enabled after probing and while U-Boot is running. They are no longer needed once control is handed to the operating system.
Mark the driver for removal during OS preparation and disable its VMMC and VQMMC supplies from the remove callback.
Signed-off-by Linus Walleij <[email protected]>
Is it worth briefly toggling the regulator off before Linux turns it on again? Linux will typically need to turn them on again later during boot, and even if not Linux should be able to deal with unused regulators. I'm not sure it's worth adding such cleanup to U-Boot.
Thanks,
Stephan
Linus Walleij
maintainerRe: [PATCH v5 06/13] mmc: arm_pl180: Power down card supplies at OS handoff
Quoted 9 lines · Stephan Gerhold
Quoted 7 lines · Linus Walleij
PL180 card supplies remain enabled after probing and while U-Boot is running. They are no longer needed once control is handed to the operating system.
Mark the driver for removal during OS preparation and disable its VMMC and VQMMC supplies from the remove callback.
Quoted 6 lines
Quoted 1 line
Signed-off-by Linus Walleij <[email protected]>Is it worth briefly toggling the regulator off before Linux turns it on again? Linux will typically need to turn them on again later during boot, and even if not Linux should be able to deal with unused regulators. I'm not sure it's worth adding such cleanup to U-Boot.
For our specific Ux500 target it is true.
But this driver is used by a bunch of platforms including some ARM reference designs, and also booting other operating systems than Linux.
Something could EFI boot off one SD card, then have rootfs on another one and the original boot card undefined in the hardware description for example. Albeit that sounds a bit stupid.
So I thought it'd be more clean to shut off the light on your way out.
But it's not like I'm married to the patch.
Yours,
Linus Walleij
Re: [PATCH v5 06/13] mmc: arm_pl180: Power down card supplies at OS handoff
Quoted 29 lines · Linus Walleij
Quoted 9 lines · Stephan Gerhold
Quoted 7 lines · Linus Walleij
PL180 card supplies remain enabled after probing and while U-Boot is running. They are no longer needed once control is handed to the operating system.
Mark the driver for removal during OS preparation and disable its VMMC and VQMMC supplies from the remove callback.
Quoted 6 lines
Quoted 1 line
Signed-off-by Linus Walleij <[email protected]>Is it worth briefly toggling the regulator off before Linux turns it on again? Linux will typically need to turn them on again later during boot, and even if not Linux should be able to deal with unused regulators. I'm not sure it's worth adding such cleanup to U-Boot.
For our specific Ux500 target it is true.
But this driver is used by a bunch of platforms including some ARM reference designs, and also booting other operating systems than Linux.
Something could EFI boot off one SD card, then have rootfs on another one and the original boot card undefined in the hardware description for example. Albeit that sounds a bit stupid.
Quoted 5 lines
So I thought it'd be more clean to shut off the light on your way out.
But it's not like I'm married to the patch.
I don't really have a strong opinion either. We can just leave it up to the maintainers.
Can you re-run get_maintainer.pl on this series for v6? Seems like the U-Boot MMC maintainers aren't included in this patch. I think it would also be worth Ccing the "ARM STM STM32MP" maintainers for arm_pl180 changes, they use the STM32_MMCI_ID code path in this driver and reviewed/tested my last changes (Patrice Chotard in particular).
Thanks,
Stephan
Linus Walleij
maintainerPATCH v5 7/13 power: regulator: Add AB8500 AUX3 support
In reply to Linus WalleijAdd regulator support for LDO AUX3 on AB8500 and AB8505 PMICs. AUX3 supplies the removable SD card on the upstream Ux500 Samsung device trees.
Support the AB8505-specific 3.05 V selector override and clear it after programming an ordinary voltage. Treat both normal and low-power modes as enabled and select the supported voltage closest to a requested target. AB8500 cut 2.0 or later is assumed.
Imply the regulator core for ARCH_U8500 so the driver can instantiate from the upstream device trees.
--- 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 | 168 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 180 insertions(+)
MAINTAINERS +1 -0
@@ -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
arch/arm/Kconfig +2 -0
@@ -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
drivers/power/pmic/ab8500.c +1 -0
@@ -253,6 +253,7 @@ static int ab8500_probe(struct udevice *dev)static const struct udevice_id ab8500_ids[] = { { .compatible ="stericsson,ab8500" }, + { .compatible ="stericsson,ab8505" }, { } };
drivers/power/regulator/Kconfig +7 -0
@@ -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
drivers/power/regulator/Makefile +1 -0
@@ -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
drivers/power/regulator/ab8500.c new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
2.55.0
Re: [PATCH v5 07/13] power: regulator: Add AB8500 AUX3 support
Quoted 37 lines · 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.
Support the AB8505-specific 3.05 V selector override and clear it after programming an ordinary voltage. Treat both normal and low-power modes as enabled and select the supported voltage closest to a requested target. AB8500 cut 2.0 or later is assumed.
Imply the regulator core for
ARCH_U8500so the driver can instantiate from the upstream device trees.Signed-off-by Linus Walleij <[email protected]>--- 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 | 168 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 180 insertions(+)[...]
drivers/power/regulator/ab8500.c new file +8
-0@@ -0,0 +1,168 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* ST-Ericsson AB8500/AB8505 LDO AUX3 regulator */ + +#include <dm.h> +#include <dm/lists.h> +#include <linux/errno.h> +#include <power/ab8500.h> +#include <power/pmic.h>
drivers/power/regulator/ab8500.c line 18
Quoted 10 lines
drivers/power/regulator/ab8500.c new file +10
-0+#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_REGU_EN BIT(0) +#define AB8500_VAUX3_SEL_MASK GENMASK(2, 0) +#define AB8505_VAUX3_SEL3 AB8500_REGU_CTRL2(0x01) +#define AB8505_VAUX3_SEL3_MASK BIT(4) +#define AB8505_VAUX3_SEL3_UV 3050000
I'm a bit confused by this list now, please either have all register addresses (AB8500_REGU_CTRL2(...)) at the top, followed by the bitmasks or make it interleaved (probably better for readability), i.e.
+#define AB8500_VAUX3_REGU AB8500_REGU_CTRL2(0x0a)
+#define AB8500_VAUX3_EN_MASK GENMASK(1, 0) /* <-- would be also good
to rename this for consistency */
+#define AB8500_VAUX3_REGU_EN BIT(0)
+#define AB8500_VAUX3_SEL AB8500_REGU_CTRL2(0x21)
+#define AB8500_VAUX3_SEL_MASK GENMASK(2, 0)
+#define AB8505_VAUX3_SEL3 AB8500_REGU_CTRL2(0x01)
+#define AB8505_VAUX3_SEL3_MASK BIT(4)
+#define AB8505_VAUX3_SEL3_UV 3050000
Am I blind or do we have no support for the AB8505 3.05V in the Linux regulator driver?
Thanks,
Stephan
Linus Walleij
maintainerRe: [PATCH v5 07/13] power: regulator: Add AB8500 AUX3 support
Quoted 4 lines · Stephan Gerhold
Quoted 4 lines
drivers/power/regulator/ab8500.c new file +4
-0+#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_REGU_EN BIT(0)
Quoted 8 lines
drivers/power/regulator/ab8500.c line 18
Quoted 4 lines
drivers/power/regulator/ab8500.c new file +4
-0+#define AB8500_VAUX3_SEL_MASK GENMASK(2, 0) +#define AB8505_VAUX3_SEL3 AB8500_REGU_CTRL2(0x01) +#define AB8505_VAUX3_SEL3_MASK BIT(4) +#define AB8505_VAUX3_SEL3_UV 3050000I'm a bit confused by this list now, please either have all register addresses (
AB8500_REGU_CTRL2(...)) at the top, followed by the bitmasks or make it interleaved (probably better for readability), i.e.
OK I fix!
Quoted 2 lines
Am I blind or do we have no support for the AB8505 3.05V in the Linux regulator driver?
We do not.
I have a pending patch series fixing this and a few other issues in the Linux driver, that I will send after the Linux merge window is over.
Yours,
Linus Walleij
Linus Walleij
maintainerPATCH v5 8/13 arm: u8500: Enable SD card regulators
In reply to Linus WalleijHave 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.
--- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
@@ -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
Signature · 1 line
2.55.0
Linus Walleij
maintainerPATCH v5 9/13 configs: stemmy: Boot EFI from external SD card
In reply to Linus WalleijReplace 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.
Skip global boot methods so EFI variables cannot redirect the scan to the internal eMMC.
Disable mkeficapsule because generating capsule tools is unrelated to running EFI payloads and adds a host GnuTLS build dependency.
--- configs/stemmy_defconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
configs/stemmy_defconfig +3 -2
@@ -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 -lbG" 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
Signature · 1 line
2.55.0
Re: [PATCH v5 09/13] configs: stemmy: Boot EFI from external SD card
Quoted 11 lines · 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.
Skip global boot methods so EFI variables cannot redirect the scan to the internal eMMC.Disable mkeficapsule because generating capsule tools is unrelated to running EFI payloads and adds a host GnuTLS build dependency.
Signed-off-by Linus Walleij <[email protected]>
Thanks!
Quoted 30 lines
--- configs/stemmy_defconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)configs/stemmy_defconfig +3
-2@@ -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 -lbG" 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 setSignature · 2 lines
-- 2.55.0
Linus Walleij
maintainerPATCH v5 10/13 arm: u8500: Switch Stemmy to upstream Janice device tree
In reply to Linus WalleijUse 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 fixed input clocks for the external SD and internal eMMC controllers. Remove the superseded downstream Stemmy and DBx500 device tree files, and disable the unused WLAN SDIO controller for U-Boot.
--- arch/arm/dts/Makefile | 1 - arch/arm/dts/ste-dbx5x0-u-boot.dtsi | 38 - arch/arm/dts/ste-dbx5x0.dtsi | 1144 ----------------------------- arch/arm/dts/ste-ux500-samsung-stemmy.dts | 36 - arch/arm/dts/u8500-u-boot.dtsi | 30 + configs/stemmy_defconfig | 3 +- 6 files changed, 32 insertions(+), 1220 deletions(-)
arch/arm/dts/Makefile +0 -1
@@ -503,7 +503,6 @@ dtb-$(CONFIG_TARGET_SL28) += fsl-ls1028a-kontron-sl28.dtb \ dtb-$(CONFIG_TARGET_TEN64) += fsl-ls1088a-ten64.dtb -dtb-$(CONFIG_TARGET_STEMMY) += ste-ux500-samsung-stemmy.dtb dtb-$(CONFIG_MACH_SUN4I) += \ sun4i-a10-inet-3f.dtb \
arch/arm/dts/ste-dbx5x0-u-boot.dtsi deleted +0 -38
@@ -1,38 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "skeleton.dtsi" -#include "ste-dbx5x0.dtsi" - -/ { - /* FIXME: Remove this when clk driver is implemented */ - sdmmcclk: sdmmcclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <100000000>; - }; - - soc { - mtu@a03c6000 { - clock-frequency = <133000000>; - }; - uart@80120000 { - clock = <38400000>; - }; - uart@80121000 { - clock = <38400000>; - }; - uart@80007000 { - clock = <38400000>; - }; - mmc@80005000 { - clocks = <&sdmmcclk>; - }; - }; - - reboot { - compatible = "syscon-reboot"; - regmap = <&prcmu>; - offset = <0x228>; /* PRCM_APE_SOFTRST */ - mask = <0x1>; - }; -};
arch/arm/dts/ste-dbx5x0.dtsi deleted +0 -1144
1,144 lines not on this page · raw message
arch/arm/dts/ste-ux500-samsung-stemmy.dts deleted +0 -36
@@ -1,36 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/dts-v1/; - -#include "ste-dbx5x0-u-boot.dtsi" -#include "ste-ab8500.dtsi" - -/ { - compatible = "samsung,stemmy", "st-ericsson,u8500"; - - chosen { - stdout-path = &serial2; - }; - - soc { - /* eMMC */ - mmc@80005000 { - status = "okay"; - - arm,primecell-periphid = <0x10480180>; - max-frequency = <100000000>; - bus-width = <8>; - - non-removable; - cap-mmc-highspeed; - }; - - /* Debugging console UART */ - uart@80007000 { - status = "okay"; - }; - - mcde@a0350000 { - status = "okay"; - }; - }; -};
arch/arm/dts/u8500-u-boot.dtsi new file +30 -0
@@ -0,0 +1,30 @@ +// 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>; + }; + + mmc@80118000 { + status = "disabled"; + }; + + mmc@80005000 { + clocks = <&sdmmcclk>; + /* U-Boot cannot handle switching the controller to DDR mode */ + /delete-property/ mmc-ddr-1_8v; + }; + }; +};
configs/stemmy_defconfig +2 -1
@@ -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
Signature · 1 line
2.55.0
Re: [PATCH v5 10/13] arm: u8500: Switch Stemmy to upstream Janice device tree
Quoted 81 lines · 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 fixed input clocks for the external SD and internal eMMC controllers. Remove the superseded downstream Stemmy and DBx500 device tree files, and disable the unused WLAN SDIO controller for U-Boot.
Signed-off-by Linus Walleij <[email protected]>--- arch/arm/dts/Makefile | 1 - arch/arm/dts/ste-dbx5x0-u-boot.dtsi | 38 - arch/arm/dts/ste-dbx5x0.dtsi | 1144 ----------------------------- arch/arm/dts/ste-ux500-samsung-stemmy.dts | 36 - arch/arm/dts/u8500-u-boot.dtsi | 30 + configs/stemmy_defconfig | 3 +- 6 files changed, 32 insertions(+), 1220 deletions(-)[...]
arch/arm/dts/ste-ux500-samsung-stemmy.dts deleted +0
-36@@ -1,36 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/dts-v1/; - -#include "ste-dbx5x0-u-boot.dtsi" -#include "ste-ab8500.dtsi" - -/ { - compatible = "samsung,stemmy", "st-ericsson,u8500"; - - chosen { - stdout-path = &serial2; - }; - - soc { - /* eMMC */ - mmc@80005000 { - status = "okay"; - - arm,primecell-periphid = <0x10480180>; - max-frequency = <100000000>; - bus-width = <8>; - - non-removable; - cap-mmc-highspeed; - }; - - /* Debugging console UART */ - uart@80007000 { - status = "okay"; - }; - - mcde@a0350000 { - status = "okay"; - }; - }; -};arch/arm/dts/u8500-u-boot.dtsi new file +12
-0@@ -0,0 +1,30 @@ +// 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 {
arch/arm/dts/u8500-u-boot.dtsi line 22
Quoted 10 lines
arch/arm/dts/u8500-u-boot.dtsi new file +10
-0+ clock-frequency = <133000000>; + }; + + mmc@80126000 { + clocks = <&sdmmcclk>; + }; + + mmc@80118000 { + status = "disabled"; + };
Nitpick: Maybe you can add a comment here to explain this
/* Typically SDIO, unneeded in U-Boot */
Although long-term I think we should try to drop all of these overrides and handle workarounds in the board code or drivers if necessary. With EFI, some people may try to boot generic distro images that don't override the DTB, in that case Linux will boot with the original U-Boot DTB. E.g. arch/arm/mach-snapdragon/of_fixup.c has some DTB workarounds that are applied only to U-Boot and then discarded when booting Linux with the U-Boot DTB.
But that's something for a future patch series, not this one. :-)
Thanks,
Stephan
Linus Walleij
maintainerRe: [PATCH v5 10/13] arm: u8500: Switch Stemmy to upstream Janice device tree
Quoted 7 lines · Stephan Gerhold
arch/arm/dts/u8500-u-boot.dtsi line 22
Quoted 3 lines
arch/arm/dts/u8500-u-boot.dtsi new file +3
-0+ mmc@80118000 { + status = "disabled"; + };Nitpick: Maybe you can add a comment here to explain this
/* Typically SDIO, unneeded in U-Boot */
OK!
Quoted 9 lines
Although long-term I think we should try to drop all of these overrides and handle workarounds in the board code or drivers if necessary. With EFI, some people may try to boot generic distro images that don't override the DTB, in that case Linux will boot with the original U-Boot DTB. E.g.
arch/arm/mach-snapdragon/of_fixup.chas some DTB workarounds that are applied only to U-Boot and then discarded when booting Linux with the U-Boot DTB.But that's something for a future patch series, not this one. :-)
Hm yeah Ux500 ARMv7 is a bit fringe but I guess it could be done.
Yours,
Linus Walleij
Linus Walleij
maintainerPATCH v5 11/13 ARM: dts: ux500: Make panel regulators have unique names
In reply to Linus WalleijU-Boot is not happy about regulators with the same name though Linux can deal with it. Make the names unique, it's more elegant.
[ upstream commit: ..... ]
(cherry picked from commit .....)
--- dts/upstream/src/arm/st/ste-ux500-samsung-golden.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
dts/upstream/src/arm/st/ste-ux500-samsung-golden.dts +2 -2
@@ -510,7 +510,7 @@ panel_reg_1v8: regulator-panel-1v8 { compatible = "regulator-fixed"; - regulator-name = "panel-fixed-supply"; + regulator-name = "panel-fixed-supply-1v8"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; /* GPIO219 */
@@ -527,7 +527,7 @@ panel_reg_3v0: regulator-panel-3v0 { compatible = "regulator-fixed"; - regulator-name = "panel-fixed-supply"; + regulator-name = "panel-fixed-supply-3v0"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; /* GPIO219 */
Signature · 1 line
2.55.0
Linus Walleij
maintainerPATCH v5 12/13 ARM: dts: ux500: Harmonize GPIO key names
In reply to Linus WalleijU-Boot want to use the volume down key for activating fastboot mode, however the code there relies on using the key label, and this differs betweem Golden and the other devices, so harmonize this by using the same label as the other devices.
[ upstream commit: ..... ]
(cherry picked from commit .....)
--- dts/upstream/src/arm/st/ste-ux500-samsung-golden.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
dts/upstream/src/arm/st/ste-ux500-samsung-golden.dts +3 -3
@@ -391,21 +391,21 @@ label = "GPIO Buttons"; volume-up { - label = "Volume Up"; + label = "VOL+"; /* GPIO67 (VOL_UP) */ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; linux,code = <KEY_VOLUMEUP>; }; volume-down { - label = "Volume Down"; + label = "VOL-"; /* GPIO92 (VOL_DOWN) */ gpios = <&gpio2 28 GPIO_ACTIVE_LOW>; linux,code = <KEY_VOLUMEDOWN>; }; home { - label = "Home"; + label = "HOME"; /* GPIO91 (HOME_KEY) */ gpios = <&gpio2 27 GPIO_ACTIVE_LOW>; linux,code = <KEY_HOMEPAGE>;
Signature · 1 line
2.55.0
Linus Walleij
maintainerPATCH v5 13/13 arm: u8500: Package Stemmy device trees in FIT
In reply to Linus WalleijBuild all seven supported Samsung Ux500 device trees into the FIT appended to U-Boot. Select the appropriate configuration at runtime from the machine ID passed by the Samsung firmware. Codina and Codina TMO share a machine ID, so distinguish Codina TMO by its board ID.
Keep a Kconfig default for the generic multi-DTB build dependency, but remove it from the defconfig since the board selection is now dynamic. Print the firmware machine and board IDs to aid diagnostics and future machine ID mappings.
--- arch/arm/Kconfig | 1 + board/ste/stemmy/Kconfig | 6 ++++ board/ste/stemmy/stemmy.c | 77 ++++++++++++++++++++++++++++++++++++++++++++--- configs/stemmy_defconfig | 1 - 4 files changed, 79 insertions(+), 6 deletions(-)
arch/arm/Kconfig +1 -0
@@ -1278,6 +1278,7 @@ config ARCH_U8500 imply DM_REGULATOR imply DM_REGULATOR_FIXED imply DM_RTC + imply MULTI_DTB_FIT imply NOMADIK_GPIO imply NOMADIK_MTU_TIMER imply PINCTRL
board/ste/stemmy/Kconfig +6 -0
@@ -9,4 +9,10 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "stemmy" +config DEFAULT_DEVICE_TREE + default "st/ste-ux500-samsung-janice" + +config OF_LIST + default "st/ste-ux500-samsung-codina st/ste-ux500-samsung-codina-tmo st/ste-ux500-samsung-gavini st/ste-ux500-samsung-golden st/ste-ux500-samsung-janice st/ste-ux500-samsung-kyle st/ste-ux500-samsung-skomer" + endif
board/ste/stemmy/stemmy.c +72 -5
101 lines not on this page · raw message
configs/stemmy_defconfig +0 -1
@@ -11,7 +11,6 @@ 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="st/ste-ux500-samsung-janice" CONFIG_OF_UPSTREAM=y CONFIG_SYS_BOOTM_LEN=0x4000000 CONFIG_SYS_LOAD_ADDR=0x100000
Signature · 1 line
2.55.0
Re: [PATCH v5 13/13] arm: u8500: Package Stemmy device trees in FIT
Quoted 11 lines · Linus Walleij
Build all seven supported Samsung Ux500 device trees into the FIT appended to U-Boot. Select the appropriate configuration at runtime from the machine ID passed by the Samsung firmware. Codina and Codina TMO share a machine ID, so distinguish Codina TMO by its board ID.
Keep a
Kconfigdefault for the generic multi-DTB build dependency, but remove it from the defconfig since the board selection is now dynamic. Print the firmware machine and board IDs to aid diagnostics and future machine ID mappings.Signed-off-by Linus Walleij <[email protected]>
Yes! This is great, thanks :)
Quoted 12 lines
--- arch/arm/Kconfig | 1 + board/ste/stemmy/Kconfig | 6 ++++ board/ste/stemmy/stemmy.c | 77 ++++++++++++++++++++++++++++++++++++++++++++--- configs/stemmy_defconfig | 1 - 4 files changed, 79 insertions(+), 6 deletions(-)arch/arm/Kconfig +0
-0
arch/arm/Kconfig config ARCH_U8500 · line 1284
Quoted 7 lines
arch/arm/Kconfig +1
-0@@ -1278,6 +1278,7 @@ config ARCH_U8500 imply DM_REGULATOR imply DM_REGULATOR_FIXED imply DM_RTC + imply MULTI_DTB_FIT imply NOMADIK_GPIO imply NOMADIK_MTU_TIMER imply PINCTRL
It's a bit weird to have this in ARCH_U8500 since there may be other (non-Samsung) U8500 boards who couldn't use MULTI_DTB_FIT.
Can you put this into stemmy_defconfig?
Quoted 5 lines
board/ste/stemmy/Kconfig +0
-0
board/ste/stemmy/Kconfig config SYS_VENDOR · line 18
Quoted 10 lines
board/ste/stemmy/Kconfig +6
-0@@ -9,4 +9,10 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "stemmy" +config DEFAULT_DEVICE_TREE + default "st/ste-ux500-samsung-janice" + +config OF_LIST + default "st/ste-ux500-samsung-codina st/ste-ux500-samsung-codina-tmo st/ste-ux500-samsung-gavini st/ste-ux500-samsung-golden st/ste-ux500-samsung-janice st/ste-ux500-samsung-kyle st/ste-ux500-samsung-skomer" + endif
I don't mind adding this here, but I'm also not sure if there is any advantage compared to adding this directly in stemmy_defconfig?
Thanks,
Stephan