评估及移植BCM5862x及BCM5301x到openwrt平台下:

一、首先得分清楚几个基本概念:

1、文件系统

    文件系统是操作系统用于明确存储设备(常见的是磁盘,也有基于NAND Flash的固态硬盘)或分区上的文件的方法和数据结构;

即在存储设备上组织文件的方法。操作系统中负责管理和存储文件信息的软件机构称为文件管理系统,简称文件系统。文件系统由三部

分组成:文件系统的接口,对对象操纵和管理的软件集合,对象及属性。从系统角度来看,文件系统是对文件存储设备的空间进行组织

和分配,负责文件存储并对存入的文件进行保护和检索的系统。具体地说,它负责为用户建立文件,存入、读出、修改、转储文件,控

制文件的存取,当用户不再使用时撤销文件等。

  嵌入式系统中常用的文件系统包括:jffs2、squashfs、ubifs、initramfs、nfs、、、、jffs2是最常用的日志文件系统,ubifs是

属于下一代jffs2,initramfs用于验证kernel是否正常运行,squashfs是一种压缩型文件系统,所占空间要比jffs2小一半,它通过解压

缩文件系统后,创建新分区rootfs_data,通过overlay(需要内核patch支持)文件系统挂载新分区到jffs2上,从而实现可写。使用相

应的文件系统需要相应的内核配置支持。

各文件系统的制作:

     jffs2::

     ubifs::

     suqashfs::

     initramfs:

  其中offset是分区开始的偏移地址,MTDPART_OFS_APPEND,表示紧接着上一个分区,

MTD Core会自动计算和处理分区地址;size是分区的大小,在最后一个分区我们设为

   MTDPART_SIZ_FULL,表示这个NAND剩下的所有部分。这样配置NAND的分区并不是唯

   一的,需要视具体的系统而定,我们可以在kernel中这样显式的指定,也可以使用bootloader

   传给内核的参数进行配置。

2、内核

kernel的几种格式:

vlinux:

vlinuxz:

image:

uImage.img:

3.uboot

几个重要的uboot启动参数:

bootargs:

bootcmd:

二、BCM特有的bootloader--CFE基本操作:

Decompressing...done
Found a ST compatible serial flash with 256 64KB blocks; total size 16MB

CFE version 6.30.163.2002 (r382208) based on BBP 1.0.37 for BCM947XX (32bit,SP,)
Build Date: Thu Feb 28 22:09:40 EST 2013 (root@localhost.localdomain)
Copyright (C) 2000-2008 Broadcom Corporation.

Init Arena
Init Devs.
Boot partition size = 262144(0x40000)
DDR Clock: 400 MHz
Warning: using legacy sdram_ncdl parameter to set DDR frequency. Equivalent setting in clkfreq=800,*0* will be ignored.
et0: Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller 6.30.163.2002 (r382208)
CPU type 0x0: 800MHz
Tot mem: 262144 KBytes

CFE mem: 0x00F00000 - 0x00FDA500 (894208)
Data: 0x00F4EB5C - 0x00F4F014 (1208)
BSS: 0x00F4F020 - 0x00F74500 (152800)
Heap: 0x00F74500 - 0x00FD8500 (409600)
Stack: 0x00FD8500 - 0x00FDA500 (8192)
Text: 0x00F00000 - 0x00F44874 (280692)
Boot: 0x00FDB000 - 0x0101B000
Reloc: I:00000000 - D:00000000

Device eth0: hwaddr 00-90-4C-0F-F0-01, ipaddr 192.168.1.1, mask 255.255.255.0
gateway not set, nameserver not set
Loader:raw Filesys:tftp Dev:eth0 File:: Options:(null)
Loading: Failed.

CFE> printenv
Variable Name Value
-------------------- --------------------------------------------------
BOOT_CONSOLE uart0
CFE_VERSION 1.0.37
CFE_BOARDNAME BCM947XX
CFE_MEMORYSIZE 262144
NET_DEVICE eth0
NET_IPADDR 192.168.1.1
NET_NETMASK 255.255.255.0
NET_GATEWAY 0.0.0.0
NET_NAMESERVER 0.0.0.0
STARTUP go;
*** command status = 0

CFE> help
Available commands:

nvram NVRAM utility.
reboot Reboot.
set console Change the active console device
loop Loop a command
flash Update a flash memory device
memtest Test 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 Verify and boot OS image.
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
ping Ping a remote IP host.
arp Display or modify the ARP Table
ifconfig Configure the Ethernet interface
show clocks Show current values of the clocks.
show heap Display information about CFE's heap
show memory Display the system physical memory map.
show devices Display information about the installed devices.
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
CFE>
CFE> help flash

