OpenWrt Forum Archive

Topic: Netgear DGN1000

The content of this topic has been archived between 24 Apr 2018 and 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

zx82 wrote:

Which zip from Netgear did you use?

I got it from here: http://download2.polytechnic.edu.na/pub … rc.tar.zip

zx82 wrote:

It is fairly impressive that the build is sufficiently self-contained to still work; unfortunately it's probably a kernel from the dark ages with tons of vulnerabilities, and getting OpenWrt userspace working on that doesn't strike me as fun.
Good luck!  Turns out I have both the 16/4 variant and the 32/8 variant here.  Out of curiosity I had a go at booting the generic ASE kernel from Attitude Adjustment (still pretty old, 3.3.8) on the 32/8 variant.  It booted and panicked at the lack of root filesystem; I see no mention of flash probing (NOR, NAND or SPI) in the output, so I suspect the generic kernel might have no support for AmazonSE SPI.  Then I somehow managed to overwrite U-Boot, so called it a day.

I'll see if I can restore U-Boot over serial later, and see whether the SPI support is just a missing config flag, or whether the Danube SPI driver works, or whether the Infineon driver in the 2.x code drop might build in a 3.x kernel.

I feel sorry for your U-Boot accident.

Yes it was straight-forward build for the GPL source, only that I had to use Mint 3.1 for the working version of dev packages until it was all built, then I transfer them all to my latest Linux. Haven't tried tftpd boot of the kernel etc, though. Still struggling with learning openwrt's make-menuconfig entries and also which staging toolchain is used for this device. The processor seems to match AR231x/AR5312 (MIPS 4KEc), am I correct?

# cat cpuinfo
system type             : R0416_BSP_EPHY_SPI_HOST_A4
processor               : 0
cpu model               : MIPS 4KEc V6.12
BogoMIPS                : 266.24
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes
ASEs implemented        : mips16
VCED exceptions         : not available
VCEI exceptions         : not available

Creating 8 MTD partitions on "amazon_se-spi":
0x00000000-0x00020000 : "U-Boot"         -> (mtd0) U-Boot
0x00020000-0x00030000 : "ENV_MAC"        -> (mtd1) U-Boot-data
0x00030000-0x00040000 : "DPF"            -> (mtd2) ? 
0x00040000-0x00050000 : "NVRAM"          -> (mtd3) Atheros art
0x00050000-0x00700000 : "RootFS_DPUMP"  -> (mtd4) rootfs
0x00700000-0x00800000 : "Kernel"        -> (mtd5) kernel
0x00050000-0x00800000 : "ROOTFS_KERNEL"  -> (mtd6) LEVEL 1 of rootfs + kernel
0x00000000-0x00020000 : "POT"            -> (mtd7) U-Boot

Flash: MX25L6445E  http://www.macronix.com/CachePages/en-u … 4MbSerialV
SoC: Lantiq PSB 50601 HL v1.2
RAM: Etrontech EM63A165TS-6G http://www.etron.com/manager/uploads/EM … S_v1.4.pdf


I thought I saw its JTAG pinouts somewhere, I'll post it if I can find it again. Not sure whether it will be significant for an advanced like you, though.
Please inform me how to do serial U-Boot restore, if you succeed. I have another device with overwritten U-Boot, too.

(Last edited by krembuk on 20 May 2016, 08:36)

krembuk wrote:

Still struggling with learning openwrt's make-menuconfig entries and also which staging toolchain is used for this device. The processor seems to match AR231x/AR5312 (MIPS 4KEc), am I correct?

Are you trying to build trunk?  You'll almost certainly need AmazonSE support specifically; you'd be very lucky if another MIPS 4KEc platform worked.  As far as I can tell, OpenWrt dropped what support it had for Amazon-SE after Attitude Adjustment/12.09.  Amazon-SE falls under the XWAY brand, and OpenWrt still has an 'xway' platform, but I don't think the 'xway' platform includes any Amazon-SE support (only Danube and beyond). So for any degree of OpenWrt support on this unit, the options seem to be: 1) build an Attitude Adjustment kernel with missing support enabled/patched back in, and don't use the router for anything important; or 2) forward-port AmazonSE support into a more recent kernel.  I think (1) sounds more realistic.  Amazon isn't that different from Danube, but is probably different enough that you'd need to do some kernel work.  (I could be wrong.)

I'll be taking route 1.  I went on a detour documenting the gory details of UART boot, and satisfying my curiosity about some technical bits of the boot ROM, so I haven't got anywhere yet.

krembuk wrote:
0x00020000-0x00030000 : "ENV_MAC"        -> (mtd1) U-Boot-data

U-Boot environment variables, yes.

krembuk wrote:
0x00030000-0x00040000 : "DPF"            -> (mtd2) ?

Don't know!

krembuk wrote:
0x00040000-0x00050000 : "NVRAM"          -> (mtd3) Atheros art

On stock firmware, the config variables for the userspace firmware live here.  Stock firmware does everything with variables, rather than having config files in an overlay or read/write filesystem.

krembuk wrote:
0x00000000-0x00020000 : "POT"            -> (mtd7) U-Boot

Yeah, I don't know why there's a duplicate mapping for U-Boot, and I've not looked into what "POT" means in Netgear world.

krembuk wrote:

I thought I saw its JTAG pinouts somewhere, I'll post it if I can find it again. Not sure whether it will be significant for an advanced like you, though.

I documented the JTAG pins of the SoC (I have another unit based on the same SoC with a JTAG header), but:

  • Accessing it directly at the chip is tricky; the chip comes in TQFP meaning the soldering required is quite fine-pitch.  It would be easier to access at the pull-up/pull-down resistors on a board like this with no JTAG header.  It looks like the JTAG pins are pulled up/down by R23, R26 (topside) and R36, R24, R25 (underside) but I haven't yet documented which side of which resistor is which JTAG pin (yet).

  • Being able to reach the JTAG pins is not quite the same as being able to use JTAG for recovery.  There needs to be support for the board's flash interface.  I'm not sure that this support exists yet for this chip family.

  • You should hopefully never need it anyway if you have serial access.  Lantiq/Infineon SoCs, including this one, seem to generally support booting over UART.

krembuk wrote:

Please inform me how to do serial U-Boot restore, if you succeed. I have another device with overwritten U-Boot, too.

I haven't got around to it just yet, but I can outline it.  UART (serial) restore is a Lantiq/Infineon feature.  You can reach UART mode by pulling a pin or two at boot; how you do that depends on the exact device (there are no generic instructions!).  On this model I've accidentally forced UART mode by shorting pins 47&48 on the SoC, but that might damage the chip; it would probably be kinder to pull the SPI flash's /HOLD pin low (but I've not tried that yet; mine falls into UART mode anyway, so I may have trashed the signature at the start of flash).  Maybe that would work on other devices too.

Then you need to find or build a U-Boot image (some source is included in the zip), convert it to the format UART mode expects (the zip uses the gct or gct.pl script to do that), and present it to the router (as simple as 'cat' on Linux, or something like "send plain file" in GUIs).  Once U-Boot is running from RAM, you need to use its commands to flash a replacement image.

zx82 wrote:

Are you trying to build trunk?  You'll almost certainly need AmazonSE support specifically; you'd be very lucky if another MIPS 4KEc platform worked.  As far as I can tell, OpenWrt dropped what support it had for Amazon-SE after Attitude Adjustment/12.09.  Amazon-SE falls under the XWAY brand, and OpenWrt still has an 'xway' platform, but I don't think the 'xway' platform includes any Amazon-SE support (only Danube and beyond). So for any degree of OpenWrt support on this unit, the options seem to be: 1) build an Attitude Adjustment kernel with missing support enabled/patched back in, and don't use the router for anything important; or 2) forward-port AmazonSE support into a more recent kernel.  I think (1) sounds more realistic.  Amazon isn't that different from Danube, but is probably different enough that you'd need to do some kernel work.  (I could be wrong.)

I'll be taking route 1.  I went on a detour documenting the gory details of UART boot, and satisfying my curiosity about some technical bits of the boot ROM, so I haven't got anywhere yet.

You just saved me from useless tinkering!
I'm still learning about kernel coding, cross compiling, so let alone talking about me getting anywhere. I'm still struggling in the basement, filling up my suitcase. smile

Will revert to Attitude Adjustment, then.

zx82 wrote:
krembuk wrote:
0x00030000-0x00040000 : "DPF"            -> (mtd2) ?

Don't know!

D'oh.  DPF = Device Provisioning File and is just a gzipped XML file full of factory reset settings.  Kill it with fire.

I restored my corrupted unit via UART mode, so we know that can be done; somewhat easier than wiring/soldering to write the SPI flash from another machine.  Forcing UART mode on an otherwise working unit by pulling down /HOLD didn't work for me though; I had to pull DI or DO low, or any CPU SPI signal high (use a suitable resistor, or risk damage).  You can make an image from the u-boot.ifx in the source dump:

objcopy --adjust-vma=0xa0010000 -I binary -O srec bootloader_src/spi-uboot/tools/u-boot.ifx u-boot.srec

