Broadcom SDK编译

Broadcom提供了工具链和源码以及编译工具

需要先编译工具链再编译源码,过程会比较繁琐而且耗时


一.编译环境

关于编译环境
,在刘英凯的ubuntu10.04和我的ubuntu12.04均编译通过
刘英凯编译的toolchains在我的电脑上编译代码时会有很多问题,所以toolchains是我重新编译的
工具链的可移动性有待验证 二.toolchains编译 $mkdirtoolchain_src/glibcCopytheiProc_glibc_toolchain
.tar.gz file into the newly created toolchain directory and untar the file:
$ cp XLDK/buildroot/dl/iProc_glibc_toolchain.tar.gz toolchain_src/ glibc/
$ cd toolchain_src/glibc
$ tar –xvzf iProc_glibc_toolchain.tar.gz
Ch
an
ge to the buildroot directory under toolchain_src/glibc:
$ cd buildroot
Lo
ad the toolchain build configuration:
$ make iproc-tools_defconfig
Ch
an
ge the Host Directory (BR2_HOST_DIR) to the new install directory via menuconfig:
$ make menuconfig //Build option 不需要更改, 默认为当前目录下的host文件夹
Ch
an
ge ‘Build options’->’Host dir’ to a directory in which to install the glibc toolchain
(<glibc_47x_toolchain_install_dir>).
Save and exit.
Bu
ild
the toolchain:
$ make
耗时
3.5h,中间需要联网下载一些源码,切勿断网,切勿中断,未编译完成的工具链也会出现各种问题
三.内核编译
Lo
ad the buildroot configuration file:
$ make $CHIP-<target type>_defconfig //make saber2-nfs_defconfig
Mo
dify the configuration to indicate glibc libraries are being used.
$ make menuconfig
Ch
an
ge ‘Toolchain’->’External toolchain C library’ to glibc/eglibc
Save and exit.
$make
耗时
3h左右,中间需要联网下载一些源码和工具,切勿断网,切勿中断
1.报错 struct siginfo not complete
将/h
ome/kevin/works/projects/XLDK-3.6.2/XLDK/buildroot/output/toolchain/gdb-7.4.1/gdb/linux-nat.c
linux-nat.h
/home/kevin/works/projects/XLDK-3.6.2/XLDK/buildroot/output/toolchain/gdb-7.4.1/gdb/gdbserver/linux-low.c
中的所有struct siginfo 改为 siginfo_t
2.缺少mkimage
在工具链
make menuconfig 设置编译
但我编译后
host/usr/bin下面未生成mkimage
最后在
ubutnu上安装了uboot-tools
用的系统默认的
$ mkimage -A arm-O linux -T kernel -n Image -a 0x61008000 -C none -d output/images/Image output/images/uImage_nfs.img
3.nfs
环境变量nfs=sete
nv bootargs console=ttyS0,115200n8 maxcpus=1 mem=480M
ip=192.168.0.22:192.168.0.99:192.168.0.1:255.255.255.0:northstar:eth0 root=/dev/nfs rw
nfsroot=192.168.0.99:/home/kevin/nfs;tftpboot uImage_nfs.img;bootm
PC上需要安装nfs server将image下的rootfs.tar解压到nfs目录下
四.u-boot for ram
1.修改uboot代码段地址
XL
DK-3.6.2/XLDK/bootloader/u-boot-2012.10-rc3/board/broadcom/bcm95626x/config.mk
CONFIG_SYS_TEXT_BASE = 0xF0000000
改为CON
FI
G_
SYS_TEXT_BASE = 0x70000000
(由于tftp默认的load addr=0x70000000,所以目前将u-boot代码段的地址也改为这个地址)
2.栈地址修改
include/configs/saber2.h中150左右
//#
define CONFIG_SYS_INIT_SP_ADDR (CONFIG_PHYS_SDRAM_0 + CONFIG_SYS_STACK_SIZE - 16)
#define CONFIG_SYS_INIT_SP_ADDR (0x78000000 + CONFIG_SYS_STACK_SIZE - 16)
3.修改初始化问题
将XL
DK-3.6.2/XLDK/bootloader/u-boot-2012.10-rc3/board/broadcom/bcm95626x/m95626x.c
int dram_init (void)函数中的
//
ddr_init2(); //注释掉
以下为正常启动打印:
U-Boot 2012.10 (May 18 2015 - 11:47:14)
DEV ID = 0xb460
SKU ID = 0xb460
DDR type: DDR3
MEMC 0 DDR speed = 667MHz
PHY revision version: 0x00a1f001
ddr_init2: Calling soc_and28_shmoo_dram_info_set
ddr_init2: Calling soc_and28_shmoo_phy_init
A Series - PHY Initialization (PHY index: 00)
A01. Turn off CKE
A02. Configure timing parameters
A03. Configure PHY PLL
PHY PLL Configuration
Fref.............: 50 MHz
Data rate........: 1333 Mbps
PLL locked.
A04. Configure reference voltage
A05. Compute VDL step size
VDL calibration complete.
VDL step size....: 11.541 ps
UI size..........: 65.000 steps
A06. Configure ADDR/CTRL VDLs
A07. Disable Virtual VTT
A08. ZQ calibration
P drive..........: 0x10
N drive..........: 0x10
P termination....: 0x06
N termination....: 0x06
P idle...........: 0x00
N idle...........: 0x00
A09. Configure Static Pad Control
A10. Configure ODT
A11. Configure Write Pre-/Post-amble
A12. Configure Auto Idle
A13. Release PHY control
A Series - PHY Initialization complete (PHY index: 00)
Programming controller register
ddr_init2: MemC initialization complete
ddr_init2: Calling soc_and28_shmoo_ctl
Va
lidate Shmoo parameters stored in flash ..... OK
Press Ctrl-C to run Shmoo ..... skipped
DDR Tuning Complete
Running simple memory test ..... OK
DDR Interface Ready
DRAM: 2 GiB
WA
RNING: Caches not enabled
Flash: PNOR flash is not present - switch decoding bit back for NAND
NAND: Micron MT29F16G08CBACA, blocks per lun: 800 lun count: 1
*ERROR* Invalid strap options for this NAND: page=0 type=13
Ove
rriding invalid strap options: strap_type=6
1024 KiB blocks, 4 KiB pages, 27B OOB, 8-bit
NAND: chipsize 2048 MiB
SF: Detected N25Q256 with page size 64 KiB, total 32 MiB
In: serial
Out: serial
Err: serial
arm_clk=1000MHz, axi_clk=400MHz, apb_clk=100MHz, arm_periph_clk=500MHz
DDR Tuning Complete
TOP_XGXS0_PLL_CONTROL_3 = 0x4a5000
TOP_UC_TAP_CONTROL = 0x3a
TOP_SWITCH_FEATURE_ENABLE_3 = 0x5d99c00
Net: Registering eth
Broadcom BCM IPROC Ethernet driver 0.1
et0: Initial GMAC 0, base address:0x18042000
et0: ethHw_chipAttach: Chip ID: 0xb460; phyaddr: 0x1
et0: gmac_serdes_init() serdes_status0: 0x0; serdes_status1: 0x100
bcmiproc_eth-0
========== relocate address: 0xdff90000, offset 0xc1f90000 ==========
Hit any key to stop autoboot: 0
##
Booting kernel from Legacy Image at f0100000 ...
Image Name: XLDK_src_3.6.2
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 6205252 Bytes = 5.9 MiB
Load Address: 61008000
Entry Point: 61008000
Ve
rifying Checksum ... OK
Loading Kernel Image ... OK
OK
boot_prep_linux commandline: console=ttyS0,115200n8 maxcpus=1 mem=480M root=mtd3 rw rootfstype=jffs2
Starting kernel ...
INFO-Cygnus:471:start_kernel() entry
Booting Linux on physical CPU 0
Linux version 3.6.5-Broadcom Linux (bhsueh@bumblebee) (gcc version 4.7.2 (Broadcom Linux) ) #10 SMP Thu Mar 19 18:39:47
CST 2015
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Broadcom iProc
cma: CMA: reserved 32 MiB at 7d000000
Memory policy: ECC disabled, Data cache writealloc
PERCPU: Embedded 7 pages/cpu @c09dc000 s6464 r8192 d14016 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 121920
Kernel command line: console=ttyS0,115200n8 maxcpus=1 mem=480M root=mtd3 rw rootfstype=jffs2
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 480MB = 480MB total
Memory: 448168k/448168k available, 43352k reserved, 0K highmem
Vi
rt
ual kernel memory layout:
ve
ctor : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xde800000 - 0xff000000 ( 520 MB)
lowmem : 0xc0000000 - 0xde000000 ( 480 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc058c000 (5648 kB)
.init : 0xc058c000 - 0xc05ba940 ( 187 kB)
.data : 0xc05bc000 - 0xc05f2f20 ( 220 kB)
.bss : 0xc05f2f44 - 0xc0617954 ( 147 kB)
SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
RC
U restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
NR_IRQS:292
arm-freq-id: 7
parent rate 25000000, x: 83886080
after shitf - current x: 2000000000
ARMPLL0: pdev: 1, ndev: 80, ndiv_frac: 0, mdiv: 4, rate: 2000000000
arm-freq-id: 7
arm-freq-id: 7
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Calibrating delay loop... 1993.93 BogoMIPS (lpj=9969664)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x61468ff8 - 0x61469050
L310 cache controller enabled
l2x0: 16 ways, CACHE_ID 0x410000c9, AUX_CTRL 0x0a130000, Cache size: 262144 B
Brought up 1 CPUs
SMP: Total of 1 processors activated (1993.93 BogoMIPS).
devtmpfs: initialized
NET: Registered protocol family 16
DMA: preallocated 16384 KiB pool for atomic coherent allocations
GENPLL[5] mdiv=40 rate=4000000000
UART clock rate 100000000
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource iproc_gtimer
NET: Registered protocol family 2
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 5, 131072 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
GENPLL[5] mdiv=40 rate=4000000000
iProc Timer driver: 4 timers running at 100000000Hz
GENPLL[5] mdiv=40 rate=4000000000
libphy: iproc_ccg_mdiobus: probed
libphy: iproc_ccg_mdiobus: probed
nand_iproc: NAND controller driver is loaded
iproc gpiochip add GPIOG
GPIOG:ioaddr fec0a000
PCIE0: LINKSTA reg 0xbe val 0x1001
PCIE0 link=0
NVRAM: map 0xf00c0000
iproc_gmac_init_module: passivemode set to 0x0
iproc_gmac_init_module: et_txq_thresh set to 0x400
iproc_gmac_init_module: et_rx_rate_limit set to 0x1
iproc_gmac_drv_probe enter name:bcm-gmac0; id:0x0; unit:0
et0: base_addr (0x18042000) irq (142)
etc_gmac_speed default GMAC0 speed: auto
etc_attach() mdio_init_time = 5
si_doattach chipid: 0xb460
si_attach socitype(0x1) chip(0xb460) chiprev(0x1) chippkg(0x0)
et0: chipattach: phyaddr(0x1)
phy5461_init Phy ChipID: 0x5d12:0x0362
eth0: Broadcom BCM5626x 10/100/1000 Mbps Ethernet Controller 6.30.40 (TOB) (r)
eth_mac_proc_create: enter
iproc_gmac_drv_probe enter name:bcm-gmac1; id:0x0; unit:1
et1: eth1addr not found, ignore it
GENPLL[5] mdiv=40 rate=4000000000
sp805-wdt sp805-wdt: registration successful
GENPLL[5] mdiv=40 rate=4000000000
sp805-wdt sp805-wdt: timtout=60 sec, nowayout=0, clk rate = 100000000
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
Installing knfsd (copyright (C) 1996 [email protected]).
NTFS driver 2.1.30 [Flags: R/O].
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 939
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 105) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0x18021000 (irq = 105) is a 16550A
bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
e1000e: Intel(R) PRO/1000 Network Driver - 2.0.0-k
e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
i2c /dev entries driver
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (7514 buckets, 30056 max)
NF_TPROXY: Transparent proxy support initialized, version 4.1.0
NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.
ip_tables: (C) 2000-2006 Netfilter Core Team
arp_tables: (C) 2002 David S. Miller
TCP: cubic registered
NET: Registered protocol family 10
ip6_tables: (C) 2000-2006 Netfilter Core Team
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Bridge firewalling registered
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
GENPLL[5] mdiv=40 rate=4000000000
qspi_iproc qspi_iproc.1: 1-lane output, 3-byte address
m25p80 spi1.0: found n25q256, expected m25p80
m25p80 spi1.0: n25q256 (32768 Kbytes)
Creating 4 MTD partitions on "spi1.0":
0x
000000000000-0x0000000a0000 : "boot"
0x
0000000a0000-0x000000100000 : "env"
0x
000000100000-0x000001000000 : "system"
0x
000001000000-0x000002000000 : "rootfs"
ONFI param page 0 valid
ONFI flash detected
NAND device: Manufacturer ID: 0x2c, Chip ID: 0x48 (Micron MT29F16G08CBACAWP), page size: 4096, OOB size: 224
nand_iproc: heuristics exception detected, Micron MT29F16G08CBACA
nand_iproc: following bootloader settings
nand_iproc: 2048MiB total, 1024KiB blocks, 4KiB pages, 27B OOB, 8-bit
nand_iproc: user oob per page: 46 bytes (4 steps)
Bad block table found at page 524032, version 0x01
Bad block table found at page 523776, version 0x01
nand_read_bbt: bad block at 0x000005a00000
nand_read_bbt: bad block at 0x000005b00000
Creating 5 MTD partitions on "nand_iproc.0":
0x
000000000000-0x000000200000 : "nboot"
0x
000000200000-0x000000600000 : "nenv"
0x
000000600000-0x000001000000 : "nsystem"
0x
000001000000-0x000004000000 : "nrootfs"
0x
000004000000-0x000080000000 : "ncustfs"
No NAND device found
VFS: Mounted root (jffs2 filesystem) on device 31:3.
devtmpfs: mounted
Freeing init memory: 184K
UBI: attaching mtd8 to ubi1
UBI: physical eraseblock size: 1048576 bytes (1024 KiB)
UBI: logical eraseblock size: 1040384 bytes
UBI: smallest flash I/O unit: 4096
UBI: VID header offset: 4096 (aligned 4096)
UBI: data offset: 8192
UBI: max. sequence number: 1850
UBI: attached mtd8 to ubi1
UBI: MTD device name: "ncustfs"
UBI: MTD device size: 1984 MiB
UBI: number of good PEBs: 1978
UBI: number of bad PEBs: 6
UBI: number of corrupted PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 121
UBI: total number of reserved PEBs: 1857
UBI: number of PEBs reserved for bad PEB handling: 38
UBI: max/mean erase counter: 3/1
UBI: image sequence number: -830026486
UBI: background thread "ubi_bgt1d" started, PID 525
UBI error: ubi_attach_mtd_dev: ubi1 already exists
UBIFS: mounted UBI device 1, volume 0, name "ncustfs"
UBIFS: file system size: 1877893120 bytes (1833880 KiB, 1790 MiB, 1805 LEBs)
UBIFS: journal size: 33292288 bytes (32512 KiB, 31 MiB, 32 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 4952683 bytes (4836 KiB)
Starting logging: OK
Initializing random number generator... done.
Starting network...
linux_kernel_bde: module license 'Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
linux-kernel-bde (560): Create GMAC device failed. Unable to identify GMAC device.
linux-kernel-bde (560): DMA in high memory requires CONFIG_HIGHMEM on ARM CPUs.
linux-kernel-bde (560): no DMA memory available
linux-kernel-bde (565): DMA in high memory requires CONFIG_HIGHMEM on ARM CPUs.
linux-kernel-bde (568): DMA in high memory requires CONFIG_HIGHMEM on ARM CPUs.
DMA pool size: 8388608
sal_config_refresh: unknown entry "bcm5626x_config" on config.bcm line 1553
Broadcom Command Monitor: Copyright (c) 1998-2010 Broadcom Corporation
Re
lease: sdk-6.4.8 built 20151225 (Fri Dec 25 15:24:47 2015)
From xiaominc@bld-bei-009:/projects/ntsw-ae/home/labguy/boot/xiaominc/huahuan/sdk/sdk-xgs-robo-6.4.8
Platform: IPROC_CMICD
OS: Unix (Posix)
AXI
unit 0: Dev 0xb460, Rev 0x01, Chip BCM56460_A0, Driver BCM56260_A0
SOC unit 0 attached to PCI device BCM56460_A0
rc: unit 0 device BCM56460_A0
rc: MMU initialized
[uC msg]UC0 messaging system: up
[uC msg]UC1 messaging system: up
[uC msg]UC2 messaging system: up
rc: BCM driver initialized
rc: L2 Table shadowing enabled
rc: Port modes initialized
BCM.0>

你可能感兴趣的:(sdk,broad)