Chinaunix首页 | 论坛 | 博客
  • 博客访问: 551022
  • 博文数量: 116
  • 博客积分: 2063
  • 博客等级: 大尉
  • 技术积分: 1174
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-26 16:44
个人简介

none

文章分类

全部博文(116)

文章存档

2023年(2)

2020年(3)

2019年(4)

2018年(7)

2017年(6)

2016年(17)

2015年(13)

2014年(19)

2013年(6)

2012年(13)

2011年(5)

2010年(11)

2008年(10)

分类: LINUX

2014-11-11 16:43:52

==========================HOW TO GOT fw_printenv/fw_setenv COMMAND==========================
[root@localhost u-boot-2010.06_hi3531_1.0.A.0]# pwd
/.100G/SVN_NVR_src_50/uboot/u-boot-2010.06_hi3531_1.0.A.0
[root@localhost u-boot-2010.06_hi3531_1.0.A.0]# 
[root@localhost u-boot-2010.06_hi3531_1.0.A.0]# ls tools/env/
crc32.c  fw_env.c  fw_env.config  fw_env.h  fw_env_main.c  Makefile  README
[root@localhost u-boot-2010.06_hi3531_1.0.A.0]# 
[root@localhost u-boot-2010.06_hi3531_1.0.A.0]# make env
make -C tools/env all MTD_VERSION= || exit 1
make[1]: Entering directory `/.100G/SVN_NVR_src_50/uboot/u-boot-2010.06_hi3531_1.0.A.0/tools/env'
arm-hisiv100-linux-gcc -Wall -DUSE_HOSTCC -I/.100G/SVN_NVR_src_50/uboot/u-boot-2010.06_hi3531_1.0.A.0/include crc32.c  fw_env.c  fw_env_main.c -o fw_printenv
make[1]: Leaving directory `/.100G/SVN_NVR_src_50/uboot/u-boot-2010.06_hi3531_1.0.A.0/tools/env'
[root@localhost u-boot-2010.06_hi3531_1.0.A.0]# 
[root@localhost u-boot-2010.06_hi3531_1.0.A.0]# ls tools/env/
crc32.c  fw_env.c  fw_env.config  fw_env.h  fw_env_main.c  fw_printenv  Makefile  README

==========================set new args in uboot==========================
hisilicon # ver
U-Boot 2010.06.Hi3531_1.0.A.0_SVN-1916M (Dec 18 2013 - 16:15:29)
hisilicon # 
hisilicon # pri
bootcmd=nand read 0x82000000 0x100000 0x500000;bootm 0x82000000
bootdelay=1
baudrate=115200
netmask=255.255.255.0
bootfile="uImage"
fver=.hi3531
kver=.hi3531
uver=.hi3531
serverip=192.168.200.138
ipaddr=192.168.200.54
ethaddr=00:00:6c:72:cd:d3
bootargs=mem=192M console=ttyAMA0,115200 root=/dev/mtdblock5 rootfstype=yaffs2 mtdparts=hinand:512K(boot),256K(ENV),256K(UNUSE),13M(kernel),2M(logo),112M(rootfs)
ethaddr1=00:00:12:21:12:21
stdin=serial
stdout=serial
stderr=serial
verify=n
ver=U-Boot 2010.06.Hi3531_1.0.A.0_SVN-1916M (Dec 18 2013 - 16:15:29)

Environment size: 552/262140 bytes
hisilicon # 
hisilicon # reset
==========================kernel startup logs==========================
Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Linux version 3.0.8 (wenjing@localhost.localdomain) (gcc version 4.4.1 (Hisilicon_v100(gcc4.4-290+uclibc_0.9.30.2+eabi+linuxpthread)) ) #Hi3531_1.0.A.0_SVN_1533:1813M SMP Thu Nov 21 17:01:57 CST 2013
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c53c7f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: godnet
[    0.000000] Memory policy: ECC disabled, Data cache writealloc
[    0.000000] PERCPU: Embedded 7 pages/cpu @c0856000 s5152 r8192 d15328 u32768
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 48768
[    0.000000] Kernel command line: mem=192M console=ttyAMA0,115200 root=/dev/mtdblock5 rootfstype=yaffs2 mtdparts=hinand:512K(boot),256K(ENV),256K(UNUSE),13M(kernel),2M(logo),112M(rootfs)

[    1.864729] 6 cmdlinepart partitions found on MTD device hinand
[    1.870643] Creating 6 MTD partitions on "hinand":
[    1.875437] 0x000000000000-0x000000080000 : "boot"
[    1.881724] 0x000000080000-0x0000000c0000 : "ENV"
[    1.887479] 0x0000000c0000-0x000000100000 : "UNUSE"
[    1.893503] 0x000000100000-0x000000e00000 : "kernel"
[    1.917923] 0x000000e00000-0x000001000000 : "logo"
[    1.926337] 0x000001000000-0x000008000000 : "rootfs"

==========================read/write args with fw_printenv command==========================
# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00020000 "boot"
mtd1: 00040000 00020000 "ENV"
mtd2: 00040000 00020000 "UNUSE"
mtd3: 00d00000 00020000 "kernel"
mtd4: 00200000 00020000 "logo"
mtd5: 07000000 00020000 "rootfs"

# cat /etc/fw_env.config 
# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.
# Notice, that the "Number of sectors" is ignored on NOR.

# MTD device name   Device offset   Env. size   Flash sector size   Number of sectors
/dev/mtd1           0x0000          0x40000      0x20000            2

# fw_printenv 
bootcmd=nand read 0x82000000 0x100000 0x500000;bootm 0x82000000
bootdelay=1
baudrate=115200
netmask=255.255.255.0
bootfile="uImage"
fver=.hi3531
kver=.hi3531
uver=.hi3531
serverip=192.168.200.138
ipaddr=192.168.200.54
ethaddr=00:00:6c:72:cd:d3
bootargs=mem=192M console=ttyAMA0,115200 root=/dev/mtdblock5 rootfstype=yaffs2 mtdparts=hinand:512K(boot),256K(ENV),256K(UNUSE),13M(kernel),2M(logo),112M(rootfs)
stdin=serial
stdout=serial
stderr=serial
verify=n
ver=U-Boot 2010.06.Hi3531_1.0.A.0_SVN-1916M (Dec 18 2013 - 16:15:29)
ethaddr1=00:00:12:21:12:21

# fw_printenv serverip
serverip=192.168.200.138

# cd /usr/sbin/

# ln -s fw_printenv fw_setenv

# fw_printenv ethaddr1
ethaddr1=00:00:12:21:12:21

# fw_setenv  ethaddr1 999999999

# fw_printenv ethaddr1
ethaddr1=999999999
#
# reboot

==========================reRead the changed args from uboot==========================
hisilicon # pri ethaddr1
ethaddr1=999999999
阅读(1437) | 评论(0) | 转发(0) |
0

上一篇:911碎片

下一篇:CTRL-Z CTRL-C

给主人留下些什么吧!~~