U-Boot

4、uboot对设备树的支持

◇◆丶佛笑我妖孽 提交于 2019-12-04 17:28:57
第01节_传递dtb给内核 : r2 a. u-boot中内核启动命令: bootm <uImage_addr> // 无设备树,bootm 0x30007FC0 bootm <uImage_addr> <initrd_addr> <dtb_addr> // 有设备树 比如 : nand read.jffs2 0x30007FC0 kernel; // 读内核uImage到内存0x30007FC0 nand read.jffs2 32000000 device_tree; // 读dtb到内存32000000 bootm 0x30007FC0 - 0x32000000 // 启动, 没有initrd时对应参数写为"-" b. bootm命令怎么把dtb_addr写入r2寄存器传给内核? ARM程序调用规则(ATPCS) c_function(p0, p1, p2) // p0 => r0, p1 => r1, p2 => r2 定义函数指针 the_kernel, 指向内核的启动地址, 然后执行: the_kernel(0, machine_id, 0x32000000); c. dtb_addr 可以随便选吗? c.1 不要破坏u-boot本身 c.2 不要挡内核的路: 内核本身的空间不能占用, 内核要用到的内存区域也不能占用 内核启动时一般会在它所处位置的下边放置页表,

BBB DT based approach

浪尽此生 提交于 2019-12-04 15:07:36
I have successfully implemented a GPIO based driver for my custom protocol using platform device model. I want to upgrade it using device tree approach. So for starters I have a beaglebone black, and I have cross compiled the kernel using the device tree config enabled and verified during uboot console messages showing Verifying Checksum ... OK Flattened Device Tree blob at 80f80000 Booting using the fdt blob at 0x80f80000 XIP Kernel Image ... OK OK Using Device Tree in place at 80f80000, end 80f899de I added my entry into the board common file node name my_gpio {compatible = "my_gpio" } Then

Passing Bootargs via Chosen node in Device Tree not working for Beaglebone Black

