Random Noise

cat /dev/random >> /dev/dsp

Extract SquashFS from TRX file

leave a comment »


#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>

#define trx_magic 0x30524448 /* "hdr0" */
#define trx_max_len 0x720000
#define trx_no_header 1 /* do not write trx header */

typedef struct {
    uint32_t magic; /* "hdr0" */
    uint32_t len; /* length of file including header */
    uint32_t crc32; /* 32-bit crc from flag_version to end of file */
    uint32_t flag_version; /* 0:15 flags, 16:31 version */
    uint32_t offsets[4]; /* offsets of partitions from start of header */
} trx_header;


trx_header *readtrx(char* file_path)
{
    FILE *file = fopen(file_path, "rb");

    trx_header *p = malloc(sizeof(trx_header));

    if (file != NULL)
    {
        fread(p, sizeof(trx_header), 1, file);
        fclose(file);
    }

    return p;
};


int main(int argc, char **argv)
{

    if(argc != 2)
    {
        printf("usage: parse_trx <trx filename>\n\n");
        return 0;
    }

    trx_header *p = readtrx(argv[1]);

    printf("magic:\t\t\t0x%08x\n",p->magic);
    printf("length:\t\t\t0x%08x\n",p->len);
    printf("crc32:\t\t\t0x%08x\n",p->crc32);
    printf("flags:\t\t\t\t%d\n",p->flag_version & 0xff);
    printf("version:\t\t\t%d\n",(p->flag_version >> 16));
    printf("lzma loader offset:\t0x%08x\n",p->offsets[0]);
    printf("kernel offset:\t\t0x%08x\n",p->offsets[1]);
    printf("rootfs offset:\t\t0x%08x\n",p->offsets[2]);
    printf("bin header offset:\t0x%08x\n",p->offsets[3]);
    printf("\n\n");
    printf("run commands below to extract squashfs from trx");
    printf("dd if=%s skip=%d ibs=1 count=%d of=hsqs\n\n", argv[1], p->offsets[1], (p->len - p->offsets[1]));

    printf("sudo unsquashfs hsqs\n");

    free(p);
    return 0;

}




Written by Vivek Unune

March 11, 2017 at 9:35 pm

Posted in Uncategorized

Linksys EA9500 Booting Lede

leave a comment »

MTD Partitions in Lede

[    3.967344] Creating 7 MTD partitions on "brcmnand.0":
[    3.972500] 0x000000000000-0x000000080000 : "boot"
[    3.977913] 0x000000080000-0x000000180000 : "nvram"
[    3.983348] 0x000000180000-0x000000200000 : "nvram"
[    3.988757] 0x000000200000-0x000001f00000 : "firmware"
[    3.994846] 0x000001f00000-0x000008000000 : "failsafe"
[    4.000664] 0x00000020001c-0x00000037c000 : "linux"
[    4.006107] 0x00000037c000-0x000001f00000 : "rootfs"
[    4.023962] 0x000000620000-0x000001f00000 : "rootfs_data"
...
...

root@LEDE:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00020000 "boot"
mtd1: 00100000 00020000 "nvram"
mtd2: 00080000 00020000 "nvram"
mtd3: 01d00000 00020000 "firmware"
mtd4: 06100000 00020000 "failsafe"
mtd5: 0017bfe4 00020000 "linux"
mtd6: 01b84000 00020000 "rootfs"
mtd7: 018e0000 00020000 "rootfs_data"

Comparing this to Linksys firmware

lede-vs-linksys

Boot log –

