diff --git a/uboot-socfpga/arch/arm/include/asm/arch-socfpga/gpio.h b/uboot-socfpga/arch/arm/include/asm/arch-socfpga/gpio.h index c9673f0..68c07a7 100755 --- a/uboot-socfpga/arch/arm/include/asm/arch-socfpga/gpio.h +++ b/uboot-socfpga/arch/arm/include/asm/arch-socfpga/gpio.h @@ -6,8 +6,9 @@ #define GPIO_MODULE1_ADDR 0xFF709000 #define GPIO_MODULE2_ADDR 0xFF70A000 -#define GPIO_SWPORTA_DR_OFFSET 0x0 -#define GPIO_SWPORTA_DDR_OFFSET 0x1 +#define GPIO_SWPORTA_DR_OFFSET 0x0 // Write Output values +#define GPIO_SWPORTA_DDR_OFFSET 0x1 // Direction +#define GPIO_EXT_PORTA_OFFSET 0x14 // Read I/O values #define GPIO_WIDTH 29 /* ugh */ diff --git a/uboot-socfpga/drivers/gpio/soc_gpio.c b/uboot-socfpga/drivers/gpio/soc_gpio.c index a439d4a..d7bc59f 100755 --- a/uboot-socfpga/drivers/gpio/soc_gpio.c +++ b/uboot-socfpga/drivers/gpio/soc_gpio.c @@ -85,7 +85,7 @@ int gpio_get_value(unsigned gpio) GET_BANK_MASK(gpio) - return (base_addr[GPIO_SWPORTA_DR_OFFSET] & mask) ? 1 : 0; + return (base_addr[GPIO_EXT_PORTA_OFFSET] & mask) ? 1 : 0; } int gpio_set_value(unsigned gpio, int value)