跟踪uboot代码,了解imx6 splash image的生成过程。

涉及文件:

  ./cpu/arm_cortexa8/start.S

  ./board/freescale/mx6q_sabresd/mx6q_sabresd.c

  ./board/freescale/commom/fsl_bmp_reversed_600x400.c

/* 汇编调用C语言 */
./cpu/arm_cortexa8/start.S: ldr pc, _start_armboot @ jump to C code ------+
|
lib_arm/board.c <-----+
start_armboot(void)
{
......
/* 一系列初始化 */
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { ---+
if ((*init_fnc_ptr)() != 0) { |
hang (); |
} |
} |
...... |
|
#if defined CONFIG_SPLASH_SCREEN && defined CONFIG_VIDEO_MX5 |
setup_splash_image(); --------------------|-+
#endif | |
...... | |
} | |
| |
init_fnc_t *init_sequence[] = { <--------+ |
#if defined(CONFIG_ARCH_CPU_INIT) |
arch_cpu_init, /* basic arch cpu dependent setup */ |
#endif |
board_init, /* basic board dependent setup */ ------+ |
#if defined(CONFIG_USE_IRQ) | |
interrupt_init, /* set up exceptions */ | |
#endif | |
timer_init, /* initialize timer */ | |
env_init, /* initialize environment */ | |
init_baudrate, /* initialze baudrate settings */ | |
serial_init, /* serial communications setup */ | |
console_init_f, /* stage 1 init of console */ | |
display_banner, /* say that we are here */ | |
#if defined(CONFIG_DISPLAY_CPUINFO) | |
print_cpuinfo, /* display cpu info (and speed) */ | |
#endif | |
#if defined(CONFIG_DISPLAY_BOARDINFO) | |
checkboard, /* display board info */ | |
#endif | |
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) | |
init_func_i2c, | |
#endif | |
dram_init, /* configure available RAM banks */ | |
#if defined(CONFIG_CMD_PCI) || defined (CONFIG_PCI) | |
arm_pci_init, | |
#endif | |
display_dram_config, | |
NULL, | |
}; | |
| |
/* imx6初始化文件 */ | |
board/freescale/mx6q_sabresd/mx6q_sabresd.c | |
int board_init(void) <-----+ |
{ |
/* need set Power Supply Glitch to 0x41736166 |
*and need clear Power supply Glitch Detect bit |
* when POR or reboot or power on Otherwise system |
*could not be power off anymore*/ |
u32 reg; |
writel(0x41736166, SNVS_BASE_ADDR + 0x64);/*set LPPGDR*/ |
udelay(10); |
reg = readl(SNVS_BASE_ADDR + 0x4c); |
reg |= (1 << 3); |
writel(reg, SNVS_BASE_ADDR + 0x4c);/*clear LPSR*/ |
|
mxc_iomux_v3_init((void *)IOMUXC_BASE_ADDR); |
setup_boot_device(); |
fsl_set_system_rev(); |
|
/* board id for linux */ |
gd->bd->bi_arch_number = MACH_TYPE_MX6Q_SABRESD; |
|
/* address of boot parameters */ |
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; |
|
setup_uart(); |
#ifdef CONFIG_DWC_AHSATA |
if (cpu_is_mx6q()) |
setup_sata(); |
#endif |
|
#ifdef CONFIG_VIDEO_MX5 |
/* Enable lvds power */ |
// setup_lvds_poweron(); |
|
panel_info_init(); -------------------+ |
| |
gd->fb_base = CONFIG_FB_BASE; | |
#ifdef CONFIG_ARCH_MMU | |
gd->fb_base = ioremap_nocache(iomem_to_phys(gd->fb_base), 0); | |
#endif | |
#endif | |
| |
#ifdef CONFIG_NAND_GPMI | |
// setup_gpmi_nand(); | |
#endif | |
| |
#if defined(CONFIG_ENET_RMII) && !defined(CONFIG_DWC_AHSATA) | |
setup_fec(); | |
#endif | |
| |
#ifdef CONFIG_MXC_EPDC | |
setup_epdc(); -------------------+ |
#endif | | |
return 0; | | |
} | | |
| | |
#ifdef CONFIG_VIDEO_MX5 | | |
void panel_info_init(void) <-------+ | |
{ | |
panel_info.vl_bpix = LCD_BPP; //屏幕颜色深度 | |
panel_info.vl_col = lvds_xga.xres; //屏幕尺寸 | |
panel_info.vl_row = lvds_xga.yres; //屏幕尺寸 | |
panel_info.cmap = colormap; | |
} | |
#endif | |
| |
static void setup_epdc(void) <-----------------------+ |
{ |
unsigned int reg; |
|
/*** epdc Maxim PMIC settings ***/ |
|
/* EPDC PWRSTAT - GPIO2[21] for PWR_GOOD status */ |
mxc_iomux_v3_setup_pad(MX6DL_PAD_EIM_A17__GPIO_2_21); |
|
/* EPDC VCOM0 - GPIO3[17] for VCOM control */ |
mxc_iomux_v3_setup_pad(MX6DL_PAD_EIM_D17__GPIO_3_17); |
|
/* UART4 TXD - GPIO3[20] for EPD PMIC WAKEUP */ |
mxc_iomux_v3_setup_pad(MX6DL_PAD_EIM_D20__GPIO_3_20); |
|
/* EIM_A18 - GPIO2[20] for EPD PWR CTL0 */ |
mxc_iomux_v3_setup_pad(MX6DL_PAD_EIM_A18__GPIO_2_20); |
|
/*** Set pixel clock rates for EPDC ***/ |
|
/* EPDC AXI clk (IPU2_CLK) from PFD_400M, set to 396/2 = 198MHz */ |
reg = readl(CCM_BASE_ADDR + CLKCTL_CSCDR3); |
reg &= ~0x7C000; |
reg |= (1 << 16) | (1 << 14); |
writel(reg, CCM_BASE_ADDR + CLKCTL_CSCDR3); |
|
/* EPDC AXI clk enable */ |
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR3); |
reg |= 0x00C0; |
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR3); |
|
/* EPDC PIX clk (IPU2_DI1_CLK) from PLL5, set to 650/4/6 = ~27MHz */ |
reg = readl(CCM_BASE_ADDR + CLKCTL_CSCDR2); |
reg &= ~0x3FE00; |
reg |= (2 << 15) | (5 << 12); |
writel(reg, CCM_BASE_ADDR + CLKCTL_CSCDR2); |
|
/* PLL5 enable (defaults to 650) */ |
reg = readl(ANATOP_BASE_ADDR + ANATOP_PLL_VIDEO); |
reg &= ~((1 << 16) | (1 << 12)); |
reg |= (1 << 13); |
writel(reg, ANATOP_BASE_ADDR + ANATOP_PLL_VIDEO); |
|
/* EPDC PIX clk enable */ |
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR3); |
reg |= 0x0C00; |
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR3); |
|
panel_info.epdc_data.working_buf_addr = CONFIG_WORKING_BUF_ADDR; |
panel_info.epdc_data.waveform_buf_addr = CONFIG_WAVEFORM_BUF_ADDR; |
|
panel_info.epdc_data.wv_modes.mode_init = 0; |
panel_info.epdc_data.wv_modes.mode_du = 1; |
panel_info.epdc_data.wv_modes.mode_gc4 = 3; |
panel_info.epdc_data.wv_modes.mode_gc8 = 2; |
panel_info.epdc_data.wv_modes.mode_gc16 = 2; |
panel_info.epdc_data.wv_modes.mode_gc32 = 2; |
|
panel_info.epdc_data.epdc_timings = panel_timings; |
|
setup_epdc_power(); |
|
/* Assign fb_base */ |
gd->fb_base = CONFIG_FB_BASE; |
} |
|
#ifdef CONFIG_SPLASH_SCREEN |
void setup_splash_image(void) <-------------------------+
{
char *s;
ulong addr; s = getenv("splashimage"); if (s != NULL) {
addr = simple_strtoul(s, NULL, 16); #if defined(CONFIG_ARCH_MMU)
addr = ioremap_nocache(iomem_to_phys(addr),
fsl_bmp_reversed_600x400_size);
#endif
/* 显示uboot图片 */
memcpy((char *)addr, (char *)fsl_bmp_reversed_600x400, ----+
fsl_bmp_reversed_600x400_size); |
} |
} |
#endif |
/* bmp文件生成的源文件 */ |
board/freescale/commom/fsl_bmp_reversed_600x400.c |
const unsigned char fsl_bmp_reversed_600x400[] = { <-----+
......
}
Author

