soc/amd/common/block/smn: Add simple SMN I/O accessors
Add PCI I/O-based SMN accessors. These accessors can be used for early workarounds when the PCI ECAM MMCONF is not working yet. An example of such workaround is the patching of PCI ECAM MMCONF base address in Turin SoC, which has to be done via SMN, but it cannot use PCI ECAM MMCONF to access SMN yet. Change-Id: I5e0faaa48e4d7b4479e3af9b795ad2a879f569fd Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/89471 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
parent
f8c10eda36
commit
b2b1eb3c5a
2 changed files with 30 additions and 0 deletions
|
|
@ -9,4 +9,12 @@ uint32_t smn_read32(uint32_t reg);
|
|||
uint64_t smn_read64(uint32_t reg);
|
||||
void smn_write32(uint32_t reg, uint32_t val);
|
||||
|
||||
#if defined(__SIMPLE_DEVICE__)
|
||||
|
||||
uint32_t smn_io_read32(uint32_t reg);
|
||||
uint64_t smn_io_read64(uint32_t reg);
|
||||
void smn_io_write32(uint32_t reg, uint32_t val);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* AMD_BLOCK_SMN_H */
|
||||
|
|
|
|||
|
|
@ -25,3 +25,25 @@ void smn_write32(uint32_t reg, uint32_t val)
|
|||
pci_write_config32(SOC_GNB_DEV, SMN_INDEX_ADDR, reg);
|
||||
pci_write_config32(SOC_GNB_DEV, SMN_DATA_ADDR, val);
|
||||
}
|
||||
|
||||
|
||||
#if defined(__SIMPLE_DEVICE__)
|
||||
|
||||
uint32_t smn_io_read32(uint32_t reg)
|
||||
{
|
||||
pci_io_write_config32(SOC_GNB_DEV, SMN_INDEX_ADDR, reg);
|
||||
return pci_io_read_config32(SOC_GNB_DEV, SMN_DATA_ADDR);
|
||||
}
|
||||
|
||||
uint64_t smn_io_read64(uint32_t reg)
|
||||
{
|
||||
return smn_io_read32(reg) | (uint64_t)smn_io_read32(reg + 4) << 32;
|
||||
}
|
||||
|
||||
void smn_io_write32(uint32_t reg, uint32_t val)
|
||||
{
|
||||
pci_io_write_config32(SOC_GNB_DEV, SMN_INDEX_ADDR, reg);
|
||||
pci_io_write_config32(SOC_GNB_DEV, SMN_DATA_ADDR, val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue