U-Boot

u-boot之顶层Makefile解析

為{幸葍}努か 提交于 2019-12-09 15:43:21
本文分析的u-boot的版本为2010.03 正常编译u-boot的流程如下 make xxx_config make all 在 u-boot之mkconfig解析 中,我们已经了解了make xxx_config做了哪些事情,今天我们就要利用它做的事情来继续分析make all这个命令。 其实make all就等于make 其实分析这个命令,也就是等于分析顶层目录下面的Makefile。下面就开始我们的探索 # 和U-Boot版本相关的一些内容 VERSION = 2010 PATCHLEVEL = 03 SUBLEVEL = EXTRAVERSION = ifneq "$(SUBLEVEL)" "" U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) else U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION) endif TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h VERSION_FILE = $(obj)include/version_autogenerated.h 上面是一些和u-boot版本相关的信息 # 确定主机CPU架构

How to boot Linux kernel from u-boot?

那年仲夏 提交于 2019-12-09 01:08:41
问题 My Linux kernel image uImage is in my U-disk. And I want to boot it from U-Boot. Also the device tree file am335x-evm.dtb is in my U-disk. What I did is below: U-Boot# usb start (Re)start USB... USB0: scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found U-Boot# fatls usb 0:1 3821960 uimage kit3/ 4065280 modules.tar my_modules/ extra/ system volume information/ 375 uenv.txt 40474 am335x-evm.dtb 4 file(s), 4 dir(s) U-Boot# fatload usb

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

家住魔仙堡 提交于 2019-12-06 07:52:59
基于迅为-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

跟 UMU 一起玩 OpenWRT(高级篇1):编译不死 U-Boot

怎甘沉沦 提交于 2019-12-06 06:55:02
UMU 2010 年初就玩 OpenWRT/DD-WRT 了,蛋似编译东西还是初学者,本文纯属蛋疼的过程,欢迎批评教育,谢谢…… 首先到 https://github.com/pepe2k/u-boot_mod 看明白作者的说明。这里简单说一下原理:固件(firmware)刷坏,但 U-Boot 没坏,这是半砖,可以用 TTL 线连路由器,通过 U-Boot 的功能刷好 firmware。如果两者都坏了,叫全砖,只能把 Flash 拆下来,用编程器刷好 U-Boot 和 firmware。不死 U-Boot 就是修改了 U-Boot 的实现,使我们可以用 RJ-45 网线来救砖,省去拆机搭 TTL 线的麻烦。 本质上说,这东西并非真的不死,只要 U-Boot 被刷坏了,还是会死,不过几率不大,因为 OpenWRT 官方发行的 ROM 全都是保护 U-Boot 区域的,根据 UMU 的经验,只有三个情况会不小心或故意刷坏:1、从原厂固件刷不良固件;2、在 DD-WRT 下搞破坏(DD-WRT 没有保护 U-Boot);3、自制固件去掉 U-Boot 写保护后搞破坏……如果您真的这么蛋疼,还是准备编程器吧,只要是软件问题,在编程器面前没有砖的概念。(JTAG 也是救砖神器,但不是每台路由器都有,比如 DIR-505 就没有!) 由于 UMU 是 Windows 程序员,平时没有安装

BBB DT based approach

試著忘記壹切 提交于 2019-12-06 06:25:01
问题 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

In u-boot, kernel_entry points to which function?

喜欢而已 提交于 2019-12-06 06:19:30
This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . This is the function from u-boot: static void boot_jump_linux(bootm_headers_t *images, int flag) { #ifdef CONFIG_ARM64 void (*kernel_entry)(void *fdt_addr); int fake = (flag & BOOTM_STATE_OS_FAKE_GO); kernel_entry = (void (*)(void *fdt_addr))images->ep; debug("## Transferring control to Linux (at address %lx)...\n", (ulong) kernel_entry); bootstage_mark(BOOTSTAGE_ID_RUN_OS); announce_and_cleanup(fake); if (!fake) kernel_entry(images->ft_addr); #else unsigned long

Reading multiple bytes using I2C in U-Boot

泪湿孤枕 提交于 2019-12-06 03:27:11
I am having a problem with the I2C driver for a Freescale p1022tw board. There is a command on U-Boot's console to read from an I2C device: i2c md chip address[.0, .1, .2] [# of objects] When I read 4 bytes from a device with id 0x60, at address 0x0, I get: tw=>i2c md 60 0 4 0000: 45 45 45 45 EEEE These values that it returned are wrong. I can get the right values if I read one byte at the time: tw=>i2c md 60 0 1 0000: 45 E tw=>i2c md 60 1 1 0001: 45 E tw=>i2c md 60 2 1 0002: 46 F tw=>i2c md 60 3 1 0003: 00 . I should have gotten 45 45 46 00 or EEF0 in the first command. In multiple readings

Can u-boot support more than one ethernet port?

荒凉一梦 提交于 2019-12-06 03:05:51
I want to ping out of multiple ethernet ports. Is there an inherent restriction where u-boot only supports a single ethernet port? Can u-boot support more than one ethernet port? Yes, in recent versions of U-Boot (going back to at least 2012.10). Salient code is eth_current_changed() and eth_set_current() in net/eth.c . Is there an inherent restriction where u-boot only supports a single ethernet port? No, recent versions of U-Boot can support more than one Ethernet port on the board. When more than one Ethernet interface is available (as reported by the "Net" device list on startup, e.g. "Net

u-boot中bss段的使用

岁酱吖の 提交于 2019-12-06 02:17:05
近日在调试uboot时,发现了一个现象,即在relocate_code前如果给未初始化或者初始化值为0的变量赋值的话,则在relocate_code后程序无法正常执行.经过学习,恶补如下知识 BSS段:BSS段(bss segment)通常是指用来存放程序中未初始化的全局变量的一块内存区域。 BSS是英文Block Started by Symbol的简称。BSS段属于静态内存分配。 数据段:数据段(data segment)通常是指用来存放程序中已初始化的全局变量的一块内存区域。数据段属于静态内存分配。 代码段:代码段(code segment/text segment)通常是指用来存放程序执行代码的一块内存区域。这部分区域的大小在程序运行前就已经确定,并且内存区域通常属于只读, 某些架构也允许代码段为可写,即允许修改程序。在代码段中,也有可能包含一些只读的常数变量,例如字符串常量等。 堆(heap):堆是用于存放进程运行中被动态分配的内存段 ,它的大小并不固定,可动态扩张或缩减。当进程调用 malloc等函数分配内存时 ,新分配的内存就被动态添加到堆上(堆被扩张);当利用free等函数释放内存时,被释放的内存从堆中被剔除(堆被缩减) 栈(stack):栈又称堆栈, 是用户存放程序临时创建的局部变量 ,也就是说我们函数括弧“{}”中定义的变量(但不包括static声明的变量

IMX6Q学习笔记——开发板的Linux系统更新和烧录

試著忘記壹切 提交于 2019-12-06 02:09:26
IMX6Q学习笔记——开发板的Linux系统更新和烧录 记录自己在电鱼电子开发SAIL-IMX6Q全能板后,并且对系统和模块进行简单测试的过程之后对开发板的Linux系统进行更新和烧录的记录过程,算是进行一个分享和记录,同时也方便自己日后查阅。 首先准备好需要的硬件和软件。PC机(需要至少一路232串口和一路USB2.0 HOST)、串口线、USB转串口线、电源适配器、USB延长线。软件需要准备超级终端、mfgtools.rar、u-boot1.imx,u-boot2.imx,zlmage,sail-imxq.dtb,rootfs.tar.bz2。 使用PC机USB OTG连接SAIL-IMX6Q/DL的OTG接口。将12V直流电源连接到SAILIMX6Q/DL主板的电源接口。 设置USB烧写模式,码开关SW4拨到 1 0 。 从光盘\Linux\烧录映像目录下拷贝sail-imx6q.dtb到mfgtools\Profiles\Linux\OS Firmware\files\sail-imx6q文件夹中 从光盘\Linux\烧录映像目录下拷贝zImage到mfgtools\Profiles\Linux\OS Firmware\files\sail-imx6q文件夹中 从光盘\Linux\烧录映像目录下拷贝u-boot1.imx或u-boot2.imx到mfgtools