soc/amd/common/block/include/gpio_banks: use gpio_t for gpio numbers

With the addition of the remote GPIO support, the GPIO number won't fit
into 8 bit any more, so use the gpio_t type instead which is an uint32_t
typedef.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I3de93fd3a2f2af3c1e3b335fef84019c56482051
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56693
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Felix Held 2021-07-28 17:36:46 +02:00
parent 21813c3577
commit 298150d9eb
2 changed files with 6 additions and 6 deletions

View File

@ -15,7 +15,7 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
static int get_gpio_gevent(uint8_t gpio, const struct soc_amd_event *table, static int get_gpio_gevent(gpio_t gpio, const struct soc_amd_event *table,
size_t items) size_t items)
{ {
int i; int i;

View File

@ -6,15 +6,17 @@
#include <types.h> #include <types.h>
#include "gpio_defs.h" #include "gpio_defs.h"
typedef uint32_t gpio_t;
struct soc_amd_gpio { struct soc_amd_gpio {
uint8_t gpio; gpio_t gpio;
uint8_t function; uint8_t function;
uint32_t control; uint32_t control;
uint32_t flags; uint32_t flags;
}; };
struct soc_amd_event { struct soc_amd_event {
uint8_t gpio; gpio_t gpio;
uint8_t event; uint8_t event;
}; };
@ -24,7 +26,7 @@ struct gpio_wake_state {
/* Number of wake_gpio with a valid setting. */ /* Number of wake_gpio with a valid setting. */
uint32_t num_valid_wake_gpios; uint32_t num_valid_wake_gpios;
/* GPIO index number that caused a wake. */ /* GPIO index number that caused a wake. */
uint8_t wake_gpios[16]; gpio_t wake_gpios[16];
}; };
/* Fill gpio_wake_state object for future event reporting. */ /* Fill gpio_wake_state object for future event reporting. */
@ -52,8 +54,6 @@ static inline bool is_gpio_event_active_low(uint32_t flags)
return (flags & GPIO_FLAG_EVENT_ACTIVE_MASK) == GPIO_FLAG_EVENT_ACTIVE_LOW; return (flags & GPIO_FLAG_EVENT_ACTIVE_MASK) == GPIO_FLAG_EVENT_ACTIVE_LOW;
} }
typedef uint32_t gpio_t;
/* /*
* gpio_configure_pads_with_override accepts as input two GPIO tables: * gpio_configure_pads_with_override accepts as input two GPIO tables:
* 1. Base config * 1. Base config