嵌入式 uboot預設引數的修改

2021-06-26 06:26:49 字數 2640 閱讀 7662

由於沒有設定uboot引數的分割槽,只能在uboot原始碼中修改預設引數以使uboot正常工作。

boot/u-boot/include/configs/ap123.h:

#define __gen_cmd(n, a, f, ec, cc, el) \

#n "=tftp 0x80060000 $" #f "&&" \

#ec " " #a " " #el "&&" \

#cc " $fileaddr " #a " $filesize\0"

*/#define __gen_cmd(n, a, f, ec, cc, el) \

#n "=tftp 0x80060000 " #f "&&" \

#ec " " #a " " #el "&&" \

#cc " $fileaddr " #a " $filesize\0"

//# define ath_u_file tuboot.bin

# define ath_u_file tuboot-router.bin

uboot檔名

//# define ath_f_file $-jffs2

# define ath_f_file ap123-router-jffs2

jffs2檔案系統檔名

//# define ath_k_file vmlinux_$.lzma.uimage

# define ath_k_file vmlinux-router.lzma.uimage

kernel img檔名

//# define ath_k_addr 0x9f300000

# define ath_k_addr 0x9fdd0000

kernel img分割槽位址

//# define mtdparts_default "mtdparts=ath-nor0:64k(u-boot),6016k(rootfs),2048k(uimage),6016k(spare_rootfs),2048k(spare_uimage),64k(log),64k(mib0),64k(caldata)"

# define mtdparts_default "mtdparts=ath-nor0:64k(u-boot),14080k(rootfs),2048k(uimage),64k(log),64k(mib0),64k(caldata)"

分割槽及其位址的修改

//# define ath_u_cmd gen_cmd(lu, 0x9f000000, ath_u_file)

# define ath_u_cmd gen_cmd_el(lu, 0x9f000000, ath_u_file, 0x10000)

//# define ath_f_cmd gen_cmd_el(lf, ath_f_addr, ath_f_file, ath_f_len)

# define ath_f_cmd gen_cmd_el(lf, ath_f_addr, ath_f_file, 0xdc0000)

//# define ath_k_cmd gen_cmd(lk, ath_k_addr, ath_k_file)

# define ath_k_cmd gen_cmd_el(lk, ath_k_addr, ath_k_file, 0x200000)

確保燒寫檔案到flash之前,erase分割槽的全部位址。如果只erase filesize,可能會出錯。

//#define config_bootargs "console=ttys0,115200 root=" ath_root_dev " rootfstype=squashfs init=/sbin/init " mtdparts_default

#define config_bootargs "console=ttys0,115200 root=" ath_root_dev " rootfstype=jffs2 init=/sbin/init " mtdparts_default

檔案系統改為jffs2

//# define config_bootcommand "bootm 0x9f5f0000"

# define config_bootcommand "bootm 0x9fdd0000"

kernel啟動位址和kernel img分割槽起始位址一致

//#define config_ipaddr 192.168.1.1

//#define config_serverip 192.168.1.10

#define config_ipaddr 192.168.2.167

#define config_serverip 192.168.2.165

板子位址和tftp server位址

boot/u-boot/include/configs/

ar7100.h:

boot/u-boot/include/configs/

ar7240.h:

//#define config_bootdelay 4

#define config_bootdelay 2

改了兩個檔案,但是肯定只有乙個檔案起作用,不過沒必要去深究哪個。

縮短了啟動時間

修改後的uboot引數如下:

嵌入式UBOOT學習

之前還學習了在虛擬機上安裝ubuntu16.04系統,使用命令安裝一些必需的軟體包,以及常用的終端命令 以後再作補充。今天學習的內容總結如下,主要是對編譯uboot前的環境變數進行配置,以及elftosb轉換工具的安裝,使用該工具編譯出mx28 ivt uboot.sb檔案。uboot的概念 ubo...

嵌入式學習筆記 uboot

1 linux啟動方式比較 一上電pc linux 嵌入式系統 bios硬碟讀入核心 boot loader 最終目的是啟動核心,有很多種,我用的是uboot 從flash讀出核心,放到sdram中 引導作業系統windows 引導核心 識別c,d盤 掛接根檔案系統 執行應用程式qq等 應用程式 2...

嵌入式啟動順序 uboot之前

本文章基於hi35xx soc 與 u boot 2010.06 具體有多少種啟動順序,這個是soc相關的,也就是說乙個soc製造出來,就已經確定了有幾種啟動順序.具體可以看soc 的晶元手冊 這裡只是概述出了作者見過的各種啟動順序的集合 1 上電執行塊 索引 存放位置 未知 執行位置 未知 上序 ...