root@LEDE:/# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.4.47 (vivek@vivek-Z97X-UD3H-BK) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3383-0bf85ef) ) #0 SMP Fri Feb 10 10:05:57 2017
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Linksys EA9500
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Hit pending asynchronous external abort (FSR=0x00001c06) during first unmask, this is most likely caused by a firmware/bootloader bug.
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat c0498d00, node_mem_map c7ef8000
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] PERCPU: Embedded 11 pages/cpu @c7eda000 s12876 r8192 d23988 u45056
[    0.000000] pcpu-alloc: s12876 r8192 d23988 u45056 alloc=11*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 124724K/131072K available (3218K kernel code, 106K rwdata, 1220K rodata, 216K init, 280K bss, 6348K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc045de44   (4440 kB)
[    0.000000]       .init : 0xc045e000 - 0xc0494000   ( 216 kB)
[    0.000000]       .data : 0xc0494000 - 0xc04ae910   ( 107 kB)
[    0.000000]        .bss : 0xc04ae910 - 0xc04f4bac   ( 281 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C: DT/platform modifies aux control register: 0x0a130000 -> 0x0a530000
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 ID prefetch enabled, offset 1 lines
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 16 ways, 256 kB
[    0.000000] L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x7e530001
[    0.000009] sched_clock: 64 bits at 700MHz, resolution 1ns, wraps every 4398046511103ns
[    0.000023] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0xa17102bcf3, max_idle_ns: 440795224838 ns
[    0.000148] Calibrating delay loop... 2786.91 BogoMIPS (lpj=13934592)
[    0.060081] pid_max: default: 32768 minimum: 301
[    0.060136] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.060144] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.060480] CPU: Testing write buffer coherency: ok
[    0.060671] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.060737] Setting up static identity map for 0x82a0 - 0x82d4
[    0.120103] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.120158] Brought up 2 CPUs
[    0.120171] SMP: Total of 2 processors activated (5580.39 BogoMIPS).
[    0.120177] CPU: WARNING: CPU(s) started in wrong/inconsistent modes (primary CPU mode 0x13)
[    0.120180] CPU: This may indicate a broken bootloader or firmware.
[    0.121510] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.121594] pinctrl core: initialized pinctrl subsystem
[    0.121904] NET: Registered protocol family 16
[    0.122381] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.151583] clocksource: Switched to clocksource arm_global_timer
[    0.152324] NET: Registered protocol family 2
[    0.152668] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.152686] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    0.152700] TCP: Hash tables configured (established 1024 bind 1024)
[    0.152746] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.152766] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.152890] NET: Registered protocol family 1
[    0.152929] PCI: CLS 0 bytes, default 64
[    0.153595] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.153726] Crashlog allocated RAM at address 0x3f00000
[    0.157009] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.157033] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.158557] io scheduler noop registered
[    0.158570] io scheduler deadline registered (default)
[    0.158914] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.159376] console [ttyS0] disabled
[    0.159417] 18000300.serial: ttyS0 at MMIO 0x18000300 (irq = 18, base_baud = 7812500) is a 16550
[    0.603381] console [ttyS0] enabled
[    0.607706] nand: device found, Manufacturer ID: 0x98, Chip ID: 0xf1
[    0.614098] nand: Toshiba NAND 128MiB 3,3V 8-bit
[    0.618725] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.626327] iproc_nand 18028000.nand: detected 128MiB total, 128KiB blocks, 2KiB pages, 16B OOB, 8-bit, BCH-8
[    0.636280] Scanning device for bad blocks
[    1.121955] Bad eraseblock 768 at 0x000006000000
[    1.298863] random: nonblocking pool is initialized
[    1.441569] mtd_read error while parsing (offset: 0x1EC0000): -74
[    1.626527] mtd_read error while parsing (offset: 0x5200000): -74
[    1.633020] mtd_read error while parsing (offset: 0x5220000): -74
[    1.639504] mtd_read error while parsing (offset: 0x5240000): -74
[    1.645987] mtd_read error while parsing (offset: 0x5260000): -74
[    1.652471] mtd_read error while parsing (offset: 0x5280000): -74
[    1.658949] mtd_read error while parsing (offset: 0x52A0000): -74
[    1.665432] mtd_read error while parsing (offset: 0x52C0000): -74
[    1.671915] mtd_read error while parsing (offset: 0x52E0000): -74
[    1.678393] mtd_read error while parsing (offset: 0x5300000): -74
[    1.684876] mtd_read error while parsing (offset: 0x5320000): -74
[    1.691360] mtd_read error while parsing (offset: 0x5340000): -74
[    1.697838] mtd_read error while parsing (offset: 0x5360000): -74
[    1.704321] mtd_read error while parsing (offset: 0x5380000): -74
[    1.710805] mtd_read error while parsing (offset: 0x53A0000): -74
[    1.717283] mtd_read error while parsing (offset: 0x53C0000): -74
[    1.723766] mtd_read error while parsing (offset: 0x53E0000): -74
[    1.730250] mtd_read error while parsing (offset: 0x5400000): -74
[    1.736728] mtd_read error while parsing (offset: 0x5420000): -74
[    1.743219] mtd_read error while parsing (offset: 0x5440000): -74
[    1.749696] mtd_read error while parsing (offset: 0x5460000): -74
[    1.756181] mtd_read error while parsing (offset: 0x5480000): -74
[    1.762664] mtd_read error while parsing (offset: 0x54A0000): -74
[    1.769141] mtd_read error while parsing (offset: 0x54C0000): -74
[    1.775625] mtd_read error while parsing (offset: 0x54E0000): -74
[    1.782109] mtd_read error while parsing (offset: 0x5500000): -74
[    1.788586] mtd_read error while parsing (offset: 0x5520000): -74
[    1.795069] mtd_read error while parsing (offset: 0x5540000): -74
[    1.801552] mtd_read error while parsing (offset: 0x5560000): -74
[    1.808030] mtd_read error while parsing (offset: 0x5580000): -74
[    1.814515] mtd_read error while parsing (offset: 0x55A0000): -74
[    1.820996] mtd_read error while parsing (offset: 0x55C0000): -74
[    1.827476] mtd_read error while parsing (offset: 0x55E0000): -74
[    1.833959] mtd_read error while parsing (offset: 0x5600000): -74
[    1.840436] mtd_read error while parsing (offset: 0x5620000): -74
[    1.846920] mtd_read error while parsing (offset: 0x5640000): -74
[    1.853404] mtd_read error while parsing (offset: 0x5660000): -74
[    1.859881] mtd_read error while parsing (offset: 0x5680000): -74
[    1.866364] mtd_read error while parsing (offset: 0x56A0000): -74
[    1.872848] mtd_read error while parsing (offset: 0x56C0000): -74
[    1.879325] mtd_read error while parsing (offset: 0x56E0000): -74
[    1.885808] mtd_read error while parsing (offset: 0x5700000): -74
[    1.892292] mtd_read error while parsing (offset: 0x5720000): -74
[    1.898770] mtd_read error while parsing (offset: 0x5740000): -74
[    1.905253] mtd_read error while parsing (offset: 0x5760000): -74
[    1.911736] mtd_read error while parsing (offset: 0x5780000): -74
[    1.918215] mtd_read error while parsing (offset: 0x57A0000): -74
[    1.924706] mtd_read error while parsing (offset: 0x57C0000): -74
[    1.931189] mtd_read error while parsing (offset: 0x57E0000): -74
[    1.937668] mtd_read error while parsing (offset: 0x5800000): -74
[    1.944151] mtd_read error while parsing (offset: 0x5820000): -74
[    1.950633] mtd_read error while parsing (offset: 0x5840000): -74
[    1.957113] mtd_read error while parsing (offset: 0x5860000): -74
[    1.963596] mtd_read error while parsing (offset: 0x5880000): -74
[    1.970080] mtd_read error while parsing (offset: 0x58A0000): -74
[    1.976558] mtd_read error while parsing (offset: 0x58C0000): -74
[    1.983041] mtd_read error while parsing (offset: 0x58E0000): -74
[    1.989518] mtd_read error while parsing (offset: 0x5900000): -74
[    1.996001] mtd_read error while parsing (offset: 0x5920000): -74
[    2.002485] mtd_read error while parsing (offset: 0x5940000): -74
[    2.008962] mtd_read error while parsing (offset: 0x5960000): -74
[    2.015446] mtd_read error while parsing (offset: 0x5980000): -74
[    2.021930] mtd_read error while parsing (offset: 0x59A0000): -74
[    2.028408] mtd_read error while parsing (offset: 0x59C0000): -74
[    2.034891] mtd_read error while parsing (offset: 0x59E0000): -74
[    2.041374] mtd_read error while parsing (offset: 0x5A00000): -74
[    2.047852] mtd_read error while parsing (offset: 0x5A20000): -74
[    2.054335] mtd_read error while parsing (offset: 0x5A40000): -74
[    2.060818] mtd_read error while parsing (offset: 0x5A60000): -74
[    2.067297] mtd_read error while parsing (offset: 0x5A80000): -74
[    2.073781] mtd_read error while parsing (offset: 0x5AA0000): -74
[    2.080259] mtd_read error while parsing (offset: 0x5AC0000): -74
[    2.086742] mtd_read error while parsing (offset: 0x5AE0000): -74
[    2.093230] mtd_read error while parsing (offset: 0x5B00000): -74
[    2.099711] mtd_read error while parsing (offset: 0x5B20000): -74
[    2.106204] mtd_read error while parsing (offset: 0x5B40000): -74
[    2.112695] mtd_read error while parsing (offset: 0x5B60000): -74
[    2.119173] mtd_read error while parsing (offset: 0x5B80000): -74
[    2.125657] mtd_read error while parsing (offset: 0x5BA0000): -74
[    2.132140] mtd_read error while parsing (offset: 0x5BC0000): -74
[    2.138617] mtd_read error while parsing (offset: 0x5BE0000): -74
[    2.145100] mtd_read error while parsing (offset: 0x5C00000): -74
[    2.151584] mtd_read error while parsing (offset: 0x5C20000): -74
[    2.158062] mtd_read error while parsing (offset: 0x5C40000): -74
[    2.164546] mtd_read error while parsing (offset: 0x5C60000): -74
[    2.171028] mtd_read error while parsing (offset: 0x5C80000): -74
[    2.177507] mtd_read error while parsing (offset: 0x5CA0000): -74
[    2.183989] mtd_read error while parsing (offset: 0x5CC0000): -74
[    2.190473] mtd_read error while parsing (offset: 0x5CE0000): -74
[    2.196951] mtd_read error while parsing (offset: 0x5D00000): -74
[    2.203434] mtd_read error while parsing (offset: 0x5D20000): -74
[    2.209912] mtd_read error while parsing (offset: 0x5D40000): -74
[    2.216397] mtd_read error while parsing (offset: 0x5D60000): -74
[    2.222879] mtd_read error while parsing (offset: 0x5D80000): -74
[    2.229357] mtd_read error while parsing (offset: 0x5DA0000): -74
[    2.235849] mtd_read error while parsing (offset: 0x5DC0000): -74
[    2.242333] mtd_read error while parsing (offset: 0x5DE0000): -74
[    2.248810] mtd_read error while parsing (offset: 0x5E00000): -74
[    2.255292] mtd_read error while parsing (offset: 0x5E20000): -74
[    2.261776] mtd_read error while parsing (offset: 0x5E40000): -74
[    2.268254] mtd_read error while parsing (offset: 0x5E60000): -74
[    2.274738] mtd_read error while parsing (offset: 0x5E80000): -74
[    2.281221] mtd_read error while parsing (offset: 0x5EA0000): -74
[    2.287699] mtd_read error while parsing (offset: 0x5EC0000): -74
[    2.294183] mtd_read error while parsing (offset: 0x5EE0000): -74
[    2.300665] mtd_read error while parsing (offset: 0x5F00000): -74
[    2.307143] mtd_read error while parsing (offset: 0x5F20000): -74
[    2.313627] mtd_read error while parsing (offset: 0x5F40000): -74
[    2.320105] mtd_read error while parsing (offset: 0x5F60000): -74
[    2.326589] mtd_read error while parsing (offset: 0x5F80000): -74
[    2.333073] mtd_read error while parsing (offset: 0x5FA0000): -74
[    2.339549] mtd_read error while parsing (offset: 0x5FC0000): -74
[    2.346032] mtd_read error while parsing (offset: 0x5FE0000): -74
[    2.353208] mtd_read error while parsing (offset: 0x6020000): -74
[    2.359690] mtd_read error while parsing (offset: 0x6040000): -74
[    2.366173] mtd_read error while parsing (offset: 0x6060000): -74
[    2.372658] mtd_read error while parsing (offset: 0x6080000): -74
[    2.379135] mtd_read error while parsing (offset: 0x60A0000): -74
[    2.385618] mtd_read error while parsing (offset: 0x60C0000): -74
[    2.392102] mtd_read error while parsing (offset: 0x60E0000): -74
[    2.398580] mtd_read error while parsing (offset: 0x6100000): -74
[    2.405063] mtd_read error while parsing (offset: 0x6120000): -74
[    2.411546] mtd_read error while parsing (offset: 0x6140000): -74
[    2.418024] mtd_read error while parsing (offset: 0x6160000): -74
[    2.424508] mtd_read error while parsing (offset: 0x6180000): -74
[    2.430991] mtd_read error while parsing (offset: 0x61A0000): -74
[    2.437469] mtd_read error while parsing (offset: 0x61C0000): -74
[    2.443952] mtd_read error while parsing (offset: 0x61E0000): -74
[    2.450429] mtd_read error while parsing (offset: 0x6200000): -74
[    2.456905] mtd_read error while parsing (offset: 0x6220000): -74
[    2.463388] mtd_read error while parsing (offset: 0x6240000): -74
[    2.469865] mtd_read error while parsing (offset: 0x6260000): -74
[    2.476348] mtd_read error while parsing (offset: 0x6280000): -74
[    2.482832] mtd_read error while parsing (offset: 0x62A0000): -74
[    2.489311] mtd_read error while parsing (offset: 0x62C0000): -74
[    2.495794] mtd_read error while parsing (offset: 0x62E0000): -74
[    2.502277] mtd_read error while parsing (offset: 0x6300000): -74
[    2.508755] mtd_read error while parsing (offset: 0x6320000): -74
[    2.515239] mtd_read error while parsing (offset: 0x6340000): -74
[    2.521722] mtd_read error while parsing (offset: 0x6360000): -74
[    2.528201] mtd_read error while parsing (offset: 0x6380000): -74
[    2.534692] mtd_read error while parsing (offset: 0x63A0000): -74
[    2.541175] mtd_read error while parsing (offset: 0x63C0000): -74
[    2.547653] mtd_read error while parsing (offset: 0x63E0000): -74
[    2.554136] mtd_read error while parsing (offset: 0x6400000): -74
[    2.560619] mtd_read error while parsing (offset: 0x6420000): -74
[    2.567097] mtd_read error while parsing (offset: 0x6440000): -74
[    2.573580] mtd_read error while parsing (offset: 0x6460000): -74
[    2.580059] mtd_read error while parsing (offset: 0x6480000): -74
[    2.586552] mtd_read error while parsing (offset: 0x64A0000): -74
[    2.593034] mtd_read error while parsing (offset: 0x64C0000): -74
[    2.599512] mtd_read error while parsing (offset: 0x64E0000): -74
[    2.605995] mtd_read error while parsing (offset: 0x6500000): -74
[    2.612478] mtd_read error while parsing (offset: 0x6520000): -74
[    2.618957] mtd_read error while parsing (offset: 0x6540000): -74
[    2.625448] mtd_read error while parsing (offset: 0x6560000): -74
[    2.631932] mtd_read error while parsing (offset: 0x6580000): -74
[    2.638411] mtd_read error while parsing (offset: 0x65A0000): -74
[    2.644902] mtd_read error while parsing (offset: 0x65C0000): -74
[    2.651385] mtd_read error while parsing (offset: 0x65E0000): -74
[    2.657864] mtd_read error while parsing (offset: 0x6600000): -74
[    2.664346] mtd_read error while parsing (offset: 0x6620000): -74
[    2.670830] mtd_read error while parsing (offset: 0x6640000): -74
[    2.677308] mtd_read error while parsing (offset: 0x6660000): -74
[    2.683790] mtd_read error while parsing (offset: 0x6680000): -74
[    2.690269] mtd_read error while parsing (offset: 0x66A0000): -74
[    2.696744] mtd_read error while parsing (offset: 0x66C0000): -74
[    2.703227] mtd_read error while parsing (offset: 0x66E0000): -74
[    2.709704] mtd_read error while parsing (offset: 0x6700000): -74
[    2.716188] mtd_read error while parsing (offset: 0x6720000): -74
[    2.722672] mtd_read error while parsing (offset: 0x6740000): -74
[    2.729149] mtd_read error while parsing (offset: 0x6760000): -74
[    2.735633] mtd_read error while parsing (offset: 0x6780000): -74
[    2.742115] mtd_read error while parsing (offset: 0x67A0000): -74
[    2.748594] mtd_read error while parsing (offset: 0x67C0000): -74
[    2.755077] mtd_read error while parsing (offset: 0x67E0000): -74
[    2.761560] mtd_read error while parsing (offset: 0x6800000): -74
[    2.768038] mtd_read error while parsing (offset: 0x6820000): -74
[    2.774522] mtd_read error while parsing (offset: 0x6840000): -74
[    2.781006] mtd_read error while parsing (offset: 0x6860000): -74
[    2.787483] mtd_read error while parsing (offset: 0x6880000): -74
[    2.793966] mtd_read error while parsing (offset: 0x68A0000): -74
[    2.800443] mtd_read error while parsing (offset: 0x68C0000): -74
[    2.806920] mtd_read error while parsing (offset: 0x68E0000): -74
[    2.813402] mtd_read error while parsing (offset: 0x6900000): -74
[    2.819880] mtd_read error while parsing (offset: 0x6920000): -74
[    2.826362] mtd_read error while parsing (offset: 0x6940000): -74
[    2.832846] mtd_read error while parsing (offset: 0x6960000): -74
[    2.839325] mtd_read error while parsing (offset: 0x6980000): -74
[    2.845816] mtd_read error while parsing (offset: 0x69A0000): -74
[    2.852300] mtd_read error while parsing (offset: 0x69C0000): -74
[    2.858778] mtd_read error while parsing (offset: 0x69E0000): -74
[    2.865261] mtd_read error while parsing (offset: 0x6A00000): -74
[    2.871744] mtd_read error while parsing (offset: 0x6A20000): -74
[    2.878222] mtd_read error while parsing (offset: 0x6A40000): -74
[    2.884706] mtd_read error while parsing (offset: 0x6A60000): -74
[    2.891188] mtd_read error while parsing (offset: 0x6A80000): -74
[    2.897667] mtd_read error while parsing (offset: 0x6AA0000): -74
[    2.904150] mtd_read error while parsing (offset: 0x6AC0000): -74
[    2.910633] mtd_read error while parsing (offset: 0x6AE0000): -74
[    2.917112] mtd_read error while parsing (offset: 0x6B00000): -74
[    2.923595] mtd_read error while parsing (offset: 0x6B20000): -74
[    2.930079] mtd_read error while parsing (offset: 0x6B40000): -74
[    2.936557] mtd_read error while parsing (offset: 0x6B60000): -74
[    2.943049] mtd_read error while parsing (offset: 0x6B80000): -74
[    2.949525] mtd_read error while parsing (offset: 0x6BA0000): -74
[    2.956008] mtd_read error while parsing (offset: 0x6BC0000): -74
[    2.962492] mtd_read error while parsing (offset: 0x6BE0000): -74
[    2.968970] mtd_read error while parsing (offset: 0x6C00000): -74
[    2.975453] mtd_read error while parsing (offset: 0x6C20000): -74
[    2.981937] mtd_read error while parsing (offset: 0x6C40000): -74
[    2.988415] mtd_read error while parsing (offset: 0x6C60000): -74
[    2.994897] mtd_read error while parsing (offset: 0x6C80000): -74
[    3.001380] mtd_read error while parsing (offset: 0x6CA0000): -74
[    3.007859] mtd_read error while parsing (offset: 0x6CC0000): -74
[    3.014342] mtd_read error while parsing (offset: 0x6CE0000): -74
[    3.020825] mtd_read error while parsing (offset: 0x6D00000): -74
[    3.027304] mtd_read error while parsing (offset: 0x6D20000): -74
[    3.033786] mtd_read error while parsing (offset: 0x6D40000): -74
[    3.040265] mtd_read error while parsing (offset: 0x6D60000): -74
[    3.046751] mtd_read error while parsing (offset: 0x6D80000): -74
[    3.053240] mtd_read error while parsing (offset: 0x6DA0000): -74
[    3.065203] mtd_read error while parsing (offset: 0x6EC0000): -74
[    3.071693] mtd_read error while parsing (offset: 0x6EE0000): -74
[    3.078170] mtd_read error while parsing (offset: 0x6F00000): -74
[    3.084653] mtd_read error while parsing (offset: 0x6F20000): -74
[    3.091142] mtd_read error while parsing (offset: 0x6F40000): -74
[    3.097625] mtd_read error while parsing (offset: 0x6F60000): -74
[    3.104117] mtd_read error while parsing (offset: 0x6F80000): -74
[    3.110599] mtd_read error while parsing (offset: 0x6FA0000): -74
[    3.117077] mtd_read error while parsing (offset: 0x6FC0000): -74
[    3.123560] mtd_read error while parsing (offset: 0x6FE0000): -74
[    3.130037] mtd_read error while parsing (offset: 0x7000000): -74
[    3.136520] mtd_read error while parsing (offset: 0x7020000): -74
[    3.143005] mtd_read error while parsing (offset: 0x7040000): -74
[    3.149482] mtd_read error while parsing (offset: 0x7060000): -74
[    3.155967] mtd_read error while parsing (offset: 0x7080000): -74
[    3.162449] mtd_read error while parsing (offset: 0x70A0000): -74
[    3.168928] mtd_read error while parsing (offset: 0x70C0000): -74
[    3.175410] mtd_read error while parsing (offset: 0x70E0000): -74
[    3.181893] mtd_read error while parsing (offset: 0x7100000): -74
[    3.188372] mtd_read error while parsing (offset: 0x7120000): -74
[    3.194857] mtd_read error while parsing (offset: 0x7140000): -74
[    3.201347] mtd_read error while parsing (offset: 0x7160000): -74
[    3.207825] mtd_read error while parsing (offset: 0x7180000): -74
[    3.214308] mtd_read error while parsing (offset: 0x71A0000): -74
[    3.220791] mtd_read error while parsing (offset: 0x71C0000): -74
[    3.227269] mtd_read error while parsing (offset: 0x71E0000): -74
[    3.233753] mtd_read error while parsing (offset: 0x7200000): -74
[    3.240232] mtd_read error while parsing (offset: 0x7220000): -74
[    3.246715] mtd_read error while parsing (offset: 0x7240000): -74
[    3.253206] mtd_read error while parsing (offset: 0x7260000): -74
[    3.259685] mtd_read error while parsing (offset: 0x7280000): -74
[    3.266176] mtd_read error while parsing (offset: 0x72A0000): -74
[    3.272660] mtd_read error while parsing (offset: 0x72C0000): -74
[    3.279137] mtd_read error while parsing (offset: 0x72E0000): -74
[    3.285620] mtd_read error while parsing (offset: 0x7300000): -74
[    3.292105] mtd_read error while parsing (offset: 0x7320000): -74
[    3.298582] mtd_read error while parsing (offset: 0x7340000): -74
[    3.305065] mtd_read error while parsing (offset: 0x7360000): -74
[    3.311548] mtd_read error while parsing (offset: 0x7380000): -74
[    3.318026] mtd_read error while parsing (offset: 0x73A0000): -74
[    3.324510] mtd_read error while parsing (offset: 0x73C0000): -74
[    3.330993] mtd_read error while parsing (offset: 0x73E0000): -74
[    3.337472] mtd_read error while parsing (offset: 0x7400000): -74
[    3.343963] mtd_read error while parsing (offset: 0x7420000): -74
[    3.350440] mtd_read error while parsing (offset: 0x7440000): -74
[    3.356916] mtd_read error while parsing (offset: 0x7460000): -74
[    3.363400] mtd_read error while parsing (offset: 0x7480000): -74
[    3.369876] mtd_read error while parsing (offset: 0x74A0000): -74
[    3.376359] mtd_read error while parsing (offset: 0x74C0000): -74
[    3.382843] mtd_read error while parsing (offset: 0x74E0000): -74
[    3.389322] mtd_read error while parsing (offset: 0x7500000): -74
[    3.395812] mtd_read error while parsing (offset: 0x7520000): -74
[    3.402297] mtd_read error while parsing (offset: 0x7540000): -74
[    3.408775] mtd_read error while parsing (offset: 0x7560000): -74
[    3.415257] mtd_read error while parsing (offset: 0x7580000): -74
[    3.421741] mtd_read error while parsing (offset: 0x75A0000): -74
[    3.428219] mtd_read error while parsing (offset: 0x75C0000): -74
[    3.434702] mtd_read error while parsing (offset: 0x75E0000): -74
[    3.441186] mtd_read error while parsing (offset: 0x7600000): -74
[    3.447663] mtd_read error while parsing (offset: 0x7620000): -74
[    3.454147] mtd_read error while parsing (offset: 0x7640000): -74
[    3.460630] mtd_read error while parsing (offset: 0x7660000): -74
[    3.467111] mtd_read error while parsing (offset: 0x7680000): -74
[    3.473599] mtd_read error while parsing (offset: 0x76A0000): -74
[    3.480085] mtd_read error while parsing (offset: 0x76C0000): -74
[    3.486562] mtd_read error while parsing (offset: 0x76E0000): -74
[    3.493045] mtd_read error while parsing (offset: 0x7700000): -74
[    3.499522] mtd_read error while parsing (offset: 0x7720000): -74
[    3.506005] mtd_read error while parsing (offset: 0x7740000): -74
[    3.512489] mtd_read error while parsing (offset: 0x7760000): -74
[    3.518967] mtd_read error while parsing (offset: 0x7780000): -74
[    3.525451] mtd_read error while parsing (offset: 0x77A0000): -74
[    3.531934] mtd_read error while parsing (offset: 0x77C0000): -74
[    3.538411] mtd_read error while parsing (offset: 0x77E0000): -74
[    3.544894] mtd_read error while parsing (offset: 0x7800000): -74
[    3.551378] mtd_read error while parsing (offset: 0x7820000): -74
[    3.557857] mtd_read error while parsing (offset: 0x7840000): -74
[    3.564339] mtd_read error while parsing (offset: 0x7860000): -74
[    3.570824] mtd_read error while parsing (offset: 0x7880000): -74
[    3.577302] mtd_read error while parsing (offset: 0x78A0000): -74
[    3.583784] mtd_read error while parsing (offset: 0x78C0000): -74
[    3.590263] mtd_read error while parsing (offset: 0x78E0000): -74
[    3.596747] mtd_read error while parsing (offset: 0x7900000): -74
[    3.603238] mtd_read error while parsing (offset: 0x7920000): -74
[    3.609715] mtd_read error while parsing (offset: 0x7940000): -74
[    3.616198] mtd_read error while parsing (offset: 0x7960000): -74
[    3.622682] mtd_read error while parsing (offset: 0x7980000): -74
[    3.629159] mtd_read error while parsing (offset: 0x79A0000): -74
[    3.635642] mtd_read error while parsing (offset: 0x79C0000): -74
[    3.642128] mtd_read error while parsing (offset: 0x79E0000): -74
[    3.648605] mtd_read error while parsing (offset: 0x7A00000): -74
[    3.655088] mtd_read error while parsing (offset: 0x7A20000): -74
[    3.661570] mtd_read error while parsing (offset: 0x7A40000): -74
[    3.668049] mtd_read error while parsing (offset: 0x7A60000): -74
[    3.674533] mtd_read error while parsing (offset: 0x7A80000): -74
[    3.681015] mtd_read error while parsing (offset: 0x7AA0000): -74
[    3.687494] mtd_read error while parsing (offset: 0x7AC0000): -74
[    3.693977] mtd_read error while parsing (offset: 0x7AE0000): -74
[    3.700460] mtd_read error while parsing (offset: 0x7B00000): -74
[    3.706938] mtd_read error while parsing (offset: 0x7B20000): -74
[    3.713421] mtd_read error while parsing (offset: 0x7B40000): -74
[    3.719899] mtd_read error while parsing (offset: 0x7B60000): -74
[    3.726383] mtd_read error while parsing (offset: 0x7B80000): -74
[    3.732866] mtd_read error while parsing (offset: 0x7BA0000): -74
[    3.739343] mtd_read error while parsing (offset: 0x7BC0000): -74
[    3.745827] mtd_read error while parsing (offset: 0x7BE0000): -74
[    3.752311] mtd_read error while parsing (offset: 0x7C00000): -74
[    3.758789] mtd_read error while parsing (offset: 0x7C20000): -74
[    3.765271] mtd_read error while parsing (offset: 0x7C40000): -74
[    3.771754] mtd_read error while parsing (offset: 0x7C60000): -74
[    3.778234] mtd_read error while parsing (offset: 0x7C80000): -74
[    3.784725] mtd_read error while parsing (offset: 0x7CA0000): -74
[    3.791207] mtd_read error while parsing (offset: 0x7CC0000): -74
[    3.797687] mtd_read error while parsing (offset: 0x7CE0000): -74
[    3.804178] mtd_read error while parsing (offset: 0x7D00000): -74
[    3.810661] mtd_read error while parsing (offset: 0x7D20000): -74
[    3.817140] mtd_read error while parsing (offset: 0x7D40000): -74
[    3.823623] mtd_read error while parsing (offset: 0x7D60000): -74
[    3.830101] mtd_read error while parsing (offset: 0x7D80000): -74
[    3.836585] mtd_read error while parsing (offset: 0x7DA0000): -74
[    3.843068] mtd_read error while parsing (offset: 0x7DC0000): -74
[    3.849545] mtd_read error while parsing (offset: 0x7DE0000): -74
[    3.856028] mtd_read error while parsing (offset: 0x7E00000): -74
[    3.862512] mtd_read error while parsing (offset: 0x7E20000): -74
[    3.868990] mtd_read error while parsing (offset: 0x7E40000): -74
[    3.875481] mtd_read error while parsing (offset: 0x7E60000): -74
[    3.881967] mtd_read error while parsing (offset: 0x7E80000): -74
[    3.888443] mtd_read error while parsing (offset: 0x7EA0000): -74
[    3.894925] mtd_read error while parsing (offset: 0x7EC0000): -74
[    3.901410] mtd_read error while parsing (offset: 0x7EE0000): -74
[    3.907888] mtd_read error while parsing (offset: 0x7F00000): -74
[    3.914370] mtd_read error while parsing (offset: 0x7F20000): -74
[    3.920854] mtd_read error while parsing (offset: 0x7F40000): -74
[    3.927333] mtd_read error while parsing (offset: 0x7F60000): -74
[    3.933816] mtd_read error while parsing (offset: 0x7F80000): -74
[    3.940294] mtd_read error while parsing (offset: 0x7FA0000): -74
[    3.946777] mtd_read error while parsing (offset: 0x7FC0000): -74
[    3.953260] mtd_read error while parsing (offset: 0x7FE0000): -74
[    3.961068] 7 bcm47xxpart partitions found on MTD device brcmnand.0
[    3.967344] Creating 7 MTD partitions on "brcmnand.0":
[    3.972500] 0x000000000000-0x000000080000 : "boot"
[    3.977913] 0x000000080000-0x000000180000 : "nvram"
[    3.983348] 0x000000180000-0x000000200000 : "nvram"
[    3.988757] 0x000000200000-0x000001f00000 : "firmware"
[    3.994846] 0x000001f00000-0x000008000000 : "failsafe"
[    4.000664] 0x00000020001c-0x00000037c000 : "linux"
[    4.006107] 0x00000037c000-0x000001f00000 : "rootfs"
[    4.011695] mtd: device 6 (rootfs) set to be root filesystem
[    4.017747] 1 squashfs-split partitions found on MTD device rootfs
[    4.023962] 0x000000620000-0x000001f00000 : "rootfs_data"
[    4.030971] libphy: Fixed MDIO Bus: probed
[    4.035143] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded
[    4.041053] bcma: bus0: Found chip with id 53030, rev 0x00 and package 0x00
[    4.048072] bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2A, class 0x0)
[    4.056730] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.056739] bcma: bus0: Core 1 found: Chipcommon B (manuf 0x4BF, id 0x50B, rev 0x05, class 0x0)
[    4.065555] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.065563] bcma: bus0: Core 2 found: DMA (manuf 0x4BF, id 0x502, rev 0x04, class 0x0)
[    4.073601] bcma: bus0: Core 3 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x07, class 0x0)
[    4.082064] bcma: bus0: Core 4 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x07, class 0x0)
[    4.090530] bcma: bus0: Core 5 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x07, class 0x0)
[    4.098986] bcma: bus0: Core 6 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x07, class 0x0)
[    4.107408] bcma: bus0: Core 7 found: PCIe Gen 2 (manuf 0x4BF, id 0x501, rev 0x07, class 0x0)
[    4.116009] bcma: bus0: Core 8 found: PCIe Gen 2 (manuf 0x4BF, id 0x501, rev 0x07, class 0x0)
[    4.124632] bcma: bus0: Core 9 found: PCIe Gen 2 (manuf 0x4BF, id 0x501, rev 0x07, class 0x0)
[    4.133268] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.133276] bcma: bus0: Core 10 found: ARM Cortex A9 core (ihost) (manuf 0x4BF, id 0x510, rev 0x07, class 0x0)
[    4.143371] bcma: bus0: Core 11 found: USB 2.0 (manuf 0x4BF, id 0x504, rev 0x07, class 0x0)
[    4.151817] bcma: bus0: Core 12 found: USB 3.0 (manuf 0x4BF, id 0x505, rev 0x07, class 0x0)
[    4.160284] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.160292] bcma: bus0: Core 13 found: SDIO3 (manuf 0x4BF, id 0x503, rev 0x01, class 0x0)
[    4.168573] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.168581] bcma: bus0: Core 14 found: I2S (manuf 0x4BF, id 0x834, rev 0x03, class 0x0)
[    4.176692] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.176699] bcma: bus0: Core 15 found: ARM Cortex A9 JTAG (manuf 0x4BF, id 0x506, rev 0x01, class 0x0)
[    4.186119] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.186127] bcma: bus0: Core 16 found: Denali DDR2/DDR3 memory controller (manuf 0x4BF, id 0x507, rev 0x01, class 0x0)
[    4.196942] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.196949] bcma: bus0: Core 17 found: ROM (manuf 0x4BF, id 0x508, rev 0x08, class 0x0)
[    4.205071] bcma: bus0: Core 18 found: NAND flash controller (manuf 0x4BF, id 0x509, rev 0x01, class 0x0)
[    4.214743] bcma: bus0: bcma_of_get_irq() failed with rc=-22
[    4.214753] bcma: bus0: Core 19 found: SPI flash controller (manuf 0x4BF, id 0x50A, rev 0x01, class 0x0)
[    4.224270] bcma: bus0: Flash type not supported
[    4.245457] can not parse nvram name (null)boardnum(null) with value 20150630 got -34
[    4.273598] bcma: bus0: Using SPROM revision 8 provided by platform.
[    4.273855] bgmac_bcma bcma0:3: Found PHY addr: 30 (NOREGS)
[    4.279454] bgmac_bcma bcma0:3: Support for Roboswitch not implemented
[    4.286018] bgmac_bcma bcma0:3: Invalid MAC addr: 00:00:00:00:00:00
[    4.292322] bgmac_bcma bcma0:3: Using random MAC: 72:88:b6:f7:6b:04
[    4.300407] b53_common: found switch: BCM53012, rev 0
[    4.306012] bgmac_bcma bcma0:4: Found PHY addr: 30 (NOREGS)
[    4.311643] bgmac_bcma bcma0:4: Support for Roboswitch not implemented
[    4.318188] bgmac_bcma bcma0:4: Invalid MAC addr: 00:00:00:00:00:00
[    4.324490] bgmac_bcma bcma0:4: Using random MAC: 2e:a8:f3:88:b1:b3
[    4.331908] bgmac_bcma bcma0:5: Found PHY addr: 30 (NOREGS)
[    4.337501] bgmac_bcma bcma0:5: Support for Roboswitch not implemented
[    4.345189] bgmac_bcma bcma0:6: Unsupported core_unit 3
[    4.350494] bgmac_bcma: probe of bcma0:6 failed with error -524
[    4.460168] pcie_iproc_bcma bcma0:7: PCI host bridge to bus 0000:00
[    4.466462] pci_bus 0000:00: root bus resource [mem 0x08000000-0x0fffffff]
[    4.473376] pcie_iproc_bcma bcma0:7: link: UP
[    4.477755] pci 0000:00:00.0: [14e4:d612] type 01 class 0x060400
[    4.477807] pci 0000:00:00.0: PME# supported from D0 D3hot D3cold
[    4.477932] PCI: bus0: Fast back to back transfers disabled
[    4.483536] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    4.491643] pci_bus 0000:01: busn_res: can not insert [bus 01-ff] under [??? 0x00000000 flags 0x0] (conflicts with (null) [??? 0x00000000 flags 0x0])
[    4.491674] pci 0000:01:00.0: [10b5:8603] type 01 class 0x060400
[    4.491718] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00003fff]
[    4.491818] pci 0000:01:00.0: supports D1 D2
[    4.491824] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    4.491945] PCI: bus1: Fast back to back transfers disabled
[    4.497536] pci 0000:01:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    4.505694] pci 0000:02:01.0: [10b5:8603] type 01 class 0x060400
[    4.505826] pci 0000:02:01.0: supports D1 D2
[    4.505833] pci 0000:02:01.0: PME# supported from D0 D1 D2 D3hot D3cold
[    4.505957] pci 0000:02:02.0: [10b5:8603] type 01 class 0x060400
[    4.506081] pci 0000:02:02.0: supports D1 D2
[    4.506088] pci 0000:02:02.0: PME# supported from D0 D1 D2 D3hot D3cold
[    4.506256] PCI: bus2: Fast back to back transfers disabled
[    4.511861] pci 0000:02:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    4.519892] pci 0000:02:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    4.528043] pci 0000:03:00.0: [14e4:4365] type 00 class 0x028000
[    4.528105] pci 0000:03:00.0: reg 0x10: [mem 0x00000000-0x00007fff 64bit]
[    4.528127] pci 0000:03:00.0: reg 0x18: [mem 0x00000000-0x007fffff 64bit]
[    4.528147] pci 0000:03:00.0: reg 0x20: [mem 0x00000000-0x000fffff 64bit pref]
[    4.528260] pci 0000:03:00.0: supports D1 D2
[    4.528388] PCI: bus3: Fast back to back transfers disabled
[    4.533994] pci_bus 0000:03: busn_res: [bus 03-ff] end is updated to 03
[    4.534133] pci 0000:04:00.0: [14e4:4365] type 00 class 0x028000
[    4.534193] pci 0000:04:00.0: reg 0x10: [mem 0x00000000-0x00007fff 64bit]
[    4.534214] pci 0000:04:00.0: reg 0x18: [mem 0x00000000-0x007fffff 64bit]
[    4.534235] pci 0000:04:00.0: reg 0x20: [mem 0x00000000-0x000fffff 64bit pref]
[    4.534350] pci 0000:04:00.0: supports D1 D2
[    4.534485] PCI: bus4: Fast back to back transfers disabled
[    4.540073] pci_bus 0000:04: busn_res: [bus 04-ff] end is updated to 04
[    4.540103] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 04
[    4.540114] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 04
[    4.540124] pci_bus 0000:01: busn_res: can not insert [bus 01-04] under [??? 0x00000000 flags 0x0] (conflicts with (null) [??? 0x00000000 flags 0x0])
[    4.540147] pci 0000:02:01.0: bridge window [io  0x1000-0x0fff] to [bus 03] add_size 1000
[    4.540159] pci 0000:02:01.0: bridge window [mem 0x00100000-0x001fffff 64bit pref] to [bus 03] add_size 200000 add_align 100000
[    4.540183] pci 0000:02:01.0: res[7]=[io  0x1000-0x0fff] res_to_dev_res add_size 1000 min_align 1000
[    4.540191] pci 0000:01:00.0: bridge window [io  0x1000-0x0fff] to [bus 02-04] add_size 1000
[    4.540200] pci 0000:02:01.0: res[9]=[mem 0x00100000-0x001fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.540208] pci 0000:02:01.0: res[9]=[mem 0x00100000-0x001fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.540216] pci 0000:01:00.0: bridge window [mem 0x00100000-0x002fffff 64bit pref] to [bus 02-04] add_size 200000 add_align 100000
[    4.540229] pci 0000:01:00.0: res[9]=[mem 0x00100000-0x002fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.540236] pci 0000:01:00.0: res[9]=[mem 0x00100000-0x002fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.540245] pci 0000:00:00.0: bridge window [mem 0x00100000-0x002fffff 64bit pref] to [bus 01-04] add_size 200000 add_align 100000
[    4.540256] pci 0000:00:00.0: res[9]=[mem 0x00100000-0x002fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.540264] pci 0000:00:00.0: res[9]=[mem 0x00100000-0x004fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.540276] pci 0000:00:00.0: BAR 8: assigned [mem 0x08000000-0x099fffff]
[    4.547077] pci 0000:00:00.0: BAR 9: assigned [mem 0x09a00000-0x09dfffff 64bit pref]
[    4.554858] pci 0000:01:00.0: res[9]=[mem 0x00100000-0x002fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.554867] pci 0000:01:00.0: res[9]=[mem 0x00100000-0x004fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.554875] pci 0000:01:00.0: res[7]=[io  0x1000-0x0fff] res_to_dev_res add_size 1000 min_align 1000
[    4.554882] pci 0000:01:00.0: res[7]=[io  0x1000-0x1fff] res_to_dev_res add_size 1000 min_align 1000
[    4.554890] pci 0000:01:00.0: BAR 8: assigned [mem 0x08000000-0x097fffff]
[    4.561697] pci 0000:01:00.0: BAR 9: assigned [mem 0x09a00000-0x09dfffff 64bit pref]
[    4.569454] pci 0000:01:00.0: BAR 0: assigned [mem 0x09800000-0x09803fff]
[    4.576270] pci 0000:01:00.0: BAR 7: no space for [io  size 0x1000]
[    4.582558] pci 0000:01:00.0: BAR 7: failed to assign [io  size 0x1000]
[    4.589187] pci 0000:01:00.0: BAR 7: no space for [io  size 0x1000]
[    4.595478] pci 0000:01:00.0: BAR 7: failed to assign [io  size 0x1000]
[    4.602113] pci 0000:02:01.0: res[9]=[mem 0x00100000-0x001fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.602122] pci 0000:02:01.0: res[9]=[mem 0x00100000-0x003fffff 64bit pref] res_to_dev_res add_size 200000 min_align 100000
[    4.602129] pci 0000:02:01.0: res[7]=[io  0x1000-0x0fff] res_to_dev_res add_size 1000 min_align 1000
[    4.602137] pci 0000:02:01.0: res[7]=[io  0x1000-0x1fff] res_to_dev_res add_size 1000 min_align 1000
[    4.602144] pci 0000:02:01.0: BAR 8: assigned [mem 0x08000000-0x08bfffff]
[    4.608944] pci 0000:02:02.0: BAR 8: assigned [mem 0x08c00000-0x097fffff]
[    4.615756] pci 0000:02:01.0: BAR 9: assigned [mem 0x09a00000-0x09cfffff 64bit pref]
[    4.623520] pci 0000:02:02.0: BAR 9: assigned [mem 0x09d00000-0x09dfffff 64bit pref]
[    4.631282] pci 0000:02:01.0: BAR 7: no space for [io  size 0x1000]
[    4.637562] pci 0000:02:01.0: BAR 7: failed to assign [io  size 0x1000]
[    4.644192] pci 0000:02:01.0: BAR 7: no space for [io  size 0x1000]
[    4.650474] pci 0000:02:01.0: BAR 7: failed to assign [io  size 0x1000]
[    4.657106] pci 0000:03:00.0: BAR 2: assigned [mem 0x08000000-0x087fffff 64bit]
[    4.664451] pci 0000:03:00.0: BAR 4: assigned [mem 0x09a00000-0x09afffff 64bit pref]
[    4.672233] pci 0000:03:00.0: BAR 0: assigned [mem 0x08800000-0x08807fff 64bit]
[    4.679572] pci 0000:02:01.0: PCI bridge to [bus 03]
[    4.684556] pci 0000:02:01.0:   bridge window [mem 0x08000000-0x08bfffff]
[    4.691367] pci 0000:02:01.0:   bridge window [mem 0x09a00000-0x09cfffff 64bit pref]
[    4.699133] pci 0000:04:00.0: BAR 2: assigned [mem 0x09000000-0x097fffff 64bit]
[    4.706474] pci 0000:04:00.0: BAR 4: assigned [mem 0x09d00000-0x09dfffff 64bit pref]
[    4.714255] pci 0000:04:00.0: BAR 0: assigned [mem 0x08c00000-0x08c07fff 64bit]
[    4.721603] pci 0000:02:02.0: PCI bridge to [bus 04]
[    4.726581] pci 0000:02:02.0:   bridge window [mem 0x08c00000-0x097fffff]
[    4.733391] pci 0000:02:02.0:   bridge window [mem 0x09d00000-0x09dfffff 64bit pref]
[    4.741157] pci 0000:01:00.0: PCI bridge to [bus 02-04]
[    4.746392] pci 0000:01:00.0:   bridge window [mem 0x08000000-0x097fffff]
[    4.753201] pci 0000:01:00.0:   bridge window [mem 0x09a00000-0x09dfffff 64bit pref]
[    4.760967] pci 0000:00:00.0: PCI bridge to [bus 01-04]
[    4.766199] pci 0000:00:00.0:   bridge window [mem 0x08000000-0x099fffff]
[    4.773010] pci 0000:00:00.0:   bridge window [mem 0x09a00000-0x09dfffff 64bit pref]
[    4.890172] pcie_iproc_bcma bcma0:8: PCI host bridge to bus 0001:00
[    4.896467] pci_bus 0001:00: root bus resource [mem 0x20000000-0x27ffffff]
[    4.903379] pcie_iproc_bcma bcma0:8: link: UP
[    4.907756] pci 0001:00:00.0: [14e4:d612] type 01 class 0x060400
[    4.907803] pci 0001:00:00.0: PME# supported from D0 D3hot D3cold
[    4.907927] PCI: bus0: Fast back to back transfers disabled
[    4.913530] pci 0001:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    4.921629] pci_bus 0001:01: busn_res: can not insert [bus 01-ff] under [??? 0x00000000 flags 0x0] (conflicts with (null) [??? 0x00000000 flags 0x0])
[    4.921660] pci 0001:01:00.0: [14e4:4365] type 00 class 0x028000
[    4.921699] pci 0001:01:00.0: reg 0x10: [mem 0x00000000-0x00007fff 64bit]
[    4.921714] pci 0001:01:00.0: reg 0x18: [mem 0x00000000-0x007fffff 64bit]
[    4.921729] pci 0001:01:00.0: reg 0x20: [mem 0x00000000-0x000fffff 64bit pref]
[    4.921803] pci 0001:01:00.0: supports D1 D2
[    4.921904] PCI: bus1: Fast back to back transfers disabled
[    4.927497] pci_bus 0001:01: busn_res: [bus 01-ff] end is updated to 01
[    4.927507] pci_bus 0001:01: busn_res: can not insert [bus 01] under [??? 0x00000000 flags 0x0] (conflicts with (null) [??? 0x00000000 flags 0x0])
[    4.927532] pci 0001:00:00.0: BAR 8: assigned [mem 0x20000000-0x20bfffff]
[    4.934351] pci 0001:00:00.0: BAR 9: assigned [mem 0x20c00000-0x20cfffff 64bit pref]
[    4.942127] pci 0001:01:00.0: BAR 2: assigned [mem 0x20000000-0x207fffff 64bit]
[    4.949462] pci 0001:01:00.0: BAR 4: assigned [mem 0x20c00000-0x20cfffff 64bit pref]
[    4.957240] pci 0001:01:00.0: BAR 0: assigned [mem 0x20800000-0x20807fff 64bit]
[    4.964577] pci 0001:00:00.0: PCI bridge to [bus 01]
[    4.969552] pci 0001:00:00.0:   bridge window [mem 0x20000000-0x20bfffff]
[    4.976363] pci 0001:00:00.0:   bridge window [mem 0x20c00000-0x20cfffff 64bit pref]
[    5.090175] pcie_iproc_bcma bcma0:9: PCI host bridge to bus 0002:00
[    5.096466] pci_bus 0002:00: root bus resource [mem 0x28000000-0x2fffffff]
[    5.103372] pcie_iproc_bcma bcma0:9: PHY or data link is INACTIVE!
[    5.109561] pcie_iproc_bcma bcma0:9: no PCIe EP device detected
[    5.115545] pcie_iproc_bcma bcma0:9: PCIe controller setup failed
[    5.122478] bcm47xx-wdt bcm47xx-wdt.0: BCM47xx Watchdog Timer enabled (30 seconds, Software Timer)
[    5.131494] bcma: bus0: Bus registered
[    5.136010] NET: Registered protocol family 10
[    5.141269] NET: Registered protocol family 17
[    5.145766] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    5.158429] 8021q: 802.1Q VLAN Support v1.8
[    5.162696] Registering SWP/SWPB emulation handler
[    5.171344] VFS: Mounted root (squashfs filesystem) readonly on device 31:6.
[    5.178574] Freeing unused kernel memory: 216K (c045e000 - c0494000)
[    5.511524] init: Console is alive
[    5.515054] init: - watchdog -
[    5.724603] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.759690] usbcore: registered new interface driver usbfs
[    5.765295] usbcore: registered new interface driver hub
[    5.770680] usbcore: registered new device driver usb
[    5.777862] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.784938] ehci-platform: EHCI generic platform driver
[    5.791245] ehci-platform 18021000.ehci: EHCI Host Controller
[    5.791756] bcm_ns_usb3 18105000.usb3-phy: Registered Broadcom Northstar USB 3.0 PHY driver
[    5.792621] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    5.793061] ohci-platform: OHCI generic platform driver
[    5.793187] ohci-platform 18022000.ohci: Generic Platform OHCI controller
[    5.793207] ohci-platform 18022000.ohci: new USB bus registered, assigned bus number 1
[    5.793301] ohci-platform 18022000.ohci: irq 29, io mem 0x18022000
[    5.837826] ehci-platform 18021000.ehci: new USB bus registered, assigned bus number 2
[    5.845881] ehci-platform 18021000.ehci: irq 29, io mem 0x18021000
[    5.866252] hub 1-0:1.0: USB hub found
[    5.870080] hub 1-0:1.0: 2 ports detected
[    5.870191] ehci-platform 18021000.ehci: USB 2.0 started, EHCI 1.00
[    5.881166] hub 2-0:1.0: USB hub found
[    5.884003] xhci-hcd 18023000.xhci: xHCI Host Controller
[    5.890362] hub 2-0:1.0: 2 ports detected
[    5.894603] xhci-hcd 18023000.xhci: new USB bus registered, assigned bus number 3
[    5.902342] xhci-hcd 18023000.xhci: hcc params 0x02501164 hci version 0x100 quirks 0x02010010
[    5.910919] xhci-hcd 18023000.xhci: irq 30, io mem 0x18023000
[    5.917183] hub 3-0:1.0: USB hub found
[    5.920978] hub 3-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    5.928278] xhci-hcd 18023000.xhci: xHCI Host Controller
[    5.933638] xhci-hcd 18023000.xhci: new USB bus registered, assigned bus number 4
[    5.951782] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[    5.960315] hub 4-0:1.0: USB hub found
[    5.964131] hub 4-0:1.0: 1 port detected
[    5.969433] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.980238] init: - preinit -
[    7.001075] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    7.007011] IPv6: ADDRCONF(NETDEV_UP): eth0.1: link is not ready
[    8.290116] bgmac_bcma bcma0:3 eth0: Link is Up - 1Gbps/Full - flow control off
[    8.297462] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    8.303935] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[    9.128247] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[    9.141467] urandom-seed: Seed file not found (/etc/urandom.seed)
[    9.215056] procd: - early -
[    9.217996] procd: - watchdog -
[    9.781908] procd: - ubus -
[    9.842732] procd: - init -
[    9.951241] kmodloader: loading kernel modules from /etc/modules.d/*
[    9.959647] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    9.969859] Loading modules backported from Linux version wt-2017-01-31-0-ge882dff19e7f
[    9.977912] Backport generated by backports.git backports-20160324-13-g24da7d3c
[    9.986446] ip_tables: (C) 2000-2006 Netfilter Core Team
[    9.994547] nf_conntrack version 0.5.0 (1952 buckets, 7808 max)
[   10.016309] xt_time: kernel timezone is -0000
[   10.029325] PPP generic driver version 2.4.2
[   10.034481] NET: Registered protocol family 24
[   10.042444] usbcore: registered new interface driver brcmfmac
[   10.048269] pci 0000:00:00.0: enabling device (0140 -> 0142)
[   10.053999] pci 0000:01:00.0: enabling device (0140 -> 0142)
[   10.059686] pci 0000:02:01.0: enabling device (0140 -> 0142)
[   10.065388] brcmfmac 0000:03:00.0: enabling device (0140 -> 0142)
[   10.230264] brcmfmac 0000:03:00.0: Direct firmware load for brcm/brcmfmac4366c-pcie.bin failed with error -2
[   15.230149] pci 0000:02:02.0: enabling device (0140 -> 0142)
[   15.235833] brcmfmac 0000:04:00.0: enabling device (0140 -> 0142)
[   15.400183] brcmfmac 0000:04:00.0: Direct firmware load for brcm/brcmfmac4366c-pcie.bin failed with error -2
[   20.400136] pci 0001:00:00.0: enabling device (0140 -> 0142)
[   20.405820] brcmfmac 0001:01:00.0: enabling device (0140 -> 0142)
[   20.570161] brcmfmac 0001:01:00.0: Direct firmware load for brcm/brcmfmac4366c-pcie.bin failed with error -2
[   25.571732] kmodloader: done loading kernel modules from /etc/modules.d/*
[   28.752086] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   28.759044] jffs2_build_filesystem(): unlocking the mtd device... done.
[   28.765777] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   29.121658] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   29.139863] device eth0 entered promiscuous mode
[   29.146073] device eth0.1 entered promiscuous mode
[   29.159108] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   29.181158] IPv6: ADDRCONF(NETDEV_UP): eth0.2: link is not ready
[   29.290147] bgmac_bcma bcma0:3 eth0: Link is Up - 1Gbps/Full - flow control off
[   29.302196] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   29.312150] br-lan: port 1(eth0.1) entered forwarding state
[   29.317809] br-lan: port 1(eth0.1) entered forwarding state
[   29.323559] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.2: link becomes ready
[   29.371350] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   31.310086] br-lan: port 1(eth0.1) entered forwarding state
[   33.763796] done.
[   33.765739] jffs2: notice: (886) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  244.796350] br-lan: port 1(eth0.1) entered disabled state
[  244.804222] device eth0.1 left promiscuous mode
[  244.808895] br-lan: port 1(eth0.1) entered disabled state
[  244.815419] IPv6: ADDRCONF(NETDEV_UP): eth0.1: link is not ready
[  244.887248] device eth0.1 entered promiscuous mode
[  244.894873] br-lan: port 1(eth0.1) entered forwarding state
[  244.900546] br-lan: port 1(eth0.1) entered forwarding state
[  246.901727] br-lan: port 1(eth0.1) entered forwarding state

Written by Vivek Unune

February 15, 2017 at 4:50 pm

Posted in lede, linux, openwrt

Tagged with , , ,

EA9500 CPU Port is 5

leave a comment »

It appears that like Netgear R8000, Linksys EA9500  CPU is connected to CPU port 5. Additionally we have to add VLAN1 changes to accommodate this.

For b53_common.c, at around line 1385 add following:

if (of_machine_is_compatible("linksys,ea9500"))
sw_dev->cpu_port = 5;

Adding changes to Network Config (target/linux/bcm53xx/base_files/02_network):

wan_macaddr="$(nvram get wan_hwaddr)"
case "$board" in
asus,rt-ac87u)
	ifname=eth1
	etXmacaddr=$(nvram get et1macaddr)
	;;
dlink,dir-885l | \
netgear,r7900 | \
netgear,r8000 | \
netgear,r8500 | \
linksys,ea9500)       # add ea9500
	ifname=eth2
	etXmacaddr=$(nvram get et2macaddr)
	;;
*)
	ifname=eth0
	etXmacaddr=$(nvram get et0macaddr)
	;;
esac

# If WAN MAC isn't explicitly set, calculate it using base MAC as reference.
[ -z "$wan_macaddr" -a -n "$etXmacaddr" ] && wan_macaddr=$(macaddr_add "$etXmacaddr" 1)

# Workaround for devices using eth2 connected to (CPU) switch port 8
case "$board" in
dlink,dir-885l | \
netgear,r7900 | \
netgear,r8000 | \
netgear,r8500 | \
linksys,ea9500)       # add ea9500
	ifname=eth0
	ucidef_add_switch "switch0" \
		"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5t@$ifname"

	# These devices should use eth2 so their eth0 interface often has no MAC
	# assigned. Manually assign eth2's MAC to the LAN.
	et2macaddr="$(nvram get et2macaddr)"
	[ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr"
	[ -n "$wan_macaddr" ] && ucidef_set_interface_macaddr "wan" "$wan_macaddr"

	board_config_flush
	exit 0
	;;
esac

Written by Vivek Unune

February 15, 2017 at 3:33 pm

Posted in lede, linux, openwrt

Tagged with , , ,

Extracting firmware brcmfmac4366c-pcie.bin

leave a comment »

1. Extract the dhd.k0 from the trx firmware
2. Find the array object in the dhd.ko that holds the firmware.

For example we know the wireless chip is a 4366c0. Then find all symbols in the .ko using readelf

~$ readelf -s dhd.ko | grep 4366c0
 218: 00198b6c 4 OBJECT GLOBAL DEFAULT 35 active_cons_4366c0
 227: 00198b40 18 OBJECT GLOBAL DEFAULT 35 dlimagever_4366c0
 247: 00198a94 169 OBJECT GLOBAL DEFAULT 35 dlimagename_4366c0
 347: 00198b68 1 OBJECT GLOBAL DEFAULT 35 dlimagetag_4366c0
 478: 00198b54 20 OBJECT GLOBAL DEFAULT 35 dlimagedate_4366c0
 518: 00198b70 <b>0xe3f38</b> OBJECT GLOBAL DEFAULT 35 dlarray_4366c0
 624: 000022e4 4 OBJECT GLOBAL DEFAULT 46 debug_params_4366c0

Note down the size for the array object. Here it is 0xe3f38 hex. Or 933688 bytes in decimal

Now we need to find the beginning offset of the array object in the .ko file. For that we inspect and already available firmware for 4366b. You see the firmware starts with 00 F2 3E B8 04 F2

screenshot-from-2017-02-12-15-39-13

And ends with firmware Id  plus 4 bytes

screenshot-from-2017-02-12-15-41-39

Taking a clue from above. We first try to find 00 F2 3E B8 04 F2 and from that offset extract 933688 bytes as we found out from elfread.

~$ dd if=dhd.ko skip=1906224 ibs=1 count=933688 of=brcmfmac4366c-pcie.bin

Examining the extracted file we can confirm the beginning and end bytes are
00 F2 3E B8 04 F2 and (firmware Id  plus 4 bytes) respectively

Written by Vivek Unune

February 12, 2017 at 8:47 pm

Posted in linux, openwrt

Tagged with , ,

Building Lede Firmware

leave a comment »

Simple DTS:

Basic DTS Linksys EA9500 which has three BCM4366 wireless chipsets. 

---
 arch/arm/boot/dts/Makefile                   |   1 +
 arch/arm/boot/dts/bcm47094-linksys-ea9500.dts | 78 +++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 arch/arm/boot/dts/bcm47094-linksys-ea9500.dts

--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -78,6 +78,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
 	bcm4709-linksys-r8000.dtb \
 	bcm47094-dlink-dir-885l.dtb \
 	bcm47094-netgear-r8500.dtb \
+	bcm47094-linksys-ea9500.dtb \
 	bcm94708.dtb \
 	bcm94709.dtb \
 	bcm953012er.dtb \
--- /dev/null
+++ b/arch/arm/boot/dts/bcm47094-linksys-ea9500.dts
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 Rafał Miłecki <rafal@milecki.pl>
+ *
+ * Licensed under the ISC license.
+ */
+
+/dts-v1/;
+
+#include "bcm4709.dtsi"
+#include "bcm5301x-nand-cs0-bch1.dtsi"
+
+/ {
+	compatible = "linksys,ea9500", "brcm,bcm47094", "brcm,bcm4708";
+	model = "Linksys EA9500";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	memory {
+		reg = <0x00000000 0x08000000>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		usb0 {
+			label = "bcm53xx:white:usb0";
+			gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "default-off";
+		};
+
+		usb1 {
+			label = "bcm53xx:white:usb1";
+			gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "default-off";
+		};
+
+		power0 {
+			label = "bcm53xx:white:power";
+			gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "default-on";
+		};
+
+
+
+		wireless {
+			label = "bcm53xx:white:5ghz-1";
+			gpios = <&chipcommon 22 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "default-off";
+		};
+
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		rfkill {
+			label = "WiFi";
+			linux,code = <KEY_RFKILL>;
+			gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>;
+		};
+
+		wps {
+			label = "WPS";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
+		};
+
+		restart {
+			label = "Reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
+		};
+	};
+};