and then convert it using gct.pl, supplying a slightly fudged bootloader_src/spi-uboot/tools/
amse_uboot.conf
from the dump to prepend the RAM init.

It crossed my mind that a more fully-featured/modern U-Boot might be nice, but there's no U-Boot support for AmazonSE in the u-boot-lantiq nor official U-Boot repositories (only in the Netgear source dumps).  There is support for Danube in u-boot-lantiq and OpenWrt's patches but I think all the supported models are either chainloaded from brnboot or running from NOR flash, so support for reading from serial flash in Amazon would have to be added, along with some voodoo for setting up the low-level peripherals that differ from Danube.  Probably not too hard if you're desperate for a fuller U-Boot, but I'd be pretty surprised if changes ever got accepted upstream.

I had a bit of a dig through the history of AmazonSE under OpenWrt.  Seems like a few factors undermined support.  Not enough docs.  Not a very popular chipset (not many models, mostly low-end).  And timing; the Attitude Adjustment feature freeze happened, and people are always less eager to run trunk.  The generic AA image doesn't seem to have working serial flash support.  After AA this model did see specific support added, and I think general serial flash support appeared for Lantiq/XWAY.  In theory the foundations are all still there in the kernel; code was written to support Amazon and work was done to merge Amazon and Danube into one XWAY platform, but I suspect this merge may have broken Amazon devices because nobody was testing on them.  And then I think because there were no users, build support for this model disappeared from the tree again before Barrier Breaker froze.

So I'm building a kernel from a point somewhere between AA and BB (maybe I should call it "Attitude Breaker"), and hoping that point falls after Amazon support stabilised but before the potentially cruel XWAY merge.  Tweaked the DTS slightly to reflect the larger flash and the death of DPF.  We'll see.

zx82 wrote:

We'll see.

Didn't work.  It hangs, probably in the SPI driver given that the last message comes from there:

[    0.288000] spi-xway 1e100800.spi: master is unqueued, this is deprecated

This problem has been seen before.  It's odd, because the driver was apparently first tested on Amazon-SE.  It has not been without its problems, though, and trunk has a newer, rewritten driver.

So maybe I spoke too soon about trunk being a bad idea; maybe resurrecting the AmazonSE build on trunk holds more promise than trying to fix the SPI driver in AA.  I'll give it a whirl.

(Last edited by zx82 on 21 May 2016, 01:14)

I just downloaded the Attitude Adjustment Amazon SE generic kernel uImage, did the tftpboot, and here it is:

AMAZON_SE # tftpboot
Using AMAZON_SE Switch device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'uImage'.
Load address: 0x80100000
Loading: #################################################################
         #################################################################
         ############################################################
done
Bytes transferred = 972193 (ed5a1 hex)
AMAZON_SE # bootm
## Booting image at 80100000 ...
   Image Name:   MIPS OpenWrt Linux-3.3.8
   Created:      2013-03-23  13:11:17 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    972129 Bytes = 949.3 kB
   Load Address: 80002000
   Entry Point:  80002000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... ERROR: LzmaDecode.c, 561

Decoding error = 1
LZMA ERROR 1 - must RESET board to recover

the device did not stuck and requested hard power off, but seems to continue with normal boot from flash, afterward, with the following messages right after the one I posted above:

ROM VER: 1.2.0
CFG 04
EEPROM Data OK


U-Boot 1.1.5-2.2 (Mar 19 2011 - 00:58:03)

DRAM:  32 MB

 relocate_code start
 relocate_code finish.
Now running in RAM - U-Boot at: 81fc0000
Flash:  8 MB
using default environment

In:    serial
Out:   serial
Err:   serial
Net:   External Clock
Selected EPHY_MODE
AMAZON_SE Switch
mac = 00:8e:f2:7f:45:a6
AMAZON_SE_GPIO_P0_IN = 0xa9ff..
AMAZON_SE_GPIO_P1_IN = 0x2b08..

Type "run flash_nfs" to mount root filesystem over NFS

Input Ctrl-c to stop autoboot:  0
Check FW intergality...OK
Ethernet Init Done!
No NMRP Server found
De-init Ethernet..Done!bootloader verion = 1.09
## Booting image at 00700000 ...
   Image Name:   MIPS Linux-2.6.20
   Created:      2012-03-05   4:37:24 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    874532 Bytes = 854 kB
   Load Address: 80002000
   Entry Point:  802a2000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.20-Amazon_SE
 (root@localhost.localdomain) (gcc version 3.4.4 20050119 (MIPS SDE)) #51 Mon Mar 5 12:37:17 CST 2012
Current Model:R0416_BSP_EPHY_SPI_HOST_A4
This model supports only basic BSP feature on Amazon SE Small board with SPI flash USB host and PPE A4 firmware
CPU revision is: 0001906c
Determined physical RAM map:
User-defined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Built 1 zonelists.  Total pages: 8128
Kernel command line: root=/dev/mtdblock4 ip=192.168.1.1:192.168.1.2::::eth0:on console=ttyS0,115200 ethaddr=00:8e:f2:7f:45:a6 mem=32M panic=1
Primary instruction cache 8kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
PID hash table entries: 128 (order: 7, 512 bytes)
mips_hpt_frequency:133333333
r4k_offset: 00145855(1333333)
Using 133.333 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29520k/32768k available (2267k kernel code, 3248k reserved, 418k data, 132k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 8
NET: Registered protocol family 20
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
amazon_se_dma_init
dma_chip_init
gptu: totally 6 16-bit timers/counters
gptu: misc_register on minor 63
gptu: succeeded to request irq 25 for timer[0]
gptu: succeeded to request irq 26 for timer[1]
gptu: succeeded to request irq 27 for timer[2]
gptu: succeeded to request irq 28 for timer[3]
gptu: succeeded to request irq 29 for timer[4]
gptu: succeeded to request irq 30 for timer[5]
squashfs: version 3.2-r2 (2007/01/15) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
fuse init (API version 7.8)
io scheduler noop registered (default)
Infineon Technologies port driver version 1.0.2
cgu: misc_register on minor = 62
led: misc_register on minor = 151
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
Unknown module try to reserve GPIO
Unknown module try to reserve GPIO
Infineon Technologies Synchronous Serial Controller (SSC) driver version 0.2.1
IFX MEI Version 4.00.01

Infineon CPE API Driver version: DSL CPE API V3.20.5.1

DSL_DRV: using proc fs
ttyS0 at MMIO 0xbe100c00 (irq = 2) is a IFX_ASC
PPP generic driver version 2.4.2
NET: Registered protocol family 24
IMQ starting with 2 devices...
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
Loading A4 (ATM+MII0) driver ...... Force to 100MB Duplex
Succeeded!
PPE datapath driver info:
  Version ID: 8.3.5.1.0.0.1
  Family    : Amazon-SE
  DR Type   : Normal Data Path | Indirect-Fast Path
  Interface : MII0 | ATM
  Mode      : Routing
  Release   : 0.0.1
PPE firmware info:
  Version ID: 3.1.2.6.1.6
  Family    : Amazon-SE
  FW Type   : Standard
  Interface : MII0 + ATM
  Mode      : Bridging + IPv4 Routing
  Release   : 1.6
PPA API --- init successfully
Infineon Technologies Synchronous SPI flash driver version 0.0.1
MTD driver for SPI flash.
Probing for Serial flash ...
Update rx_eff_size to 4
 <5>Creating 8 MTD partitions on "amazon_se-spi":
0x00000000-0x00020000 : "U-Boot"
0x00020000-0x00030000 : "ENV_MAC"
0x00030000-0x00040000 : "DPF"
0x00040000-0x00050000 : "NVRAM"
0x00050000-0x00700000 : "RootFS_DPUMP"
0x00700000-0x00800000 : "Kernel"
0x00050000-0x00800000 : "ROOTFS_KERNEL"
0x00000000-0x00020000 : "POT"
Update rx_eff_size to 4096
 <6>dwc_otg: version 2.2-RC3
dwc_otg dwc_otg: DWC OTG Controller
dwc_otg dwc_otg: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg: irq 31, io mem 0x00000000
DWC_otg: Init: Power Port (0)
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
nf_conntrack version 0.5.0 (256 buckets, 2048 max)
nf_ct_ftp: registering helper for pf: 2 port: 21
nf_ct_ftp: registering helper for pf: 10 port: 21
GRE over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: configuration #1 chosen from 1 choice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
atmpvc_init() failed with -17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Time: MIPS clocksource has been installed.
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 132k freed
init started: BusyBox v1.13.1 (2012-03-01 17:48:55 CST
starting pid 14, tty '': '/usr/etc/rcS
Algorithmics/MIPS FPU Emulator v1.5
netfilter PSD loaded - (c) astaro AG
ipt_http_string: module license 'SERCOMM' taints kernel.
init:866
cat: can't open '/tmp/etc/block.htm': No such file or directory
insmod: cannot insert '/lib/modules/igmp_snooping.ko': unknown symbol in module, or unknown parameter
device eth0 entered promiscuous mode
br0: port 1(eth0) entering learning state
userspace registering PID
cat: can't open '/proc/nvram/BaseMacAddr': No such file or directory
ap_name=(null) action=start
/bin/echo GMT+0 > /etc/TZ
killall: udhcpd: no process killed
iptables: No chain/target/match by that name
killall: miniupnpd: no process killed
killall: dnrd: no process killed
Notice: caching turned off
Warning: Using /etc/hosts will be removed in a future version. Please use only the /etc/dnrd/master file or use -m off.
dnrd -a 192.168.0.1 -m hosts -c off --timeout=0 -b  -s 1.1.1.1
Do not need swap cal data
VAP-Name -- ath0
BGSCAN --   0
Fast-Frame-Txq-Min -- 1000
SHORT GI --   1
CWM MODE --   1
CWM EXTOFFSET --   1
CWM EXTPROTSPACING --   0
AMPDU --   1
TX CHAIN MASK --   1
RX CHAIN MASK --   1
HIDESSID --   0
APBRIDGE --   1
Frequency -- 0.0
SSID -- virginmedia0265831
COUNTRY CODE --   0x114
WDS --   0
MACCMD --   0
DOTH --   0
COUNTRY IE --   1

Please press Enter to activate this console. ff
WaitForConfiguration
100
WaitForLinkActivate
200
0
WaitForConfiguration
100
WaitForLinkActivate
200

oh, wait. Is it because of the load addresss? I just realized that they are different after posting them above, just now.

It is annoying that my Windows 7 does not seem to pass tftp request to my tftp server although I turned off the firewall, and I had to bring another computer with WinXP. Will try again, later.

zx82 wrote:

I had a bit of a dig through the history of AmazonSE under OpenWrt.  Seems like a few factors undermined support.  Not enough docs.  Not a very popular chipset (not many models, mostly low-end).  And timing; the Attitude Adjustment feature freeze happened, and people are always less eager to run trunk.  The generic AA image doesn't seem to have working serial flash support.  After AA this model did see specific support added, and I think general serial flash support appeared for Lantiq/XWAY.  In theory the foundations are all still there in the kernel; code was written to support Amazon and work was done to merge Amazon and Danube into one XWAY platform, but I suspect this merge may have broken Amazon devices because nobody was testing on them.  And then I think because there were no users, build support for this model disappeared from the tree again before Barrier Breaker froze.

So I'm building a kernel from a point somewhere between AA and BB (maybe I should call it "Attitude Breaker"), and hoping that point falls after Amazon support stabilised but before the potentially cruel XWAY merge.  Tweaked the DTS slightly to reflect the larger flash and the death of DPF.  We'll see.

I'm starting to think about dirty porting everything from Openwrt AA into the cleanly-compiled, provided source code of the DGN1000SP. But, I also have not tested the compiled firmware. As I've mentioned, I still have to fight this Windows 7's tftp issue, too.

krembuk wrote:

I just downloaded the Attitude Adjustment Amazon SE generic kernel uImage, did the tftpboot, and here it is: ...

...
Decoding error = 1
LZMA ERROR 1 - must RESET board to recover
...
   Image Name:   MIPS Linux-2.6.20

So it tried to boot a kernel TFTPd into memory, had a problem, reset and booted into the default kernel in flash.

I can't explain why you got a decoding error; I've booted the very same kernel and as I've said, on mine it gets as far as the panic (no serial flash, so no root fs).  Given that the checksum passes, I'd say 1) try again just in case it was a glitch; 2) there's the slim possibility it's U-Boot disagreeing with the LZMA; I have a different U-Boot build (you have 1.1.5-2.2 Mar 19 2011 - 00:58:03, I have 1.1.5-2.2 Dec  3 2009 - 16:57:11).

