add uboot and vanet

This commit is contained in:
geekard
2012-09-03 09:08:17 +08:00
parent 5ef7c20052
commit 05e8ae5877
60 changed files with 3909 additions and 70 deletions

View File

@@ -0,0 +1,36 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-08-11T19:15:34+08:00
====== jffs2 scan eraseblock() Magic bitmask 0x1985 not found at ======
Created Saturday 11 August 2012
如果在mount一个 jffs2文件系统到目录中出现
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x2b10 instead ...
Further such events for this erase block will not be printed
类似的错误时,可能的原因是:
1. 该设备文件(/dev/mtdblock1)对应的存储单元并没有存放一个有效的jffs2文件系统这时可以用LTIB或mtd-utils软件包中的mkfs.jffs2工具制作
该jffs2文件系统映像然后用uboot命令行着那个的nand或cp.b等命令或系统启动后用mtd-utils软件包中的nanderase,nandwrite工具烧写。
2. 如果设备对应的是一个有效的jffs2文件系统那么很可能是在制作jffs2文件系统映像时 erase block size option not matches the one you have in your NAND. 对于LTIB而言默认的擦出块大小是64KB对于K9F5608的该值为16KB(参考其datasheet), 所以需要将下面该的值改为16.
--- Choose your root filesystem image type │ │
│ │ Target image: (jffs2) ---> │ │
│ │ [ ] Run a command after building the target image │ │
│ │ (**64**) jffs2 erase block size in KB │ │
│ │ [ ] read-only root filesystem
如果使用mkfs.jffs2命令行选项则参数针对K9F1G08U08 256MB NAND Flash含义如下
http://hi.baidu.com/_%CB%BC%CF%EB%B5%C4%D0%A1%D3%E3_/blog/item/ccb2d2d69c8bf9ca50da4b59.html
mkfs.jffs2 -n -s 2048 -e 128KiB --pad=0x800000 -d root_fs -o kevin.jffs2
参数注释:
-s 页大小试验可以不特别要求512亦可
__-e 擦除块大小(Block Erase)__需和手册相匹配此处为128由手册可知1 Block = 2K + 64B + 64 Pages = __128K__ + 4Kbytes
此处如果设置过大(如 256将出现jffs2_scan_eraseblock():Magic bitmask......问题, 如果设置过小(如 64将出现Empth flash at .......问题
--pad 设置**生成文件大小**,其实此处也不算是设置,因为此选项是填充的意思,当生成文件比参数规定大小大时, 此选项不起作用。只有当生成文件小于规定大小才会进行填充。

View File

@@ -0,0 +1,20 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-08-10T14:08:29+08:00
====== minicom乱码 ======
Created Friday 10 August 2012
错误的可能原因:
1. 波特率不对应该设置为115200
2.串口的位数为8无奇偶校验停止位为1位8N1
3.**软件、硬件流控不设置**。
设置结果应该如下:
A - Serial Device : /dev/ttyUSB0 |
B - Lockfile Location : /var/lock |
C - Callin Program : |
D - Callout Program : |
E - Bps/Par/Bits : **115200 8N1** |
F - Hardware Flow Control : **No** |
G - Software Flow Control : **No**

View File

@@ -0,0 +1,7 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-08-11T21:15:04+08:00
====== VFS错误 ======
Created Saturday 11 August 2012
如果内核可以正常地启动但是当执行到挂载root时出错这可能与bootargs的ramdisk_size的值与ltib输出的不一致有关。

View File

@@ -8,5 +8,5 @@ Created Wednesday 22 February 2012
这可能与uboot的环境变量bootargs中console设置错误有关正确的应该为
setenv bootargs root=/dev/ram rw console=ttyS0,115200 ramdisk_size=xxxx
注意ramdisk_size大小要和ltib输出的一致但可以比后者大否则kernel启动的最后
在mount该文件时会出错。
注意ramdisk_size大小要和ltib输出的一致但可以比后者大(有时设置较大时会出错所以最好设为ltib的输出值)否则kernel启动的最后
在mount该文件时VFS子系统会出错。

View File

@@ -0,0 +1,19 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-08-11T15:57:47+08:00
====== 内核提示找不到rc.S文件 ======
Created Saturday 11 August 2012
内核启动后输出如下内容:
RAMDISK: gzip image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing unused kernel memory: 152k freed
can't run '/etc/rc.d/rcS': No such file or directory
--------------------------------------------
rcS是一个shell脚本文件使用的解释器是/bin/sh而该文件在ramdisk中并没由存在。
这可能是busybox中的配置有误
Choose which shell is aliased to 'sh' name (ash) ---> │ │
Choose which shell is aliased to 'bash' name (ash) --->
选中上面两个选项即可。

View File

@@ -17,4 +17,22 @@ Created Friday 03 August 2012
4.执行/usr/sbin/visudo命令在打开的文件中添加
geekard ALL = NOPASSWD: /bin/rpm, /opt/freescale/ltib/usr/bin/rpm
5.
5. 修改jffs2的erase block size 为16(按照K9F5608 datasheet上的Erase Block参数指定)
--- Choose your root filesystem image type │ │
│ │ Target image: __(jffs2)__ ---> │ │
│ │ [ ] Run a command after building the target image │ │
│ │ __(16)__ jffs2 erase block size in KB │ │
│ │ [ ] read-only root filesystem │ │
│ │ (512k) tmpfs size │ │
│ │ (/tmp /var) Place these dirs in writable RAM │ │
│ │ () rootfs target directory
6. ltib在编译某个软件包如busybox前会先到rpm/RPMS/ppc/目录下查看busybox rpm软件包是否存在已经存在如果存在的话将不会再
编译它而是在最后直接将其安装到rootfs目录下所以如果想配置busybox则除了在package list中选中configure busybox before compile外
还要删除rpm/RPMS/ppc目录下的busybox rpm包。如果该软件包的rpm包不存在则ltib会到rpm/BUILD目录中查看该软件包的源代码目录是否存在
如果存在则直接编译(编译完后并不删除该源代码目录),如果不存子则会从/opt/freescale/pkg目录下解压该软件包到BUILD目录中编译完后会自动删除
BUILD中的源代码目录所以如果用户希望ltib在编译时使用自己的源代码可以使用一下方法
1. #./ltib -m prep -p busybox #将/opt/freescale/pkg目录中的busybox软件包解压到BUILD目录中同时打补丁和配置源代码。
2. # cp -rv MY-busybox/* rpm/BUILD/busybox #用户的代码替换就代码
3. # ./ltib -m scbuild -p busybox
4. #./ltib -m scdeploy -p busybox

View File

@@ -0,0 +1,37 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-08-11T20:46:27+08:00
====== mtd-utils ======
Created Saturday 11 August 2012
**编译时出现下列错误:**
gcc -I./include -DWITHOUT_XATTR -O2 -g -Wall -c -o ftl_format.o ftl_format.c -g -Wp,-MD,./.ftl_format.c.dep
In file included from /home/geekard/PPC/sysroot/usr/include/endian.h:60:0,
from /home/geekard/PPC/sysroot/usr/include/sys/types.h:216,
from ftl_format.c:37:
./include/bits/byteswap.h:21:3: error: __#error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."__
make: *** [ftl_format.o] Error 1
error: Bad exit status from /home/geekard/PPC/ltib-mpc8315erdb-20100719/tmp/rpm-tmp.69478 (%build)
---------------------------
解决的方法是打开byteswap.h文件将下面几行注释掉
20 #if !defined _BYTESWAP_H && !defined _NETINET_IN_H
21 # error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
22 #endif
------------------------------------------------------------
make -C ./ubi-utils
make[1]: Entering directory `/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/mtd-utils/ubi-utils'
gcc -I./inc -I./src -I../include -std=gnu99 -DPACKAGE_VERSION=\"1.0\" -O2 -g -Werror -Wall -Wwrite-strings -W -c -o pfiflash.o ./src/pfiflash.c -g -Wp,-MD,.pfiflash.c.dep
gcc -I./inc -I./src -I../include -std=gnu99 -DPACKAGE_VERSION=\"1.0\" -O2 -g -Werror -Wall -Wwrite-strings -W -c -o libpfiflash.o ./src/libpfiflash.c -g -Wp,-MD,.libpfiflash.c.dep
gcc -I./inc -I./src -I../include -std=gnu99 -DPACKAGE_VERSION=\"1.0\" -O2 -g -Werror -Wall -Wwrite-strings -W -c -o list.o ./src/list.c -g -Wp,-MD,.list.c.dep
gcc -I./inc -I./src -I../include -std=gnu99 -DPACKAGE_VERSION=\"1.0\" -O2 -g -Werror -Wall -Wwrite-strings -W -c -o reader.o ./src/reader.c -g -Wp,-MD,.reader.c.dep
gcc -I./inc -I./src -I../include -std=gnu99 -DPACKAGE_VERSION=\"1.0\" -O2 -g -Werror -Wall -Wwrite-strings -W -c -o error.o ./src/error.c -g -Wp,-MD,.error.c.dep
./src/error.c: In function 'info_msg':
./src/error.c:77:6: error: **variable 'n' set but not used [-Werror=unused-but-set-variable]**
cc1: all warnings being treated as errors
------------------
解决方法是将ubi-utils/Makefile中的-Werror去掉
11 CC := $(CROSS)gcc
12 CFLAGS ?= -O2 -g __-Werror__
13 CFLAGS += -Wall -Wwrite-strings -W

View File

@@ -5,7 +5,16 @@ Creation-Date: 2012-08-02T15:31:27+08:00
====== uboot ======
Created Thursday 02 August 2012
1. ltib在编译uboot时长时间地停在下面的命令行上
1.编译时提示
make[1]: Leaving directory `/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/cpu/mpc83xx'
make[1]: Entering directory `/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/cpu/mpc83xx'
.depend:117: *** multiple target patterns. Stop.
错误。
---------------
解决方法是将cpu/mpc83xx/.depend文件删除即可。
2. ltib在编译uboot时长时间地停在下面的命令行上
powerpc-e300c3-linux-gnu-objcopy -O srec u-boot u-boot.srec
powerpc-e300c3-linux-gnu-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
而且生成的uboot.bin文件非常大

View File

@@ -0,0 +1,37 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-08-10T16:52:25+08:00
====== uboot-nand ======
Created Friday 10 August 2012
如果在编译nand型的uboot时提示如下错误
[geekard@kb310 u-boot-2009.03-rc2]$ make distclean
[geekard@kb310 u-boot-2009.03-rc2]$ make MPC8315ERDB_NAND_config
... NAND Configuring for MPC8315ERDB board...
[geekard@kb310 u-boot-2009.03-rc2]$ make
-o /home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/u-boot-spl
mpc8315erdb.o: In function `putc':
/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/board/freescale/mpc8315erdb/mpc8315erdb.c:324: undefined reference to __`_savegpr_31'__
/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/board/freescale/mpc8315erdb/mpc8315erdb.c:332: undefined reference to __`_restgpr_31_x'__
sdram.o: In function `initdram':
/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/board/freescale/mpc8315erdb/sdram.c:129: undefined reference to `_restgpr_29_x'
nand_init.o: In function `puts':
/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/board/freescale/mpc8315erdb/nand_init.c:112: undefined reference to `_restgpr_30_x'
time.o: In function `usec2ticks':
/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/board/freescale/mpc8315erdb/time.c:38: undefined reference to `_savegpr_31'
/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/board/freescale/mpc8315erdb/time.c:48: undefined reference to `_restgpr_31_x'
time.o: In function `udelay':
/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/board/freescale/mpc8315erdb/time.c:67: undefined reference to `_restgpr_28_x'
make[1]: *** [/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/u-boot-spl] Error 1
make[1]: Leaving directory `/home/geekard/PPC/ltib-mpc8315erdb-20100719/rpm/BUILD/u-boot-2009.03-rc2/nand_spl/board/freescale/mpc8315erdb'
make: *** [nand_spl] Error 2
[geekard@kb310 u-boot-2009.03-rc2]$
------------------------------
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810#c4
calls to _savegpr_32 and _restgpr_r31_x are only generated when compiling libgcc with -Os , but same compiled with -O2 does not emit the calls
所以解决的方法是编辑uboot顶层目录中的config.mk文件将
119 DBGFLAGS= -g # -DDEBUG
120 OPTFLAGS= -Os #-fomit-frame-pointer
上面的-Os改为-O2即可。