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
6 6
#define GPIO_MODULE1_ADDR       0xFF709000
7 7
#define GPIO_MODULE2_ADDR       0xFF70A000
8 8

  
9
#define GPIO_SWPORTA_DR_OFFSET  0x0
10
#define GPIO_SWPORTA_DDR_OFFSET 0x1
9
#define GPIO_SWPORTA_DR_OFFSET  0x0                    // Write Output values
10
#define GPIO_SWPORTA_DDR_OFFSET 0x1                    // Direction
11
#define GPIO_EXT_PORTA_OFFSET   0x14                   // Read I/O values
11 12

  
12 13
#define GPIO_WIDTH      29 /* ugh */
13 14

  
uboot-socfpga/drivers/gpio/soc_gpio.c
85 85

  
86 86
       GET_BANK_MASK(gpio)
87 87

  
88
       return (base_addr[GPIO_SWPORTA_DR_OFFSET] & mask) ? 1 : 0;
88
       return (base_addr[GPIO_EXT_PORTA_OFFSET] & mask) ? 1 : 0;
89 89
}
90 90

  
91 91
int gpio_set_value(unsigned gpio, int value)
    (1-1/1)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)