接上一节:u-boot-2017.11移植(一)
下面这些很多我也不懂,慢慢消化吧~
参考:
https://blog.csdn.net/hyyoxhk/article/details/81980930
创建ARCH文件
-
修改 arch/arm/mach-exynos/Makefile,在itop4412.h中会定义CONFIG_ITOP4412这个宏
#obj-$(CONFIG_EXYNOS4210)+= dmc_init_exynos4.o clock_init_exynos4.o ifneq (,$(filter y, $(CONFIG_EXYNOS4210) $(CONFIG_ITOP4412))) obj-y += dmc_init_exynos4.o clock_init_exynos4.o endif
-
时钟初始化
时钟初始化不好,对串口调试有影响
2.1 修改 arch/arm/mach-exynos/clock_init_exynos4.c,时钟初始化
都是从其他dalao那里拷贝过来的,似乎是文档里看的。
2.2 增加头文件arch/arm/mach-exynos/itop4412_setup.h
时钟对应的地址,较多
-
内存控制器初始化
3.1 修改arch/arm/mach-exynos/dmc_init_exynos4.c改动不大
3.2 修改头文件arch/arm/mach-exynos/itop4412_setup.h
DMC对应的地址,较少
-
lowlevel_init.c
串口:uart2;#ifdef CONFIG_ITOP4412 exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE); #else exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); #endif
取消tzpc初始化
#ifndef CONFIG_ITOP4412 tzpc_init(); #endif
-
spl_boot.c
#ifndef CONFIG_ITOP4412 /* just for exynos5 can be call */ emmc_boot_clk_div_set(); #endif
-
clock.c
u-boot启动后会停留在MMC问题,待验证
static unsigned long exynos4_get_mmc_clk(int dev_index)
static unsigned long exynos4_get_mmc_clk(int dev_index)#ifdef CONFIG_ITOP4412 struct exynos4x12_clock *clk = (struct exynos4x12_clock *)samsung_get_base_clock(); #else struct exynos4_clock *clk = (struct exynos4_clock *)samsung_get_base_clock(); #endif
static void exynos4_set_mmc_clk(int dev_index, unsigned int div)
#ifdef CONFIG_ITOP4412 struct exynos4x12_clock *clk = (struct exynos4x12_clock *)samsung_get_base_clock(); #else struct exynos4_clock *clk = (struct exynos4_clock *)samsung_get_base_clock(); #endif #ifdef CONFIG_ITOP4412 sel = readl(&clk->src_lcd); #else sel = readl(&clk->src_lcd0); #endif #ifdef CONFIG_ITOP4412 ratio = readl(&clk->div_lcd); #else ratio = readl(&clk->div_lcd0); #endif
void exynos4_set_lcd_clk(void)
#ifdef CONFIG_ITOP4412 struct exynos4x12_clock *clk = (struct exynos4x12_clock *)samsung_get_base_clock(); #else struct exynos4_clock *clk = (struct exynos4_clock *)samsung_get_base_clock(); #endif #ifdef CONFIG_ITOP4412 clrsetbits_le32(&clk->src_lcd, 0xf, 0x6); #else clrsetbits_le32(&clk->src_lcd0, 0xf, 0x6); #endif #ifdef CONFIG_ITOP4412 setbits_le32(&clk->gate_ip_lcd, 1 << 0); #else setbits_le32(&clk->gate_ip_lcd0, 1 << 0); #endif #ifdef CONFIG_ITOP4412 clrsetbits_le32(&clk->div_lcd, 0xf, 0x1); #else clrsetbits_le32(&clk->div_lcd0, 0xf, 0x1); #endif
-
power.c
u-boot卡在等待停止autoboot,修改这个后可以运行
在include/mach/power.h加入4412结构体
创建mku-boot文件夹
放入BL1文件:E4412_N.bl1.bin
放入env文件:env.bin(这个文件是什么?怎么来的?)
编写build.sh文件,生成spl.bin和u-boot.bin文件,并与BL1、env文件合成一个文件
编写clean.sh文件,清除编译生成的文件
编写sd_fusing.sh文件,将生成的最终xxx_u-boot.bin文件烧录到SD卡上,然后通过SD卡启动
我因为linux版本问题(不支持uimag),还未引导kernel img,所以不知道是否可行,后续移植新的linux在看看;
第一次弄github,不知道有没问题~~
上面那个链接的dalao他的程序是可以的,可以去下载他的文件(没C币某宝代下2RMB,何必苦等)