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

开发环境: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

mem_ctrl_init(actions & DO_MEM_RESET);

diff --git a/configs/tiny4412_defconfig b/configs/tiny4412_defconfig

index 93917b9..19d0dda 100644

--- a/configs/tiny4412_defconfig

+++ b/configs/tiny4412_defconfig

@@ -24,6 +24,16 @@ CONFIG_CMD_FS_GENERIC=y

CONFIG_OF_CONTROL=y

#

+#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

+

+#

#NOTE:do not delete this:

#

# CONFIG_CMD_IMLS is not set

编译下载代码到SD卡,从SD卡启动后,tiny4412开发板的com0串口上会输出如下调试字符串:

UART DEBUG enable .... !!!

后面移植调试u-boot SPL部分的代码时候,可以通过串口打印log的方式进行,比之前的点亮LED灯调试可以获取到更多信息。

参考

1、《Exynos 4412 SCP_Users Manual_Ver.0.10.00_Preliminary.pdf》

2、《嵌入式Linux系统开发完全手册_基于4412_上册.pdf》

3、uboot_tiny4412-20130729

4、Tiny4412裸机程序之UART收发数据 http://www.techbulo.com/1555.html

X-006 FriendlyARM tiny4412 u-boot移植之Debug串口用起来的更多相关文章

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

    <<<<<<<<<<<<<<<<<<<<<<<<< ...

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

    <<<<<<<<<<<<<<<<<<<<<<<<< ...

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

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

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

    <<<<<<<<<<<<<<<<<<<<<<<<< ...

  5. X-001 FriendlyARM Tiny4412 uboot移植前奏

    版权声明:本文为博主原创文章,转载请注明出处 开发环境:win7 64位 + VMware12 + Ubuntu14.04 64位 工具链:linaro提供的gcc-linaro-6.1.1-2016 ...

  6. 基于tiny4412的u-boot移植(一)

    作者信息 作者:彭东林 邮箱:pengdonglin137@163.com QQ: 405728433 平台介绍 开发环境:win7 64位 + VMware11 + Ubuntu14.04 64位 ...

  7. X-008 FriendlyARM tiny4412 uboot移植之copy u-boot到DDR内存

    <<<<<<<<<<<<<<<<<<<<<<<<< ...

  8. X-010 FriendlyARM tiny4412 uboot移植之移植网卡驱动TFTP用起来

    <<<<<<<<<<<<<<<<<<<<<<<<< ...

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

    <<<<<<<<<<<<<<<<<<<<<<<<< ...

随机推荐

  1. 【转载】GDI 映像方式 之 SetViewportOrgEx 与 SetWindowOrgEx 解析

    SetViewportOrgEx 与 SetWindowOrgEx 解析 这两个函数,用来改变视端口和窗口的原点,并都具有改变轴的效果,以致(0,0)不再指左上角. 「视端口」是依据设备坐标(图素)的 ...

  2. js播放器

    <object?id="player"?height="64"?width="260"?classid="CLSID:6BF ...

  3. 【转】HBase技术介绍 转载自 http://www.searchtb.com/2011/01/understanding-hbase.html

    HBase简介 HBase – Hadoop Database,是一个高可靠性.高性能.面向列.可伸缩的分布式存储系统,利用HBase技术可在廉价PC Server上搭建起大规模结构化存储集群. HB ...

  4. java项目开发第五天——奋力完成数据库

    又一次成功地避开了UI界面,看来以后在这个部分得残了,无奈,心塞,不知为何.今天人品不好,大清早在群里签到居然和机器人聊起来了,顿时感觉智商被碾压,还下载了一个QQ空间背景复制器,看了看果真是实现了, ...

  5. HBase集群安装

    1.HBase的机群搭建过程(在原来的hadoop0上的HBase伪分布基础上进行搭建)1.1 集群结构,主节点(hmaster)是hadoop0,从节点(region server)是hadoop1 ...

  6. listview去掉条目间的分割线

    未去掉前: 去掉后: java代码可以这么写: 1          listView.setDivider(null);//去掉条目间的分割线 PS:ListView的几个常用操作 listView ...

  7. English--Computer System

    A: Hey, Bill, Can you tell what's wrong with my computer? I can't move the mouse, I can's user the k ...

  8. DDS视图&Button控件

    <Button android:id="@+id/btn1" android:layout_width="wrap_content"    //包裹文字 ...

  9. PAT (Advanced Level) 1073. Scientific Notation (20)

    简单模拟题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> # ...

  10. 同花顺核新下单程序的"界面不操作超时时间"的设定

    "界面不操作超时时间"的设定 同花顺核新下单程序的'界面不操作超时时间'的设定 系统> 系统设置> 界面设置> 界面不操作超时时间(分): 在这个输入框里填上个3 ...