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__);
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值