Hi all, this patch series contains PHYTEC barebox patches which weren't yet introduced to this mailing list (or at least not in this form). 1. The first patch increases the stability during boot in extreme cold conditions. 2. The second and third patch adds some missing configs (OCOTP write support and some OF commands). 3. The last three patches (fourth, fifth and sixth) are meant as a fixup for patches that deleted the PMIC supply nodes. They were introduced because barebox doesn't support DA9063 PMIC regulator driver and instead prints ugly warnings (recently downgraded from error) like: imx-esdhc 2194000.mmc@2194000.of: Failed to get 'vmmc' regulator (ignored). In either way, we rely on PMIC's reset default and use dummy regulators. Using barebox specific device-tree property ('barebox,allow-dummy-supply') shouldn't break booting Linux with barebox internal device-tree and allows using dummy regulators in bootloader where regulator support is limited. The complete solution would be porting DA9063 regulator driver to barebox, but let's add that to our "to-do" list for now and use this workaround instead. Best regards, Andrej Changes in v2: - remove "PHYTEC specific" config patch. Drop removing IPUV3 driver and move enabled configs to default imx_v7_defconfig, - move "barebox,allow-dummy-supply" to be added to regulator provider Andrej Picej (5): ARM: configs: imx_v7_defconfig: add OF commands ARM: configs: imx_v7_defconfig: add OCOTP write support regulator: allow use of dummy regulator ARM: dts: imx6qdl: pfla02: use dummy regulators documentation: regulator: add allow-dummy-supply Stefan Riedmueller (1): flash-header-phytec-pcl063: Set SOC voltage to 1.25 V during boot .../bindings/regulator/regulator.rst | 35 +++++++++++++++++++ .../flash-header-phytec-pcl063.h | 2 ++ arch/arm/configs/imx_v7_defconfig | 4 +++ arch/arm/dts/imx6qdl-phytec-pfla02.dtsi | 12 ++----- drivers/regulator/core.c | 20 +++++++++-- 5 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 Documentation/devicetree/bindings/regulator/regulator.rst -- 2.25.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
From: Stefan Riedmueller <s.riedmueller@phytec.de> To increase stability during boot in cold conditions (< -30 °C) increase the SOC voltage from 1.15 V to 1.25 V in DCD. The ARM voltage is left unchanged at its default 1.15 V. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Andrej Picej <andrej.picej@norik.com> --- Changes in v2: - no changes --- arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h index 9a8f5f18e..8e0ab6f58 100644 --- a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h +++ b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h @@ -3,6 +3,8 @@ loadaddr 0x80000000 soc imx6 ivtofs 0x400 +wm 32 0x020c8140 0x00580012 + wm 32 0x020c4068 0xffffffff wm 32 0x020c406c 0xffffffff wm 32 0x020c4070 0xffffffff -- 2.25.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Add OF commands: - of_overlay, - of_display_timings and - of_fixup_status. Signed-off-by: Andrej Picej <andrej.picej@norik.com> --- Changes in v2: - drop "PHYTEC specific" patch and add changes directly to imx_v7_defconfig --- arch/arm/configs/imx_v7_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/configs/imx_v7_defconfig b/arch/arm/configs/imx_v7_defconfig index 624698ae3..29c2d3190 100644 --- a/arch/arm/configs/imx_v7_defconfig +++ b/arch/arm/configs/imx_v7_defconfig @@ -133,6 +133,9 @@ CONFIG_CMD_WD=y CONFIG_CMD_BAREBOX_UPDATE=y CONFIG_CMD_OF_NODE=y CONFIG_CMD_OF_PROPERTY=y +CONFIG_CMD_OF_DISPLAY_TIMINGS=y +CONFIG_CMD_OF_FIXUP_STATUS=y +CONFIG_CMD_OF_OVERLAY=y CONFIG_CMD_OFTREE=y CONFIG_CMD_TIME=y CONFIG_CMD_STATE=y -- 2.25.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Signed-off-by: Andrej Picej <andrej.picej@norik.com> --- Changes in v2: - drop "PHYTEC specific" patch and add changes directly to imx_v7_defconfig --- arch/arm/configs/imx_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/imx_v7_defconfig b/arch/arm/configs/imx_v7_defconfig index 29c2d3190..8e707b960 100644 --- a/arch/arm/configs/imx_v7_defconfig +++ b/arch/arm/configs/imx_v7_defconfig @@ -198,6 +198,7 @@ CONFIG_WATCHDOG=y CONFIG_WATCHDOG_IMX=y CONFIG_PWM=y CONFIG_PWM_IMX=y +CONFIG_IMX_OCOTP_WRITE=y CONFIG_MXS_APBH_DMA=y CONFIG_GPIO_STMPE=y CONFIG_REGULATOR=y -- 2.25.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
The idea of devicetree property which allows use of dummy regulator is not new but has not been implemented until now. This implementation uses barebox specific devicetree property "barebox,allow-dummy-supply" to allow switching to a dummy power regulator in cases where proper regulator driver is not available. This property can be set for regulator or for PMIC regulators nodes, which then allow use of dummy regulator for all its child nodes. Basically just catch the regulators ensure_probed error, if "barebox,allow-dummy-supply" property is set and return dummy regulator. Signed-off-by: Andrej Picej <andrej.picej@norik.com> --- Changes in v2: - node is now added on regulator side, so check for property on provider side --- drivers/regulator/core.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 097f7d779..4f45c23cd 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -197,7 +197,7 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c { char *propname; struct regulator_internal *ri; - struct device_node *node; + struct device_node *node, *node_parent; int ret; propname = basprintf("%s-supply", supply); @@ -231,8 +231,24 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c } ret = of_device_ensure_probed(node); - if (ret) + if (ret) { + /* + * If "barebox,allow-dummy-supply" property is set for regulator + * provider allow use of dummy regulator (NULL is returned). + * Check regulator node and its parent if this setting is set + * PMIC wide. + */ + node_parent = of_get_parent(node); + if (of_get_property(node, "barebox,allow-dummy-supply", NULL) || + of_get_property(node_parent, "barebox,allow-dummy-supply", NULL)) { + dev_dbg(dev, "Allow use of dummy regulator for " \ + "%s-supply\n", supply); + ri = NULL; + goto out; + } + return ERR_PTR(ret); + } list_for_each_entry(ri, ®ulator_list, list) { if (ri->node == node) { -- 2.25.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
The power for the phyFLEX sd cards and ethernet controller are supplied by the DA9063 PMIC's LDOs. There is no barebox driver for those LDO regulators. Thus use dummy-regulators to suppress warning message. Signed-off-by: Andrej Picej <andrej.picej@norik.com> --- Changes in v2: - move "barebox,allow-dummy-supply" property from regulator consumer to regulator provider --- arch/arm/dts/imx6qdl-phytec-pfla02.dtsi | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi index 0653fcc3c..ada160768 100644 --- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi @@ -81,15 +81,6 @@ }; }; -&fec { - /* - * barebox doesn't have a driver for the PMIC providing the phy-supply - * (dlg,da9063). So remove the phy-supply property and rely on the - * PMIC's reset default which has this supply enabled. - */ - /delete-property/ phy-supply; -}; - &gpmi { partitions { compatible = "fixed-partitions"; @@ -162,5 +153,8 @@ watchdog-priority = <500>; restart-priority = <500>; reset-source-priority = <500>; + regulators { + barebox,allow-dummy-supply; + }; }; }; -- 2.25.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Add "barebox,allow-dummy-supply" property documentation. Signed-off-by: Andrej Picej <andrej.picej@norik.com> --- Changes in v2: - adapt documentation to changed usage --- .../bindings/regulator/regulator.rst | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/regulator.rst diff --git a/Documentation/devicetree/bindings/regulator/regulator.rst b/Documentation/devicetree/bindings/regulator/regulator.rst new file mode 100644 index 000000000..9afc020ac --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/regulator.rst @@ -0,0 +1,35 @@ +Voltage/Current Regulators +========================== + +In addition to the upstream bindings, another property is added: + +Optional properties: +- ``barebox,allow-dummy-supply`` : A property to allow usage of dummy power + regulator. This can be added to regulator nodes, whose drivers are not yet + supported. It will rely on regulator reset defaults and use of dummy regulator + instead. + +Examples: + +.. code-block:: none + + pmic@58 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pmic>; + compatible = "dlg,da9063"; + reg = <0x58>; + + regulators { + barebox,allow-dummy-supply; + + vddcore_reg: bcore1 { + regulator-min-microvolt = <730000>; + regulator-max-microvolt = <1380000>; + }; + + vddsoc_reg: bcore2 { + regulator-min-microvolt = <730000>; + regulator-max-microvolt = <1380000>; + }; + } + } -- 2.25.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On Fri, Nov 19, 2021 at 1:55 AM Andrej Picej <andrej.picej@norik.com> wrote: > > ret = of_device_ensure_probed(node); > - if (ret) > + if (ret) { > + /* > + * If "barebox,allow-dummy-supply" property is set for regulator > + * provider allow use of dummy regulator (NULL is returned). > + * Check regulator node and its parent if this setting is set > + * PMIC wide. > + */ > + node_parent = of_get_parent(node); > + if (of_get_property(node, "barebox,allow-dummy-supply", NULL) || > + of_get_property(node_parent, "barebox,allow-dummy-supply", NULL)) { > + dev_dbg(dev, "Allow use of dummy regulator for " \ > + "%s-supply\n", supply); > + ri = NULL; > + goto out; > + } > + > return ERR_PTR(ret); This return, which was added in "common: add initial barebox deep-probe support", is a memory leak of propname. It should be goto out. _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On 19. 11. 21 11:49, Trent Piepho wrote: > On Fri, Nov 19, 2021 at 1:55 AM Andrej Picej <andrej.picej@norik.com> wrote: >> >> ret = of_device_ensure_probed(node); >> - if (ret) >> + if (ret) { >> + /* >> + * If "barebox,allow-dummy-supply" property is set for regulator >> + * provider allow use of dummy regulator (NULL is returned). >> + * Check regulator node and its parent if this setting is set >> + * PMIC wide. >> + */ >> + node_parent = of_get_parent(node); >> + if (of_get_property(node, "barebox,allow-dummy-supply", NULL) || >> + of_get_property(node_parent, "barebox,allow-dummy-supply", NULL)) { >> + dev_dbg(dev, "Allow use of dummy regulator for " \ >> + "%s-supply\n", supply); >> + ri = NULL; >> + goto out; >> + } >> + >> return ERR_PTR(ret); > > This return, which was added in "common: add initial barebox > deep-probe support", is a memory leak of propname. It should be goto > out. > You are right, if that's ok I will create a separate patch for that. BR, Andrej _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Fix memory leak of propname. Signed-off-by: Andrej Picej <andrej.picej@norik.com> --- drivers/regulator/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 097f7d779..c5cb9ee34 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -231,8 +231,10 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c } ret = of_device_ensure_probed(node); - if (ret) - return ERR_PTR(ret); + if (ret) { + ri = ERR_PTR(ret); + goto out; + } list_for_each_entry(ri, ®ulator_list, list) { if (ri->node == node) { -- 2.25.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On Fri, Nov 19, 2021 at 10:54:23AM +0100, Andrej Picej wrote: > Hi all, > > this patch series contains PHYTEC barebox patches which weren't yet > introduced to this mailing list (or at least not in this form). > > 1. The first patch increases the stability during boot in extreme cold > conditions. > > 2. The second and third patch adds some missing configs (OCOTP write > support and some OF commands). > > 3. The last three patches (fourth, fifth and sixth) are meant as a > fixup for patches that deleted the PMIC supply nodes. They were > introduced because barebox doesn't support DA9063 PMIC regulator driver > and instead prints ugly warnings (recently downgraded from error) like: > > imx-esdhc 2194000.mmc@2194000.of: Failed to get 'vmmc' regulator (ignored). > > In either way, we rely on PMIC's reset default and use dummy > regulators. Using barebox specific device-tree property > ('barebox,allow-dummy-supply') shouldn't break booting Linux with > barebox internal device-tree and allows using dummy regulators in > bootloader where regulator support is limited. The complete solution > would be porting DA9063 regulator driver to barebox, but let's add that > to our "to-do" list for now and use this workaround instead. > > Best regards, > Andrej > > Changes in v2: > - remove "PHYTEC specific" config patch. Drop removing IPUV3 driver and move > enabled configs to default imx_v7_defconfig, > - move "barebox,allow-dummy-supply" to be added to regulator provider > > Andrej Picej (5): > ARM: configs: imx_v7_defconfig: add OF commands > ARM: configs: imx_v7_defconfig: add OCOTP write support > regulator: allow use of dummy regulator > ARM: dts: imx6qdl: pfla02: use dummy regulators > documentation: regulator: add allow-dummy-supply Applied, thanks Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Gentle ping. The patch was probably missed as is was send as an reply to Trent's memory leak find. On 19. 11. 21 14:06, Andrej Picej wrote: > Fix memory leak of propname. > > Signed-off-by: Andrej Picej <andrej.picej@norik.com> > --- > drivers/regulator/core.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c > index 097f7d779..c5cb9ee34 100644 > --- a/drivers/regulator/core.c > +++ b/drivers/regulator/core.c > @@ -231,8 +231,10 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c > } > > ret = of_device_ensure_probed(node); > - if (ret) > - return ERR_PTR(ret); > + if (ret) { > + ri = ERR_PTR(ret); > + goto out; > + } > > list_for_each_entry(ri, ®ulator_list, list) { > if (ri->node == node) { _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On Tue, Mar 01, 2022 at 09:21:34AM +0100, Andrej Picej wrote: > Gentle ping. The patch was probably missed as is was send as an reply to > Trent's memory leak find. > > On 19. 11. 21 14:06, Andrej Picej wrote: > > Fix memory leak of propname. > > > > Signed-off-by: Andrej Picej <andrej.picej@norik.com> > > --- > > drivers/regulator/core.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c > > index 097f7d779..c5cb9ee34 100644 > > --- a/drivers/regulator/core.c > > +++ b/drivers/regulator/core.c > > @@ -231,8 +231,10 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c > > } > > ret = of_device_ensure_probed(node); > > - if (ret) > > - return ERR_PTR(ret); > > + if (ret) { > > + ri = ERR_PTR(ret); > > + goto out; > > + } This conflicts with b720625659 ("regulator: allow use of dummy regulator"). I fixed this up, see the result in next. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On 1. 03. 22 09:47, Sascha Hauer wrote: > On Tue, Mar 01, 2022 at 09:21:34AM +0100, Andrej Picej wrote: >> Gentle ping. The patch was probably missed as is was send as an reply to >> Trent's memory leak find. >> >> On 19. 11. 21 14:06, Andrej Picej wrote: >>> Fix memory leak of propname. >>> >>> Signed-off-by: Andrej Picej <andrej.picej@norik.com> >>> --- >>> drivers/regulator/core.c | 6 ++++-- >>> 1 file changed, 4 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c >>> index 097f7d779..c5cb9ee34 100644 >>> --- a/drivers/regulator/core.c >>> +++ b/drivers/regulator/core.c >>> @@ -231,8 +231,10 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c >>> } >>> ret = of_device_ensure_probed(node); >>> - if (ret) >>> - return ERR_PTR(ret); >>> + if (ret) { >>> + ri = ERR_PTR(ret); >>> + goto out; >>> + } > > This conflicts with b720625659 ("regulator: allow use of dummy regulator"). > I fixed this up, see the result in next. Ohh, ok. That was fast. Thanks. Andrej _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox