求助,uboot启动流程分析能实现什么新功能

20:07 提问
Uboot移植问题,求指教
小弟用的是华清的FS4412 v2的开发板,在进行他们给提供的Uboot移植实验时做到EMMC初始化时,编译后总是出错,不知道该怎解决,小弟自己已经研究了还几天了,就是解决不了,希望大神门给解决一下
出错的信息如下:
Generating include/autoconf.mk
Configuring for fs4412 board...
Generating include/autoconf.mk
Generating include/autoconf.mk.dep
arm-none-linux-gnueabi-gcc -DDO_DEPS_ONLY \
-fno-common -ffixed-r8 -msoft-float
-D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x43E00000 -I/home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/include -fno-builtin -ffreestanding -nostdinc -isystem /home/linux/yunshiming/system/gcc-4.6.4/bin/../lib/gcc/arm-arm1176jzfssf-linux-gnueabi/4.6.4/include -pipe
-DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage
-o lib/asm-offsets.s lib/asm-offsets.c -c -S
if [ -f arch/arm/cpu/armv7/exynos/asm-offsets.c ];then \
arm-none-linux-gnueabi-gcc -DDO_DEPS_ONLY \
-fno-common -ffixed-r8 -msoft-float
-D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x43E00000 -I/home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/include -fno-builtin -ffreestanding -nostdinc -isystem /home/linux/yunshiming/system/gcc-4.6.4/bin/../lib/gcc/arm-arm1176jzfssf-linux-gnueabi/4.6.4/include -pipe
-DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage
-o arch/arm/cpu/armv7/exynos/asm-offsets.s arch/arm/cpu/armv7/exynos/asm-offsets.c -c -S; \
touch arch/arm/cpu/armv7/exynos/asm-offsets.s; \
Generating include/generated/asm-offsets.h
tools/scripts/make-asm-offsets arch/arm/cpu/armv7/exynos/asm-offsets.s include/generated/asm-offsets.h
Generating include/generated/generic-asm-offsets.h
tools/scripts/make-asm-offsets lib/asm-offsets.s include/generated/generic-asm-offsets.h
for dir in tools examples/standalone examples/api arch/arm/cpu/armv7 do \
make -C $dir _ done
make[1]: Entering directory /home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/tools'
make[1]: Nothing to be done for_depend'.
make[1]: Leaving directory /home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/tools'
make[1]: Entering directory/home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/examples/standalone'
make[1]: Nothing to be done for _depend'.
make[1]: Leaving directory/home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/examples/standalone'
make[1]: Entering directory /home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/examples/api'
make[1]: Nothing to be done for_depend'.
make[1]: Leaving directory /home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/examples/api'
make[1]: Entering directory/home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/arch/arm/cpu/armv7'
make[1]: Nothing to be done for _depend'.
make[1]: Leaving directory/home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/arch/arm/cpu/armv7'
make -C tools all
make -C arch/arm/cpu/armv7 start.o
make[1]: Entering directory /home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/tools'
make[1]: *** No rule to make target/home/linux/myfile/arm/u-boot-2013.01-fs4412/tools/gen_eth_addr.c', needed by gen_eth_addr.o'.
make[1]: Leaving directory/home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/tools'
make: *** [tools] Error 2
make: *** Waiting for unfinished jobs....
make[1]: Entering directory /home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/arch/arm/cpu/armv7'
make[1]: *** No rule to make target/home/linux/myfile/arm/u-boot-2013.01-fs4412/include/asm-offsets.h', needed by start.o'.
make[1]: Leaving directory/home/linux/yunshiming/Source_Code/u-boot-2013.01-fs4412/arch/arm/cpu/armv7'
make: *** [arch/arm/cpu/armv7/start.o] Error 2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
There are some error(s) while building uboot, please use command make to check.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
按赞数排序
是操作步骤有问题,把tools目录下的fs4412sql文件删除后,执行clean,然后重新编译就可以了
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐博主最新文章
博主热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)博主最新文章
博主热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)博主最新文章
博主热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)为uboot添加网卡功能可以让uboot通过tftp下载内核, 方便我们的开发, 对于网卡功能的移植,我们依然在在一遍又一遍的实践这个uboot改造的套路。
找运行逻辑,即插入代码的位置。
根据运行逻辑编写功能代码。
找配置逻辑,即修改哪些文件使配置生效。
根据配置逻辑修改配置使功能代码生效。
重新编译烧写uboot。
1. 找运行逻辑
为了实现ping、tftp下载、nfs挂载等功能,必须将uboot的网卡功能配置上,这个功能属于板级功能,
看README+经验+样板
需要在相应板级目录的xxx.c中配置,所以我们找到了"board/samsung/xboot/xboot.c",这个文件的入口是board_init(),即1.找到了运行逻辑。
* netdev.h - definitions an prototypes for network devices
* Board and CPU-specific initialization functions
* board_eth_init() has highest priority.
cpu_eth_init() only
* gets called if board_eth_init() isn't instantiated or fails.
* Return values:
0: success
-1: failure
40 int board_eth_init(bd_t *bis);
41 int cpu_eth_init(bd_t *bis);
56 int dm9000_initialize(bd_t *bis);
//doc/README.drivers.eth
----------
----------
21 When U-Boot initializes, it will call the common function eth_initialize().
22 This will in turn call the board-specific board_eth_init() (or if that fails,
23 the cpu-specific cpu_eth_init()).
These board-specific functions can do random
24 system handling, but ultimately they will call the driver-specific register
25 function which in turn takes care of initializing that particular instance.
27 Keep in mind that you should code the driver to avoid storing state in global
28 data as someone might want to hook up two of the same devices to one board.
29 Any such information that is specific to an interface should be stored in a
30 private, driver-defined data structure and pointed to by eth-&priv (see below).
32 So the call graph at this stage would look something like:
33 board_init()
eth_initialize()
board_eth_init() / cpu_eth_init()
driver_register()
initialize eth_device
eth_register()
2. 编写功能代码
接下来就需要根据网卡手册进行配置,显然,写的都是裸板代码,这里,我们的dm9000网卡的配置代码如下,此为2.根据运行逻辑编写相应的代码。
31 struct exynos4_gpio_part2 *gpio2;
32 #ifdef CONFIG_DRIVER_DM9000
33 #define EXYNOS4412_SROMC_BASE 0X
34 #define DM9000_Tacs (0x1)
35 #define DM9000_Tcos (0x1)
36 #define DM9000_Tacc (0x5)
37 #define DM9000_Tcoh (0x1)
38 #define DM9000_Tah (0xC)
39 #define DM9000_Tacp (0x9)
40 #define DM9000_PMC (0x1)
41 struct exynos_sromc {
unsigned int bc[6];
* s5p_config_sromc() - select the proper SROMC Bank and configure the
* band width control and bank control registers
* srom_bank - SROM
* srom_bw_conf - SMC Band witdh reg configuration value
* srom_bc_conf - SMC Bank Control reg configuration value
52 void exynos_config_sromc(u32 srom_bank, u32 srom_bw_conf, u32 srom_bc_conf)
struct exynos_sromc *srom = (struct exynos_sromc *)(EXYNOS4412_SROMC_BASE);
/* Configure SMC_BW register to handle proper SROMC bank */
tmp = srom-&
tmp&= ~(0xF && (srom_bank * 4));
tmp |= srom_bw_
srom-&bw =
/* Configure SMC_BC register */
srom-&bc[srom_bank] = srom_bc_
64 static void dm9000aep_pre_init(void)
unsigned char smc_bank_num = 1;
unsigned int
smc_bw_conf=0;
unsigned int
smc_bc_conf=0;
/* gpio configuration */
writel(0xx + 0x120);
writel(0xx + 0x140);
/* 16 Bit bus width */
writel(0xx + 0x180);
writel(0x0000FFFF, 0x + 0x188);
writel(0xx + 0x1C0);
writel(0x0000FFFF, 0x + 0x1C8);
writel(0xx + 0x1E0);
writel(0x0000FFFF, 0x + 0x1E8);
smc_bw_conf &= ~(0xf&&4);
smc_bw_conf |= (1&&7) | (1&&6) | (1&&5) | (1&&4);
smc_bc_conf = ((DM9000_Tacs && 28)
| (DM9000_Tcos && 24)
| (DM9000_Tacc && 16)
| (DM9000_Tcoh && 12)
| (DM9000_Tah && 8)
| (DM9000_Tacp && 4)
| (DM9000_PMC));
exynos_config_sromc(smc_bank_num,smc_bw_conf,smc_bc_conf);
95 int board_init(void)
gd-&bd-&bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
101 #ifdef CONFIG_DRIVER_DM9000
dm9000aep_pre_init();
103 #endif
174 #endif
175 #ifdef CONFIG_CMD_NET
176 int board_eth_init(bd_t *bis)
int rc = 0;
180 #ifdef CONFIG_DRIVER_DM9000
rc = dm9000_initialize(bis);
182 #endif
185 #endif
3. 找配置逻辑
将网卡代码编写好之后,我们来分析uboot的配置逻辑,这部分的大部分内容我已经在一文中进行了介绍,这里仅介绍和网卡相关的配置文件。和通用的配置文件一样,我们首先需要将
在相关配置文件中添加网络支持,一文中已经介绍了uboot的配置原理,make config最后生成的结果文件是"include/configs/xxx.h",里面以宏的形式对板子的功能进行了配置,我们这里需要的文件是"include/configs/xboot.h"。
我们只需要打开或关闭相应的宏,就可以完成对某一功能的配置
4. 修改配置
我们主要的工作就是在头文件中打开相应的宏开关,虽然不使用这种宏开关的方式也可以将功能添加成功,但是移植的一个重要原则就是尊重原架构,这对后期维护和代码重用都很有好处。
85 #define CONFIG_CMD_PING
//#undef CONFIG_CMD_PING
90 #define CONFIG_CMD_NET
//#undef CONFIG_CMD_NET
155 /* Enable devicetree support */
156 #define CONFIG_OF_LIBFDT
158 #ifdef CONFIG_CMD_NET
159 #define CONFIG_NET_MULTI
160 #define CONFIG_DRIVER_DM9000 1
161 #define CONFIG_DM9000_BASE 0x
162 #define DM9000_IO
CONFIG_DM9000_BASE
163 #define DM9000_DATA
(CONFIG_DM9000_BASE + 4)
164 #define CONFIG_DM9000_USE_16BIT
165 #define CONFIG_DM9000_NO_SROM 1
166 #define CONFIG_ETHADDR
11:22:33:44:55:66
167 #define CONFIG_IPADDR
192.168.9.200
168 #define CONFIG_SERVERIP 192.168.9.120
169 #define CONFIG_GATEWAYIP
192.168.9.1
170 #define CONFIG_NETMASK
255.255.255.0
171 #endif
173 #endif
/* __CONFIG_H */
5. 重新编译and烧写
最终的结果如下, 我们可以看到dm9000已经启动了
也可以正常的加载并启动内核
阅读(...) 评论()

我要回帖

更多关于 uboot i2c write实现 的文章

 

随机推荐