[PATCH] ata: pci: enable bus mastering
Bin Meng
bmeng.cn at gmail.com
Tue Apr 11 14:54:59 CEST 2023
On Tue, Apr 11, 2023 at 7:23 PM Christian Gmeiner
<christian.gmeiner at gmail.com> wrote:
>
> The non DM code path already would enable pci bus mastering. Do the
> same for the DM code path.
>
> 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 | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index 6998b82aa5..e80324e91a 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1152,7 +1152,12 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
> int ahci_probe_scsi_pci(struct udevice *ahci_dev)
> {
> ulong base;
> - u16 vendor, device;
> + u16 vendor, device, cmd;
> +
> + /* Enable bus mastering. */
nits: remove the ending .
> + dm_pci_read_config16(dev, PCI_COMMAND, &cmd);
> + cmd |= PCI_COMMAND_MASTER;
> + dm_pci_write_config16(dev, PCI_COMMAND, cmd);
>
> base = (ulong)dm_pci_map_bar(ahci_dev, PCI_BASE_ADDRESS_5, 0, 0,
> PCI_REGION_TYPE, PCI_REGION_MEM);
> --
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
More information about the U-Boot
mailing list