-
在CONFIG_BOOTCOMMAND 里面添加如下红色语句,通过该方法可以实现通过SD卡自动烧写,但有个问题,就是在烧写MLO/u-boot.img/uImage等,怎样在LCD屏上显示烧写进度条或百分比?
-
#define CONFIG_BOOTCOMMAND \
"echo Begin update system to Nand;"\
"nand erase.chip;mmc rescan; "\
"echo start Update MLO;"\
"fatload mmc 0 80A00000 MLO;nand write.i 80A00000 0 ${filesize}; "\ 怎样同步在LCD屏上显示烧写进度条?
"echo start Update u-boot.img;"\
"fatload mmc 0 80A00000 u-boot.img;nand write.i 80A00000 800000 ${filesize}; "\ 怎样同步在LCD屏上显示烧写进度条?
"echo start Update uImage;"\
"fatload mmc 0 80A00000 uImage;nand write.i 80A00000 c00000 ${filesize}; "\ 怎样同步在LCD屏上显示烧写进度条?
"echo start Update ubi.img;"\
"fatload mmc 0 80A00000 ubi.img;nand write.i 80A00000 1400000 ${filesize};"\ 怎样同步在LCD屏上显示烧写进度条?
"echo start Update logo.bmp;"\
"fatload mmc 0 80A00000 logo.bmp;nand write.i 80A00000 600000 ${filesize};"\
"echo Update system to Nand success;"\
" if test $bootdev = MMC; then " \
"mmc dev ${mmcdev}; mmc rescan;"\
"echo hejx debug test SD/MMC found on device ${mmcdev};" \
"run hejx_auto_update_nand;"\
"if run loadbootenv; then " \
"echo Loaded environment from ${bootenv};" \
"run importbootenv;" \
"run hejx_auto_update_nand;"\
"fi;" \
"if test -n $uenvcmd; then " \
"echo Running uenvcmd …;" \
"run uenvcmd;" \
"run hejx_auto_update_nand;"\
"fi;" \
"if run loaduimagefat; then " \
"run mmcboot;" \
"run hejx_auto_update_nand;"\
"elif run loaduimage; then " \
"run mmcboot;" \
"run hejx_auto_update_nand;"\
"else " \
"echo Could not find ${bootfile} ;" \
"run hejx_auto_update_nand;"\
"fi;" \
"else " \
"run nandboot;" \
"fi;" \
Steven Liu1:
首先,这个烧录是在UBOOT阶段发生的,如果你想用LCD做个进度条,首先要做的是先在UBOOT阶段把LCD的初始化工作做了,然后再做一个进度条,写一个uboot指令来做进度条的调整。感觉需要付出的时间和精力还是不少的,先从做LCD的初始化开始吧。
Mak he:
回复 Steven Liu1:
Steven Liu,
你好!
我在uboot阶段自己添加Lcd驱动,步骤如下:
1.lcd端口配置,(board/ti/mux.c)
static struct module_pin_mux lcd_pin_mux[] = { {OFFSET(lcd_data0), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data1), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data2), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data3), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data4), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data5), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data6), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data7), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data8), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data9), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data10), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data11), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data12), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data13), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data14), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_data15), (MODE(0) | PULLUDDIS)}, {OFFSET(lcd_vsync), (MODE(0))}, {OFFSET(lcd_hsync), (MODE(0))}, {OFFSET(lcd_pclk), (MODE(0))}, {OFFSET(lcd_ac_bias_en), (MODE(0))}, {-1},};
configure_module_pin_mux(lcd_pin_mux);
2.am335x_evm.h里面添加关于LCD驱动的宏
#define CONFIG_VIDEO#define CONFIG_VIDEO_DA8XX#define CONFIG_CFB_CONSOLE#define CONFIG_CMD_BMP#define DAVINCI_LCD_CNTL_BASE 0x4830E000#define CONFIG_SYS_CONSOLE_IS_IN_ENV#define VIDEO_TSTC_FCT serial_tstc#define VIDEO_GETC_FCT serial_getc#define VIDEO_KBD_INIT_FCT 0#define CONFIG_VIDEO_LOGO
3.修改LCD屏参数(drivers/video/da8xx-fb.c)
static const struct display_panel disp_panel = { WVGA, 32, 8, COLOR_ACTIVE,};
static const struct lcd_ctrl_config lcd_cfg = { &disp_panel, .ac_bias = 255, .ac_bias_intrpt = 0, .dma_burst_sz = 16, .bpp = 16, .fdd = 255, .tft_alt_mode = 0, .stn_565_mode = 0, .mono_8bit_mode = 0, .invert_line_clock = 1, .invert_frm_clock = 1, .sync_edge = 0, .sync_ctrl = 1, .raster_order = 0,};
4.编译uboot,
5.烧写运行,打印调试查看,运行卡死下面语句
static inline void lcd_disable_raster(void){ u32 reg; printf("debug test1!\n") reg = lcdc_read(&da8xx_fb_reg_base->raster_ctrl);//在该语句卡死,没有下条打印,所有的 lcdc_read()与lcdc_write()均卡住,估计是da8xx_fb_reg_base初始化不对 printf("debug test2!\n") if (reg & LCD_RASTER_ENABLE) lcdc_write(reg & ~LCD_RASTER_ENABLE, &da8xx_fb_reg_base->raster_ctrl);}
我怀疑是
video_hw_init初始化时, da8xx_fb_reg_base = (struct da8xx_lcd_regs *)DAVINCI_LCD_CNTL_BASE;的DAVINCI_LCD_CNTL_BASE地址不对(即#define DAVINCI_LCD_CNTL_BASE 0x4830E000不正确),不知是否是该原因?