Adding EA9500 to target/linux/bcm53xx/image/Makefile

define Device/linksys-ea9500
  DEVICE_TITLE := Linksys EA9500
  DEVICE_PACKAGES := $(BRCMFMAC_4366B1) $(USB3_PACKAGES)
  IMAGES := trx
  IMAGE/trx := append-rootfs | trx-serial
endef
TARGET_DEVICES += linksys-ea9500

 

Written by Vivek Unune

February 10, 2017 at 9:58 pm

Posted in lede, linux, openwrt

Tagged with , , , ,

Linksys EA9500 Flash Layout

leave a comment »

From three sources i.e CFE, boot log and Linksys diagnostics obtained from stock firmware it is difficult to clearly guess the partitions in EA9500.

From what we know, the flash is a Toshiba 128MB (TC58BVG0S3HTA00)

CFE log:

CFE> show devices
Device Name          Description
-------------------  ---------------------------------------------------------
uart0                NS16550 UART at 0x18000300
uart1                NS16550 UART at 0x18000400
nflash0              Toshiba NAND flash size 131072KB
nflash0.boot         Toshiba NAND flash offset 0 size 512KB
nflash0.nvram        Toshiba NAND flash offset 80000 size 1024KB
nflash0.devinfo      Toshiba NAND flash offset 180000 size 512KB
nflash0.trx          Toshiba NAND flash offset 200000 size 1KB
nflash0.os           Toshiba NAND flash offset 20001C size 29696KB
nflash0.trx2         Toshiba NAND flash offset 1F00000 size 1KB
nflash0.os2          Toshiba NAND flash offset 1F0001C size 29696KB
nflash1.boot         Toshiba NAND flash offset 0 size 512KB
nflash1.nvram        Toshiba NAND flash offset 80000 size 1024KB
nflash1.devinfo      Toshiba NAND flash offset 180000 size 512KB
nflash1.trx          Toshiba NAND flash offset 200000 size 29696KB
nflash1.trx2         Toshiba NAND flash offset 1F00000 size 29696KB
nflash1.brcmnand     Toshiba NAND flash offset 3C00000 size 69632KB
eth0                 Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller

 

 

