mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-29 08:00:26 +09:00
sata_sil: Enable DM_PCI operation
Even though the sata_sil driver was converted over to the driver model, it still assumed that the PCI controller is using the legacy interface. Allow the "devno" member to be a struct udevice pointer and use DM_PCI_COMPAT to covert the rest of the interface. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
cc696e7cae
commit
44a4042b01
@ -27,7 +27,11 @@
|
|||||||
|
|
||||||
#include "sata_sil.h"
|
#include "sata_sil.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_DM_PCI
|
||||||
|
#define virt_to_bus(devno, v) dm_pci_virt_to_mem(devno, (void *) (v))
|
||||||
|
#else
|
||||||
#define virt_to_bus(devno, v) pci_virt_to_mem(devno, (void *) (v))
|
#define virt_to_bus(devno, v) pci_virt_to_mem(devno, (void *) (v))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* just compatible ahci_ops */
|
/* just compatible ahci_ops */
|
||||||
struct sil_ops {
|
struct sil_ops {
|
||||||
@ -608,13 +612,18 @@ static int sil_init_sata(struct udevice *uc_dev, int dev)
|
|||||||
/* Save the private struct to block device struct */
|
/* Save the private struct to block device struct */
|
||||||
#if !CONFIG_IS_ENABLED(BLK)
|
#if !CONFIG_IS_ENABLED(BLK)
|
||||||
sata_dev_desc[dev].priv = (void *)sata;
|
sata_dev_desc[dev].priv = (void *)sata;
|
||||||
|
sata->devno = sata_info.devno;
|
||||||
#else
|
#else
|
||||||
priv->sil_sata_desc[dev] = sata;
|
priv->sil_sata_desc[dev] = sata;
|
||||||
priv->port_num = dev;
|
priv->port_num = dev;
|
||||||
|
#ifdef CONFIG_DM_PCI
|
||||||
|
sata->devno = uc_dev->parent;
|
||||||
|
#else
|
||||||
|
sata->devno = sata_info.devno;
|
||||||
|
#endif /* CONFIG_DM_PCI */
|
||||||
#endif
|
#endif
|
||||||
sata->id = dev;
|
sata->id = dev;
|
||||||
sata->port = port;
|
sata->port = port;
|
||||||
sata->devno = sata_info.devno;
|
|
||||||
sprintf(sata->name, "SATA#%d", dev);
|
sprintf(sata->name, "SATA#%d", dev);
|
||||||
sil_cmd_soft_reset(sata);
|
sil_cmd_soft_reset(sata);
|
||||||
tmp = readl(port + PORT_SSTATUS);
|
tmp = readl(port + PORT_SSTATUS);
|
||||||
|
@ -21,7 +21,11 @@ struct sil_sata {
|
|||||||
u16 pio;
|
u16 pio;
|
||||||
u16 mwdma;
|
u16 mwdma;
|
||||||
u16 udma;
|
u16 udma;
|
||||||
|
#ifdef CONFIG_DM_PCI
|
||||||
|
struct udevice *devno;
|
||||||
|
#else
|
||||||
pci_dev_t devno;
|
pci_dev_t devno;
|
||||||
|
#endif
|
||||||
int wcache;
|
int wcache;
|
||||||
int flush;
|
int flush;
|
||||||
int flush_ext;
|
int flush_ext;
|
||||||
|
Loading…
Reference in New Issue
Block a user