Skip to contentSkip to conversation

mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

PATCH New Faiz Abbas 4 participants 9 messages May 22, 2020 – Jun 18, 2020

Subsystems (4)
lore
Share & tools
lore

Faiz Abbas

author
#0 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

Cleanup this driver to use dt in U-boot and static platdata in SPL. This requires the following steps:

1. Move all platdata assignment from probe() to ofdata_to_platdata(). This function is only called in U-boot.
2. Replicate all the platdata assignment being done in ofdata_to_platdata() in the omapl138 board file. This data is used in the SPL case where SPL_OF_CONTROL is not enabled.
3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig

This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL')

---

This patch fixes things being broken by Simon's series disabling
libfdt when using of-platdata:
https://patchwork.ozlabs.org/project/uboot/cover/20191107155318.103300-1-sjg at chromium.org/

 .../mach-davinci/include/mach/sdmmc_defs.h    |  7 +++
 board/davinci/da8xxevm/omapl138_lcdk.c        | 12 ++++
 configs/omapl138_lcdk_defconfig               |  4 --
 drivers/mmc/davinci_mmc.c                     | 63 ++++++++-----------
 4 files changed, 45 insertions(+), 41 deletions(-)
arch/arm/mach-davinci/include/mach/sdmmc_defs.h +7 -0
index 46f6391aa2..f95a607e52 100644
@@ -152,6 +152,13 @@ struct davinci_mmc {
 	struct mmc_config cfg;
 };
 
+#define DAVINCI_MAX_BLOCKS	(32)
+struct davinci_mmc_plat {
+	struct davinci_mmc_regs *reg_base;	/* Register base address */
+	struct mmc_config cfg;
+	struct mmc mmc;
+};
+
 int davinci_mmc_init(bd_t *bis, struct davinci_mmc *host);
 
 #endif /* _SDMMC_DEFS_H */
board/davinci/da8xxevm/omapl138_lcdk.c +12 -0
index adb56c6c87..84603cb117 100644
@@ -368,8 +368,20 @@ U_BOOT_DEVICE(omapl138_uart) = {
 	.platdata = &serial_pdata,
 };
 
+static const struct davinci_mmc_plat mmc_platdata = {
+	.reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
+	.cfg = {
+		.f_min = 200000,
+		.f_max = 25000000,
+		.voltages = MMC_VDD_32_33 | MMC_VDD_33_34,
+		.host_caps = MMC_MODE_4BIT,
+		.b_max = DAVINCI_MAX_BLOCKS,
+		.name = "da830-mmc",
+	},
+};
 U_BOOT_DEVICE(omapl138_mmc) = {
 	.name = "davinci_mmc",
+	.platdata = &mmc_platdata,
 };
 
 void spl_board_init(void)
configs/omapl138_lcdk_defconfig +0 -4
index 50cf09c7f1..b0a58de03d 100644
@@ -40,16 +40,13 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_DIAG=y
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
-CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="da850-lcdk"
-CONFIG_SPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
-CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_DA8XX_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DAVINCI=y
@@ -82,4 +79,3 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_DA8XX=y
 CONFIG_USB_MUSB_PIO_ONLY=y
 CONFIG_USB_STORAGE=y
-# CONFIG_SPL_OF_LIBFDT is not set
drivers/mmc/davinci_mmc.c +26 -37

109 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

pt., 22 maj 2020 o 04:02 Faiz Abbas <[email protected]> napisa?(a):

Quoted 11 lines

Cleanup this driver to use dt in U-boot and static platdata in SPL. This requires the following steps:

1. Move all platdata assignment from probe() to ofdata_to_platdata(). This function is only called in U-boot.
2. Replicate all the platdata assignment being done in ofdata_to_platdata() in the omapl138 board file. This data is used in the SPL case where SPL_OF_CONTROL is not enabled.
3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig

Quoted 3 lines

This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL')

#2 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

