tiny4412 --Uboot移植(4) 串口

开发环境:win10 64位 + VMware12 + Ubuntu14.04 32位

工具链:linaro提供的gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi

要移植的u-boot版本:u-boot-2016-11

Tiny4412开发板硬件版本为

  底板:  Tiny4412SDK 1312B

  核心板:Tiny4412 - 1306

1,原理图

查看tiny4412SDK-1312B -Schematic.pdf

可看出,底板使用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-tiny
index 4810202..3e057dc 100644
--- a/arch/arm/dts/exynos4412-tiny4412.dts
+++ b/arch/arm/dts/exynos4412-tiny4412.dts
@@ -14,74 +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";
-       };
-
-       i2c@13860000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-slave-addr = <0x10>;
-               samsung,i2c-max-bus-freq = <100000>;
-               status = "okay";
+  chosen {
+      stdout-path = "serial0";
+    };

+  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/Makefile b/arch/arm/mach-exynos/Makefile
index 5889802..5575adf 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -15,7 +15,7 @@ ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_EXYNOS5)  += clock_init_exynos5.o
 obj-$(CONFIG_EXYNOS5)  += dmc_common.o dmc_init_ddr3.o
 obj-$(CONFIG_EXYNOS4210)+= dmc_init_exynos4.o clock_init_exynos4.o
-obj-$(CONFIG_EXYNOS4412)+= dmc_init_exynos4412.o clock_init_exynos4412.o
+obj-$(CONFIG_EXYNOS4412)+= dmc_init_exynos4.o clock_init_exynos4412.o

 obj-y  += spl_boot.o tzpc.o
 obj-y  += lowlevel_init.o

diff --git a/arch/arm/mach-exynos/lowlevel_init.c b/arch/arm/mach-exynos/lowleve
index 1e090fd..c69be57 100644
--- a/arch/arm/mach-exynos/lowlevel_init.c
+++ b/arch/arm/mach-exynos/lowlevel_init.c
@@ -218,9 +218,15 @@ int do_lowlevel_init(void)
 #ifdef CONFIG_DEBUG_UART
 #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_SERIAL_SUPPORT)) ||      !defined(CONFIG_SPL_BUILD)
-               exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
-               debug_uart_init();
+
+    #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();
 #endif
+        printascii("UART0 init ... OK !!!\n\r");
 #endif
                mem_ctrl_init(actions & DO_MEM_RESET);
                tzpc_init();

diff --git a/configs/tiny4412_defconfig b/configs/tiny4412_defconfig
index ccc9fab..25c6bfb 100644
--- a/configs/tiny4412_defconfig
+++ b/configs/tiny4412_defconfig
@@ -37,3 +37,14 @@ CONFIG_OF_CONTROL=y
 #CONFIG_G_DNL_MANUFACTURER="Samsung"
 #CONFIG_G_DNL_VENDOR_NUM=0x04e8
 #CONFIG_G_DNL_PRODUCT_NUM=0x6601
+
+#DEBUG UART
+#
+CONFIG_DEBUG_UART=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_DEBUG_UART_S5P=y
+CONFIG_DEBUG_UART_BASE=0x13800000
+CONFIG_DEBUG_UART_CLOCK=100000000
+
+#

原文地址:https://www.cnblogs.com/chu-yi/p/10387604.html

时间: 2024-11-06 20:41:14

tiny4412 --Uboot移植(4) 串口的相关文章

X-007 FriendlyARM tiny4412 u-boot移植之内存初始化

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  开发环境:

X-006 FriendlyARM tiny4412 u-boot移植之Debug串口用起来

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  开发环境:

第二章、Tiny4412 U-BOOT移植二 启动分析【转】

本文转载自:http://blog.csdn.net/eshing/article/details/37521481 版权声明:本文为博主原创文章,未经博主允许不得转载. 一.启动过程说明 讲解启动过程,首先的源头就是打开电源,这个相信没人人不知道.CPU上电后,此时SP指针指向0x0000_0000,从这个地址取第一条指令.但此时:PLL没有启动,CPU工作频率为外部输入晶振频率,非常低(Exynos4412芯片边上有一颗24MHz,一颗27MHz,一颗32.768KHz):CPU的工作模式.

X-004 FriendlyARM tiny4412 uboot移植之点亮指路灯

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

X-003 FriendlyARM tiny4412 uboot移植之添加相应目录文件

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

X-001 FriendlyARM Tiny4412 uboot移植前奏

版权声明:本文为博主原创文章,转载请注明出处 开发环境:win7 64位 + VMware12 + Ubuntu14.04 64位 工具链:linaro提供的gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi 要移植的u-boot版本:u-boot-2016-09 参考u-boot版本:友善之臂提供的 u-boot-2010-12 Tiny4412开发板硬件版本为:     底板:  Tiny4412/Super4412SDK 1506      

X-005 FriendlyARM tiny4412 uboot移植之时钟初始化

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  开发环境:

X-009 FriendlyARM tiny4412 uboot移植之SD Card用起来Kernel boot起来

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  开发环境:

tiny4412 --Uboot移植(3) 时钟

开发环境:win10 64位 + VMware12 + Ubuntu14.04 32位 工具链:linaro提供的gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi 要移植的u-boot版本:u-boot-2016-11 Tiny4412开发板硬件版本为:   底板:  Tiny4412SDK 1312B   核心板:Tiny4412 - 1306   1.时钟体系 exynos4412芯片时钟体系的介绍在<Exynos 4412 SCP_User