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

开发环境: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. device tree --- #address-cells and #size-cells property

    device tree source Example1 / { #address-cells = <0x1>; // 在 root node 下使用 1 個 u32 來代表 address ...

  2. CRM 业务

    1. 创建CRM项目 引入插件 创建数据库 from django.db import models from django.db import models class Department(mod ...

  3. Codefroces 735D Taxes(哥德巴赫猜想)

    题目链接:http://codeforces.com/problemset/problem/735/D 题目大意:给一个n,n可以被分解成n1+n2+n3+....nk(1=<k<=n). ...

  4. 【数据挖掘基础算法】KNN最近邻分类算法

    算法简介: 通过计算待预测样本和已知分类号的训练样本之间的距离来判断该样本属于某个已知分类号的概率.并选取概率最大的分类号来作为待预测样本的分类号 懒惰分类算法,其模型的建立直到待预测实例进行预测时才 ...

  5. 非常粗糙的react网页ppt

    import React, {Component} from 'react'; import './slide.css'; class Page extends Component { constru ...

  6. Windows内核读书笔记——Windows异常分发处理机制

    本篇读书笔记主要参考自<深入解析Windows操作系统>和<软件调试>这两本书. IDT是处理异常,实现操作系统与CPU的交互的关口. 系统在初始化阶段会去填写这个结构. ID ...

  7. MVC – 5.MVC设计模式和.NetMVC框架

    MVC模式-设计模式 •控制器(Controller)- 负责转发请求,对请求进行处理. •视图 (View) - 界面设计人员进行图形界面设计. •模型 (Model)-业务逻辑.数据.验证规则.数 ...

  8. 【转】servlet/filter/listener/interceptor区别与联系

    原文:https://www.cnblogs.com/doit8791/p/4209442.html 一.概念: 1.servlet:servlet是一种运行服务器端的java应用程序,具有独立于平台 ...

  9. NIO-4pipe

    import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.Pipe; import org.ju ...

  10. mp4文件数据格式解析

    unsigned int(32)[3]    32*3bit string[32]  32*8bit class VisualSampleEntry(codingname) extends Sampl ...