AM4378 uboot lcd pin初始化

1. uboot中要把LCD关闭,lcd的 EN引脚默认配置为low即可。 

uboot-2013版本

./board/ti/am43xx/mux.c

static struct module_pin_mux lcd_bl_mux[] = {
    //{0x800 + 0x164, (MODE(7))}, /* LCD backlight control */
    {0x800 + 0x164, (MODE(0))}, /* LCD backlight control */
    {0x800 + 0x1d4, (MODE(7))}, /* EN BACKLIGHT */
    {-1},

};


void enable_lcdbl_pin_mux(void)
{
configure_module_pin_mux(lcd_bl_mux);

}

2. ./board/ti/am43xx/board.c

在int board_init(void) 最后加上

lcd_bl_init();

static void lcd_bl_init(void)
{
#define GPIO0_BASE 0x44E07000
#define GPIO0_CTRL (GPIO0_BASE + 0x130)
#define GPIO0_OE (GPIO0_BASE + 0x134)
#define GPIO0_CLRDATAOUT (GPIO0_BASE + 0x190)
#define GPIO0_SETDATAOUT (GPIO0_BASE + 0x194)


#define GPIO4_BASE 0x48320000
#define GPIO4_CTRL (GPIO4_BASE + 0x130)
#define GPIO4_OE (GPIO4_BASE + 0x134)
#define GPIO4_CLRDATAOUT (GPIO4_BASE + 0x190)
#define GPIO4_SETDATAOUT (GPIO4_BASE + 0x194)
enable_lcdbl_pin_mux();

/* Enable module */
writel(readl(GPIO0_CTRL)&~(0x1), GPIO0_CTRL);
/* Set output LOW */
//writel(0x1<<7, GPIO0_CLRDATAOUT);

writel(0x1<<7, GPIO0_SETDATAOUT);

/* Set output enable */
writel(readl(GPIO0_OE)&~(0x1<<7), GPIO0_OE);
/* Set output LOW again */
//writel(0x1<<7, GPIO0_CLRDATAOUT);
writel(0x1<<7, GPIO0_SETDATAOUT);

printf("James lcd off %s\n", __func__);
}


你可能感兴趣的:(AM437x)