All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] imx8mm_beacon: Enable fixed regulator in SPL
@ 2020-12-30 14:14 Adam Ford
  2020-12-30 14:14 ` [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties Adam Ford
  2021-01-23 15:49 ` [PATCH 1/2] imx8mm_beacon: Enable fixed regulator in SPL sbabic at denx.de
  0 siblings, 2 replies; 10+ messages in thread
From: Adam Ford @ 2020-12-30 14:14 UTC (permalink / raw)
  To: u-boot

Because SPL can support SD UHS, the fixed regulator needs to be
enabled in SPL to reset the SD card.

Fixes: 1a5d9c84b472 ("imx8mm_beacon: Enable HS400 on MMC controller")
Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
index 49d5453078..b0ea87a58c 100644
--- a/configs/imx8mm_beacon_defconfig
+++ b/configs/imx8mm_beacon_defconfig
@@ -95,6 +95,7 @@ CONFIG_SPL_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_BD71837=y
 CONFIG_SPL_DM_REGULATOR_BD71837=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_SPL_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties
  2020-12-30 14:14 [PATCH 1/2] imx8mm_beacon: Enable fixed regulator in SPL Adam Ford
@ 2020-12-30 14:14 ` Adam Ford
  2020-12-30 14:22   ` Fabio Estevam
  2021-01-23 15:49 ` [PATCH 1/2] imx8mm_beacon: Enable fixed regulator in SPL sbabic at denx.de
  1 sibling, 1 reply; 10+ messages in thread
From: Adam Ford @ 2020-12-30 14:14 UTC (permalink / raw)
  To: u-boot

i.MX8M Mini can provide support for high speed grades in the
usdhc controllers.

On the imx8mm-beacon-kit, the sdhc2 hosts a microSD card, and
sdhc3 hosts an eMMC capable of HS400ES.

In order to toggle this mode in SPL, the reg_usdhc2_vmmc must
be available in SPL. Add all these flags to
imx8mm-beacon-kit-u-boot.dtsi

Suggested-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
index 6d80a529ae..d7da29c592 100644
--- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
@@ -38,6 +38,7 @@
 };
 
 &reg_usdhc2_vmmc {
+	u-boot,dm-spl;
 	u-boot,off-on-delay-us = <20000>;
 };
 
@@ -112,10 +113,14 @@
 
 &usdhc2 {
 	u-boot,dm-spl;
+	sd-uhs-sdr104;
+	sd-uhs-ddr50;
 };
 
 &usdhc3 {
 	u-boot,dm-spl;
+	mmc-hs400-1_8v;
+	mmc-hs400-enhanced-strobe;
 };
 
 &i2c1 {
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties
  2020-12-30 14:14 ` [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties Adam Ford
@ 2020-12-30 14:22   ` Fabio Estevam
  2020-12-30 14:45     ` Adam Ford
  0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2020-12-30 14:22 UTC (permalink / raw)
  To: u-boot

Hi Adam,

On Wed, Dec 30, 2020 at 11:14 AM Adam Ford <aford173@gmail.com> wrote:

>  &usdhc2 {
>         u-boot,dm-spl;
> +       sd-uhs-sdr104;
> +       sd-uhs-ddr50;

Shouldn't these properties be part of the main dtsi instead of adding
them to the u-boot.dtsi one?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties
  2020-12-30 14:22   ` Fabio Estevam
@ 2020-12-30 14:45     ` Adam Ford
  2020-12-30 15:24       ` Fabio Estevam
  0 siblings, 1 reply; 10+ messages in thread
From: Adam Ford @ 2020-12-30 14:45 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 30, 2020 at 8:22 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Adam,
>
> On Wed, Dec 30, 2020 at 11:14 AM Adam Ford <aford173@gmail.com> wrote:
>
> >  &usdhc2 {
> >         u-boot,dm-spl;
> > +       sd-uhs-sdr104;
> > +       sd-uhs-ddr50;
>
> Shouldn't these properties be part of the main dtsi instead of adding
> them to the u-boot.dtsi one?

Linux doesn't appear to need it, and no 64-bit imx boards in Linux
appear to use them.  Some layerscape boards appear to use these flags.
If it's not necessary for Linux, but it is necessary for U-Boot, it
seems like the -u-boot.dtsi file is the right place to put it.
It's consistent with that was done for the imx8mm-evk-u-boot.dtsi and others [1]

[1] - https://gitlab.denx.de/u-boot/u-boot/-/commit/50b1a69cee0dc06d0c713a5a978998f2b4a9cb31

adam

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties
  2020-12-30 14:45     ` Adam Ford
@ 2020-12-30 15:24       ` Fabio Estevam
  2020-12-30 16:29         ` Adam Ford
  0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2020-12-30 15:24 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 30, 2020 at 11:45 AM Adam Ford <aford173@gmail.com> wrote:

> Linux doesn't appear to need it, and no 64-bit imx boards in Linux
> appear to use them.  Some layerscape boards appear to use these flags.
> If it's not necessary for Linux, but it is necessary for U-Boot, it
> seems like the -u-boot.dtsi file is the right place to put it.
> It's consistent with that was done for the imx8mm-evk-u-boot.dtsi and others [1]

IMHO the device trees should be the same for Linux and U-Boot as much as we can.

Of course, it is OK to add custom U-Boot properties, such as
u-boot,dm-spl inside -u-boot.dtsi file, but adding MMC related
properties only in U-Boot dtsi does not seem correct.

It would be nice if someone could investigate what is missing in the
U-Boot sdhc driver to handle these modes by default.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties
  2020-12-30 15:24       ` Fabio Estevam
@ 2020-12-30 16:29         ` Adam Ford
  2020-12-30 16:34           ` Fabio Estevam
  0 siblings, 1 reply; 10+ messages in thread
From: Adam Ford @ 2020-12-30 16:29 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 30, 2020 at 9:24 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> On Wed, Dec 30, 2020 at 11:45 AM Adam Ford <aford173@gmail.com> wrote:
>
> > Linux doesn't appear to need it, and no 64-bit imx boards in Linux
> > appear to use them.  Some layerscape boards appear to use these flags.
> > If it's not necessary for Linux, but it is necessary for U-Boot, it
> > seems like the -u-boot.dtsi file is the right place to put it.
> > It's consistent with that was done for the imx8mm-evk-u-boot.dtsi and others [1]
>
> IMHO the device trees should be the same for Linux and U-Boot as much as we can.
>
> Of course, it is OK to add custom U-Boot properties, such as
> u-boot,dm-spl inside -u-boot.dtsi file, but adding MMC related
> properties only in U-Boot dtsi does not seem correct.
>
> It would be nice if someone could investigate what is missing in the
> U-Boot sdhc driver to handle these modes by default.

U-Boot has a structure to define the capabilities of the usdhc controller.

static struct esdhc_soc_data usdhc_imx8qm_data = {
  .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING |
  ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200 |
  ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES,
};

This is referenced from a variety of compatible flags, including the imx8mm.

It looks like the code is missing the checks for all of them except
ESDHC_FLAG_USDHC and ESDHC_FLAG_STD_TUNING.
The flags get copied from data->flags to priv->flags, but we check the
flags and convert them to host capabilities.  I think these flags need
to somehow get checked and  then converted to cfg->host_caps.
It gets more complicated, because the flags would need to get cleared
if the pinmux doesn't have 100MHz and 200MHz options available to it.

By comparison, the Linux code appears to handle the various flags.

In the meantime, would you be opposed to this patch since other imx8m
kits have the equivalent patch already applied?  They could be removed
if/when the esdhc driver gets updated.

adam

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties
  2020-12-30 16:29         ` Adam Ford
@ 2020-12-30 16:34           ` Fabio Estevam
  2020-12-30 17:44             ` Adam Ford
  0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2020-12-30 16:34 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 30, 2020 at 1:29 PM Adam Ford <aford173@gmail.com> wrote:

> In the meantime, would you be opposed to this patch since other imx8m
> kits have the equivalent patch already applied?  They could be removed
> if/when the esdhc driver gets updated.

I am not opposed to this patch, but would be nice if the U-Boot esdhc
driver could be changed to behave like the kernel one.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties
  2020-12-30 16:34           ` Fabio Estevam
@ 2020-12-30 17:44             ` Adam Ford
  2020-12-30 17:47               ` Fabio Estevam
  0 siblings, 1 reply; 10+ messages in thread
From: Adam Ford @ 2020-12-30 17:44 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 30, 2020 at 10:34 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> On Wed, Dec 30, 2020 at 1:29 PM Adam Ford <aford173@gmail.com> wrote:
>
> > In the meantime, would you be opposed to this patch since other imx8m
> > kits have the equivalent patch already applied?  They could be removed
> > if/when the esdhc driver gets updated.
>
> I am not opposed to this patch, but would be nice if the U-Boot esdhc
> driver could be changed to behave like the kernel one.

I just sent an RFC [1] for change that uses the esdhc_soc_data flags
to determine whether or not the function/feature is present in the
controller and checks to see if the function is enabled from Kconfig.

I was able to remove the u-boot.dtsi changes that I previously pushed,
and I was able to see that the eMMC device is running at HS400_ES
(200MHz)

u-boot=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device
u-boot=> mmc info
Device: FSL_SDHC
Manufacturer ID: 45
OEM: 100
Name: DG403
Bus Speed: 200000000
Mode: HS400ES (200MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 29.1 GiB
Bus Width: 8-bit DDR
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 29.1 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
u-boot=>

[1] - https://patchwork.ozlabs.org/project/uboot/patch/20201230173907.2891555-1-aford173 at gmail.com/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties
  2020-12-30 17:44             ` Adam Ford
@ 2020-12-30 17:47               ` Fabio Estevam
  0 siblings, 0 replies; 10+ messages in thread
From: Fabio Estevam @ 2020-12-30 17:47 UTC (permalink / raw)
  To: u-boot

Hi Adam,

On Wed, Dec 30, 2020 at 2:44 PM Adam Ford <aford173@gmail.com> wrote:

> I just sent an RFC [1] for change that uses the esdhc_soc_data flags
> to determine whether or not the function/feature is present in the
> controller and checks to see if the function is enabled from Kconfig.
>
> I was able to remove the u-boot.dtsi changes that I previously pushed,
> and I was able to see that the eMMC device is running at HS400_ES
> (200MHz)

Thanks for investigating and providing a patch. Appreciated!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] imx8mm_beacon: Enable fixed regulator in SPL
  2020-12-30 14:14 [PATCH 1/2] imx8mm_beacon: Enable fixed regulator in SPL Adam Ford
  2020-12-30 14:14 ` [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties Adam Ford
@ 2021-01-23 15:49 ` sbabic at denx.de
  1 sibling, 0 replies; 10+ messages in thread
From: sbabic at denx.de @ 2021-01-23 15:49 UTC (permalink / raw)
  To: u-boot

> Because SPL can support SD UHS, the fixed regulator needs to be
> enabled in SPL to reset the SD card.
> Fixes: 1a5d9c84b472 ("imx8mm_beacon: Enable HS400 on MMC controller")
> Signed-off-by: Adam Ford <aford173@gmail.com>
> diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
> index 49d5453078..b0ea87a58c 100644
> --- a/configs/imx8mm_beacon_defconfig
> +++ b/configs/imx8mm_beacon_defconfig
> @@ -95,6 +95,7 @@ CONFIG_SPL_DM_REGULATOR=y
>  CONFIG_DM_REGULATOR_BD71837=y
>  CONFIG_SPL_DM_REGULATOR_BD71837=y
>  CONFIG_DM_REGULATOR_FIXED=y
> +CONFIG_SPL_DM_REGULATOR_FIXED=y
>  CONFIG_DM_REGULATOR_GPIO=y
>  CONFIG_CONS_INDEX=2
>  CONFIG_DM_SERIAL=y
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-23 15:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 14:14 [PATCH 1/2] imx8mm_beacon: Enable fixed regulator in SPL Adam Ford
2020-12-30 14:14 ` [PATCH 2/2] ARM: dts: imx8mm-beacon: add UHS and HS400/HS400ES properties Adam Ford
2020-12-30 14:22   ` Fabio Estevam
2020-12-30 14:45     ` Adam Ford
2020-12-30 15:24       ` Fabio Estevam
2020-12-30 16:29         ` Adam Ford
2020-12-30 16:34           ` Fabio Estevam
2020-12-30 17:44             ` Adam Ford
2020-12-30 17:47               ` Fabio Estevam
2021-01-23 15:49 ` [PATCH 1/2] imx8mm_beacon: Enable fixed regulator in SPL sbabic at denx.de

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.