SUMMARY

Update a flash memory device

USAGE

flash [options] filename [flashdevice]

Copies data from a source file name or device to a flash memory device.
The source device can be a disk file (FAT filesystem), a remote file
(TFTP) or a flash device. The destination device may be a flash or eeprom.
If the destination device is your boot flash (usually flash0), the flash
command will restart the firmware after the flash update is complete

OPTIONS

-noerase Don't erase flash before writing
-offset=* Begin programming at this offset in the flash device
-size=* Size of source device when programming from flash to flash
-noheader Override header verification, flash binary without checking
-mem Use memory as source instead of a device

*** command status = 0
CFE>
CFE>
CFE> help load

SUMMARY

Load an executable file into memory without executing it

USAGE

load [-options] host:filename|dev:filename

This command loads an executable file into memory, but does not
execute it. It can be used for loading data files, overlays or
other programs needed before the 'boot' command is used. By
default, 'load' will load a raw binary at virtual address 0x20000000.

OPTIONS

-elf Load the file as an ELF executable
-srec Load the file as ASCII S-records
-raw Load the file as a raw binary
-z Load compessed file
-loader=* Specify CFE loader name
-tftp Load the file using the TFTP protocol
-fatfs Load the file from a FAT file system
-rawfs Load the file from an unformatted file system
-fs=* Specify CFE file system name
-max=* Specify the maximum number of bytes to load (raw only)
-addr=* Specify the load address (hex) (raw only)

*** command status = 0
CFE>
CFE> load tftp 192.168.1.10:Image
*** command status = -6
CFE>
CFE> load -tftp -addr=81008000 192.168.1.10:Image
Loader:raw Filesys:tftp Dev:eth0 File:192.168.1.10:Image Options:(null)
Loading: .. 6566180 bytes read
Entry at 0x81008000
*** command status = 0
CFE>
CFE>
CFE> help go

SUMMARY

Verify and boot OS image.

USAGE

go

Boots OS image if valid. Waits for a new OS image if image is invalid
or boot_wait is unset or not on.

*** command status = 0
CFE>

CFE> load -addr=82000000 -tftp 192.168.1.10:u-boot.bin
Loader:raw Filesys:tftp Dev:eth0 File:192.168.1.10:u-boot.bin Options:(null)
Loading: .. 537212 bytes read
Entry at 0x82000000
*** command status = 0
CFE>

CFE> show devices
Device Name Description
------------------- ---------------------------------------------------------
uart0 NS16550 UART at 0x18000300
uart1 NS16550 UART at 0x18000400
flash0 ST Compatible Serial flash size 16384KB
flash0.boot ST Compatible Serial flash offset 00000000 size 256KB
flash0.trx ST Compatible Serial flash offset 00040000 size 1KB
flash0.os ST Compatible Serial flash offset 0004001C size 16064KB
flash0.nvram ST Compatible Serial flash offset 00FF0000 size 64KB
flash1.boot ST Compatible Serial flash offset 00000000 size 256KB
flash1.trx ST Compatible Serial flash offset 00040000 size 16064KB
flash1.nvram ST Compatible Serial flash offset 00FF0000 size 64KB
eth0 Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller
*** command status = 0
CFE>

CFE> flash -noheader 192.168.1.10:u-boot.bin -offset=0 flash0
Reading 192.168.1.10:u-boot.bin: Done. 537212 bytes read
Programming...done. 537212 bytes written
*** command status = 0
CFE>

三、BCM网络配置:

四、移植SDK到openwrt基本步骤及注意事项:

