博通CFE篇:
setenv -p STARTUP boot -z -elf flash0.mrskernel: 'root=/dev/nfs nfsroot=10.0.14.188:/home/software1/$USER/target ip=dhcp rw‘
新分区
CFE> show devices
Device Name Description
------------------- ---------------------------------------------------------
uart0 16550 DUART at 0xB0406B00 channel 0
flash0.cfe New NAND flash at 00000000 offset 00000000 size 512KB
flash0.macadr New NAND flash at 00000000 offset 00080000 size 128KB
flash0.splash New NAND flash at 00000000 offset 000A0000 size 1024KB
flash0.fgdl1 New NAND flash at 00000000 offset 001A0000 size 15360KB
flash0.fgdl1kernel New NAND flash at 00000000 offset 010A0000 size 3072KB
flash0.fgdl2 New NAND flash at 00000000 offset 013A0000 size 15360KB
flash0.fgdl2kernel New NAND flash at 00000000 offset 022A0000 size 3072KB
flash0.mrs New NAND flash at 00000000 offset 025A0000 size 84608KB
flash0.mrskernel New NAND flash at 00000000 offset 07840000 size 3072KB
flash0.data New NAND flash at 00000000 offset 07B40000 size 4096KB
flash0.stbinfo New NAND flash at 00000000 offset 07F40000 size 128KB
flash0.nvram New NAND flash at 00000000 offset 07F60000 size 512KB
flash0.reserved New NAND flash at 00000000 offset 07FE0000 size 128KB
eth0 BCM7038 Internal Ethernet at 0xB0080000
*** command status = 0
修改内存:
setenv -p STARTUP "boot -z -elf flash0.kernel: 'ubi.mtd=rootfs rootfstype=ubifs root=ubi0:rootfs bmem=96#32M'"
CFE默认环境:
CFE> show devices
Device Name Description
------------------- ---------------------------------------------------------
uart0 16550 DUART at 0xB0406B00 channel 0
flash0.cfe New NAND flash at 00000000 offset 00000000 size 2048KB
flash0.macadr New NAND flash at 00000000 offset 00200000 size 1024KB
flash0.nvram New NAND flash at 00000000 offset 00300000 size 1024KB
flash0.avail0 New NAND flash at 00000000 offset 00400000 size 119808KB
flash0.kernel New NAND flash at 00000000 offset 07900000 size 5120KB
flash0.virtual New NAND flash at 00000000 offset 07E00000 size 1024KB
flash0.kreserv New NAND flash at 00000000 offset 07F00000 size 1024KB
eth0 BCM7038 Internal Ethernet at 0xB0080000
*** command status = 0
CFE> printenv
Variable Name Value
-------------------- --------------------------------------------------
BOOT_CONSOLE uart0
LINUX_FFS_STARTAD 400000
LINUX_FFS_SIZE 7500000
LINUX_PART_STARTAD 7900000
LINUX_PART_SIZE 500000
STARTUP boot -z -elf flash0.kernel: 'ubi.mtd=rootfs rootfstype=ubifs root=ubi0:rootfs'
ETH0_HWADDR 00:01:02:03:04:05
CFE_VERSION 3.7.6
CFE_BOARDNAME BCM97550A0
CFE_MEMORYSIZE 128
*** command status = 0
CFE> info
========================================================================
CPU speed: 432MHz
MEMC_0 DDR Frequency=533 MHz
MEMC_0 DDR Mode=DDR2
MEMC_0 DDR Width = 16
Total memory used by CFE: 0x87000000 - 0x87042620 (271904)
Initialized Data: 0x870404B0 - 0x87042268 (7608)
BSS Area: 0x87042268 - 0x87042620 (952)
Local Heap: 0x87042800 - 0x87142800 (1048576)
Stack Area: 0x87142800 - 0x87144800 (8192)
Text (code) segment: 0x87000000 - 0x8701012C (65836)
CFE driver build information:
LDR: ELF 1; BIN 1; SREC 1
UI: LEVEL 3; MIN 0
FS: FAT 1; FAT32 1
NET: STACK 1; ENET 1; TCP 0
USB: STACK 1; ETH 1; DISK 1; SERIAL 1; HID 1
FLASH: NAND
========================================================================
*** command status = 0
CFE> help
Available commands:
ts Time stamp utility
info Show CFE configuration information
set console Change the active console device
loop Loop a command
reboot Reboot the system
dir List the directory of a FAT file system
macprog Program MAC addresses.
macprog2 Program a specific MAC address.
flash Update a flash memory device
memtest Test memory.
t Test contents of memory.
f Fill contents of memory.
e Modify contents of memory.
d Dump memory.
u Disassemble instructions.
batch Load a batch file into memory and execute it
go Start a previously loaded program.
load Load an executable file into memory without executing it
save Save a region of memory to a remote file via TFTP
boot Load an executable file into memory and execute it
ping Ping a remote IP host.
ifconfig Configure the Ethernet interface
sleep Sleep for specified milliseconds.
waitusb Wait for USB device to be installed.
show usb Display devices connected to USB bus.
show heap Display information about CFE's heap
show memory Display the system physical memory map.
show devices Display information about the installed devices.
testenv Tests environment variable for various conditions. Default is test the existence of the variable
incenv Increment an integer environment variable.
unsetenv Delete an environment variable.
printenv Display the environment variables
setenv Set an environment variable.
help Obtain help for CFE commands
For more information about a command, enter 'help command-name'
*** command status = 0
boot -z -elf 10.0.14.188:vmlinuz-7550a0 'root=/dev/nfs nfsroot=10.0.14.188:/home/software1/$USER/target ip=dhcp rw‘
加载到内存的80040000
load2mem -noheader 10.0.14.188:/cfe.bin flash0.cfe
设置快捷键:
setenv -p F3 "ifconfig eth0 -auto"
U盘功能:
CFE:flash -noheader usbdisk0:/c.bmp flash0.splash
显示开机图片
只需要:
flash -noheader 10.0.10.188:/luorenyang/b.bmp flash0.splash
macprog2 00-01-02-04-03-08
ifconfig eth0 -auto
flash -noheader 10.0.14.188:/luorenyang/cfe.bin flash0.cfe
boot -z -elf 10.0.14.188:/luorenyang/vmlinuz-7550a0 vmlinuz-initrd-7550a0
CFE烧写方式:可否从串口烧写?
否。
CFE nand分区的最后一个设置计算公式?
?
分区结构:
typedef struct PartitionTable {
int part_size;
char * part_name;
int part_spare_size;
} PartitionTable;
bcm97550_devs.c
PartitionTable NandPartition [] = {
2*1024*1024, "cfe", 2*128*1024,/* CFE boots from 0xbfc0_0000 */
1024*1024, "macadr", 1*128*1024, /* Use 512K block to handle 512K block size */
1024*1024, "nvram", 1*128*1024, /* Use 512K block to handle 512K block size */
#ifdef CFG_SPLASH
512*1024, "splash", 1*128*1024,
#endif
0, "avail0", 16*128*1024,/* remainder of flash depending on size of the part, after all other partitions have been allocated */
5*1024*1024, "kernel", 2*128*1024,
1024*1024, "virtual", 1*128*1024,
1024*1024, "kreserv", 1*128*1024 /* last 1MB is reserved for linux for bad block table */
};
1万+