krembuk wrote:

I'm starting to think about dirty porting everything from Openwrt AA into the cleanly-compiled, provided source code of the DGN1000SP.

You'd be stuck on an ancient kernel forever, and you'd probably never get to use any kernel modules from OpenWrt, but I guess that's not a million miles away from how things would be if we had AA working.

zx82 wrote:

I'll give [trunk] a whirl.

My trunk build hangs even earlier than my AB build, this time after:

[    0.000000] Linux version 4.4.7 (me@mine) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 r49377) ) #3 Sat May 21 08:14:16 UTC 2016
[    0.000000] SoC: Amazon_SE rev 1.3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001906c (MIPS 4KEc)
[    0.000000] MIPS: machine is DGN1000B - Netgear DGN1000B
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 00485000 @ 00002000 (usable)
[    0.000000]  memory: 00129000 @ 00487000 (usable after init)
[    0.000000] Wasting 64 bytes for tracking 2 unused pages

So indeed I suspect the merged xway code hasn't been tested on AmazonSE.  That RAM map looks screwy.

I think I experienced what you got earlier. This time it works when I changed the load address:

ROM VER: 1.2.0
CFG 04
EEPROM Data OK


U-Boot 1.1.5-2.2 (Mar 19 2011 - 00:58:03)

DRAM:  32 MB

 relocate_code start
 relocate_code finish.
Now running in RAM - U-Boot at: 81fc0000
Flash:  8 MB
using default environment

In:    serial
Out:   serial
Err:   serial
Net:   External Clock
Selected EPHY_MODE
AMAZON_SE Switch
mac = 00:8e:f2:7f:45:a6
AMAZON_SE_GPIO_P0_IN = 0xa9ff..
AMAZON_SE_GPIO_P1_IN = 0x2b08..

Type "run flash_nfs" to mount root filesystem over NFS

Input Ctrl-c to stop autoboot:  0
AMAZON_SE # tftpboot 0x00700000 uImage
Using AMAZON_SE Switch device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'uImage'.
Load address: 0x700000
Loading: checksum bad
checksum bad
#################################################################
         #################################################################
         ############################################################
done
Bytes transferred = 972193 (ed5a1 hex)
AMAZON_SE # bootm 0x00700000
## Booting image at 00700000 ...
   Image Name:   MIPS Linux-2.6.20
   Created:      2012-03-05   4:37:24 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    874532 Bytes = 854 kB
   Load Address: 80002000
   Entry Point:  802a2000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.20-Amazon_SE
 (root@localhost.localdomain) (gcc version 3.4.4 20050119 (MIPS SDE)) #51 Mon Mar 5 12:37:17 CST 2012