Boot Log:

Creating 6 MTD partitions on "nflash":
0x000000000000-0x000000080000 : "boot" 
0x000000080000-0x000000200000 : "nvram" 
0x000000200000-0x000001f00000 : "linux" 
0x00000042db00-0x000001f00000 : "rootfs" 
0x000001f00000-0x000005200000 : "linux2" 
0x00000212dba4-0x000005200000 : "rootfs2"
...
Creating 1 MTD partitions on "brcmnand":
0x000005200000-0x000008000000 : "brcmnand"

 

 

Linksys Diagnostics:

cat /proc/mtd:
 dev:  size     erasesize name
 mtd0: 00080000 00020000  "boot"
 mtd1: 00180000 00020000  "nvram"
 mtd2: 01d00000 00020000  "linux"
 mtd3: 01ad2504 00020000  "rootfs"
 mtd4: 03300000 00020000  "linux2"
 mtd5: 030d245c 00020000  "rootfs2"
 mtd6: 02e00000 00020000  "brcmnand"

 

Visually –

ea9500-partitions-observed

Combining all three sets we can deduce following:

ea9500-partitions

*mtd4, mtd5, mtd6 are safe estimates.

In order to support the layout in OpenWrt or Lede, we have to ensure that the
firmware image is less than 29MB

Written by Vivek Unune

February 6, 2017 at 8:17 pm

Posted in lede, linux, openwrt

Tagged with , , , , , ,

Linksys EA9500 GPIOs

leave a comment »

Function GPIO # Active Low/High
Reset Button 10 Active Low
WPS Button 3 Active Low
WPS LED 22 Active Low
WIFI Button 16 Active Low
WIFI LED 0 Active Low
USB0 LED 1 Active Low
USB1 LED 2 Active Low
LOGO_LED 4 Active High
WHITE_BARS_LED 5 Active High
BLUE_BAR1_LED 12 Active High
BLUE_BAR2_LED 13 Active High
BLUE_BAR3_LED 15 Active High -> Low
BLUE_BAR4_LED 18 Active High
BLUE_BAR5_LED 19 Active High
BLUE_BAR6_LED 20 Active High
BLUE_BAR7_LED* 21 Active High
BLUE_BAR8_LED 8 Active High
USB0Enable 13 Active High
USB0Enable 14 Active High

 

*Next Hardware iteration will use GPIO 23 for BAR7_LED

Written by Vivek Unune

February 2, 2017 at 8:53 pm

Posted in linux, openwrt

Tagged with , , , , ,