OS:Ubuntu 18.04
开发板:TINY4412
编译器:arm-linux-gnueabi-gcc 7.5.0
步骤:
1)u-boot-2020.01.tar.bz2
tar xvf u-boot-2020.01.tar.bz2
cd u-boot-2020.01
2)configs/tiny4412_defconfig
cp configs/origen_defconfig configs/tiny4412_defconfig
set CONFIG_SPL_TEXT_BASE to '0x02023400'
change 'ORIGEN' to 'TINY4412'
change 'origen' to 'tiny4412'
change '4210' to '4412'
3)Makefile
ARCH = arm
CROSS_COMPILE = arm-linux-gnueabi-
4)include/configs/tiny4412.h
cp include/configs/origen.h include/configs/tiny4412.h
change 'ORIGEN' to 'TINY4412'
delete CONFIG_EXYNOS4412
delete CONFIG_TINY4412
5)arch/arm/dts/exynos4412-tiny4412.dts
cp arch/arm/dts/exynos4210-origen.dts arch/arm/dts/exynos4412-tiny4412.dts
change 'Insignal Origen evaluation' to 'FriendlyArm Tiny4412'
change 'insignal,origen' to ''friendlyarm,tiny4412'
change '4210' to '4412'
6)arch/arm/dts/Makefile
add 'exynos4412-tiny4412.dtb' at dtb-$(CONFIG_EXYNOS4)
7)arch/arm/mach-exynos/Kconfig
add
config TARGET_TINY4412
bool "Exynos4412 Tiny4412 board"
select SUPPORT_SPL
add
source "board/samsung/tiny4412/Kconfig"
8)arch/arm/mach-exynos/Makefile
change obj-$(CONFIG_EXYNOS4210) to obj-$(CONFIG_EXYNOS4412)
9)arch/arm/mach-exynos/lowlevel_init.c
change PERIPH_ID_UART3 to PERIPH_ID_UART0 in do_lowlevel_init(...)
add
printascii("\r\nHi U-Boot!\r\n");
under 'debug_uart_init();'
10)arch/arm/mach-exynos/exynos4_setup.h
change 'ORIGEN' to 'TINY4412'
11)arch/arm/mach-exynos/clock_init_exynos4.c
change system_clock_init(...) to
void system_clock_init(void)
{
struct exynos4x12_clock *clk =
(struct exynos4x12_clock *)samsung_get_base_clock();
/* APLL= 1400 MHz MPLL=800 MHz */
writel(0x01000001, &clk->src_cpu);
sdelay(0x10000);
writel(0x1111000, &clk->src_top1);
writel(CLK_SRC_PERIL0_VAL, &clk->src_peril0);
sdelay(0x10000);
writel(0x1160730, &clk->div_cpu0);
writel(0x506, &clk->div_cpu1);
writel(CLK_DIV_PERIL0_VAL, &clk->div_peril0);
/* Set PLL locktime */
writel(PLL_LOCKTIME, &clk->apll_lock);
writel(PLL_LOCKTIME, &clk->mpll_lock);
writel(0x803800, &clk->apll_con1);
writel(0x80af0300, &clk->apll_con0);
writel(0x803800, &clk->mpll_con1);
writel(0x80640300, &clk->mpll_con0);
sdelay(0x30000);
}
12)board/samsung/tiny4412
cp -rf board/samsung/origen/ board/samsung/tiny4412
rename 'board/samsung/tiny4412/origen.c' to 'board/samsung/tiny4412/tiny4412.c'
rename 'board/samsung/tiny4412/tools/mkorigenspl.c' to 'board/samsung/tiny4412/tools/mktiny4412spl.c'
change 'origen' to 'tiny4412' in 'board/samsung/tiny4412/Makefile'
change 'origen' to 'tiny4412' in 'board/samsung/tiny4412/MAINTAINERS'
change 'origen' to 'tiny4412' in 'board/samsung/tiny4412/Kconfig'
in 'board/samsung/tiny4412/Kconfig', add
config EXYNOS4412
bool
default y
config TINY4412
bool
default y
13).config
cp configs/tiny4412_defconfig .config
make menuconfig, then EXIT immediatly, and SAVE.
14)make menuconfig
select SPL / TPL --->Support serial
select SPL / TPL --->Support GPIO in SPL
select Device Drivers --->Serial drivers --->Enable an early debug UART for debugging --->Select which UART will provide the debug UART (Samsung S5P)
select Device Drivers --->Serial drivers --->(0x13800000) Base address of UART
select Device Drivers --->Serial drivers --->(100000000) UART input clock
15)make
16)fuse
17)boot on SD mode, should print 'Hi U-Boot!'.
要点分析:
1)clock
FIN-->SCLKMPLL-->SCLKMPLL_USER_T-->MOUTUART-->SCLK_URAT