broadcom 平台的 bcm956218x芯片,会使用2个bootloader 一个是BMC, 一个是CFE。
1. 两个bootloader之间可以用 “~.” 进行切换。
<BMC>
Switching to MIPS
2. BMC 命令如下:
<BMC> help
show-bmc-info Print basic information of BMC.
show-payload-info Print basic information of payload.
get-device-id Print BMC device version.
show-lel-info Print basic information of local SEL.
clear-lel Clear local SEL.
get-lel-entry Print informatin of local events.get-sensor-info Print information of sensors.
set-debug-level Set debug level.
set-debug-module Open or close one module's debug flag.
set-next-pay-bank Set next payload bank select mode, which
works in next payload power on.
fru-control Payload reset, power off, or power on.
stop-watchdog Stop CFD watchdog or BMC watchdog.
snpb 0/1 可以在两块CFE备份之间切换
<BMC> snpb 1
<BMC> Will set next payload bank selecet to 1
3. CFE 命令:
CFE> help
Available commands:
@ Boot VxWorks
c Change the VxWorks boot string
p Parse and display VxWorks boot string
M Show or set Ethernet MAC address
etx start eth loopback application
lbtest start eth loopback application
ethstat eth drv stats
cpw write p0 register
ttlb test TLB
tdc test data cache
flprobe Probe flash
reg CPU Register Get/Set utility.
gpio gpio Diagnostic
reset Reset the system.
nvram import Import nvram variables from standard environment.
nvram erase Delete all nvram variables.
nvram commit Commit nvram variable bindings.
nvram show Show all nvram variables.
nvram unset Delete an nvram variable.
nvram set Set the value of an nvram variable.
nvram get Get the value of an nvram variable.
flash Update a flash memory device
memtest Test memory.
f Fill contents of memory.
e Modify contents of memory.
d Dump memory.
reserve Mark a region of memory as reserved
autoboot Automatic system bootstrap.
batch Load a batch file into memory and execute it
go Start a previously loaded program.
boot Load an executable file into memory and execute it
load Load an executable file into memory without executing it
save Save a region of memory to a remote file via TFTP
ttcp TCP test command.
tcp constest tcp console test.
tcp listen port listener.
tcp connect TCP connection test.
rlogin mini rlogin client.
ping Ping a remote IP host.
arp Display or modify the ARP Table
ifconfig Configure the Ethernet interface
show config Dump CP0 configuration registers
show heap Display information about CFE's heap
show memory Display the system physical memory map.
show devices Display information about the installed devices.
sizeenv Get environment space size information.
clearenv Clear environment variables.
unsetenv Delete an environment variable.
printenv Display the environment variables
setenv Set an environment variable.
help Obtain help for CFE commands
show devices
CFE> show devices
Device Name Description
------------------- ---------------------------------------------------------
uart0 NS16550 UART at 0x18000300
uart1 NS16550 UART at 0x18000400
flash0.boot New CFI flash at 1C000000 offset 00000000 size 512KB
flash0.env New CFI flash at 1C000000 offset 00080000 size 128KB
flash0.nvram New CFI flash at 1C000000 offset 000A0000 size 128KB
flash0.kernel New CFI flash at 1C000000 offset 000C0000 size 5120KB
flash0.ramdisk New CFI flash at 1C000000 offset 005C0000 size 24832KB
flash0.etc New CFI flash at 1C000000 offset 01E00000 size 2048KB
flash1.boot New CFI flash at 1C000000 offset 00000000 size 512KB
flash1.env New CFI flash at 1C000000 offset 00080000 size 128KB
flash1.nvram New CFI flash at 1C000000 offset 000A0000 size 128KB
flash1.kernel New CFI flash at 1C000000 offset 000C0000 size 5120KB
flash1.os New CFI flash at 1C000000 offset 005C0000 size 26880KB
flash2 New CFI flash at 1C000000 size 65536KB
eth0 BCMB218 StrataXGS Switch (mod 00) at 0xA8000000
*** command status = 0
printenv
CFE> printenv
Variable Name Value
-------------------- --------------------------------------------------
BOOT_CONSOLE uart0
ETH0_HWADDR 02-10-18-47-04-10
CFE_VERSION 5.1.4
CFE_BOARDNAME BCM956218
CFE_MEMORYSIZE 256
STARTUP load -z -addr=0x81000000 -max=0x3000000 flash0.ramdisk:;boot -elf flash0.kernel:
LINUX_CMDLINE console=ttyS0,115200 root=/dev/mtdblock3 rw rootfstype=jffs2 mem=128M
*** command status = 0
setenv
CFE> setenv LINUX_CMDLINE "console=ttyS0,115200 root=/dev/mtdblock3 rw rootfstype=jffs2 mem=128M"
*** command status = 0
CMDLINE 参数用来传递给Linux kernel
show memory
CFE> show memory
Range Start Range End Range Size Description
------------ ------------ -------------- --------------------
000000000000-000007EBAFFF (000007EBB000) DRAM (available)
000008000000-00000FFFFFFF (000008000000) DRAM (available)
*** command status = 0
CFE> ifconfig eth0 -auto --- 自动获取IP
unsetenv STARTUP --- 于setenv 相反
load -z -addr=0x81000000 -max=0x3300000 128.224.156.95:initrd.gz --- tftp 载入rootfs
boot -elf 128.224.156.95:vmlinux ---tftp boot kernel
flash -noheader 128.224.156.95:cfe.bin flash2 --- 刷入CFE.bin
e -w 0x60000000 0x12347711 --- 把 数写入内存, 看该内存地址是否可读写
d 0x60000000 10 ---- 读内存,从0x60000000开始,读10个数。
4. 可以同过下面的链接下载CFE build tool 和源代码。
http://www.broadcom.com/support/communications_processors/downloads.php