x-007friendlyarmtiny4412u-boot移植之内存初始化

LoTGu LoTGu     2022-08-16     778

关键词:

 

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

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

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

 

在上一节中我们把tiny4412开发板上的COM0串口用起来,可以通过COM0串口输出一些调试信息。接下来要做的是初始化tiny4412开发板上的DDR3内存。

 

1Tiny4412开发板上的DDR3内存

   原理图:Tiny4412-1412-Schematic.pdf

clip_image002

从原理图上可以看出,使用2K4B4G1646B-HCK内存芯片并联组成了数据位为32bit 1G大小的内存。内存芯片接在exynos4412芯片的DMC0上,使用了一个chip(chip0),内存地址空间为0x40000000-0x80000000

 

2Exynos4412芯片DMC初始化步骤

具体信息在 《Exynos 4412 SCP_Users Manual_Ver.0.10.00_Preliminary.pdf》第18Dynamic Memory Controller

clip_image004

clip_image006

 

3Tiny4412 DDR3初始化代码

diff --git a/arch/arm/mach-exynos/dmc_init_exynos4412.c b/arch/arm/mach-exynos/dmc_init_exynos4412.c

new file mode 100644

index 0000000..27f72cd

--- /dev/null

+++ b/arch/arm/mach-exynos/dmc_init_exynos4412.c

@@ -0,0 +1,254 @@

+/*

+ * Memory setup for board based on EXYNOS4412

+ *

+ *                 2016

+ * Modified by AP0904225 <ap0904225@qq.com>

+ *

+ * Copyright (C) 2013 Samsung Electronics

+ * Rajeshwari Shinde <rajeshwari.s@samsung.com>

+ *

+ * See file CREDITS for list of people who contributed to this

+ * project.

+ *

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

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

+ * published by the Free Software Foundation; either version 2 of

+ * the License, or (at your option) any later version.

+ *

+ * This program is distributed in the hope that it will be useful,

+ * but WITHOUT ANY WARRANTY; without even the implied warranty of

+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

+ * GNU General Public License for more details.

+ *

+ * You should have received a copy of the GNU General Public License

+ * along with this program; if not, write to the Free Software

+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,

+ * MA 02111-1307 USA

+ */

+

+#include <config.h>

+#include <asm/arch/dmc.h>

+#include "common_setup.h"

+#include "exynos4412_setup.h"

+

+#ifdef TINY4412

+struct mem_timings mem = {

+   .direct_cmd_msr = {

+       DIRECT_CMD1, DIRECT_CMD2, DIRECT_CMD3, DIRECT_CMD4

+   },

+   .timingref   = 0x000000BB,

+   .timingrow   = 0x6946654f,

+   .timingdata  = 0x46460506,

+   .timingpower = 0x5200183c,

+   .zqcontrol   = 0xE3854C03,

+   .control0    = 0x71101008,

+   .control1    = 0xe0000086,

+   .control2    = 0x00000000,

+   .concontrol  = 0x0FFF301A,

+   .prechconfig = 0xff000000,

+   .memcontrol  = 0x00302640,      /* Tiny4412-1412 core board only use chip0 */

+   .memconfig0  = 0x40C01333,      /* ROW is 15bit */

+   .memconfig1  = 0x80C01333,      /* DMC0 address up to 0x7FFFFFFF */

+   .dll_resync  = FORCE_DLL_RESYNC,

+   .dll_on      = DLL_CONTROL_ON,

+

+};

+#else

+struct mem_timings mem = {

+   .direct_cmd_msr = {

+       DIRECT_CMD1, DIRECT_CMD2, DIRECT_CMD3, DIRECT_CMD4

+   },

+   .timingref = TIMINGREF_VAL,

+   .timingrow = TIMINGROW_VAL,

+   .timingdata = TIMINGDATA_VAL,

+   .timingpower = TIMINGPOWER_VAL,

+   .zqcontrol = ZQ_CONTROL_VAL,

+   .control0 = CONTROL0_VAL,

+   .control1 = CONTROL1_VAL,

+   .control2 = CONTROL2_VAL,

+   .concontrol = CONCONTROL_VAL,

+   .prechconfig = PRECHCONFIG,

+   .memcontrol = MEMCONTROL_VAL,

+   .memconfig0 = MEMCONFIG0_VAL,

+   .memconfig1 = MEMCONFIG1_VAL,

+   .dll_resync = FORCE_DLL_RESYNC,

+   .dll_on = DLL_CONTROL_ON,

+};

+#endif

+

+static void phy_control_reset(int ctrl_no, struct exynos4_dmc *dmc)

+{

+   if (ctrl_no) {

+       writel((mem.control1 | (1 << mem.dll_resync)),

+              &dmc->phycontrol1);

+       writel((mem.control1 | (0 << mem.dll_resync)),

+              &dmc->phycontrol1);

+   } else {

+       writel((mem.control0 | (0 << mem.dll_on)),

+              &dmc->phycontrol0);

+       writel((mem.control0 | (1 << mem.dll_on)),

+              &dmc->phycontrol0);

+   }

+}

+

+static void dmc_config_mrs(struct exynos4_dmc *dmc, int chip)

