[U-Boot] [PATCH 0/4] k2g: switch mmc/sd to driver model

This patch set switches mmc/sd support on k2g to use driver model.
Tested both SD card and emmc on k2g-evm by writing data, reading it back and comparing crc.
also tested with buildman for am33xx and omap
Sekhar Nori (4): drivers: mmc: omap_hsmmc: fix build breakage ARM: dts: K2G: Add support for MMC controller ARM: dts: k2g-evm: enable mmc/sd suppport defconfig: k2g_evm_defconfig: Enable mmc driver model
arch/arm/dts/k2g-evm.dts | 8 ++++++++ arch/arm/dts/k2g.dtsi | 23 +++++++++++++++++++++++ configs/k2g_evm_defconfig | 1 + drivers/mmc/omap_hsmmc.c | 2 ++ 4 files changed, 34 insertions(+)

structure member 'cd_inverted' of omap_hsmmc_data is available only when OMAP_HSMMC_USE_GPIO is defined.
When CONFIG_DM_MMC is defined, but not CONFIG_OMAP_GPIO, this will cause build breakage in omap_hsmmc driver of the sort:
CC drivers/mmc/omap_hsmmc.o ../drivers/mmc/omap_hsmmc.c: In function 'omap_hsmmc_ofdata_to_platdata': ../drivers/mmc/omap_hsmmc.c:1763:6: error: 'struct omap_hsmmc_data' has no member named 'cd_inverted' priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted"); ^
Fix this by accessing cd_inverted only when OMAP_HSMMC_USE_GPIO is defined.
Signed-off-by: Sekhar Nori nsekhar@ti.com --- drivers/mmc/omap_hsmmc.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index e80ac3d7220c..fceafe1f156e 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -801,7 +801,9 @@ static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev) cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
+#ifdef OMAP_HSMMC_USE_GPIO priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted"); +#endif
return 0; }

On Wednesday 10 August 2016 07:24 PM, Sekhar Nori wrote:
structure member 'cd_inverted' of omap_hsmmc_data is available only when OMAP_HSMMC_USE_GPIO is defined.
When CONFIG_DM_MMC is defined, but not CONFIG_OMAP_GPIO, this will cause build breakage in omap_hsmmc driver of the sort:
CC drivers/mmc/omap_hsmmc.o ../drivers/mmc/omap_hsmmc.c: In function 'omap_hsmmc_ofdata_to_platdata': ../drivers/mmc/omap_hsmmc.c:1763:6: error: 'struct omap_hsmmc_data' has no member named 'cd_inverted' priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted"); ^
Fix this by accessing cd_inverted only when OMAP_HSMMC_USE_GPIO is defined.
Signed-off-by: Sekhar Nori nsekhar@ti.com
Acked-by: Mugunthan V N mugunthanvnm@ti.com
Regards Mugunthan V N

On Wed, Aug 10, 2016 at 07:24:03PM +0530, Sekhar Nori wrote:
structure member 'cd_inverted' of omap_hsmmc_data is available only when OMAP_HSMMC_USE_GPIO is defined.
When CONFIG_DM_MMC is defined, but not CONFIG_OMAP_GPIO, this will cause build breakage in omap_hsmmc driver of the sort:
CC drivers/mmc/omap_hsmmc.o ../drivers/mmc/omap_hsmmc.c: In function 'omap_hsmmc_ofdata_to_platdata': ../drivers/mmc/omap_hsmmc.c:1763:6: error: 'struct omap_hsmmc_data' has no member named 'cd_inverted' priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted"); ^
Fix this by accessing cd_inverted only when OMAP_HSMMC_USE_GPIO is defined.
Signed-off-by: Sekhar Nori nsekhar@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

K2G SoC from TI has two MMC/SD controllers. Add device tree data for these.
Signed-off-by: Sekhar Nori nsekhar@ti.com --- arch/arm/dts/k2g.dtsi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
diff --git a/arch/arm/dts/k2g.dtsi b/arch/arm/dts/k2g.dtsi index 00cd49297336..add03b74da36 100644 --- a/arch/arm/dts/k2g.dtsi +++ b/arch/arm/dts/k2g.dtsi @@ -149,5 +149,28 @@ #size-cells = <0>; status = "disabled"; }; + + mmc0: mmc@23000000 { + compatible = "ti,omap4-hsmmc"; + reg = <0x23000000 0x400>; + interrupts = <GIC_SPI 96 IRQ_TYPE_EDGE_RISING>; + bus-width = <4>; + ti,needs-special-reset; + no-1-8-v; + max-frequency = <96000000>; + status = "disabled"; + }; + + mmc1: mmc@23100000 { + compatible = "ti,omap4-hsmmc"; + reg = <0x23100000 0x400>; + interrupts = <GIC_SPI 97 IRQ_TYPE_EDGE_RISING>; + bus-width = <8>; + ti,needs-special-reset; + ti,non-removable; + max-frequency = <96000000>; + status = "disabled"; + clock-names = "fck"; + }; }; };

