summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/gpio_banks/gpio.c16
-rw-r--r--src/soc/amd/common/block/include/amdblocks/acpimmio.h17
2 files changed, 16 insertions, 17 deletions
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c
index 018c61430e..fbeb38f717 100644
--- a/src/soc/amd/common/block/gpio_banks/gpio.c
+++ b/src/soc/amd/common/block/gpio_banks/gpio.c
@@ -15,6 +15,22 @@
#include <assert.h>
#include <string.h>
+/* MMIO access of new-style GPIO bank configuration registers */
+static inline void *gpio_ctrl_ptr(uint8_t gpio_num)
+{
+ return acpimmio_gpio0 + gpio_num * sizeof(uint32_t);
+}
+
+static inline uint32_t gpio_read32(uint8_t gpio_num)
+{
+ return read32(gpio_ctrl_ptr(gpio_num));
+}
+
+static inline void gpio_write32(uint8_t gpio_num, uint32_t value)
+{
+ write32(gpio_ctrl_ptr(gpio_num), value);
+}
+
static int get_gpio_gevent(gpio_t gpio, const struct soc_amd_event *table,
size_t items)
{
diff --git a/src/soc/amd/common/block/include/amdblocks/acpimmio.h b/src/soc/amd/common/block/include/amdblocks/acpimmio.h
index 9c007e7668..bf84a2564e 100644
--- a/src/soc/amd/common/block/include/amdblocks/acpimmio.h
+++ b/src/soc/amd/common/block/include/amdblocks/acpimmio.h
@@ -325,23 +325,6 @@ static inline void gpio_100_write8(uint8_t reg, uint8_t value)
write8(acpimmio_gpio_100 + reg, value);
}
-/* New GPIO banks configuration registers */
-
-static inline void *gpio_ctrl_ptr(uint8_t gpio_num)
-{
- return acpimmio_gpio0 + gpio_num * sizeof(uint32_t);
-}
-
-static inline uint32_t gpio_read32(uint8_t gpio_num)
-{
- return read32(gpio_ctrl_ptr(gpio_num));
-}
-
-static inline void gpio_write32(uint8_t gpio_num, uint32_t value)
-{
- write32(gpio_ctrl_ptr(gpio_num), value);
-}
-
static inline uint8_t xhci_pm_read8(uint8_t reg)
{
return read8(acpimmio_xhci_pm + reg);