Skip to contentSkip to conversation

dm: mmc: socfpga: fix MMC_OPS support

PATCH New Sylvain Lesne 4 participants 6 messages Oct 24, 2016 – Oct 26, 2016 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm: mmc: socfpga: fix MMC_OPS support

Now that CONFIG_BLK and CONFIG_MMC_OPS are enabled by default with CONFIG_DM_MMC, the DWMMC driver on the socfpga platform fails at runtime.

This adds the missing fields in the driver declaration.

---

Hi,

I might be missing something, but with the latest master, on a socfpga board, I get the following failure:

U-Boot SPL 2016.11-rc2-00072-g869588d-dirty (Oct 24 2016 - 17:18:22) drivers/ddr/altera/sequencer.c: Preparing to start memory calibration drivers/ddr/altera/sequencer.c: CALIBRATION PASSED drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot from MMC1
spl: partition error
MMC: block number 0xx exceeds max(0xx)
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

After some digging, it seems that the socfpga_dw_mmc driver slipped through the cracks during some steps of the DM conversion, so I added the missing fields of the driver declaration, mimicking what's done in the other dw_mmc_* drivers, and it works on my board.

(Also, this is kind of unrelated, but it looks like the error message 'MMC: block number 0xx exceeds max(0xx)' has a formatting issue!)

---
 drivers/mmc/socfpga_dw_mmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/socfpga_dw_mmc.c +2 -0
index 5a3a4ff..0a22e58 100644
@@ -151,7 +151,9 @@ U_BOOT_DRIVER(socfpga_dwmmc_drv) = {
 	.id		= UCLASS_MMC,
 	.of_match	= socfpga_dwmmc_ids,
 	.ofdata_to_platdata = socfpga_dwmmc_ofdata_to_platdata,
+	.ops		= &dm_dwmci_ops,
 	.bind		= socfpga_dwmmc_bind,
 	.probe		= socfpga_dwmmc_probe,
 	.priv_auto_alloc_size = sizeof(struct dwmci_socfpga_priv_data),
+	.platdata_auto_alloc_size = sizeof(struct socfpga_dwmci_plat),
 };
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 dm: mmc: socfpga: fix MMC_OPS support

Quoted 8 lines · Sylvain Lesne

Now that CONFIG_BLK and CONFIG_MMC_OPS are enabled by default with CONFIG_DM_MMC, the DWMMC driver on the socfpga platform fails at runtime.

This adds the missing fields in the driver declaration.

---

Nice catch, thanks.

Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 dm: mmc: socfpga: fix MMC_OPS support

In reply to Sylvain Lesne
Quoted 31 lines · Sylvain Lesne

Now that CONFIG_BLK and CONFIG_MMC_OPS are enabled by default with CONFIG_DM_MMC, the DWMMC driver on the socfpga platform fails at runtime.

This adds the missing fields in the driver declaration.

---

Hi,

I might be missing something, but with the latest master, on a socfpga board, I get the following failure:

U-Boot SPL 2016.11-rc2-00072-g869588d-dirty (Oct 24 2016 - 17:18:22) drivers/ddr/altera/sequencer.c: Preparing to start memory calibration drivers/ddr/altera/sequencer.c: CALIBRATION PASSED drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot from MMC1
spl: partition error
MMC: block number 0xx exceeds max(0xx)
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

After some digging, it seems that the socfpga_dw_mmc driver slipped through the cracks during some steps of the DM conversion, so I added the missing fields of the driver declaration, mimicking what's done in the other dw_mmc_* drivers, and it works on my board.

Quoted 7 lines

(Also, this is kind of unrelated, but it looks like the error message 'MMC: block number 0xx exceeds max(0xx)' has a formatting issue!)

---
 drivers/mmc/socfpga_dw_mmc.c | 2 ++
 1 file changed, 2 insertions(+)

The formatting issue may be due to tiny-printf.

- Simon

#3 lore raw

PATCH 1/1 dm: mmc: socfpga: fix MMC_OPS support

Hi,

Quoted 9 lines · Simon Glass
Quoted 8 lines · Sylvain Lesne

Now that CONFIG_BLK and CONFIG_MMC_OPS are enabled by default with CONFIG_DM_MMC, the DWMMC driver on the socfpga platform fails at runtime.

This adds the missing fields in the driver declaration.

Applied on u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

Quoted 40 lines
Quoted 23 lines

---

Hi,

I might be missing something, but with the latest master, on a socfpga board, I get the following failure:

U-Boot SPL 2016.11-rc2-00072-g869588d-dirty (Oct 24 2016 - 17:18:22) drivers/ddr/altera/sequencer.c: Preparing to start memory calibration drivers/ddr/altera/sequencer.c: CALIBRATION PASSED drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot from MMC1
spl: partition error
MMC: block number 0xx exceeds max(0xx)
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

After some digging, it seems that the socfpga_dw_mmc driver slipped through the cracks during some steps of the DM conversion, so I added the missing fields of the driver declaration, mimicking what's done in the other dw_mmc_* drivers, and it works on my board.

Quoted 7 lines

(Also, this is kind of unrelated, but it looks like the error message 'MMC: block number 0xx exceeds max(0xx)' has a formatting issue!)

---
 drivers/mmc/socfpga_dw_mmc.c | 2 ++
 1 file changed, 2 insertions(+)

The formatting issue may be due to tiny-printf.

- Simon

#4 lore raw

PATCH 1/1 dm: mmc: socfpga: fix MMC_OPS support

Quoted 9 lines · Jaehoon Chung

Hi,

Quoted 6 lines · Simon Glass
Quoted 5 lines · Sylvain Lesne

Now that CONFIG_BLK and CONFIG_MMC_OPS are enabled by default with CONFIG_DM_MMC, the DWMMC driver on the socfpga platform fails at runtime.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

This adds the missing fields in the driver declaration.

Applied on u-boot-mmc. Thanks!

Cool, thanks.

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw

PATCH 1/1 dm: mmc: socfpga: fix MMC_OPS support

In reply to Simon Glass

Hi,

Quoted 11 lines · Simon Glass
Quoted 8 lines · Sylvain Lesne

(Also, this is kind of unrelated, but it looks like the error message 'MMC: block number 0xx exceeds max(0xx)' has a formatting issue!)

---
 drivers/mmc/socfpga_dw_mmc.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 6 lines

The formatting issue may be due to tiny-printf.

- Simon

Thanks for the review! And indeed, I didn't realize that tiny-printf doesn't support the 'long int' specifiers, sorry.

--
Best regards,
Sylvain Lesne