diff mbox

[U-Boot] dm: mmc: socfpga: fix MMC_OPS support

Message ID 1477326277-337-1-git-send-email-lesne@alse-fr.com
State Accepted
Commit 4f9378cf67c657c8de20284ed1be8be38a6e47bc
Delegated to: Jaehoon Chung
Headers show

Commit Message

Sylvain Lesne Oct. 24, 2016, 4:24 p.m. UTC
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.

Signed-off-by: Sylvain Lesne <lesne@alse-fr.com>
---

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(+)

Comments

Marek Vasut Oct. 24, 2016, 8:37 p.m. UTC | #1
On 10/24/2016 06:24 PM, Sylvain Lesne wrote:
> 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.
> 
> Signed-off-by: Sylvain Lesne <lesne@alse-fr.com>
> ---

Nice catch, thanks.

Acked-by: Marek Vasut <marex@denx.de>
Simon Glass Oct. 24, 2016, 9:13 p.m. UTC | #2
On 24 October 2016 at 10:24, Sylvain Lesne <lesne@alse-fr.com> wrote:
>
> 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.
>
> Signed-off-by: Sylvain Lesne <lesne@alse-fr.com>
> ---
>
> 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(+)


Reviewed-by: Simon Glass <sjg@chromium.org>

The formatting issue may be due to tiny-printf.

- Simon
Jaehoon Chung Oct. 26, 2016, 2:03 a.m. UTC | #3
Hi,

On 10/25/2016 06:13 AM, Simon Glass wrote:
> On 24 October 2016 at 10:24, Sylvain Lesne <lesne@alse-fr.com> wrote:
>>
>> 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.
>>
>> Signed-off-by: Sylvain Lesne <lesne@alse-fr.com>

Applied on u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

>> ---
>>
>> 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(+)
> 
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> The formatting issue may be due to tiny-printf.
> 
> - Simon
> 
> 
>
Marek Vasut Oct. 26, 2016, 2:58 a.m. UTC | #4
On 10/26/2016 04:03 AM, Jaehoon Chung wrote:
> Hi,
> 
> On 10/25/2016 06:13 AM, Simon Glass wrote:
>> On 24 October 2016 at 10:24, Sylvain Lesne <lesne@alse-fr.com> wrote:
>>>
>>> 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.
>>>
>>> Signed-off-by: Sylvain Lesne <lesne@alse-fr.com>
> 
> Applied on u-boot-mmc. Thanks!

Cool, thanks.
Sylvain Lesne Oct. 26, 2016, 7:50 a.m. UTC | #5
Hi,

On 10/24/2016 11:13 PM, Simon Glass wrote:
> On 24 October 2016 at 10:24, Sylvain Lesne <lesne@alse-fr.com> wrote:
>>
>> (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(+)
> 
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> 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
diff mbox

Patch

diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c
index 5a3a4ff..0a22e58 100644
--- a/drivers/mmc/socfpga_dw_mmc.c
+++ b/drivers/mmc/socfpga_dw_mmc.c
@@ -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),
 };