Current Model:R0416_BSP_EPHY_SPI_HOST_A4
This model supports only basic BSP feature on Amazon SE Small board with SPI flash USB host and PPE A4 firmware
CPU revision is: 0001906c
Determined physical RAM map:
User-defined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Built 1 zonelists.  Total pages: 8128
Kernel command line:  mem=32M
Primary instruction cache 8kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
PID hash table entries: 128 (order: 7, 512 bytes)
mips_hpt_frequency:133333333
r4k_offset: 00145855(1333333)
Using 133.333 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29520k/32768k available (2267k kernel code, 3248k reserved, 418k data, 132k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 8
NET: Registered protocol family 20
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
amazon_se_dma_init
dma_chip_init
gptu: totally 6 16-bit timers/counters
gptu: misc_register on minor 63
gptu: succeeded to request irq 25 for timer[0]
gptu: succeeded to request irq 26 for timer[1]
gptu: succeeded to request irq 27 for timer[2]
gptu: succeeded to request irq 28 for timer[3]
gptu: succeeded to request irq 29 for timer[4]
gptu: succeeded to request irq 30 for timer[5]
squashfs: version 3.2-r2 (2007/01/15) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
fuse init (API version 7.8)
io scheduler noop registered (default)
Infineon Technologies port driver version 1.0.2
cgu: misc_register on minor = 62
led: misc_register on minor = 151
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
Unknown module try to reserve GPIO
Unknown module try to reserve GPIO
Infineon Technologies Synchronous Serial Controller (SSC) driver version 0.2.1
IFX MEI Version 4.00.01

Infineon CPE API Driver version: DSL CPE API V3.20.5.1

DSL_DRV: using proc fs
ttyS0 at MMIO 0xbe100c00 (irq = 2) is a IFX_ASC
PPP generic driver version 2.4.2
NET: Registered protocol family 24
IMQ starting with 2 devices...
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
Loading A4 (ATM+MII0) driver ...... Force to 100MB Duplex
Succeeded!
PPE datapath driver info:
  Version ID: 8.3.5.1.0.0.1
  Family    : Amazon-SE
  DR Type   : Normal Data Path | Indirect-Fast Path
  Interface : MII0 | ATM
  Mode      : Routing
  Release   : 0.0.1
PPE firmware info:
  Version ID: 3.1.2.6.1.6
  Family    : Amazon-SE
  FW Type   : Standard
  Interface : MII0 + ATM
  Mode      : Bridging + IPv4 Routing
  Release   : 1.6
PPA API --- init successfully
Infineon Technologies Synchronous SPI flash driver version 0.0.1
MTD driver for SPI flash.
Probing for Serial flash ...
Update rx_eff_size to 4
 <5>Creating 8 MTD partitions on "amazon_se-spi":
0x00000000-0x00020000 : "U-Boot"
0x00020000-0x00030000 : "ENV_MAC"
0x00030000-0x00040000 : "DPF"
0x00040000-0x00050000 : "NVRAM"
0x00050000-0x00700000 : "RootFS_DPUMP"
0x00700000-0x00800000 : "Kernel"
0x00050000-0x00800000 : "ROOTFS_KERNEL"
0x00000000-0x00020000 : "POT"
Update rx_eff_size to 4096
 <6>dwc_otg: version 2.2-RC3
dwc_otg dwc_otg: DWC OTG Controller
dwc_otg dwc_otg: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg: irq 31, io mem 0x00000000
DWC_otg: Init: Power Port (0)
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
nf_conntrack version 0.5.0 (256 buckets, 2048 max)
nf_ct_ftp: registering helper for pf: 2 port: 21
nf_ct_ftp: registering helper for pf: 10 port: 21
GRE over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: configuration #1 chosen from 1 choice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
atmpvc_init() failed with -17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Cannot open root device "<NULL>" or unknown-block(0,0)
Please append a correct "root=" boot option
Time: MIPS clocksource has been installed.
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Will try with my GPL compiled kernel, later

(Last edited by krembuk on 21 May 2016, 10:52)

My compiled kernel is giving exactly the same message as above. I'm confused.

BTW, when I tried to go into pressing Ctrl-C quickly after turning on the power, I once got:

ROM VER: 1.2.0
CFG 04
UART

instead of

ROM VER: 1.2.0
CFG 04
EEPROM Data OK

(Last edited by krembuk on 21 May 2016, 11:40)

Booted the openwrt uImage, after specifying

AMAZON_SE # run flashargs

which

flashargs=setenv bootargs root=/dev/mtdblock4

With message of kernel build seems exactly the same as the original (build time, etc). I'm confused.

AMAZON_SE # tftpboot 0x00700000 uImage
Using AMAZON_SE Switch device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'uImage'.
Load address: 0x700000
Loading: checksum bad
checksum bad
#################################################################
         #################################################################
         ############################################################
done
Bytes transferred = 972193 (ed5a1 hex)
AMAZON_SE # tftpboot 0x00700000 uImage
Using AMAZON_SE Switch device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'uImage'.
Load address: 0x700000
Loading: #################################################################
         #################################################################
         ############################################################
done
Bytes transferred = 972193 (ed5a1 hex)
AMAZON_SE # run flashargs
AMAZON_SE # bootm 0x00700000
## Booting image at 00700000 ...
   Image Name:   MIPS Linux-2.6.20
   Created:      2012-03-05   4:37:24 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    874532 Bytes = 854 kB
   Load Address: 80002000
   Entry Point:  802a2000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.20-Amazon_SE
 (root@localhost.localdomain) (gcc version 3.4.4 20050119 (MIPS SDE)) #51 Mon Mar 5 12:37:17 CST 2012
Current Model:R0416_BSP_EPHY_SPI_HOST_A4
This model supports only basic BSP feature on Amazon SE Small board with SPI flash USB host and PPE A4 firmware
CPU revision is: 0001906c
Determined physical RAM map:
User-defined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Built 1 zonelists.  Total pages: 8128
Kernel command line: root=/dev/mtdblock4  mem=32M
Primary instruction cache 8kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
PID hash table entries: 128 (order: 7, 512 bytes)
mips_hpt_frequency:133333333
r4k_offset: 00145855(1333333)
Using 133.333 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29520k/32768k available (2267k kernel code, 3248k reserved, 418k data, 132k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 8
NET: Registered protocol family 20
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
amazon_se_dma_init
dma_chip_init
gptu: totally 6 16-bit timers/counters
gptu: misc_register on minor 63
gptu: succeeded to request irq 25 for timer[0]
gptu: succeeded to request irq 26 for timer[1]
gptu: succeeded to request irq 27 for timer[2]
gptu: succeeded to request irq 28 for timer[3]
gptu: succeeded to request irq 29 for timer[4]
gptu: succeeded to request irq 30 for timer[5]
squashfs: version 3.2-r2 (2007/01/15) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
fuse init (API version 7.8)
io scheduler noop registered (default)
Infineon Technologies port driver version 1.0.2
cgu: misc_register on minor = 62
led: misc_register on minor = 151
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
Unknown module try to reserve GPIO
Unknown module try to reserve GPIO
Infineon Technologies Synchronous Serial Controller (SSC) driver version 0.2.1
IFX MEI Version 4.00.01

Infineon CPE API Driver version: DSL CPE API V3.20.5.1

DSL_DRV: using proc fs
ttyS0 at MMIO 0xbe100c00 (irq = 2) is a IFX_ASC
PPP generic driver version 2.4.2
NET: Registered protocol family 24
IMQ starting with 2 devices...
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
Loading A4 (ATM+MII0) driver ...... Force to 100MB Duplex
Succeeded!
PPE datapath driver info:
  Version ID: 8.3.5.1.0.0.1
  Family    : Amazon-SE
  DR Type   : Normal Data Path | Indirect-Fast Path
  Interface : MII0 | ATM
  Mode      : Routing
  Release   : 0.0.1
PPE firmware info:
  Version ID: 3.1.2.6.1.6
  Family    : Amazon-SE
  FW Type   : Standard
  Interface : MII0 + ATM
  Mode      : Bridging + IPv4 Routing
  Release   : 1.6
PPA API --- init successfully
Infineon Technologies Synchronous SPI flash driver version 0.0.1
MTD driver for SPI flash.
Probing for Serial flash ...
Update rx_eff_size to 4
 <5>Creating 8 MTD partitions on "amazon_se-spi":
0x00000000-0x00020000 : "U-Boot"
0x00020000-0x00030000 : "ENV_MAC"
0x00030000-0x00040000 : "DPF"
0x00040000-0x00050000 : "NVRAM"
0x00050000-0x00700000 : "RootFS_DPUMP"
0x00700000-0x00800000 : "Kernel"
0x00050000-0x00800000 : "ROOTFS_KERNEL"
0x00000000-0x00020000 : "POT"
Update rx_eff_size to 4096
 <6>dwc_otg: version 2.2-RC3
dwc_otg dwc_otg: DWC OTG Controller
dwc_otg dwc_otg: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg: irq 31, io mem 0x00000000
DWC_otg: Init: Power Port (0)
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
nf_conntrack version 0.5.0 (256 buckets, 2048 max)
nf_ct_ftp: registering helper for pf: 2 port: 21
nf_ct_ftp: registering helper for pf: 10 port: 21
GRE over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: configuration #1 chosen from 1 choice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
atmpvc_init() failed with -17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Time: MIPS clocksource has been installed.
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 132k freed
init started: BusyBox v1.13.1 (2012-03-01 17:48:55 CST
starting pid 14, tty '': '/usr/etc/rcS
Algorithmics/MIPS FPU Emulator v1.5
netfilter PSD loaded - (c) astaro AG
ipt_http_string: module license 'SERCOMM' taints kernel.
init:866
cat: can't open '/tmp/etc/block.htm': No such file or directory
insmod: cannot insert '/lib/modules/igmp_snooping.ko': unknown symbol in module, or unknown parameter
device eth0 entered promiscuous mode
br0: port 1(eth0) entering learning state
userspace registering PID
cat: can't open '/proc/nvram/BaseMacAddr': No such file or directory
ap_name=(null) action=start
/bin/echo GMT+0 > /etc/TZ
killall: udhcpd: no process killed
iptables: No chain/target/match by that name
killall: miniupnpd: no process killed
killall: dnrd: no process killed
Notice: caching turned off
Warning: Using /etc/hosts will be removed in a future version. Please use only the /etc/dnrd/master file or use -m off.
dnrd -a 192.168.0.1 -m hosts -c off --timeout=0 -b  -s 1.1.1.1
Do not need swap cal data
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
interface ath0 does not exist!
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
ff
WaitForConfiguration
100

Please press Enter to activate this console. WaitForLinkActivate

Here is the original boot message from factory flash firmware

ROM VER: 1.2.0
CFG 04
EEPROM Data OK


U-Boot 1.1.5-2.2 (Mar 19 2011 - 00:58:03)

DRAM:  32 MB

 relocate_code start
 relocate_code finish.
Now running in RAM - U-Boot at: 81fc0000
Flash:  8 MB
using default environment

In:    serial
Out:   serial
Err:   serial
Net:   External Clock
Selected EPHY_MODE
AMAZON_SE Switch
mac = 00:8e:f2:7f:45:a6
AMAZON_SE_GPIO_P0_IN = 0xa9ff..
AMAZON_SE_GPIO_P1_IN = 0x2b08..

Type "run flash_nfs" to mount root filesystem over NFS

Input Ctrl-c to stop autoboot:  0
Check FW intergality...OK
Ethernet Init Done!
SC: RX pkt len:148
SC: RX pkt len:60
SC: RX pkt len:86
SC: RX pkt len:90
SC: RX pkt len:60
SC: RX pkt len:90
SC: RX pkt len:60
SC: RX pkt len:1036
SC: RX pkt len:1056
SC: RX pkt len:86
SC: RX pkt len:66
SC: RX pkt len:1056
SC: RX pkt len:1036
SC: RX pkt len:62
SC: RX pkt len:110
SC: RX pkt len:698
SC: RX pkt len:718
SC: RX pkt len:698
SC: RX pkt len:718
SC: RX pkt len:60
SC: RX pkt len:86
SC: RX pkt len:66
SC: RX pkt len:148
SC: RX pkt len:175
SC: RX pkt len:60
No NMRP Server found
De-init Ethernet..Done!bootloader verion = 1.09
## Booting image at 00700000 ...
   Image Name:   MIPS Linux-2.6.20
   Created:      2012-03-05   4:37:24 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    874532 Bytes = 854 kB
   Load Address: 80002000
   Entry Point:  802a2000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.20-Amazon_SE
 (root@localhost.localdomain) (gcc version 3.4.4 20050119 (MIPS SDE)) #51 Mon Mar 5 12:37:17 CST 2012
Current Model:R0416_BSP_EPHY_SPI_HOST_A4
This model supports only basic BSP feature on Amazon SE Small board with SPI flash USB host and PPE A4 firmware
CPU revision is: 0001906c
Determined physical RAM map:
User-defined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Built 1 zonelists.  Total pages: 8128
Kernel command line: root=/dev/mtdblock4 ip=192.168.1.1:192.168.1.2::::eth0:on console=ttyS0,115200 ethaddr=00:8e:f2:7f:45:a6 mem=32M panic=1
Primary instruction cache 8kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
PID hash table entries: 128 (order: 7, 512 bytes)
mips_hpt_frequency:133333333
r4k_offset: 00145855(1333333)
Using 133.333 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29520k/32768k available (2267k kernel code, 3248k reserved, 418k data, 132k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 8
NET: Registered protocol family 20
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
amazon_se_dma_init
dma_chip_init
gptu: totally 6 16-bit timers/counters
gptu: misc_register on minor 63
gptu: succeeded to request irq 25 for timer[0]
gptu: succeeded to request irq 26 for timer[1]
gptu: succeeded to request irq 27 for timer[2]
gptu: succeeded to request irq 28 for timer[3]
gptu: succeeded to request irq 29 for timer[4]
gptu: succeeded to request irq 30 for timer[5]
squashfs: version 3.2-r2 (2007/01/15) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
fuse init (API version 7.8)
io scheduler noop registered (default)
Infineon Technologies port driver version 1.0.2
cgu: misc_register on minor = 62
led: misc_register on minor = 151
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
Unknown module try to reserve GPIO
Unknown module try to reserve GPIO
Infineon Technologies Synchronous Serial Controller (SSC) driver version 0.2.1
IFX MEI Version 4.00.01

Infineon CPE API Driver version: DSL CPE API V3.20.5.1

DSL_DRV: using proc fs
ttyS0 at MMIO 0xbe100c00 (irq = 2) is a IFX_ASC
PPP generic driver version 2.4.2
NET: Registered protocol family 24
IMQ starting with 2 devices...
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
Loading A4 (ATM+MII0) driver ...... Force to 100MB Duplex
Succeeded!
PPE datapath driver info:
  Version ID: 8.3.5.1.0.0.1
  Family    : Amazon-SE
  DR Type   : Normal Data Path | Indirect-Fast Path
  Interface : MII0 | ATM
  Mode      : Routing
  Release   : 0.0.1
PPE firmware info:
  Version ID: 3.1.2.6.1.6
  Family    : Amazon-SE
  FW Type   : Standard
  Interface : MII0 + ATM
  Mode      : Bridging + IPv4 Routing
  Release   : 1.6
PPA API --- init successfully
Infineon Technologies Synchronous SPI flash driver version 0.0.1
MTD driver for SPI flash.
Probing for Serial flash ...
Update rx_eff_size to 4
 <5>Creating 8 MTD partitions on "amazon_se-spi":
0x00000000-0x00020000 : "U-Boot"
0x00020000-0x00030000 : "ENV_MAC"
0x00030000-0x00040000 : "DPF"
0x00040000-0x00050000 : "NVRAM"
0x00050000-0x00700000 : "RootFS_DPUMP"
0x00700000-0x00800000 : "Kernel"
0x00050000-0x00800000 : "ROOTFS_KERNEL"
0x00000000-0x00020000 : "POT"
Update rx_eff_size to 4096
 <6>dwc_otg: version 2.2-RC3
dwc_otg dwc_otg: DWC OTG Controller
dwc_otg dwc_otg: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg: irq 31, io mem 0x00000000
DWC_otg: Init: Power Port (0)
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
nf_conntrack version 0.5.0 (256 buckets, 2048 max)
nf_ct_ftp: registering helper for pf: 2 port: 21
nf_ct_ftp: registering helper for pf: 10 port: 21
GRE over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: configuration #1 chosen from 1 choice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
atmpvc_init() failed with -17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Time: MIPS clocksource has been installed.
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 132k freed
init started: BusyBox v1.13.1 (2012-03-01 17:48:55 CST
starting pid 14, tty '': '/usr/etc/rcS
Algorithmics/MIPS FPU Emulator v1.5
netfilter PSD loaded - (c) astaro AG
ipt_http_string: module license 'SERCOMM' taints kernel.
init:866
cat: can't open '/tmp/etc/block.htm': No such file or directory
insmod: cannot insert '/lib/modules/igmp_snooping.ko': unknown symbol in module, or unknown parameter
device eth0 entered promiscuous mode
br0: port 1(eth0) entering learning state
userspace registering PID
cat: can't open '/proc/nvram/BaseMacAddr': No such file or directory
ap_name=(null) action=start
/bin/echo GMT+0 > /etc/TZ
killall: udhcpd: no process killed
iptables: No chain/target/match by that name
killall: miniupnpd: no process killed
killall: dnrd: no process killed
Notice: caching turned off
Warning: Using /etc/hosts will be removed in a future version. Please use only the /etc/dnrd/master file or use -m off.
dnrd -a 192.168.0.1 -m hosts -c off --timeout=0 -b  -s 1.1.1.1
Do not need swap cal data
VAP-Name -- ath0
BGSCAN --   0
Fast-Frame-Txq-Min -- 1000
SHORT GI --   1
CWM MODE --   1
CWM EXTOFFSET --   1
CWM EXTPROTSPACING --   0
AMPDU --   1
TX CHAIN MASK --   1
RX CHAIN MASK --   1
HIDESSID --   0
APBRIDGE --   1
Frequency -- 0.0
SSID -- virginmedia0265831
COUNTRY CODE --   0x114
WDS --   0
MACCMD --   0
DOTH --   0
COUNTRY IE --   1

Please press Enter to activate this console. ff

The difference is right at the end of boot message

My manual tftpboot + bootm resulted in:

cat: can't open '/proc/nvram/BaseMacAddr': No such file or directory
ap_name=(null) action=start
/bin/echo GMT+0 > /etc/TZ
killall: udhcpd: no process killed
iptables: No chain/target/match by that name
killall: miniupnpd: no process killed
killall: dnrd: no process killed
Notice: caching turned off
Warning: Using /etc/hosts will be removed in a future version. Please use only the /etc/dnrd/master file or use -m off.
dnrd -a 192.168.0.1 -m hosts -c off --timeout=0 -b  -s 1.1.1.1
Do not need swap cal data
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
interface ath0 does not exist!
Error doing ioctl(): Unknown error -1
Error doing ioctl(): Unknown error -1
ff
WaitForConfiguration
100

Please press Enter to activate this console. WaitForLinkActivate

while normal boot without interruption ends with:

cat: can't open '/proc/nvram/BaseMacAddr': No such file or directory
ap_name=(null) action=start
/bin/echo GMT+0 > /etc/TZ
killall: udhcpd: no process killed
iptables: No chain/target/match by that name
killall: miniupnpd: no process killed
killall: dnrd: no process killed
Notice: caching turned off
Warning: Using /etc/hosts will be removed in a future version. Please use only the /etc/dnrd/master file or use -m off.
dnrd -a 192.168.0.1 -m hosts -c off --timeout=0 -b  -s 1.1.1.1
Do not need swap cal data
VAP-Name -- ath0
BGSCAN --   0
Fast-Frame-Txq-Min -- 1000
SHORT GI --   1
CWM MODE --   1
CWM EXTOFFSET --   1
CWM EXTPROTSPACING --   0
AMPDU --   1
TX CHAIN MASK --   1
RX CHAIN MASK --   1
HIDESSID --   0
APBRIDGE --   1
Frequency -- 0.0
SSID -- virginmedia0265831
COUNTRY CODE --   0x114
WDS --   0
MACCMD --   0
DOTH --   0
COUNTRY IE --   1

Please press Enter to activate this console. ff

(Last edited by krembuk on 21 May 2016, 12:29)

zx82 wrote:

That RAM map looks screwy.

I tried overriding it with a "mem=32M" kernel cmdline via U-Boot bootargs, which didn't work (bootargs doesn't seem to get passed in the way the kernel expects, so can't be used in place of/as an extension of device tree args).  So I put the mem=32M into the device tree.   That got things as far as enumerating the MTD partitions and panicked because no root is set; so root=... went in the device tree too.

Next, a rootfs.  Being too impatient and lazy to build the rootfs just yet, I grabbed a generic one.  I used Attitude Adjustment instead of BB or CC because the latter may be built for Danube/VRX units with 34Kc support, not this unit with 4KEc.  Did try a CC, but it hung in init; didn't hear a peep after:

[    0.689279] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    0.701317] Freeing unused kernel memory: 1236K (8046b000 - 805a0000)
[    1.213739] random: nonblocking pool is initialized

The AA userspace boots atop a trunk kernel, but with two problems.  One, the overlay never comes up, because AA checks for JFFS2 magic "deadc0de" but trunk's JFFS2 uses "19852003", so AA thinks the FS creation hasn't completed.  Two, no ethernet; the drivers complain of:

[    0.578485] libphy: ltq_mii: probed
[    0.580739] eth0 (uninitialized): no PHY found
[    0.585350] etop: mdio probe failed

This process unearthed some problems with stock U-Boot (besides the bootargs problem).  Turns out it ignores the settings in mtdblock1 (it fakes the CRC check on the partition, pretending it failed) and always uses its own embedded defaults.  Saving variables is also disabled (wouldn't be any use).  This is annoying because trunk kernels don't fit in the default last-meg-of-flash location, but you can't change where it looks for the kernel without rebuilding U-Boot or intervening every time.  It has no facility to erase portions of serial flash either.  That provokes the initial JFFS format into very loud complaints about the flash not being empty, but can be worked around with mtd erase.

Next up: build a trunk rootfs, and see if that ethernet thing can be explained.

krembuk wrote:

I think I experienced what you got earlier. This time it works when I changed the load address:

AMAZON_SE # tftpboot 0x00700000 uImage
...
AMAZON_SE # bootm 0x00700000
## Booting image at 00700000 ...
   Image Name:   MIPS Linux-2.6.20
...

I don't think that's doing what you think it's doing.  tftpboot reads an image from the network into memory, but (stock) U-Boot treats 0x0 through 0x00800000 as flash.  It seems unlikely it'd let you do both (i.e. network straight into flash) in one go; in that case I'm not sure quite what it does, but it doesn't look like it's doing what you want.

You need to decide:

  • Are you going to send kernels every time you want to boot them? (slow, boring, repetitive, but saves flash wear and lets you test kernels bigger than 1MiB).  If so, use "tftpboot 0x81000000" then "bootm 0x81000000".  At the time U-Boot is running, 0x81000000 is smack-bang in the middle of (unused) RAM.

  • Or are you going to flash kernels each time which are always smaller than 1MiB?  If the kernel is mostly working (perhaps you're working on userspace fixes), flashing it saves sending it again the next time you boot.  If so, to flash you need to "tftpboot 0x81000000" then "cp.b 0x81000000 0x700000 $(filesize)".  Then "bootm".

  • If you want to do something else, U-Boot is going to get in your way unless you hack and rebuild it.

krembuk wrote:

BTW, when I tried to go into pressing Ctrl-C quickly after turning on the power, I once got:

ROM VER: 1.2.0
CFG 04
UART

instead of

ROM VER: 1.2.0
CFG 04
EEPROM Data OK

Given that it didn't say "EEPROM Data OK", I'd guess that either the power wasn't stable and the flash chip was in a funny state, or that a stray wire or something touched the flash.  You can force UART mode by doing something nasty like pulling the flash /CE high, or by corrupting the flash signature.

zx82 wrote:

see if that ethernet thing can be explained.

Basic ethernet now works on that trunk kernel too.  Haven't tested switch/VLANs (there's no swconfig in the generic AA rootfs anyway).

zx82 wrote:

I don't think that's doing what you think it's doing.  tftpboot reads an image from the network into memory, but (stock) U-Boot treats 0x0 through 0x00800000 as flash.  It seems unlikely it'd let you do both (i.e. network straight into flash) in one go; in that case I'm not sure quite what it does, but it doesn't look like it's doing what you want.

You need to decide:

  • Are you going to send kernels every time you want to boot them? (slow, boring, repetitive, but saves flash wear and lets you test kernels bigger than 1MiB).  If so, use "tftpboot 0x81000000" then "bootm 0x81000000".  At the time U-Boot is running, 0x81000000 is smack-bang in the middle of (unused) RAM.

  • Or are you going to flash kernels each time which are always smaller than 1MiB?  If the kernel is mostly working (perhaps you're working on userspace fixes), flashing it saves sending it again the next time you boot.  If so, to flash you need to "tftpboot 0x81000000" then "cp.b 0x81000000 0x700000 $(filesize)".  Then "bootm".

  • If you want to do something else, U-Boot is going to get in your way unless you hack and rebuild it.

I did tftpboot to test the externally built kernels, I'm a newbie in this kind of "cooking class". I don't want to brick this device in the first place, so I always took safety measures before replacing any mtdblock, by transferring anything into memory and not touching the mtd in any way until I know what I have is 100% working.

You seem to build something in trunk. Are you porting Amazon SE to trunk?
The u-boot source code is available as part of the GPL source of the factory firmware.

BTW, could give me comment about USB-mod suitable for this device? It has a place for USB port (J2, lower right side), the factory kernel detects USB, but seems there is one missing chip on board for USB. I'm still thinking of USB storage to hold backup of the MTDs. Probably I can use ramdisk and a little trick with httpd, and this USB mod is a bit distraction to me, but having USB storage working sounds cool smile

https://farm8.staticflickr.com/7308/26888697650_b888b2e43b_z.jpg

(Last edited by krembuk on 22 May 2016, 06:38)

krembuk wrote:

I don't want to brick this device in the first place, so I always took safety measures before replacing any mtdblock, by transferring anything into memory and not touching the mtd in any way until I know what I have is 100% working.

Backups are important, and avoiding bricking saves time!  But in this case I think U-Boot's memory map is tricking you into doing something more dangerous.  Once U-Boot gives you a prompt on this unit, it makes memory appear like this:

  • 0x00000000 -- 0x00800000: U-Boot pretends this region is memory, when it's really flash.  If you cp.b to there, you're actually writing to the serial flash.  (I don't think this is a genuine hardware mapping, just something faked by U-Boot, either with exception handlers or just by translating addresses you type.)

  • 0x80000000 -- 0x80002000: this is RAM, but is typically used for exception handlers so is not a good place to put anything.

  • 0x80002000 -- 0x81fc0000: free for you or U-Boot to copy things into; in particular, if you bootm from somewhere within 0x00000000 -- 0x00800000, what U-Boot will really do is copy the kernel from flash into somewhere in this region before running it.  When it's a Linux image, it'll also be decompressed (maybe by U-Boot, maybe by its own decompresser) to somewhere else in RAM.  Typically it's safest to use addresses in the middle for scratchpad, so that nothing else conflicts.

  • 0x81fc0000 -- 0x82000000: after the ROM loads U-Boot, U-Boot decompresses itself and then relocates itself to here, the highest 256KiB.  U-Boot runs from here, so don't write to it.

So: feel free to put kernel images in the middle of free RAM before booting them, or to put kernel images or payloads you want to flash in the free RAM before flashing them.  But you should only be using flash addresses when flashing.

krembuk wrote:

You seem to build something in trunk. Are you porting Amazon SE to trunk?

Support for AmazonSE in Linux/OpenWrt was added, and basically finished, by John Crispin (blogic) and others back in 2011--2013.  Unfortunately the build system support in OpenWrt missed Attitude Adjustment and didn't get enough testing so it got removed before Barrier Breaker, but all the code supporting the AmazonSE platform is still there.  So I'm just restoring the glue that makes it build.  You couldn't really call it porting.

I'm basing this on trunk because before January (i.e. Chaos Calmer and earlier) the serial flash driver was buggy.

No promises, but things are looking encouraging right now.  I'll keep this thread updated with progress.  If support progresses enough to call it useful, I'll update the wiki page and consider asking the maintainers to resurrect it officially.

krembuk wrote:

The u-boot source code is available as part of the GPL source of the factory firmware.

Yes, but I really hate building/tweaking manufacturer source dumps, and while there's other productive stuff I can be doing, I will avoid it.  When I do it (if it builds with OpenWrt's toolchain without too much pain) I'll post the patch, the new binary, and a payload for UART mode booting.

krembuk wrote:

BTW, could give me comment about USB-mod suitable for this device?

The board uses its USB hardware to talk to the WiFi chipset, directly.  The manufacturer built the board with the option of a hub and a USB port, but chose not to use it.  The hub chip they left out is no longer made and would need various support bits.  So, broadly, you can:

  • with some hacking, have one USB port instead of WiFi (to which you could add an external powered hub)

  • find a perfectly compatible replacement USB hub chip, and obtain and solder lots of fine-pitch components, giving you onboard WiFi and a USB port

So neither option sounds like much fun.

(Last edited by zx82 on 22 May 2016, 12:20)

zx82 wrote:

Backups are important, and avoiding bricking saves time!  But in this case I think U-Boot's memory map is tricking you into doing something more dangerous.

Thanks, learned something again. So I was just lucky putting that uImage into flash memory map, but it didn't replace the original thing.
I still have that LZMA problem with the uImage if I tftp it into 0x8*****, but I'll keep looking.

zx82 wrote:

No promises, but things are looking encouraging right now.  I'll keep this thread updated with progress.  If support progresses enough to call it useful, I'll update the wiki page and consider asking the maintainers to resurrect it officially.

Hearing that you're doing something on this is giving me hope, actually smile

zx82 wrote:

The board uses its USB hardware ....
So neither option sounds like much fun.

I'm dropping that idea, now. Thanks!

Ha! My LZMA issue was caused the default tftpboot is using 0x80001000 instead of 0x80002000
I just realized that after reading it many times. Looks like I can't trust the default options.

Here it is using the factory GPL kernel:

AMAZON_SE # tftpboot 0x80200000 uImage
Using AMAZON_SE Switch device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'uImage'.
Load address: 0x80200000
Loading: #################################################################
         #################################################################
         #########################
done
Bytes transferred = 791515 (c13db hex)
AMAZON_SE #  tftpboot 0x80200000 uImage
Using AMAZON_SE Switch device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'uImage'.
Load address: 0x80200000
Loading: #################################################################
         #################################################################
         #########################
done
Bytes transferred = 791515 (c13db hex)
AMAZON_SE # bootm 0x80200000
## Booting image at 80200000 ...
   Image Name:   MIPS Linux-2.6.20
   Created:      2016-05-20   2:08:16 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    791451 Bytes = 772.9 kB
   Load Address: 80002000
   Entry Point:  80265000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.20-Amazon_SE
 (root@threef) (gcc version 3.4.4 20050119 (MIPS SDE)) #64 Fri May 20 08:46:11 WIB 2016
Current Model:R0416_BSP_EPHY_SPI_HOST_A4
This model supports only basic BSP feature on Amazon SE Small board with SPI flash USB host and PPE A4 firmware
CPU revision is: 0001906c
Determined physical RAM map:
User-defined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Built 1 zonelists.  Total pages: 8128
Kernel command line:  mem=32M
Primary instruction cache 8kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
PID hash table entries: 128 (order: 7, 512 bytes)
mips_hpt_frequency:133333333
r4k_offset: 00145855(1333333)
Using 133.333 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29772k/32768k available (2064k kernel code, 2996k reserved, 377k data, 128k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 8
NET: Registered protocol family 20
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
amazon_se_dma_init
dma_chip_init
gptu: totally 6 16-bit timers/counters
gptu: misc_register on minor 63
gptu: succeeded to request irq 25 for timer[0]
gptu: succeeded to request irq 26 for timer[1]
gptu: succeeded to request irq 27 for timer[2]
gptu: succeeded to request irq 28 for timer[3]
gptu: succeeded to request irq 29 for timer[4]
gptu: succeeded to request irq 30 for timer[5]
squashfs: version 3.2-r2 (2007/01/15) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
io scheduler noop registered (default)
Infineon Technologies port driver version 1.0.2
cgu: misc_register on minor = 62
led: misc_register on minor = 151
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
Unknown module try to reserve GPIO
Unknown module try to reserve GPIO
Infineon Technologies Synchronous Serial Controller (SSC) driver version 0.2.1
IFX MEI Version 4.00.01

Infineon CPE API Driver version: DSL CPE API V3.20.5.1

DSL_DRV: using proc fs
ttyS0 at MMIO 0xbe100c00 (irq = 2) is a IFX_ASC
PPP generic driver version 2.4.2
NET: Registered protocol family 24
IMQ starting with 2 devices...
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
Loading A4 (ATM+MII0) driver ...... Force to 100MB Duplex
Succeeded!
PPE datapath driver info:
  Version ID: 8.3.5.1.0.0.1
  Family    : Amazon-SE
  DR Type   : Normal Data Path | Indirect-Fast Path
  Interface : MII0 | ATM
  Mode      : Routing
  Release   : 0.0.1
PPE firmware info:
  Version ID: 3.1.2.6.1.6
  Family    : Amazon-SE
  FW Type   : Standard
  Interface : MII0 + ATM
  Mode      : Bridging + IPv4 Routing
  Release   : 1.6
PPA API --- init successfully
Infineon Technologies Synchronous SPI flash driver version 0.0.1
MTD driver for SPI flash.
Probing for Serial flash ...
Update rx_eff_size to 4
 <5>Creating 8 MTD partitions on "amazon_se-spi":
0x00000000-0x00020000 : "U-Boot"
0x00020000-0x00030000 : "ENV_MAC"
0x00030000-0x00040000 : "DPF"
0x00040000-0x00050000 : "NVRAM"
0x00050000-0x00700000 : "RootFS_DPUMP"
0x00700000-0x00800000 : "Kernel"
0x00050000-0x00800000 : "ROOTFS_KERNEL"
0x00000000-0x00020000 : "POT"
Update rx_eff_size to 4096
 <6>dwc_otg: version 2.2-RC3
dwc_otg dwc_otg: DWC OTG Controller
dwc_otg dwc_otg: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg: irq 31, io mem 0x00000000
DWC_otg: Init: Power Port (0)
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
nf_conntrack version 0.5.0 (256 buckets, 2048 max)
nf_ct_ftp: registering helper for pf: 2 port: 21
nf_ct_ftp: registering helper for pf: 10 port: 21
GRE over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: configuration #1 chosen from 1 choice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
atmpvc_init() failed with -17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Cannot open root device "<NULL>" or unknown-block(0,0)
Please append a correct "root=" boot option
Time: MIPS clocksource has been installed.
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

but now I still can't reproduce the boot, using exactly the same parameter. Getting that LZMA issue again. Strange.

(Last edited by krembuk on 23 May 2016, 13:04)

krembuk wrote:

Ha! My LZMA issue was caused the default tftpboot is using 0x80001000 instead of 0x80002000
I just realized that after reading it many times. Looks like I can't trust the default options.

So your self-built kernel boots now?

krembuk wrote:

Hearing that you're doing something on this is giving me hope, actually

The current status here is that a very slightly modified trunk builds, boots to userspace and has working basic ethernet.  The switch (VLANs) and the WiFi don't work yet.

The WiFi problem manifests as the USB driver re-registering many times after being recognised:

[    8.244590] IFXUSB: ifxusb_hcd: version 3.2 B110801
[    8.762205] IFXUSB: USB core #0 soft-reset
[    8.970154] IFXUSB: USB core #0 soft-reset
[    8.973044] ifxusb_hcd ifxusb_hcd: IFX USB Controller
[    8.978141] ifxusb_hcd ifxusb_hcd: new USB bus registered, assigned bus number 1
[    8.985451] ifxusb_hcd ifxusb_hcd: irq 39, io mem 0xbe101000
[    8.990965] IFXUSB: Init: Power Port (0)
[    9.001593] hub 1-0:1.0: USB hub found
[    9.005529] hub 1-0:1.0: 1 port detected
[    9.017500] IFXUSB: ifxusb_hcd: version 3.2 B110801
[    9.021154] Error: Driver 'ifxusb_hcd' is already registered, aborting...
[    9.027863] IFXUSB: ifxusb_hcd_driver_init retval=-16
[    9.042089] IFXUSB: ifxusb_hcd: version 3.2 B110801
[    9.045744] Error: Driver 'ifxusb_hcd' is already registered, aborting...
[    9.052453] IFXUSB: ifxusb_hcd_driver_init retval=-16

Unsurprisingly this interferes with the WiFi driver loading:

[   19.632170] usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[   21.491450] usb 1-1: Service connection timeout for: 256
[   21.495836] ath9k_htc 1-1:1.0: ath9k_htc: Unable to initialize HTC services
[   21.502820] ath9k_htc: Failed to initialize the device
[   21.521298] usb 1-1: ath9k_htc: USB layer deinitialized

The switch comes up fine in EPHY mode (as though just plugged into the switch with an ethernet cable, no swconfig or /proc/switch):

[    0.573527] Selected EPHY mode
[    0.591467] libphy: ltq_mii: probed
[    0.601018] eth0: attached PHY [Generic PHY] (phy_addr=1e180000.etop-ff:08, irq=-1)

But in MII mode, no such luck:

[    1.052588] libphy: ltq_mii: probed
[    1.062018] eth0 (uninitialized): no PHY found

even though CONFIG_AR8216_PHY=y in my kernel.  Some added debug tells me all 32 MDIO addresses look empty in MII mode.

It should look like it does on some Danube-based units with working switches (spw504v):

[ 0.576000] switch0: Atheros AR8216 rev. 1 switch registered on 1e180000.etop-ff
[ 0.616000] libphy: ltq_mii: probed
[ 0.656000] eth0: attached PHY [Atheros AR8216/AR8236/AR8316] (phy_addr=1e180000.etop-ff:00, irq=-1)

I'm somewhat out of my depth on both problems at this point.  Besides seeing what a bit more debug tells me about the probe process, I have one more thing to investigate before I cry for help from upstream: I have a TG585v8 which has the same SoC but a BCM5325 switch.  I notice it has a 25MHz crystal only for the switch, whereas the DGN1000 has a 25MHz crystal both on the switch and on the SoC, which might hint at this being a clock source problem.  I'll try adding b53 support to this kernel, UART-booting the TG585v8 (which is otherwise entirely locked down) with it, and see if the switch on that one gets detected in MII mode.  That would at least indicate that AmazonSE can do MII mode with the current driver.

Found it. I have to run

tftpboot 0x80200000 uImage

twice so it won't stuck with LZMA decode error. What kind of voodoo is this?

zx82 wrote:

So your self-built kernel boots now?

Yes, it does, from the factory GPL source. Only that it complains on the wireless parts, seems it can't find the art partition.

krembuk wrote:

Yes, it does, from the factory GPL source. Only that it complains on the wireless parts, seems it can't find the art partition.

I'm not convinced there is one.  What's the error message?  The only reference to Atheros in the stock blob is within the U-Boot env partition, and it's pretty short (might be regional radio or MAC address settings, but doesn't look like a firmware).

zx82 wrote:
krembuk wrote:

Yes, it does, from the factory GPL source. Only that it complains on the wireless parts, seems it can't find the art partition.

I'm not convinced there is one.  What's the error message?  The only reference to Atheros in the stock blob is within the U-Boot env partition, and it's pretty short (might be regional radio or MAC address settings, but doesn't look like a firmware).


Please wait, I'm having that LZMA error again, though I ran tftpboot twice. Seems like running twice tftpboot is not the solution. Basically it is similar with issue that I posted earlier, on the difference between the automatic internal flash booting and the manual tftp booting.

But maybe you're right, because I only use rootfs=/dev/mtdblock4 for the boot param. Looks like I need to add MAC etc, based on printenv.

Will try again tomorrow..

OK. I have to let it "cool down" after turning off power, then I won't have that LZMA issue.
Now I add "run addmisc" to add boot param, which according to printenv:

addmisc=setenv bootargs $(bootargs) console=ttyS0,$(baudrate) ethaddr=$(ethaddr) mem=$(mem) panic=1

And it boots properly:

AMAZON_SE # tftpboot 0x80200000  uImage.comp
Using AMAZON_SE Switch device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'uImage.comp'.
Load address: 0x80200000
Loading: checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
#################################################################
         #################################################################
         #########################
done
Bytes transferred = 791515 (c13db hex)
AMAZON_SE #  tftpboot 0x80200000  uImage.comp
Using AMAZON_SE Switch device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'uImage.comp'.
Load address: 0x80200000
Loading: #################################################################
         #################################################################
         #########################
done
Bytes transferred = 791515 (c13db hex)
AMAZON_SE # run flashargs
AMAZON_SE # run addmisc
AMAZON_SE # bootm 0x80200000
## Booting image at 80200000 ...
   Image Name:   MIPS Linux-2.6.20
   Created:      2016-05-20   2:08:16 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    791451 Bytes = 772.9 kB
   Load Address: 80002000
   Entry Point:  80265000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.20-Amazon_SE
 (root@threef) (gcc version 3.4.4 20050119 (MIPS SDE)) #64 Fri May 20 08:46:11 WIB 2016
Current Model:R0416_BSP_EPHY_SPI_HOST_A4
This model supports only basic BSP feature on Amazon SE Small board with SPI flash USB host and PPE A4 firmware
CPU revision is: 0001906c
Determined physical RAM map:
User-defined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Built 1 zonelists.  Total pages: 8128
Kernel command line: root=/dev/mtdblock4 console=ttyS0,115200 ethaddr=00:8e:f2:7f:45:a6 mem=32M panic=1
Primary instruction cache 8kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
PID hash table entries: 128 (order: 7, 512 bytes)
mips_hpt_frequency:133333333
r4k_offset: 00145855(1333333)
Using 133.333 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29772k/32768k available (2064k kernel code, 2996k reserved, 377k data, 128k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 8
NET: Registered protocol family 20
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
amazon_se_dma_init
dma_chip_init
gptu: totally 6 16-bit timers/counters
gptu: misc_register on minor 63
gptu: succeeded to request irq 25 for timer[0]
gptu: succeeded to request irq 26 for timer[1]
gptu: succeeded to request irq 27 for timer[2]
gptu: succeeded to request irq 28 for timer[3]
gptu: succeeded to request irq 29 for timer[4]
gptu: succeeded to request irq 30 for timer[5]
squashfs: version 3.2-r2 (2007/01/15) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
io scheduler noop registered (default)
Infineon Technologies port driver version 1.0.2
cgu: misc_register on minor = 62
led: misc_register on minor = 151
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
drivers/char/amazon_se_led.c amazon_se_led_config 1244: f_software_update = 1
Unknown module try to reserve GPIO
Unknown module try to reserve GPIO
Infineon Technologies Synchronous Serial Controller (SSC) driver version 0.2.1
IFX MEI Version 4.00.01

Infineon CPE API Driver version: DSL CPE API V3.20.5.1

DSL_DRV: using proc fs
ttyS0 at MMIO 0xbe100c00 (irq = 2) is a IFX_ASC
PPP generic driver version 2.4.2
NET: Registered protocol family 24
IMQ starting with 2 devices...
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
Loading A4 (ATM+MII0) driver ...... Force to 100MB Duplex
Succeeded!
PPE datapath driver info:
  Version ID: 8.3.5.1.0.0.1
  Family    : Amazon-SE
  DR Type   : Normal Data Path | Indirect-Fast Path
  Interface : MII0 | ATM
  Mode      : Routing
  Release   : 0.0.1
PPE firmware info:
  Version ID: 3.1.2.6.1.6
  Family    : Amazon-SE
  FW Type   : Standard
  Interface : MII0 + ATM
  Mode      : Bridging + IPv4 Routing
  Release   : 1.6
PPA API --- init successfully
Infineon Technologies Synchronous SPI flash driver version 0.0.1
MTD driver for SPI flash.
Probing for Serial flash ...
Update rx_eff_size to 4
 <5>Creating 8 MTD partitions on "amazon_se-spi":
0x00000000-0x00020000 : "U-Boot"
0x00020000-0x00030000 : "ENV_MAC"
0x00030000-0x00040000 : "DPF"
0x00040000-0x00050000 : "NVRAM"
0x00050000-0x00700000 : "RootFS_DPUMP"
0x00700000-0x00800000 : "Kernel"
0x00050000-0x00800000 : "ROOTFS_KERNEL"
0x00000000-0x00020000 : "POT"
Update rx_eff_size to 4096
 <6>dwc_otg: version 2.2-RC3
dwc_otg dwc_otg: DWC OTG Controller
dwc_otg dwc_otg: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg: irq 31, io mem 0x00000000
DWC_otg: Init: Power Port (0)
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
nf_conntrack version 0.5.0 (256 buckets, 2048 max)
nf_ct_ftp: registering helper for pf: 2 port: 21
nf_ct_ftp: registering helper for pf: 10 port: 21
GRE over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: configuration #1 chosen from 1 choice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
atmpvc_init() failed with -17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Time: MIPS clocksource has been installed.
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 128k freed
init started: BusyBox v1.13.1 (2012-03-01 17:48:55 CST
starting pid 14, tty '': '/usr/etc/rcS
Algorithmics/MIPS FPU Emulator v1.5
netfilter PSD loaded - (c) astaro AG
ipt_http_string: module license 'SERCOMM' taints kernel.
init:866
cat: can't open '/tmp/etc/block.htm': No such file or directory
insmod: cannot insert '/lib/modules/igmp_snooping.ko': unknown symbol in module, or unknown parameter
device eth0 entered promiscuous mode
br0: port 1(eth0) entering learning state
userspace registering PID
cat: can't open '/proc/nvram/BaseMacAddr': No such file or directory
ap_name=(null) action=start
/bin/echo GMT+0 > /etc/TZ
killall: udhcpd: no process killed
iptables: No chain/target/match by that name
killall: miniupnpd: no process killed
killall: dnrd: no process killed
Notice: caching turned off
Warning: Using /etc/hosts will be removed in a future version. Please use only the /etc/dnrd/master file or use -m off.
dnrd -a 192.168.0.1 -m hosts -c off --timeout=0 -b  -s 1.1.1.1
Do not need swap cal data
VAP-Name -- ath0
BGSCAN --   0
Fast-Frame-Txq-Min -- 1000
SHORT GI --   1
CWM MODE --   1
CWM EXTOFFSET --   1
CWM EXTPROTSPACING --   0
AMPDU --   1
TX CHAIN MASK --   1
RX CHAIN MASK --   1
HIDESSID --   0
APBRIDGE --   1
Frequency -- 0.0
SSID -- virginmedia0265831
COUNTRY CODE --   0x114
WDS --   0
MACCMD --   0
DOTH --   0
COUNTRY IE --   1

Please press Enter to activate this console. ff