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

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

Git仓库地址:https://github.com/X-Project-FriendlyARMTiny4412/u-boot

Tiny4412开发板硬件版本为

    底板:  Tiny4412/Super4412SDK 1506

       核心板:Tiny4412 - 1412

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 

在上一节中我们已经完成了把u-boot.bin从SD卡上拷贝到DDR内存,并跳转到DDR内存中去执行u-boot的工作。这节仅先记录下如何把SDCard用起来,并且把Kernelboot起来的一些具体的操作,详细分析后面再写。

1、Tiny4412 SDCard用起来

代码修改如下:

diff --git a/arch/arm/dts/exynos4412-tiny4412.dts b/arch/arm/dts/exynos4412-tiny4412.dts

index a467250..3010f50 100644

--- a/arch/arm/dts/exynos4412-tiny4412.dts

+++ b/arch/arm/dts/exynos4412-tiny4412.dts

@@ -1,29 +1,135 @@

/*

- * FriendlyARM Tiny4412 board device tree source

- *

+ * FriendlyARM's Exynos4412 based TINY4412 board device tree source

*             2016

*  Author  AP0904225 <ap0904225@qq.com>

*

- * SPDX-License-Identifier:    GPL-2.0+

- */

+ * Device tree source file for FriendlyARM's TINY4412 board which is based on

+ * Samsung's Exynos4412 SoC.

+ *

+ * This program is free software; you can redistribute it and/or modify

+ * it under the terms of the GNU General Public License version 2 as

+ * published by the Free Software Foundation.

+ *

+ * SPDX-License-Identifier:    GPL-2.0+

+ *

+*/

/dts-v1/;

#include "exynos4412.dtsi"

