summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-11-26 11:42:49 +0100
committerTom Rini <trini@konsulko.com>2022-01-12 14:21:24 -0500
commit7fabaa5313352a563568504a8354aaf11c1af85a (patch)
treeb2f8259220f3377033777912cb7d7faa80c38f86 /drivers/pci
parent022d43bdfb3e8064097666a7d8ddd4670a8b530f (diff)
downloadu-boot-7fabaa5313352a563568504a8354aaf11c1af85a.tar.gz
u-boot-7fabaa5313352a563568504a8354aaf11c1af85a.tar.bz2
u-boot-7fabaa5313352a563568504a8354aaf11c1af85a.zip
pci: sh7780: Use PCI_CONF1_ADDRESS() macro
PCI sh7780 driver uses standard format of Config Address for PCI Configuration Mechanism #1. So use new U-Boot macro PCI_CONF1_ADDRESS(). Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci_sh7780.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/pci_sh7780.c b/drivers/pci/pci_sh7780.c
index 06d711a6cb..7533286c01 100644
--- a/drivers/pci/pci_sh7780.c
+++ b/drivers/pci/pci_sh7780.c
@@ -34,9 +34,9 @@
int pci_sh4_read_config_dword(struct pci_controller *hose,
pci_dev_t dev, int offset, u32 *value)
{
- u32 par_data = 0x80000000 | dev;
+ u32 par_data = PCI_CONF1_ADDRESS(PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev), offset);
- p4_out(par_data | (offset & 0xfc), SH7780_PCIPAR);
+ p4_out(par_data, SH7780_PCIPAR);
*value = p4_in(SH7780_PCIPDR);
return 0;
@@ -45,9 +45,9 @@ int pci_sh4_read_config_dword(struct pci_controller *hose,
int pci_sh4_write_config_dword(struct pci_controller *hose,
pci_dev_t dev, int offset, u32 value)
{
- u32 par_data = 0x80000000 | dev;
+ u32 par_data = PCI_CONF1_ADDRESS(PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev), offset);
- p4_out(par_data | (offset & 0xfc), SH7780_PCIPAR);
+ p4_out(par_data, SH7780_PCIPAR);
p4_out(value, SH7780_PCIPDR);
return 0;
}