[U-Boot] [PATCH 0/1] Set VLD04 output to 2.8V in PMIC initialization.

This change sets the VLDO4 settings output to 2.8V in PMIC initialization. I accidentally noticed this when I was testing the DSI voltage input which was 3.3V. Not setting the proper voltage can harm some of the voltage sensitive peripheral.
Gautam Bhat (1): Set VLD04 output to 2.8V in PMIC initialization.
board/freescale/mx7dsabresd/mx7dsabresd.c | 10 ++++++++++ 1 file changed, 10 insertions(+)

This change sets the VLDO4 settings output to 2.8V in PMIC initialization so that the MIPI DSI and MIPI CSI input voltage is 2.8V as per the schematics.
Signed-off-by: Gautam Bhat mindentropy@gmail.com ---
board/freescale/mx7dsabresd/mx7dsabresd.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index ecea5a529a..8df7ed575a 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -341,6 +341,7 @@ int power_init_board(void) { struct udevice *dev; int ret, dev_id, rev_id; + uint regval;
ret = pmic_get("pfuze3000", &dev); if (ret == -ENODEV) @@ -354,6 +355,15 @@ int power_init_board(void)
pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 0, 1);
+ /* + * Set the voltage of VLDO4 output to 2.8V which feeds + * the MIPI DSI and MIPI CSI inputs. + */ + regval = pmic_reg_read(dev, PFUZE3000_VLD4CTL); + regval &= ~(0xF); + regval |= 0xA; /* Set to 2.8V */ + pmic_reg_write(dev, PFUZE3000_VLD4CTL, regval); + return 0; } #endif

Hello Gautam,
On Wed, Jun 21, 2017 at 1:18 PM, Gautam Bhat mindentropy@gmail.com wrote:
This change sets the VLDO4 settings output to 2.8V in PMIC initialization so that the MIPI DSI and MIPI CSI input voltage is 2.8V as per the schematics.
Signed-off-by: Gautam Bhat mindentropy@gmail.com
Thanks for the patch; Fabio, could you take a look at this?

Hi Gautam,
On Wed, Jun 21, 2017 at 1:18 PM, Gautam Bhat mindentropy@gmail.com wrote:
This change sets the VLDO4 settings output to 2.8V in PMIC initialization so that the MIPI DSI and MIPI CSI input voltage is 2.8V as per the schematics.
As we do not have MIPI DSI / MIPI CSI support in U-Boot, it is preferable to let the kernel configure the regulator.
You can do this is the device tree like this:
diff --git a/arch/arm/boot/dts/imx7d-sdb.dts b/arch/arm/boot/dts/imx7d-sdb.dts index 54c4540..923aa755 100644 --- a/arch/arm/boot/dts/imx7d-sdb.dts +++ b/arch/arm/boot/dts/imx7d-sdb.dts @@ -285,8 +285,8 @@ };
vgen6_reg: vldo4 { - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; regulator-always-on; }; };
Regards,
Fabio Estevam

On Tue, Jun 27, 2017 at 10:54 PM, Fabio Estevam festevam@gmail.com wrote:
Hi Gautam,
On Wed, Jun 21, 2017 at 1:18 PM, Gautam Bhat mindentropy@gmail.com wrote:
This change sets the VLDO4 settings output to 2.8V in PMIC initialization so that the MIPI DSI and MIPI CSI input voltage is 2.8V as per the schematics.
As we do not have MIPI DSI / MIPI CSI support in U-Boot, it is preferable to let the kernel configure the regulator.
You can do this is the device tree like this:
diff --git a/arch/arm/boot/dts/imx7d-sdb.dts b/arch/arm/boot/dts/imx7d-sdb.dts index 54c4540..923aa755 100644 --- a/arch/arm/boot/dts/imx7d-sdb.dts +++ b/arch/arm/boot/dts/imx7d-sdb.dts @@ -285,8 +285,8 @@ };
vgen6_reg: vldo4 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>; regulator-always-on; }; };
Regards,
Fabio Estevam
Hi Fabio,
The patch for the kernel was supposed to be next. Should I send the kernel patch to mainline or some place else?
Coming to u-boot, the fact that even if there is no MIPI DSI/MIPI CSI support the voltage would still be 3.3V in those rails. In my case I do not attach the display after u-boot boots up. I keep the display attached and sometimes I leave it in u-boot command line without going over to the kernel. Since this is a development board this is often the case for many developers and there may be chances of the display getting damaged.
Thanks, Gautam.

Hi Gautam,
On Tue, Jun 27, 2017 at 11:32 PM, mind entropy mindentropy@gmail.com wrote:
Hi Fabio,
The patch for the kernel was supposed to be next. Should I send the kernel patch to mainline or some place else?
Do you have MIPI DSI working in mainline kernel? If you do, please share the patches.
You can use ./scripts/get_maintainer.pl to get the people and lists to put on Cc.
Coming to u-boot, the fact that even if there is no MIPI DSI/MIPI CSI support the voltage would still be 3.3V in those rails. In my case I do not attach the display after u-boot boots up. I keep the display attached and sometimes I leave it in u-boot command line without going over to the kernel. Since this is a development board this is often the case for many developers and there may be chances of the display getting damaged.
It makes sense now. Please send a v2 with the following changes:
1. Add mx7dsabresd to the Subject, so that it becomes: mx7dsabresd: Set VLD04 output to 2.8V
2. Explain in the commit message why you are doing such change, just like you did above, where you explain that the default LDO4 output is 3.3V and that is beyond the MIPI DSI spec.
3. Remove the extra parentesis (0xF): regval &= ~0xF; is enough.
Thanks

On Wed, Jun 28, 2017 at 7:43 PM, Fabio Estevam festevam@gmail.com wrote:
Hi Gautam,
On Tue, Jun 27, 2017 at 11:32 PM, mind entropy mindentropy@gmail.com wrote:
Hi Fabio,
The patch for the kernel was supposed to be next. Should I send the kernel patch to mainline or some place else?
Do you have MIPI DSI working in mainline kernel? If you do, please share the patches.
I would really like to mainline the MIPI DSI support to the mainline kernel as well as u-boot. In fact I think support for u-boot would be much simpler. I have already written a driver for the HX8363 MIPI controller for the Truly displays and I would like to contribute it to the freescale tree with some polishing but I don't have the hardware to test anymore i.e. the mx7dsabresd. Please note that the freescale tree has support for the HX8369 controller.
Thanks, Gautam.

Hi Gautam,
On Mon, Jul 3, 2017 at 2:55 PM, Gautam Bhat mindentropy@gmail.com wrote:
I would really like to mainline the MIPI DSI support to the mainline kernel as well as u-boot. In fact I think support for u-boot would be much simpler. I have already written a driver for the HX8363 MIPI controller for the Truly displays and I would like to contribute it to the freescale tree with some polishing but I don't have the hardware to test anymore i.e. the mx7dsabresd. Please note that the freescale tree has support for the HX8369 controller.
Feel free to post the patches :-)
participants (4)
-
Fabio Estevam
-
Gautam Bhat
-
mind entropy
-
Otavio Salvador