broadcom移植到openwrt总结的更多相关文章

  1. 搭建OpenWrt开发环境(包括编译过程)

    OpenWrt是一个高度模块化.高度自动化的嵌入式linux发行版,其编译和安装过程比普通的linux发行版而言,要简单太多了.如果您是新手,您那恐惧的心大可放到肚子里,呵呵.对于新手来说最麻烦的恐怕 ...

  2. ./scripts/feeds update -a OpenWrt大招系列

    ./scripts/feeds update -a Updating feed 'packages' from 'https://github.com/openwrt/packages.git' .. ...

  3. openwrt开发

    之前写过一篇日志,是关于如何搭建自己的OpenWRT开发环境.经过最近一段时间的开发学习和实践,对OpenWRT环境的开发有了一定的了解.在这里将我的开发心得做个整理. 1.搭建开发环境 首先,我们需 ...

  4. 如何在OpenWRT环境下做开发

    1.搭建开发环境 首先,在执行make menuconfig后,会出现下图: 其中,图中红框部分是我定制路由器的系统版本,大家可以根据不同的路由器进行不同的选择:绿框部分表示我们需要编译一个SDK开发 ...

  5. [Openwrt 项目开发笔记]:PHP+Nginx安装(七)

    [Openwrt项目开发笔记]系列文章传送门:http://www.cnblogs.com/double-win/p/3888399.html 正文: 在上一节中,我们已经搭建了MySQL数据库了,因 ...

  6. [Openwrt 项目开发笔记]:DDNS设置(五)

    [Openwrt项目开发笔记]系列文章传送门:http://www.cnblogs.com/double-win/p/3888399.html 正文: 在上一节中,我主要讲述了如何在Openwrt上安 ...

  7. openwrt<转载--openwrt框架分析 >

    这次讲讲openwrt的结构. 1. 代码上来看有几个重要目录package, target, build_root, bin, dl.... ---build_dir/host目录是建立工具链时的临 ...

  8. 【转载】openwrt框架分析

    文章出处:http://blog.csdn.net/kingvenll/article/details/27545221 这次讲讲openwrt的结构. 1. 代码上来看有几个重要目录package, ...

  9. 软路由OpenWrt(LEDE)2020.5.10更新 UPnP+NAS+多拨+网盘+DNS优化

    近期更新:2020.05.10更新-基于OpenWrt R2020.5.9版本,源码截止2020.05.10.   交流群:QQ 1030484865 电报 t.me/t_homelede   版本说 ...

随机推荐

  1. Java经典实例:使用DateFormatter来格式化日期时间

    Java版本:1.8开始 import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; ...

  2. 对datatable操作,查询

    #region DataTable筛选,排序返回符合条件行组成的新DataTable或直接用DefaultView按条件返回 /// <summary> /// DataTable筛选,排 ...

  3. mysql经纬度查询并且计算2KM范围内附近用户的sql查询性能优化实例教程

    之前很傻很天真地以为无非就是逐个计算距离,然后比较出来就行了,然后当碰到访问用户很多,而且数据库中经纬度信息很多的时候,计算量的迅速增长,能让服务器完全傻逼掉,还是老前辈的经验比我们丰富,给了我很大的 ...

  4. 如何让C#像JavaScript一样编程

    JavaScript是一门动态语言,可以动态的给对象添加属性和方法,非常方便.那么有没有一种方式可以让C#也具备动态添加属性和方法的能力,像Javascript一样进行编程? 下面就介绍一个很不错的框 ...

  5. emberjs学习二(ember-data和localstorage_adapter)

    emberjs学习二(ember-data和localstorage_adapter) 准备工作 首先我们加入ember-data和ember-localstorage-adapter两个依赖项,使用 ...

  6. 系统安装LOL等游戏后出现VS调试报错"无法调试""拒绝访问"之类的调试错误

    一个问题抠得脑壳痛,度娘一番各种各样的答案.基本属于 1,调试权限被清0 2,文件权限问题   其中看到很多解决方案中提到"重启电脑"的说法.我也试了几次不行甚至游戏都卸载了.后来 ...

  7. CSS常用样式(一)

    一.字体样式 1.font-style:设置或检索对象中的文本字体样式. 取值: normal:指定文本字体样式为正常的字体 italic:指定文本字体样式为斜体.对于没有斜体变量的特殊字体,将应用o ...

  8. 编写更加稳定/可读的javascript代码

    每个人都有自己的编程风格,也无可避免的要去感受别人的编程风格--修改别人的代码."修改别人的代码"对于我们来说的一件很痛苦的事情.因为有些代码并不是那么容易阅读.可维护的,让另一个 ...

  9. 为Windows Azure Web站点添加MIME类型解决文件下载失败的问题

    这几天在倒腾Autodesk 360 Viewer,前面的文章也介绍过了,这将是一个全新的在线模型浏览工具.我做了个实验,把A360Viewer放在一个web 站点,然后发布到Windows Azur ...

  10. 使用Masonry搭建特殊布局时与xib的对比

    之前只有比较浅的接触过Masonry.项目中大多数的布局还是用xib中的AutoLayout与手码的frame计算相结合,相信也会有很多项目和我一样是这两种布局的组合.其实xib各方面用的感觉都挺好, ...