This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3359: Add GPIO input detection in Uboot

Part Number: AM3359

Hi,

Customer wants to add GPIO input detection in Uboot. Please help check below code:

board/ti/am335x/board.c

#define GPIO_1_15      GPIO_TO_PIN(1, 15)//add

int board_late_init(void)

{

    u32 reg_val;

    ...

    gpio_request(GPIO_1_15, "key");//add

    gpio_direction_input(GPIO_1_15);//add

    mdelay(300);//add

    reg_val = gpio_get_value(GPIO_1_15);//add

}

board/ti/am335x/mux.c

static struct module_pin_mux gpio1_15_pin_mux[] = {

    {OFFSET(gpmc_ad15), (MODE(7) | PULLUP_EN)},

    {-1},

};//add

void enable_board_pin_mux(void)

{

    if(board_is_bone()) {

    ...

    configure_module_pin_mux(spi0_pin_mux);

    configure_module_pin_mux(gpio1_15_pin_mux);//add

}

He can't acquire value from gpio_get_value.

  • Hi Nancy,
    Can we try re-arranging the GPIO functions, and testing them using "gpio..." cmds @u-boot prompt
    For example,

    => gpio
    gpio - query and control gpio pins
    Usage:
    gpio <input|set|clear|toggle> <pin>
        - input/set/clear/toggle/benchmark the specified pin
    gpio status [-a] [<bank> | <pin>]  - show [all/claimed] GPIOs

    Best,

    -Hong