Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uboot配置过程(mkconfig脚本+其他) #21

Open
TongxinV opened this issue Mar 4, 2017 · 0 comments
Open

uboot配置过程(mkconfig脚本+其他) #21

TongxinV opened this issue Mar 4, 2017 · 0 comments

Comments

@TongxinV
Copy link
Owner

TongxinV commented Mar 4, 2017

uboot配置过程(mkconfig脚本+其他)

在编译uboot之前需要进行配置(带参数执行mkconfig脚本+其他)

make x210_sd_config 为例:主要完成的内容

make x210_sd_config时会相应的去执行Makefile中的:

x210_sd_config :	unconfig
@$(MKCONFIG) $(@:_config=) arm s5pc11x x210 samsung s5pc110
@echo "TEXT_BASE = 0xc3e00000" > $(obj)board/samsung/x210/config.mk

@$(MKCONFIG)就表示调用目录下的mkconfig脚本,后面是mkconfig脚本的6个参数,不是五个
$(@:_config=) arm s5pc11x x210 samsung s5pc110

$和@结合: 是Makefile自动变量的一种,会被替换成目标x210_sd

冒号表示加工,怎么加工呢?就是把目标中的_config等于空(等号后面没东西表示空)。即x210_sd_config里的_config部分用空替换,得到:x210_sd,这就是第一个参数,则:

$1:	x210_sd
$2:	arm
$3: s5pc11x
$4:	x210
$5: samsumg
$6:	s5pc110
所以,$# = 6

TEXT_BASE = 0xc3e00000:指定uboot的链接地址,因为uboot中启用了虚拟地址映射,因此这个C3E00000地址就等于0x23E00000(也可能是33E00000具体地址要取决于uboot中做的虚拟地址映射关系

下面打开mkconfig脚本分析

总结

uboot编译前的配置(mkconfig脚本+其他)主要完成的内容:
1.创建符号链接,用于将来在写代码过程中能自动索引具体平台的文件
2.在include目录下创建config.mk文件并向里面写内容(其实就是把$2到$6的内容写入)让主Makefile去包含
3.在include目录下创建config.h文件并向里面写内容(其实就一行#include <configs/$1.h>)用于Makefile作为生成autoconf.mk的依赖和让start.S去包含
4.直接创建 $(obj)board/samsung/x210/config.mk文件并向里面写内容(TEXT_BASE = 0xc3e00000)让根目录下的config.mk去包含

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant