[U-Boot] help on DM

Andy Tang andy.tang at nxp.com
Thu May 17 01:38:30 UTC 2018


Thanks Simon. We convert the driver to ahci uclass. Problem solved.

Regards,
Andy

-----Original Message-----
From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
Sent: 2018年5月16日 23:40
To: Andy Tang <andy.tang at nxp.com>
Cc: u-boot at lists.denx.de
Subject: Re: help on DM

Hi Andy,

On 8 May 2018 at 19:48, Andy Tang <andy.tang at nxp.com> wrote:
> Hi Simon,
>
>
>
> I am working on enabling DM for sata driver. Previously sata was 
> initialized by calling
>
> the functions ahci_init() and scsi_scan(). Now I plan to use 
> driver/ata/sata_ceva.c as our sata driver.
>
> In board config file I enabled the following configs (dts was added
> properly):
>
>
>
> +CONFIG_DM_SCSI=y
>
> +CONFIG_SATA_CEVA=y
>
> +CONFIG_AHCI=y
>
> +CONFIG_BLK=y
>
> +CONFIG_SCSI_AHCI=y
>
> +CONFIG_SCSI=y
>
>
>
> But I always got the "Synchronous Abort" error. I tracked the code and 
> found
>
> dev->uclass_priv was not allocated properly because
> dev->uclass->uc_drv->per_device_auto_alloc_size is 0.
>
> But I didn’t find where I can set per_device_auto_alloc_size or attach 
> a uclass_priv structure to the device.
>
>
>
> I am new to DM. Could you please give me some suggestions here?

So you are expecting that the SCSI uclass should have some per-device uclass data? I don't think this is the case at present.

Which code is actually crashing here?

Regards,
Simon


More information about the U-Boot mailing list