+{

+   int i;

+   unsigned long mask = 0;

+

+   if (chip)

+       mask = DIRECT_CMD_CHIP1_SHIFT;

+

+   for (i = 0; i < MEM_TIMINGS_MSR_COUNT; i++) {

+       writel(mem.direct_cmd_msr[i] | mask,

+              &dmc->directcmd);

+   }

+}

+

+static void dmc_init(struct exynos4_dmc *dmc)

+{

+   /*

+    * DLL Parameter Setting:

查看详情

x-004friendlyarmtiny4412uboot移植之点亮指路灯

 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<&l 查看详情

x-003friendlyarmtiny4412uboot移植之添加相应目录文件

  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 查看详情

x-005friendlyarmtiny4412uboot移植之时钟初始化

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 查看详情

x-009friendlyarmtiny4412uboot移植之sdcard用起来kernelboot起来

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 查看详情

x-002exyson4412芯片启动过程分析

 移植u-boot到FriendlyARMTiny4412开发板上,首先我们需要对SamsungExyson4412芯片的启动方式、系统时钟初始化、串口初始化、内存初始化以及开发板的内存地址空间分配有一个清楚的认识。下面是一些参考资料:1>、技术部落(这... 查看详情

itop-4412开发板运行linuxqt系统,怎么挂接u盘

参考技术A如果是iTop-4412的android4.0系统,可以这样来实现:linuxQT系统下挂载u盘,首先用命令mknod/dev/sda1b81创建U盘的设备节点,然后使用命令mount/dev/sda1/mnt/udisk/挂载u盘即可。 查看详情

tiny4412u-boot分析u-boot配置流程分析

参考Friendlyarm的文档,编译uboot的流程为maketiny4412_configmake这个过程主要涉及到两个文件,顶层的Makefile文件和mkconfig文件,makeconfig文件是一个脚本,通过文件的注释可以了解到它的作用#Scripttocreateheaderfilesandlinkstoconfigure#U-Bootforasp... 查看详情

u-boot启动流程详解-基于itop4412开发板

...(NAND,NORFLASH,SD,MMC等)拷贝到DDR中,最后启动linux内核。4412u-boot启动流程:A.开机运行iRom中代码B.BL1阶段(E4412_N.bl1.xxxxG. 查看详情

tiny4412-1312__uboot移植(代码片段)

...16.08-x86_64_arm-linux-gnueabi要移植的u-boot版本:u-boot-2016-11Tiny4412开发板硬件版本为:  底板:  Tiny4412SDK1312B  核心板:Tiny4412-1306 1.获取U-BOOT源码从FTP站点下载: ftp://ftp.denx.de/pub/u-bootuboot-2016-09.tar.bz22.交... 查看详情

tiny4412u-boot分析u-boot引导内核流程

在u-boot中,通过bootm命令启动内核。bootm命令的作用是将内核加载到指定的内存地址,然后通过R0、R1、R2寄存器传递启动参数之后启动内核。在启动内核之前需要对环境做一些初始化工作,主要有如下几个方面:(1)、cpu寄存器设... 查看详情

tiny4412u-boot分析u-boot启动流程

从大方面来说,u-boot的启动分成两个阶段,第一个阶段主要的职责是准备初始化的环境,主要有以下几点①设置异常向量表②把CPU的工作模式设置为SVC32模式③关闭中断、MMU和cache④关闭看门狗⑤初始化内存、时钟、串口⑥设置... 查看详情

第二章tiny4412u-boot移植二启动分析

本文转载自:http://blog.csdn.net/eshing/article/details/37521481版权声明:本文为博主原创文章,未经博主允许不得转载。一、启动过程说明      讲解启动过程,首先的源头就是打开电源,这个相信没人人不知道。CPU... 查看详情

tiny4412学习杂记

1.Android挂载NFS使用busyboxmount来替代mount命令2.修改Uboot中fastboot最大buff 使用U-boot烧写Android5.0的时候出现remote:datatoolarge将 include/configs/tiny4412.h 改大一点3.tiny4412内核中trustzone配置开关tiny4412 trust 查看详情

tiny4412u-boot烧写及根文件系统制作(不进入终端问题)

...tails?id=51400196(转) VMware12环境:ubuntu12.4开发板:tiny4412首先烧写bootloader,我用一个8G的内存卡,现在不说sd卡的制作过程了,网上可以参考。现在就把我给arm的emmc烧写过程开始说。用sd卡启动,开发板的右下角有个开关控制... 查看详情

uboot移植前奏

  Tiny4412开发板硬件版本为:     底板: Tiny4412/Super4412SDK1506      核心板:Tiny4412-1412 1、下载u-boot源代码,建立u-boot代码仓库   参考:h 查看详情

tiny4412--uboot移植串口(代码片段)

...16.08-x86_64_arm-linux-gnueabi要移植的u-boot版本:u-boot-2016-11Tiny4412开发板硬件版本为:  底板:  Tiny4412SDK1312B  核心板:Tiny4412-1306 1,原理图查看tiny4412SDK-1312B-Schematic.pdf   可看出,底板使用UART0作... 查看详情

tiny4412裸机程序说明

...自己想学点东西,过于求成,又过于自信,直接买了Tiny4412的板子,但网上关于4412的资料太少,我一直没办法啃动,只能尽可能找来各种相关资料进行参考分析。我想在U-Boot程序中加入LCD显示功能,但始终都没有正常点亮LCD,放... 查看详情