int board_late_init(void) { char *my_bootdelay; char bootmode = 0; char const *panel = getenv("panel"); /* * Check the boot-source. If booting from NOR Flash, * disable bootdelay */ gpio_request(IMX_GPIO_NR(7, 6), "bootsel0"); gpio_direction_input(IMX_GPIO_NR(7, 6)); gpio_request(IMX_GPIO_NR(7, 7), "bootsel1"); gpio_direction_input(IMX_GPIO_NR(7, 7)); gpio_request(IMX_GPIO_NR(7, 1), "bootsel2"); gpio_direction_input(IMX_GPIO_NR(7, 1)); bootmode |= (gpio_get_value(IMX_GPIO_NR(7, 6)) ? 1 : 0) << 0; bootmode |= (gpio_get_value(IMX_GPIO_NR(7, 7)) ? 1 : 0) << 1; bootmode |= (gpio_get_value(IMX_GPIO_NR(7, 1)) ? 1 : 0) << 2; if (bootmode == 7) { my_bootdelay = getenv("nor_bootdelay"); if (my_bootdelay != NULL) setenv("bootdelay", my_bootdelay); else setenv("bootdelay", "-2"); } /* if we have the lg panel, we can initialze it now */ if (panel) if (!strcmp(panel, displays[1].mode.name)) lg4573_spi_startup(CONFIG_LG4573_BUS, CONFIG_LG4573_CS, 10000000, SPI_MODE_0); return 0; }
static int do_lgset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { lg4573_spi_startup(0, 0, 10000000, SPI_MODE_0); return 0; }