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

开发环境: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. sqlite3_get_table()

    { sqlite3 *db; char *errmsg=NULL;    //用来存储错误信息字符串 char ret=0; int my_age=0;    //类型根据要提取的数据类型而定 cha ...

  2. Elasticsearch5.0 安装问题集锦【转】

    转自 Elasticsearch5.0 安装问题集锦 - 代码&优雅着&生活 - 博客园http://www.cnblogs.com/sloveling/p/elasticsearch ...

  3. Nim 游戏、SG 函数、游戏的和

    Nim游戏 Nim游戏定义 Nim游戏是组合游戏(Combinatorial Games)的一种,准确来说,属于“Impartial Combinatorial Games”(以下简称ICG).满足以 ...

  4. 安装在Ubuntu上的Python虚拟环境

    安装指南是在 Ubuntu 下面操作的.不同的 Linux 版本,安装指令不同.所以,该指南的某些指令对于像 CentOS 等非 Ubuntu 系统不适用. 为什么需要使用虚拟环境? 虚拟环境是一个将 ...

  5. Codeforces 822C Hacker, pack your bags!(思维)

    题目大意:给你n个旅券,上面有开始时间l,结束时间r,和花费cost,要求选择两张时间不相交的旅券时间长度相加为x,且要求花费最少. 解题思路:看了大佬的才会写!其实和之前Codeforces 776 ...

  6. 自家人不认识自家人——考你一道有趣的Javascript小题目

    今天的内容很简单,给大家分享一个有趣的Javascript小题目. 题目很简单,就是填空: var a = ______; var b = a; alert(a==b); // alert " ...

  7. [前端随笔][css] 弹性布局

    说在前面 弹性布局,顾名思义就是有弹性,能够根据屏幕/当前空间大小自由伸缩的.使用弹性布局可以很好的适应各种尺寸的客户端. 关键代码 display:flex; 设定元素为弹性布局 <文档传送门 ...

  8. day5冒泡排序

    冒泡排序:是一种基础的算法,实现数据的排序,排序的原则是前一个与后一个进行比较,如果前面的值大则交换,否则不交换,多次循环每次把最大的数据循环至后面就能够完成所需. 上面的图是冒泡排序的原理,每次循环 ...

  9. javax.persistence.EntityNotFoundException: Unable to find报错

    这类错id 可能是10,可能是27,也可能是其他数字 错误描述: javax.persistence.EntityNotFoundException: Unable to find 某个类 with ...

  10. Python类总结-封装(私有属性,方法)

    封装基础 广义上面向对象的封装:代码的保护,面向对象的思想本身就是一种封装 只让自己的对象能调用自己类中的方法 狭义上的封装-面向对象三大特性之一(私有变量,用公有的方法封装私有属性,方法叫封装) 把 ...