Project

General

Profile

u-boot bug reading gpio ยป uboot-socfpga_gpio.patch

Chris Ward, 03/13/2017 02:42 PM

View differences:

uboot-socfpga/arch/arm/include/asm/arch-socfpga/gpio.h
#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 */
uboot-socfpga/drivers/gpio/soc_gpio.c
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)
    (1-1/1)