Skip to content

Commit

Permalink
pci: sh7780: Use PCI_CONF1_ADDRESS() macro
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
  • Loading branch information
pali authored and trini committed Jan 12, 2022
1 parent 022d43b commit 7fabaa5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/pci/pci_sh7780.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 7fabaa5

Please sign in to comment.