In reply to Faiz Abbas

Hi Faiz,

Quoted 21 lines · Faiz Abbas

Cleanup this driver to use dt in U-boot and static platdata in SPL. This requires the following steps:

1. Move all platdata assignment from probe() to ofdata_to_platdata(). This function is only called in U-boot.
2. Replicate all the platdata assignment being done in ofdata_to_platdata() in the omapl138 board file. This data is used in the SPL case where SPL_OF_CONTROL is not enabled.
3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig

This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL')

---

This patch fixes things being broken by Simon's series disabling
libfdt when using of-platdata:
https://patchwork.ozlabs.org/project/uboot/cover/20191107155318.103300-1-sjg at chromium.org/

Quoted 5 lines
 .../mach-davinci/include/mach/sdmmc_defs.h    |  7 +++
 board/davinci/da8xxevm/omapl138_lcdk.c        | 12 ++++
 configs/omapl138_lcdk_defconfig               |  4 --
 drivers/mmc/davinci_mmc.c                     | 63 ++++++++-----------
 4 files changed, 45 insertions(+), 41 deletions(-)

Could this use of-platdata instead?

Regards,
Simon

author
#3 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

Hi Simon,

Quoted 24 lines · Simon Glass

Hi Faiz,

Quoted 21 lines · Faiz Abbas

Cleanup this driver to use dt in U-boot and static platdata in SPL. This requires the following steps:

1. Move all platdata assignment from probe() to ofdata_to_platdata(). This function is only called in U-boot.
2. Replicate all the platdata assignment being done in ofdata_to_platdata() in the omapl138 board file. This data is used in the SPL case where SPL_OF_CONTROL is not enabled.
3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig

This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL')

---

This patch fixes things being broken by Simon's series disabling
libfdt when using of-platdata:
https://patchwork.ozlabs.org/project/uboot/cover/20191107155318.103300-1-sjg at chromium.org/

Quoted 8 lines
Quoted 5 lines
 .../mach-davinci/include/mach/sdmmc_defs.h    |  7 +++
 board/davinci/da8xxevm/omapl138_lcdk.c        | 12 ++++
 configs/omapl138_lcdk_defconfig               |  4 --
 drivers/mmc/davinci_mmc.c                     | 63 ++++++++-----------
 4 files changed, 45 insertions(+), 41 deletions(-)

Could this use of-platdata instead?

We would need to implement address translation in of-platdata to do that. I prefer merging your fixes with this for now and leave of-platdata up for the future.

Thanks,
Faiz

#4 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

Hi Faiz,

Quoted 34 lines · Faiz Abbas

Hi Simon,

Quoted 30 lines · Simon Glass

Hi Faiz,

Quoted 26 lines · Faiz Abbas

Cleanup this driver to use dt in U-boot and static platdata in SPL. This requires the following steps:

1. Move all platdata assignment from probe() to ofdata_to_platdata(). This function is only called in U-boot.
2. Replicate all the platdata assignment being done in ofdata_to_platdata() in the omapl138 board file. This data is used in the SPL case where SPL_OF_CONTROL is not enabled.
3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig

This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL')

---

This patch fixes things being broken by Simon's series disabling
libfdt when using of-platdata:
https://patchwork.ozlabs.org/project/uboot/cover/20191107155318.103300-1-sjg at chromium.org/

 .../mach-davinci/include/mach/sdmmc_defs.h    |  7 +++
 board/davinci/da8xxevm/omapl138_lcdk.c        | 12 ++++
 configs/omapl138_lcdk_defconfig               |  4 --
 drivers/mmc/davinci_mmc.c                     | 63 ++++++++-----------
 4 files changed, 45 insertions(+), 41 deletions(-)
Quoted 5 lines
Quoted 2 lines

Could this use of-platdata instead?

We would need to implement address translation in of-platdata to do that. I prefer merging your fixes with this for now and leave of-platdata up for the future.

