[U-Boot] [PATCH] ata: ahci: enable bus mastering

Simon Glass sjg at chromium.org
Wed May 22 18:39:48 UTC 2019


Hi Christian,

On Wed, 22 May 2019 at 02:40, Christian Gmeiner
<christian.gmeiner at gmail.com> wrote:
>
> When using the coreboot target CONFIG_DM_SCSI gets set to y. This has the effect
> that the current 'enable bus mastering' logic gets not compiled in. This change

Where is it missing? Is it because U-Boot is not scanning the PCI bus?

> fixes ahci problems I am seeing on an Intel Apollolake device.
>
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  drivers/ata/ahci.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index e3135bb75f..3f9348a8b3 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1174,6 +1174,12 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
>  int ahci_probe_scsi_pci(struct udevice *ahci_dev)
>  {
>         ulong base;
> +       u16 cmd;
> +
> +       /* Enable bus mastering. */

Please don't put . at the end.

> +       dm_pci_read_config16(ahci_dev, PCI_COMMAND, &cmd);
> +       cmd |= PCI_COMMAND_MASTER;
> +       dm_pci_write_config16(ahci_dev, PCI_COMMAND, cmd);

See dm_pci_clrset_config16()

>
>         base = (ulong)dm_pci_map_bar(ahci_dev, PCI_BASE_ADDRESS_5,
>                                      PCI_REGION_MEM);
> --
> 2.21.0
>

Regards,
Simon


More information about the U-Boot mailing list