Skip to contentSkip to conversation

omap_hsmmc: update struct hsmmc to accommodate omap3 from DT

RFC PATCH New Adam Ford 2 participants 3 messages Apr 10, 2017 – Apr 11, 2017 Arm (32-bit)

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

RFC PATCH 1/7 omap_hsmmc: update struct hsmmc to accommodate omap3 from DT

I am working on porting an OMAP3630 board to support device tree, and I attempted to change enable DM_MMC. Unfortunately, that broke MMC.

I discovered that the base addresses were originally updated to reflect a change in the base address when using the device tree for some devices.

This was done in 11e1582506c6 ("omap_hsmmc: update struct hsmmc to accomodate base address from DT")

Unfortunately, this breaks the base address on an OMAP3630 (and I assume omap34xx) which currently doesn't have OF support yet.

Without this patch, the when driver attemps to write to mmc_base->sysconfig at 4809c110 is used instead of mmc_base->sysconfig at 4809c010. This makes any attempt to use the mmc fail. With this patch, I am able to read/write to the MMC device with DM_MMC enabled with OF support.

If there is a better solution, I am open to ideas. I verified this against the OMAP3530 TRM and OMAP3630 TRM. Since AM3359 TRM has the same value, it might be helpful for other boards, but I don't have them to test. If there is a better solution, I am perfectly open for suggestions.

If this gets reviewed and approved, I can push the OMAP3630 (and OMAP3) device trees which might let more boards move to DM and OF support.

arch/arm/include/asm/omap_mmc.h +1 -1
index f2bf645..fd9b741 100644
@@ -26,7 +26,7 @@
 #define OMAP_MMC_H_
 
 struct hsmmc {
-#ifdef CONFIG_DM_MMC
+#if defined(CONFIG_DM_MMC) && !defined(OMAP34XX)
 	unsigned char res0[0x100];
 #endif
 	unsigned char res1[0x10];
Signature · 1 line
2.7.4
#1 lore raw

RFC PATCH 1/7 omap_hsmmc: update struct hsmmc to accommodate omap3 from DT

Quoted 17 lines · Adam Ford

I am working on porting an OMAP3630 board to support device tree, and I attempted to change enable DM_MMC. Unfortunately, that broke MMC.

I discovered that the base addresses were originally updated to reflect a change in the base address when using the device tree for some devices.

This was done in 11e1582506c6 ("omap_hsmmc: update struct hsmmc to accomodate base address from DT")

Unfortunately, this breaks the base address on an OMAP3630 (and I assume omap34xx) which currently doesn't have OF support yet.

Without this patch, the when driver attemps to write to mmc_base->sysconfig at 4809c110 is used instead of mmc_base->sysconfig at 4809c010. This makes any attempt to use the mmc fail. With this patch, I am able to read/write to the MMC device with DM_MMC enabled with OF support.

Quoted 4 lines

If there is a better solution, I am open to ideas. I verified this against the OMAP3530 TRM and OMAP3630 TRM. Since AM3359 TRM has the same value, it might be helpful for other boards, but I don't have them to test. If there is a better solution, I am perfectly open for suggestions.

How about handling this in the same way as handled by Linux kernel omap_hsmmc driver?

Quoted 20 lines

If this gets reviewed and approved, I can push the OMAP3630 (and OMAP3) device trees which might let more boards move to DM and OF support.

arch/arm/include/asm/omap_mmc.h +1 -1
index f2bf645..fd9b741 100644
@@ -26,7 +26,7 @@
 #define OMAP_MMC_H_
 
 struct hsmmc {
-#ifdef CONFIG_DM_MMC
+#if defined(CONFIG_DM_MMC) && !defined(OMAP34XX)
 	unsigned char res0[0x100];
 #endif
 	unsigned char res1[0x10];
Signature · 2 lines
Regards
Vignesh
author
#2 lore raw

RFC PATCH 1/7 omap_hsmmc: update struct hsmmc to accommodate omap3 from DT

Quoted 20 lines · Vignesh R
Quoted 17 lines · Adam Ford

I am working on porting an OMAP3630 board to support device tree, and I attempted to change enable DM_MMC. Unfortunately, that broke MMC.

I discovered that the base addresses were originally updated to reflect a change in the base address when using the device tree for some devices.

This was done in 11e1582506c6 ("omap_hsmmc: update struct hsmmc to accomodate base address from DT")

Unfortunately, this breaks the base address on an OMAP3630 (and I assume omap34xx) which currently doesn't have OF support yet.

Without this patch, the when driver attemps to write to mmc_base->sysconfig at 4809c110 is used instead of mmc_base->sysconfig at 4809c010. This makes any attempt to use the mmc fail. With this patch, I am able to read/write to the MMC device with DM_MMC enabled with OF support.

Quoted 8 lines
Quoted 4 lines

If there is a better solution, I am open to ideas. I verified this against the OMAP3530 TRM and OMAP3630 TRM. Since AM3359 TRM has the same value, it might be helpful for other boards, but I don't have them to test. If there is a better solution, I am perfectly open for suggestions.

How about handling this in the same way as handled by Linux kernel omap_hsmmc driver?

I will concede that I originally misread the AM33xx TRM. According
to it Table 18-14, the SYSSTATUS is offset 0x114, and the OMAP3 datasheet shows 0x14 consistent with the table in U-boot without the x100 byte offset.

I believe my initial suggestion should work by checking CONFIG_OMAP34XX. If present, it will not add the offset.

Sorry for the noise, I'll clean up the patch and resubmit it.

adam

Quoted 24 lines
Quoted 12 lines

If this gets reviewed and approved, I can push the OMAP3630 (and OMAP3) device trees which might let more boards move to DM and OF support.

arch/arm/include/asm/omap_mmc.h +0 -0
index f2bf645..fd9b741 100644

arch/arm/include/asm/omap_mmc.h line 32

Quoted 8 lines
arch/arm/include/asm/omap_mmc.h +1 -1
@@ -26,7 +26,7 @@
 #define OMAP_MMC_H_
 
 struct hsmmc {
-#ifdef CONFIG_DM_MMC
+#if defined(CONFIG_DM_MMC) && !defined(OMAP34XX)
      unsigned char res0[0x100];
 #endif
      unsigned char res1[0x10];

--
Regards
Vignesh