OK, yes, we can't wait for non-existent features.

There is a bit of a queue of functionality lining up for of-platdata at present.

Regards,
Simon

#5 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

Hi Faiz,

I have ended up with an omap L138 lcdk board. Do you have instructions on how to get it booting from uSD and how to create the card image? I have tried various sources but nothing works so far. Also, are you able to send me a test image I can 'dd' onto the board?

Regards,
Simon

Quoted 50 lines · Simon Glass

Hi Faiz,

Quoted 34 lines · Faiz Abbas

Hi Simon,

Quoted 30 lines · Simon Glass

Hi Faiz,

Quoted 26 lines · Faiz Abbas

Cleanup this driver to use dt in U-boot and static platdata in SPL. This requires the following steps:

1. Move all platdata assignment from probe() to ofdata_to_platdata(). This function is only called in U-boot.
2. Replicate all the platdata assignment being done in ofdata_to_platdata() in the omapl138 board file. This data is used in the SPL case where SPL_OF_CONTROL is not enabled.
3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig

This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL')

---

This patch fixes things being broken by Simon's series disabling
libfdt when using of-platdata:
https://patchwork.ozlabs.org/project/uboot/cover/20191107155318.103300-1-sjg at chromium.org/

 .../mach-davinci/include/mach/sdmmc_defs.h    |  7 +++
 board/davinci/da8xxevm/omapl138_lcdk.c        | 12 ++++
 configs/omapl138_lcdk_defconfig               |  4 --
 drivers/mmc/davinci_mmc.c                     | 63 ++++++++-----------
 4 files changed, 45 insertions(+), 41 deletions(-)
Quoted 5 lines
Quoted 2 lines

Could this use of-platdata instead?

We would need to implement address translation in of-platdata to do that. I prefer merging your fixes with this for now and leave of-platdata up for the future.

OK, yes, we can't wait for non-existent features.

There is a bit of a queue of functionality lining up for of-platdata at present.

Regards,
Simon

author
#6 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

Simon,

Quoted 7 lines · Simon Glass

Hi Faiz,

I have ended up with an omap L138 lcdk board. Do you have instructions on how to get it booting from uSD and how to create the card image? I have tried various sources but nothing works so far. Also, are you able to send me a test image I can 'dd' onto the board?

The commands in board/davinci/da8xxevm/README.da850 don't work?

Try the following:

2 - using the "dd" command

        $ dd if=u-boot.ais of=/dev/mmcblk0 seek=117 bs=512 conv=fsync

Thanks,
Faiz

#7 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

Hi Faiz,

Quoted 12 lines · Faiz Abbas

Simon,

Quoted 7 lines · Simon Glass

Hi Faiz,

I have ended up with an omap L138 lcdk board. Do you have instructions on how to get it booting from uSD and how to create the card image? I have tried various sources but nothing works so far. Also, are you able to send me a test image I can 'dd' onto the board?

Quoted 6 lines

The commands in board/davinci/da8xxevm/README.da850 don't work?

Try the following:

2 - using the "dd" command

        $ dd if=u-boot.ais of=/dev/mmcblk0 seek=117 bs=512 conv=fsync

Thanks! I didn't make the connection with da850 or think to look in board/ for docs.

Regards,
Simon

#8 lore raw

PATCH 1/1 mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

In reply to Faiz Abbas
Quoted 10 lines · Faiz Abbas

Cleanup this driver to use dt in U-boot and static platdata in SPL. This requires the following steps:

1. Move all platdata assignment from probe() to ofdata_to_platdata(). This function is only called in U-boot.
2. Replicate all the platdata assignment being done in ofdata_to_platdata() in the omapl138 board file. This data is used in the SPL case where SPL_OF_CONTROL is not enabled.
3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig

Quoted 3 lines

This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL')

Applied to u-boot-ti next.

Thanks and regards,
Lokesh