diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2019-12-02 16:42:40 +1100 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-12-04 14:19:24 +1100 |
commit | 08cd61e9d078419af6ef96ad7e626ae4ed5de9b6 (patch) | |
tree | 632530bcf2265dd88d6c5190bff681250a3d62f6 /core/pci-opal.c | |
parent | 7853fc53cfccc20e7cca0b0bf18c5e84cd5d306c (diff) | |
download | skiboot-08cd61e9d078419af6ef96ad7e626ae4ed5de9b6.zip skiboot-08cd61e9d078419af6ef96ad7e626ae4ed5de9b6.tar.gz skiboot-08cd61e9d078419af6ef96ad7e626ae4ed5de9b6.tar.bz2 |
phb4: Add PHB options get/set OPAL calls
These are new OPAL calls to tweak various PHB parameters.
The first two are:
- TVT Select 'GTE4GB' Option of the PHB control register to enable use
of the second TVE for DMA trafic just above 4GB;
- MMIO EEH Disable to disable EEH for all MMIO commands.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'core/pci-opal.c')
-rw-r--r-- | core/pci-opal.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/core/pci-opal.c b/core/pci-opal.c index 828ce8a..ce8de63 100644 --- a/core/pci-opal.c +++ b/core/pci-opal.c @@ -461,6 +461,46 @@ static int64_t opal_pci_map_pe_dma_window_real(uint64_t phb_id, } opal_call(OPAL_PCI_MAP_PE_DMA_WINDOW_REAL, opal_pci_map_pe_dma_window_real, 5); +static int64_t opal_phb_set_option(uint64_t phb_id, uint64_t opt, + uint64_t setting) +{ + struct phb *phb = pci_get_phb(phb_id); + int64_t rc; + + if (!phb) + return OPAL_PARAMETER; + + if (!phb->ops->set_option) + return OPAL_UNSUPPORTED; + + phb_lock(phb); + rc = phb->ops->set_option(phb, opt, setting); + phb_unlock(phb); + + return rc; +} +opal_call(OPAL_PHB_SET_OPTION, opal_phb_set_option, 3); + +static int64_t opal_phb_get_option(uint64_t phb_id, uint64_t opt, + uint64_t *setting) +{ + struct phb *phb = pci_get_phb(phb_id); + int64_t rc; + + if (!phb || !setting) + return OPAL_PARAMETER; + + if (!phb->ops->get_option) + return OPAL_UNSUPPORTED; + + phb_lock(phb); + rc = phb->ops->get_option(phb, opt, setting); + phb_unlock(phb); + + return rc; +} +opal_call(OPAL_PHB_GET_OPTION, opal_phb_get_option, 3); + static int64_t opal_pci_reset(uint64_t id, uint8_t reset_scope, uint8_t assert_state) { |