Tony Liu

2016-8-9, Shenzhen

imx6 uboot splash image的更多相关文章

  1. imx6 uboot lcd

    本文记录imx6 uboot中关于lcd初始化的过程. uboot中相关的文件: cpu/arm_cortexa8/start.S lib_arm/board.c board/freescale/mx ...

  2. imx6 uboot lvds clock

    在uboot中添加logo,lvds接口的lcd显示不正常,出现波动.网上说是lvds时钟频率的问题. 使用示波器测量之后,发现频率是60M,而lcd最大频率才46.8M. 因此就需要更改uboot中 ...

  3. imx6 uboot启动流程分析

    参考http://blog.csdn.net/skyflying2012/article/details/25804209 这里以imx6平台为例,分析uboot启动流程对于任何程序,入口函数是在链接 ...

  4. imx6 uboot saveenv fail

    uboot设置环境变量之后,不能保存在EMMC中,出现错误. MX6SDL SABRESD U-Boot > saveenv Saving Environment to SPI Flash... ...

  5. imx6 u-boot.bin 和 u-boot.imx

    有些MFG TOOL烧录工具使用了u-boot.imx,而不是原来的u-boot.bin文件进行烧录. 这两个镜像的区别是,u-boot.bin文件编译后,会在u-boot.bin的开头添加一个大小为 ...

  6. imx6 uboot logo 更改

    最近需要更改im6 uboot的开机logo,使用10.1inch, 1024x600,18bit的LCD,期间遇到了很多的问题,记录于此. 参考链接 https://community.nxp.co ...

  7. iMX6QD How to Add 24-bit LVDS Support in Android

    iMX6QD How to Add 24-bit LVDS Support in Android 版本 4 由 Ying Liu 于 2012-10-14 下午11:52创建,最后由 Jodi Pau ...

  8. imx6 Image Vector Table (IVT)

    imx6开启启动之后,运行板子上的ROM程序.ROM确定启动的设备,进行一些初始化,然后读取IVT,进行寄存器初始化,最后运行uboot/cpu/arm_cortexa8/start.S中的_star ...

  9. imx6 RGB LCD

    imx6dl需要支持lcd接口的屏,imx6dl的datasheet并没有明确的说明lcd相关的配置,只在Display Content Integrity Checker (DCIC)一章中介绍.本 ...

