Vamos a compilar un nuevo CFE para Broadcom 96348GW-11, (probado en router Comtrend CT-5361).
CFE original del CT-5361:
CFE version 1.0.37-0.7-1 for BCM96348 (32bit,SP,BE) Build Date: Thu Apr 28 12:04:28 CST 2005 (root@jyang.linux.comtrend.com) Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.
Vamos a trabajar plataforma Debian 6, necesitamos una plataforma con kernel 2.6.2:
Necesitamos los fuentes y el toolchain para la plataforma BCM96348GW-11, que vamos a descargar con git:
#git clone git://github.com/Noltari/cfe_bcm63xx.git
Editar el fichero build.sh y cambiar de las macs el número que manejar y su base address, colocar la mac address adecuada:
hostTools/nvramembed -b "96348GW-11" -n 4 -m 11:22:33:44:55:66 -i cfe6348.bin -o cfe6348-nvr.bin
Cambiar por:
hostTools/nvramembed -b "96348GW-11" -n 11 -m 00:1d:20:xx:xx:xx -i cfe6348.bin -o cfe6348-nvr.bin
Ejecutar build.sh.
#./build.sh
Y tras compilar:
nvramembed: Embed the NVRAM with the following inputs: Board id : 96348GW-11 Number of Mac Addresses : 11 Base Mac Address: : 00:1d:20:xx:xx:xx Memory size : 16MB Input File Name : cfe6348.bin Output File Name : cfe6348-nvr.bin CFE size is 61868 NVRAM CRC = 0x9664f4e cfe6348-nvr.bin CFE with embedded NVRAM successfully created.
Copiar cfe6348-nvr.bin y renombrarlo a CFE.BIN
# cp cfe6348-nvr.bin CFE.BIN
Y ya podemos grabar nuestra flash a través de Jtag. El resultado es:
CFE version 1.0.37-6.4 for BCM96348 (32bit,SP,BE) Build Date: mié ene 21 15:10:59 CET 2015 (didac@kaos.es) Copyright (C) 2000-2005 Broadcom Corporation. Boot Address 0xbfc00000 Initializing Arena. Initializing Devices. Parallel flash device: name AM29LV320MB, id 0x2200, size 4096KB ** Image information not found. ** CPU type 0x29107: 256MHz, Bus: 128MHz, Ref: 32MHz Total memory: 16777216 bytes (16MB) Total memory used by CFE: 0x80401000 - 0x80524E30 (1195568) Initialized Data: 0x8041C660 - 0x8041E55 BSS Area: 0x8041E550 - 0x80422E30 (18656) Local Heap: 0x80422E30 - 0x80522E30 (1048576) Stack Area: 0x80522E30 - 0x80524E30 (8192) Text (code) segment: 0x80401000 - 0x8041C658 (112216) Boot area (physical): 0x00525000 - 0x00565000 Relocation Factor: I:00000000 - D:00000000 Board IP address : 192.168.1.1 Host IP address : 192.168.1.100 Gateway IP address : Run from flash/host (f/h) : f Default host run file name : vmlinux Default host flash file name : bcm963xx_fs_kernel Boot delay (0-9 seconds) : 1 Board Id Name : 96348GW-11 Psi size in KB : 24 Number of MAC Addresses (1-32) : 11 Base MAC Address : 00:1d:20:0e:e3:4a Ethernet PHY Type : Internal Memory size in MB : 16 CMT Thread Number : 0
Si no te apetece compilar, el cfe final lo puedes encontrar aquí: cfe.bin .