diff options
author | Richard Spiegel <richard.spiegel@silverbackltd.com> | 2017-11-24 07:47:42 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-12-07 17:18:56 +0000 |
commit | ebf3aa8c631339938684b39a26d3f51f97ada88a (patch) | |
tree | a35d50ec8c6886c2a8d98ee635d9f4980186dbd3 /src/soc/amd/stoneyridge/include | |
parent | 903472c3c8ba80495b108ed507142b8e879b7b1a (diff) |
amd/stoneyridge: Create new wide IO functions
Create new generic wide IO functions in southbridge.c. These new
functions must be usable by kahlee/ec.c and amd/stoneyridge/lpc.c.
BUG=b:64033893
TEST=Just build at this stage, full boot to OS and verify serial output
at related change 14fdd03a83. Some extra outputs for testing removed
when code was committed.
Change-Id: Icd0841a1959f3e109b3c35fa35bb4b3c44099dc3
Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
Reviewed-on: https://review.coreboot.org/22590
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/amd/stoneyridge/include')
-rw-r--r-- | src/soc/amd/stoneyridge/include/soc/southbridge.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/soc/amd/stoneyridge/include/soc/southbridge.h b/src/soc/amd/stoneyridge/include/soc/southbridge.h index 3b9ea80934..bbf6344f6a 100644 --- a/src/soc/amd/stoneyridge/include/soc/southbridge.h +++ b/src/soc/amd/stoneyridge/include/soc/southbridge.h @@ -290,6 +290,9 @@ #define OC_PORT2_SHIFT 8 #define OC_PORT3_SHIFT 12 +#define WIDEIO_RANGE_ERROR -1 +#define TOTAL_WIDEIO_PORTS 3 + static inline int sb_sata_enable(void) { /* True if IDE or AHCI. */ @@ -343,6 +346,32 @@ uint32_t xhci_pm_read32(uint8_t reg); int s3_load_nvram_early(int size, u32 *old_dword, int nvram_pos); int s3_save_nvram_early(u32 dword, int size, int nvram_pos); void bootblock_fch_early_init(void); +/** + * @brief Find the size of a particular wide IO + * + * @param index = index of desired wide IO + * + * @return size of desired wide IO + */ +uint16_t sb_wideio_size(int index); +/** + * @brief Identify if any LPC wide IO is covering the IO range + * + * @param start = start of IO range + * @param size = size of IO range + * + * @return Index of wide IO covering the range or error + */ +int sb_find_wideio_range(uint16_t start, uint16_t size); +/** + * @brief Program a LPC wide IO to support an IO range + * + * @param start = start of range to be routed through wide IO + * @param size = size of range to be routed through wide IO + * + * @return Index of wide IO register used or error + */ +int sb_set_wideio_range(uint16_t start, uint16_t size); /* * Call the mainboard to get the USB Over Current Map. The mainboard |