随机推荐

  1. dojo 五 配置dojoconfig

    官方教程:Configuring Dojo with dojoConfig例子: <-- set Dojo configuration, load Dojo --> <script& ...

  2. Spring @Autowired、@Resource、@Required、@Component、@Repository、@Service、@Controller注解的用法和作用

    Spring @Autowired,@Resource,@Required注解的用法和作用 Spring中 @Autowired标签与 @Resource标签 的区别 Spring注解@Compone ...

  3. 【jQuery获取下拉框select、单选框radio、input普通框的值和checkbox选中的个数】

    radio单选框:name属性相同 <input type="radio" id="sp_type" name="p_type" va ...

  4. JavaScript:使用JavaScript 实现注册表单的校验

    说明:在点击提交时进行表单校验,具体要求如下: 1)用户名为3~16个字符,且不能包含”@”和”#”字符: 2)密码和校验密码必须一致,且长度在8个字符到16个字符: 3)兴趣爱好至少选择一项: 4) ...

  5. 不止是联网!教你玩转PC自带Wi-Fi网卡

    前言:Wi-Fi对于现在的智能手机来说已经是再熟悉不过的配置了,而主板自带Wi-Fi网卡的设计也越来越普及,但有些玩家可能思维还停留在“Wi-Fi网卡 = 连无线网络用的网卡,我用有线就不需要”的层次 ...

  6. EntityFramework Data Annotations

    详细的实体映射介绍(Data Annotation) http://msdn.microsoft.com/en-us/data/jj591583

  7. POJ 3279 Fliptile (二进制+搜索)

    [题目链接]click here~~ [题目大意]: 农夫约翰知道聪明的牛产奶多. 于是为了提高牛的智商他准备了例如以下游戏. 有一个M×N 的格子,每一个格子能够翻转正反面,它们一面是黑色,还有一面 ...

  8. centos 搭建 搭建uwsgi服务

    1. 安装linux系统所需的一些软件依赖 yum groupinstall "Development tools" yum install openssl openssl-dev ...

  9. 使用Topshelf创建Windows服务(转)

    Calculator public class Calculator : ICalculator { public Calculator() { Logger = LogManager.GetCurr ...

  10. C#设置文件夹用户权限

    var security = new DirectorySecurity();   string path=@"C:\temp" //设置权限的应用为文件夹本身.子文件夹及文件,所 ...