♀尐吖头ヾ 提交于 2019-12-04 07:30:24
As per my understanding chosen node is used to send boot arguments to the kernel. The following is the chosen node of the existing device code (am335x-bone-common.dtsi). chosen { stdout-path = &uart0; }; So, I have modified chosen node to pass kernel arguments. chosen { bootargs = "console=ttyO0,115200 root=/dev/mmcblk0p2 rootfstype=ext3 rw rootwait"; stdout-path = &uart0; }; While bringing up the board I encountered KERNEL PANIC, Here is the log { https://pastebin.com/XHyrsmfG } FYI: These are the u-boot commands issued on serial console(minicom) inorder to port kernel and devicetree using

飞思卡尔iMX6开发板-L4.1.15-TF卡开机自动烧写镜像

跟風遠走 提交于 2019-12-04 05:32:39
硬件环境:迅为iTOP-imx6 开发板 1. 拷贝相应的压缩包到ubuntu系统下。并解压。 2. 格式化tf卡为fat32格式。然后在 ubuntu 系统下插入 tf 卡,使用命令“df -l”可以查看 tf 卡的设备节点以及挂在的目录,如下图所示。 3.作者这里 tf 卡的节点是/dev/sdb1,挂载在“/media/C03F-4578”目录(也有可能是 sdc,sdd 之类的,根据实际情况,目录也都不一样)。然后我们使用 umount 命令取消挂载 “umount /media/C03F-4578”。 4. 使用“ls /sbin/mkfs*”,作者机器如下图所示。 如上图所示,假如用户的机器中没有“/sbin/mkfs.fat”文件,则使用命令“ln -s /sbin/mkfs.vfat /sbin/mkfs.fat”,有的话,直接跳过这一步。 5. 使用 cd 命令进入到前面解压生成的 tf_flash 文件夹 然后在当前目录下运行“./mksdcard-android.sh -f /dev/sdb”(注意 sdb 后面不要跟数字),如下图所示。 运行完成如下图所示。 然后拔下 tf 卡,重新插入到 ubuntu 系统下,输入命令“df -l”,可以看到 tf 卡分区信息,以及挂载的目录,如下图所示。 上图中“/dev/sdb5“是文件系统的分区(有可能用户的盘符会是

Linux系统移植(1)

杀马特。学长 韩版系。学妹 提交于 2019-12-03 23:17:41
一、u-boot工程    1.BootLoader介绍     BootLoader是操作系统运行之前要执行的一段程序,它复制初始化硬件设备、建立内存空间映射,为操作系统的运行做好准备,是一个专门加载操作系统的程序。     对于嵌入式系统而言,没有通用的硬件平台,因此也没有通用的BootLoader,不同的平台、CPUyi架构都有不同的BootLoader,因为BootLoader不光依赖CPU的体系结构,也以来硬件平台的配置,对于不同的开发板而言,哪怕它的CPU一样,BootLoader也会有区别,因此我们为每一款开发板制作属于它的BootLoader程序。     但大部分开发板的BootLoader仍有许多共性,所以我们没有必须全部从零制作,而对一个基础的BootLoader进行 修改 ,制作出能用的BootLoader程序。    2.u-boot简介     u-boot( Universal Boot Loader )是BootLoader的一种,它遵循 GPL通用许可证 的开源项目,它的源码的目录、编译形式都和Linux的源码很相似,可以说u-boot就是仿照Linux开发的。    3.u-boot源码的获取     ① 源头的代码是u-boot官网下载的,这种源码是最干净最存粹的,一般CPU 的生产厂商会下载这种源码。     

u-boot

僤鯓⒐⒋嵵緔 提交于 2019-12-03 20:12:44
https://www.denx.de/wiki/U-Boot 下载地址 准备好工具链 在/etc/bash.bashrc 添加 export PATH=$PATH:/.../bin 并source 这个文件 下载一份源码 目录层次结构: ==================== / arch体系结构特定文件 / arc ARC架构通用文件 / arm ARM体系结构通用的文件 / m68k m68k架构通用的文件 / microblaze对microblaze体系结构通用的文件 / mips MIPS架构通用的文件 / nds32 NDS32体系结构通用文件 / nios2 Altera NIOS2架构通用的文件 / openrisc OpenRISC架构通用的文件 / powerpc PowerPC体系结构通用的文件 / sandbox与硬件无关的“ sandbox”通用的文件 / sh SH体系结构通用的文件 / x86 x86体系结构通用的文件 / api外部应用程序的机器/ arch独立API / board依赖于板的文件 / cmd U-Boot命令功能 / common杂项架构独立功能 / configs板默认配置文件 / disk用于磁盘驱动器分区处理的代码 / doc文档(不要期望太多) / drivers常用的设备驱动程序 / dts包含用于生成内部U-Boot

iMX6Q/PLUS开发板烧写设备树内核的Ubuntu系统

帅比萌擦擦* 提交于 2019-12-03 18:16:40
基于迅为-iMX6D、iMX6Q 和 iMX6PLUS 三个硬件版本,设备树镜像的烧写方法以及镜像所在目录,镜像名称全部一致,所以作者将烧写章节合并到一起。 请注意,如果购买的是 iMX6D 版本,想要烧写设备树版本镜像,请使用 iMX6D 设备树版本的光盘(iMX6D 还有一个非设备树版本的光盘); 如果购买的是 iMX6Q 版本,想要烧写设备树版本镜像,请使用 iMX6Q 设备树版本的光盘(iMX6Q 还有一个非设备树版本的光盘); 如果购买的还是 PLUS 版本,请使用 PLUS 版本的光盘。 烧写工具是 iMX6D/Q/PLUS 设备树内核光盘资料的“02 编译器以及烧写工具 烧写工具”目录下的“android_m6.0.1_2.0.0_ga_tool_20190412.7z”压缩包(红色日期可能会变),解压压缩包,进入解压得到的文件夹“mfgtools”。 其中,“MfgTool2.exe”是烧写工具,“cfg.ini”是配置文件,打开“cfg.ini”,如下图所示,确保“[LIST]”的参数是 Ubuntu。 编译好的设备树 Ubuntu16.04 镜像在 imx6D/Q/PLUS 设备树内核光盘资料的“06 镜像_Ubuntu 文件系统”目录下。其中分为 1G 和 2G 的镜像,用户根据硬件内存大小使用对应的镜像。 这里以 1G 内存镜像为例,将其中的“u-boot

How does the bootloader pick up the command after a “restarting system with command”?

喜你入骨 提交于 2019-12-03 16:49:46
问题 Looking in the android source for the reboot command we find the following line: __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, \ LINUX_REBOOT_CMD_RESTART2, argv[optind]); Which is the standard Linux system call to reboot the system with a specific command, see Unix System Call Reboot. In Android this command is used to tell the bootloader to start either the kernel in recovery mode or to go to the fastboot mode within the bootloader. My question is: How does the bootloader pick up the

Linux On ARM开发纪要

两盒软妹~` 提交于 2019-12-03 10:35:01
ARM的开发与X86还是有不少区别的,这里做了一些简单的介绍,以方便X86下的开发者能更快地切换到Linux on ARM的体系下面来。 ARM近年来的发展可谓如日中天,苹果和Android的使用是最为快速的推动力,而今Windows也支持ARM了,而更小型的树莓派和一些超低功耗模块也都有使用ARM的内核了。 尽管微软已经耐不住寂寞,大部分使用ARM的设备还是Linux或是类Linux的系统内核,因为Linux的可裁剪性非常好,而且可用的资源非常非常多了。在“软件定义世界”的思路引领下,Linux on ARM必将是未来的大潮流。 Linux on ARM与X86体系下的不同点是采用“设备”的概念,“X86下的BIOS”是可以自己烧进去的(就是那个启示时按个烧写键,就把引导区少到Flash的指定区域了,这个地址在给定板子上是不能变的),这个叫boot-loader,一般用的u-boot。当然,因为u-boot是开源的,因此出现了很多变体,但基本上都是大同小异。 boot-loader启动后,就会跳转到下一个地址,开始载入Linux内核,这里头最重要的是文件系统。有了文件系统,就不用再去读写Flash的裸扇区了,而是通过文件系统进行数据文件的操作。然后将会进入命令行界面,有一个叫Busy-box的小程序把常用的一些命令都打包到了一起,使用起来更方便、体积更小、运行更快。这时候

loading u-Boot in memory instead of flashing it

六月ゝ 毕业季﹏ 提交于 2019-12-03 09:53:44
问题 In my ARM based custom board, I flash u-boot to NAND whenever I do changes on that. (putting some debug statements/modification). Is there any way to directly load the uboot image in RAM memory instead of flashing it every time? For linux kernel image I do load it in memory and use bootm to boot that image. Similarly for u-boot I am trying out. Kindly provide your suggestions. 回答1: Someone at Freescale has done this, for their P1022DS evaluation system (and some others as well). They have