X-006 FriendlyARM tiny4412 u-boot移植之Debug串口用起来
Posted LoTGu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了X-006 FriendlyARM tiny4412 u-boot移植之Debug串口用起来相关的知识,希望对你有一定的参考价值。
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
开发环境:win7 64位 + VMware12 + Ubuntu14.04 64位
工具链:linaro提供的gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi
要移植的u-boot版本:u-boot-2016-11
Tiny4412开发板硬件版本为:
底板: Tiny4412/Super4412SDK 1506
核心板:Tiny4412 - 1412
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
在上一节我们初始化完成了exynos4412的时钟,接下来把tiny4412的debug串口用起来。
1、Tiny4412 debug 串口电路原理图
参考:Tiny4412SDK-1506-Schematic.pdf
Tiny4412-1412-Schematic.pdf
从原理图上我们可看出,tiny4412的debug串口使用的uart0.
2、uart0初始化步骤
1. 选择UART的时钟源
2.将所涉及的UART通道管脚设为UART功能
3. 设置波特率:UBRDIVn寄存器(UART BAUD RATE DIVISOR)、UFRACVALn寄存器
4. 设置传输格式:ULCONn寄存器(UART LINE CONTROL)
5. 设置UART工作模式:UCONn寄存器(UART CONTROL)
6. UFCONn寄存器(UART FIFO CONTROL)、UFSTATn寄存器(UART FIFO STATUS)
3、使用Tiny4412 Debug 串口uart0代码设置
diff --git a/arch/arm/dts/exynos4412-tiny4412.dts b/arch/arm/dts/exynos4412-tiny4412.dts index 8822d52..a467250 100644 --- a/arch/arm/dts/exynos4412-tiny4412.dts +++ b/arch/arm/dts/exynos4412-tiny4412.dts @@ -14,73 +14,16 @@ model = "Tiny4412 based on Exynos4412"; compatible = "samsung,tiny4412", "samsung,exynos4412";
- aliases { - i2c0 = "/i2c@13860000"; - i2c1 = "/i2c@13870000"; - i2c2 = "/i2c@13880000"; - i2c3 = "/i2c@13890000"; - i2c4 = "/i2c@138a0000"; - i2c5 = "/i2c@138b0000"; - i2c6 = "/i2c@138c0000"; - i2c7 = "/i2c@138d0000"; - serial0 = "/serial@13800000"; - console = "/serial@13810000"; - mmc2 = "/sdhci@12530000"; - mmc4 = "/dwmmc@12550000"; + chosen { + stdout-path = "serial0"; };
- i2c@13860000 { - samsung,i2c-sda-delay = <100>; - samsung,i2c-slave-addr = <0x10>; - samsung,i2c-max-bus-freq = <100000>; - status = "okay"; + aliases { + serial0 = "/serial@13800000"; + console = "/serial@13800000"; };
- serial@13810000 { + serial0:serial@13810000 { status = "okay"; }; - - sdhci@12510000 { - status = "disabled"; - }; - - sdhci@12520000 { - status = "disabled"; - }; - - sdhci@12530000 { - samsung,bus-width = <4>; - samsung,timing = <1 2 3>; - cd-gpios = <&gpk2 2 0>; - }; - - sdhci@12540000 { - status = "disabled"; - }; - - dwmmc@12550000 { - samsung,bus-width = <8>; - samsung,timing = <2 1 0>; - samsung,removable = <0>; - fifoth_val = <0x203f0040>; - bus_hz = <400000000>; - div = <0x3>; - index = <4>; - }; - - ehci@12580000 { - compatible = "samsung,exynos-ehci"; - reg = <0x12580000 0x100>; - #address-cells = <1>; - #size-cells = <1>; - phy { - compatible = "samsung,exynos-usb-phy"; - reg = <0x125B0000 0x100>; - }; - }; - - emmc-reset { - compatible = "samsung,emmc-reset"; - reset-gpio = <&gpk1 2 0>; - }; }; diff --git a/arch/arm/mach-exynos/lowlevel_init.c b/arch/arm/mach-exynos/lowlevel_init.c index 1e090fd..361727d 100644 --- a/arch/arm/mach-exynos/lowlevel_init.c +++ b/arch/arm/mach-exynos/lowlevel_init.c @@ -215,11 +215,17 @@ int do_lowlevel_init(void)
if (actions & DO_CLOCKS) { system_clock_init(); + #ifdef CONFIG_DEBUG_UART #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_SERIAL_SUPPORT)) || \\ !defined(CONFIG_SPL_BUILD) + #ifdef TINY4412 + exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE); + #else exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); + #endif debug_uart_init(); + printascii("UART DEBUG enable .... !!!\\n\\r"); #endif #endif X-004 FriendlyARM tiny4412 uboot移植之点亮指路灯 X-003 FriendlyARM tiny4412 uboot移植之添加相应目录文件 X-005 FriendlyARM tiny4412 uboot移植之时钟初始化 X-007 FriendlyARM tiny4412 u-boot移植之内存初始化 |