/ {

-   model = "Tiny4412 based on Exynos4412";

-   compatible = "samsung,tiny4412", "samsung,exynos4412";

-

-   chosen {

-       stdout-path = "serial0";

-   };

+   model = "FriendlyARM TINY4412 board based on Exynos4412";

+   compatible = "friendlyarm,tiny4412", "samsung,exynos4412", "samsung,exynos4";

aliases {

serial0 = "/serial@13800000";

console = "/serial@13800000";

+       mmc2 = "/sdhci@12530000";

+       mmc4 = "/dwmmc@12550000";

};

-   serial0:serial@13810000 {

+   memory {

+       reg = <0x40000000 0x40000000>;

+   };

+

+   serial0:serial@13800000 {

status = "okay";

};

+

+   serial1:serial@13810000 {

+       status = "disabled";

+   };

+

+   serial2:serial@13820000 {

+       status = "disabled";

+   };

+

+   serial3:serial@13830000 {

+       status = "disabled";

+   };

+

+   serial4:serial@13840000 {

+       status = "disabled";

+   };

+

+   i2c@13860000 {

+       status = "disabled";

+   };

+

+   i2c@13870000 {

+       status = "disabled";

+   };

+

+   i2c@13880000 {

+       status = "disabled";

+   };

+

+   i2c@13890000 {

+       status = "disabled";

+   };

+

+   i2c@138a0000 {

+       status = "disabled";

+   };

+

+   i2c@138b0000 {

+       status = "disabled";

+   };

+

+   i2c@138c0000 {

+       status = "disabled";

+   };

+

+   i2c@138d0000 {

+       status = "disabled";

+   };

+

+   sdhci@12510000 {

+       compatible = "samsung,exynos4412-sdhci";

+       status = "disabled";

+   };

+

+   sdhci@12520000 {

+       compatible = "samsung,exynos4412-sdhci";

+       status = "disabled";

+   };

+

+   sdhci@12530000 {

+       compatible = "samsung,exynos4412-sdhci";

+       samsung,bus-width = <4>;

+       samsung,timing = <1 2 3>;

+       cd-gpios = <&gpk2 2 0>;

+   };

+

+   sdhci@12540000 {

+       compatible = "samsung,exynos4412-sdhci";

+       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/configs/tiny4412_defconfig b/configs/tiny4412_defconfig

index 19d0dda..62ed0d2 100644

--- a/configs/tiny4412_defconfig

+++ b/configs/tiny4412_defconfig

@@ -1,6 +1,3 @@

-#

-# U-Boot 2016.11 Configuration for FriendlyARM tiny4412

-#

CONFIG_ARM=y

CONFIG_ARCH_EXYNOS=y

CONFIG_ARCH_EXYNOS4=y

@@ -11,34 +8,43 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y

CONFIG_SYS_CONSOLE_INFO_QUIET=y

CONFIG_SPL=y

CONFIG_HUSH_PARSER=y

-CONFIG_SYS_PROMPT="TINY4412 # "

+CONFIG_SYS_PROMPT="Tiny4412 # "

CONFIG_CMD_BOOTZ=y

+# CONFIG_CMD_IMLS is not set

+# CONFIG_CMD_XIMG is not set

+CONFIG_DM_MMC=y

CONFIG_CMD_MMC=y

+CONFIG_CMD_DFU=y

+CONFIG_CMD_USB_MASS_STORAGE=y

+# CONFIG_CMD_FPGA is not set

+# CONFIG_CMD_NET is not set

+CONFIG_CMD_DHCP=y

+# CONFIG_CMD_NFS is not set

CONFIG_CMD_MII=y

CONFIG_CMD_CACHE=y

+# CONFIG_CMD_MISC is not set

CONFIG_CMD_EXT2=y

CONFIG_CMD_EXT4=y

CONFIG_CMD_EXT4_WRITE=y

CONFIG_CMD_FAT=y

CONFIG_CMD_FS_GENERIC=y

CONFIG_OF_CONTROL=y

+CONFIG_DFU_MMC=y

+CONFIG_USB=y

+CONFIG_DM_USB=y

+CONFIG_USB_GADGET=y

+CONFIG_USB_GADGET_DWC2_OTG=y

+CONFIG_USB_GADGET_DOWNLOAD=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

-

-#

-#NOTE:do not delete this:

-#

-# CONFIG_CMD_IMLS is not set

-# CONFIG_CMD_XIMG is not set

-# CONFIG_CMD_MISC is not set

-# CONFIG_CMD_FPGA is not set

-# CONFIG_CMD_NET is not set

-# CONFIG_CMD_NFS is not set

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

diff --git a/include/configs/tiny4412.h b/include/configs/tiny4412.h

index 3a02f9e..4197e16 100644

--- a/include/configs/tiny4412.h

+++ b/include/configs/tiny4412.h

@@ -1,5 +1,5 @@

/*

- *         2016

+ *         2017

*     Author AP0904225 <ap0904225@qq.com>

*

* Configuration settings for the FriendlyARM TINY4412 (EXYNOS4412) board.

@@ -15,10 +15,6 @@

#include <configs/exynos4-common.h>

-/* TIZEN THOR downloader support */

-#undef CONFIG_CMD_THOR_DOWNLOAD

-#undef CONFIG_USB_FUNCTION_THOR

-

/* High Level Configuration Options */

#define TINY4412           1   /* working with TINY4412*/

@@ -36,15 +32,15 @@

#define CONFIG_SYS_LOAD_ADDR       (CONFIG_SYS_SDRAM_BASE + 0x3E00000)

#define CONFIG_SYS_TEXT_BASE       0x43E00000

+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_TEXT_BASE - 0x1000000)

#define CONFIG_MACH_TYPE       MACH_TYPE_TINY4412

/* select serial console configuration */

-#define CONFIG_SERIAL2

#define CONFIG_BAUDRATE            115200

/* Console configuration */

-#define CONFIG_DEFAULT_CONSOLE     "console=ttySAC1,115200n8\0"

+#define CONFIG_DEFAULT_CONSOLE     "console=ttySAC0,115200n8\0"

#define CONFIG_SYS_MEM_TOP_HIDE    (1 << 20)   /* ram console */

@@ -93,10 +89,10 @@

"fi;" \

"load mmc ${mmcdev} ${loadaddr} uImage; bootm ${loadaddr} "

-#define CONFIG_CLK_1000_400_200

+/* //#define CONFIG_CLK_1000_400_200 */

/* MIU (Memory Interleaving Unit) */

-#define CONFIG_MIU_2BIT_21_7_INTERLEAVED

+/* //#define CONFIG_MIU_2BIT_21_7_INTERLEAVED */

#define CONFIG_ENV_IS_IN_MMC

#define CONFIG_SYS_MMC_ENV_DEV     0

@@ -109,13 +105,10 @@

#define CONFIG_SPL_LDSCRIPT    "board/samsung/common/exynos-uboot-spl.lds"

#define CONFIG_SPL_MAX_FOOTPRINT   (14 * 1024)

-#define CONFIG_SYS_INIT_SP_ADDR        0x02040000

-

-/* U-Boot copy size from SD/MMC to DRAM.*/

+/* U-Boot copy size from boot Media to DRAM.*/

#define COPY_BL2_SIZE      0x80000

#define BL2_START_OFFSET   ((CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)/512)

#define BL2_SIZE_BLOC_COUNT    (COPY_BL2_SIZE/512)  /* u-boot size is 512K */

-

/*

*    SD/MMC(1 Block = 512B) layout:

*    +------------+-------------------------------------------------------------------------------------------------+

@@ -130,5 +123,4 @@

*/

-

#endif /* __CONFIG_H */

2、Kernel boot起来

2.1 先把u-boot烧进SD卡,并把uImage、ramdisk.img和exynos4412-tiny4412.dtb拷贝进SD卡,这三个文件的下载地址为:http://files.cnblogs.com/files/AP0904225/tiny4412-test-image.tar.gz

tiny4412开发板从SD卡启动后,使其进入u-boot命令行状态,如下图所示:

2.2 输入mmcinfo命令查看下SD/MMC设备信息:

2.3 设置bootcmd参数

设置bootcmd变量为 "load mmc 0 0x40007000 uImage; load mmc 0 0x48000000 ramdisk.img; load mmc 0 0x42000000 exynos4412-tiny4412.dtb; bootm 0x40007000 0x48000000 0x42000000";并保存。

load mmc 0 0x40007000 uImage 是把SD卡上的uImage文件读到内存地址为0x40007000处;

load mmc 0 0x48000000 ramdisk.img 是把SD卡上的ramdisk.img文件读到内存地址为0x48000000处;

load mmc 0 0x42000000 exynos4412-tiny4412.dtb是把SD卡上的exynos4412-tiny4412.dtb读到内存地址为0x42000000处;

bootm 0x40007000 0x48000000 0x42000000是告诉u-boot从0x40007000处启动内核,并告诉内核ramdisk.img和设备树文件(*.dtb)的地址为0x48000000、0x42000000

2.4查看下u-boot的环境变量:

然输入boot命令后就把kernel boot起来了

X-009 FriendlyARM tiny4412 uboot移植之SD Card用起来Kernel boot起来的更多相关文章

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  8. tiny4412 --Uboot移植(6) SD卡驱动,启动内核

    开发环境:win10 64位 + VMware12 + Ubuntu14.04 32位 工具链:linaro提供的gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-g ...

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

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

随机推荐

  1. 【转载】C#异常Retry通用类

    //Retry机制 public static class Retry { /// <summary> /// 重试零个参数无返回值的方法 /// </summary> /// ...

  2. 【会装】kylin的安装(填坑)和简单使用

     1.简介 kylin的设计思想是空间换时间,将hive上的大表的维度全部排列组合计算也将度量提前计算然后存入HBase库,这个步骤在kylin中称之为build cube. 在查询的时候已经建立cu ...

  3. C/C++——[02] 运算符和表达式

    C/C++中表示数据运算的符号称为“运算符”.运算符所用到的操作数个数,称为运算符的“目数”. C/C++语言的运算符有赋值运算符.算术运算符.逻辑运算符.位运算符等多类. 将变量.常量等用运算符连接 ...

  4. mknod命令

    mknod - make block or character special filesmknod [OPTION]... NAME TYPE [MAJOR MINOR]    option 有用的 ...

  5. HDU 2544 最短路(floyd+bellman-ford+spfa+dijkstra队列优化)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2544 题目大意:找点1到点n的最短路(无向图) 练一下最短路... dijkstra+队列优化: #i ...

  6. Logistic回归与梯度上升算法

    原创作品出处 原始出处 .作者信息和本声明.否则将追究法律责任.http://sbp810050504.blog.51cto.com/2799422/1608064 Logistic回归与梯度上升算法 ...

  7. Copy List with Random Pointer——技巧

    A linked list is given such that each node contains an additional random pointer which could point t ...

  8. Python 2 到 Python 3 的变化

    1: commands 被 subprocess 所取代:举例 Python2中使用getoutput: >>> import commands >>> print ...

  9. [你必须知道的.NET]第二十二回:字符串驻留(上)---带着问题思考

    发布日期:2008.8.27 作者:Anytao © 2008 Anytao.com ,Anytao原创作品,转贴请注明作者和出处. 说在,开篇之前 走钢丝的人,在刺激中体验快感.带着问题思考,在问题 ...

  10. (转载)使用curl 和 libjson 完成联网和数据解析

    转载地址:http://my.oschina.net/cocosgame/blog/71181 libjson 编译和使用 - 3. libjson的C接口 API http://blog.csdn. ...