On Wednesday 10 August 2016 07:24 PM, Sekhar Nori wrote:
K2G SoC from TI has two MMC/SD controllers. Add device tree data for these.
Signed-off-by: Sekhar Nori nsekhar@ti.com
Acked-by: Mugunthan V N mugunthanvnm@ti.com
Regards Mugunthan V N

On Wed, Aug 10, 2016 at 07:24:04PM +0530, Sekhar Nori wrote:
K2G SoC from TI has two MMC/SD controllers. Add device tree data for these.
Signed-off-by: Sekhar Nori nsekhar@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

The K2G EVM from TI has an SD card slot as well as onboard eMMC for data storage.
Enable support for these.
Signed-off-by: Sekhar Nori nsekhar@ti.com --- arch/arm/dts/k2g-evm.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/dts/k2g-evm.dts b/arch/arm/dts/k2g-evm.dts index e95efd476707..61d0d5543337 100644 --- a/arch/arm/dts/k2g-evm.dts +++ b/arch/arm/dts/k2g-evm.dts @@ -100,3 +100,11 @@ }; }; }; + +&mmc0 { + status = "okay"; +}; + +&mmc1 { + status = "okay"; +};

On Wednesday 10 August 2016 07:24 PM, Sekhar Nori wrote:
The K2G EVM from TI has an SD card slot as well as onboard eMMC for data storage.
Enable support for these.
Signed-off-by: Sekhar Nori nsekhar@ti.com
Acked-by: Mugunthan V N mugunthanvnm@ti.com
Regards Mugunthan V N

On Wed, Aug 10, 2016 at 07:24:05PM +0530, Sekhar Nori wrote:
The K2G EVM from TI has an SD card slot as well as onboard eMMC for data storage.
Enable support for these.
Signed-off-by: Sekhar Nori nsekhar@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

K2G can benefit from driver model support in the MMC/SD driver it uses: omap_hsmmc
Enable driver model MMC support for K2G.
Signed-off-by: Sekhar Nori nsekhar@ti.com --- configs/k2g_evm_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/k2g_evm_defconfig b/configs/k2g_evm_defconfig index 5d44e8deb3d1..825de72f9488 100644 --- a/configs/k2g_evm_defconfig +++ b/configs/k2g_evm_defconfig @@ -32,6 +32,7 @@ CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_DM_ETH=y +CONFIG_DM_MMC=y CONFIG_REMOTEPROC_TI_POWER=y CONFIG_SYS_NS16550=y CONFIG_USB=y

On Wednesday 10 August 2016 07:24 PM, Sekhar Nori wrote:
K2G can benefit from driver model support in the MMC/SD driver it uses: omap_hsmmc
Enable driver model MMC support for K2G.
Signed-off-by: Sekhar Nori nsekhar@ti.com
Acked-by: Mugunthan V N mugunthanvnm@ti.com
Regards Mugunthan V N

On Wed, Aug 10, 2016 at 07:24:06PM +0530, Sekhar Nori wrote:
K2G can benefit from driver model support in the MMC/SD driver it uses: omap_hsmmc
Enable driver model MMC support for K2G.
Signed-off-by: Sekhar Nori nsekhar@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

Hi,
On 08/10/2016 10:54 PM, Sekhar Nori wrote:
This patch set switches mmc/sd support on k2g to use driver model.
Tested both SD card and emmc on k2g-evm by writing data, reading it back and comparing crc.
also tested with buildman for am33xx and omap
Applied on u-boot-mmc. Thanks!
Best Regards, Jaehoon Chung
Sekhar Nori (4): drivers: mmc: omap_hsmmc: fix build breakage ARM: dts: K2G: Add support for MMC controller ARM: dts: k2g-evm: enable mmc/sd suppport defconfig: k2g_evm_defconfig: Enable mmc driver model
arch/arm/dts/k2g-evm.dts | 8 ++++++++ arch/arm/dts/k2g.dtsi | 23 +++++++++++++++++++++++ configs/k2g_evm_defconfig | 1 + drivers/mmc/omap_hsmmc.c | 2 ++ 4 files changed, 34 insertions(+)
participants (4)
-
Jaehoon Chung
-
Mugunthan V N
-
Sekhar Nori
-
Tom Rini