[U-boot][itop4412]u-boot-2017.11移植(二)
建立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,何必苦等)