Welcome! Log In Create A New Profile

Advanced

Debian on DNS-320L (B1)

Posted by Ironaxe 
Re: UART Boot DNS-320 B1 with broken NAND
December 12, 2018 06:38PM
/backup# flash_erase /dev/mtd0 0 0
Erasing 128 Kibyte @ 7f619f5c00000064 --  6 % complete 


root@debian:/backup# nandwrite /dev/mtd0 mtd0.dns-320
Image 1048576 bytes, NAND page 2048 bytes, OOB area 64 bytes, device size 786432 bytes
nandwrite: error!: Input file does not fit into device
           error 0 (Success)
nandwrite: error!: Data was only partially written due to error
           error 0
Looks like the nanddump was incorrected! It should have no OOB and no ECC. When dumping with these explicit options, the dump should be exactly 1024k.

Try

nanddump --noecc --omitoob -f mtd0.dns320 /dev/mtd0

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 12/12/2018 08:02PM by bodhi.
Re: UART Boot DNS-320 B1 with broken NAND
December 12, 2018 08:56PM
Hold on. The device size is 786432.

Let’s take a closer look at mtd0.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 12, 2018 09:42PM
Ok I see the error.

Mtd0 size is actually 0x0000000c0000, which is 786432 bytes.

So you must redo the mtd0 dump on the good box. The below command must result in a file size 786432 bytes.

nanddump --noecc --omitoob -f mtd0.dns320 /dev/mtd0

The previous dump was wrong (was good enough for kwboot, but not for NAND).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 13, 2018 05:32AM
But the original mtd0 Partition size was 1M.
So the "old" dump was 1M too. Should ist have been smaller without OOB and ECC?
I recently modified the mtd0 Dump so ist loads faster through kwboot. ( Saved it under another name, and it is only 462K in size. Deleted nearly the whole FF Part from the middle to the end with a Hex Editor. )
Re: UART Boot DNS-320 B1 with broken NAND
December 13, 2018 06:09PM
Ironaxe,

> But the original mtd0 Partition size was 1M.
> So the "old" dump was 1M too. Should ist have been
> smaller without OOB and ECC?

No, it is 0xc0000 = 768K

Quote

console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)

And the kernel initialized these 2 mtds as such:

[    8.727471] Creating 2 MTD partitions on "orion_nand":
[    8.732587] 0x000000000000-0x0000000c0000 : "uboot"
[    8.738868] 0x000000100000-0x000008000000 : "root"


So this nandwrite would not work when the image is 1M.

nandwrite /dev/mtd0 mtd0.dns-320

Note that mtd1 (root) starts at 1M. But it does not mean mtd0 is 1M, it could be whatever size, with an unused NAND space after u-boot image. In this case it is 256k.

So you need to boot the good box with the new envs. And then dump mtd0 to get the image file of 768K exact (if it is greater than 768K then the nanddump command is wrong).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 12/13/2018 06:10PM by bodhi.
Re: UART Boot DNS-320 B1 with broken NAND
December 15, 2018 03:39PM
bodhi Wrote:
-------------------------------------------------------
> Ironaxe,
>
>
> Creating 7 MTD partitions on "nand_mtd":
> 0x000000000000-0x000000100000 : "u-boot"
>
>
> That's your mtd0. You only need to dump this with
> nanddump.
>
> # this nanddump command produces the 1MB file
> mtd0.dns-320 in the current directory
>
> nanddump --noecc --omitoob -f mtd0.dns-320 /dev/mtd0
>
>
> If nanddump is not available in stock OS, then
> download the binary in this tarball (nanddump
> binary in this tarball works in stock 2.6.xx
> kernel)
Re: UART Boot DNS-320 B1 with broken NAND
December 15, 2018 04:26PM
Quote

> Creating 7 MTD partitions on "nand_mtd":
> 0x000000000000-0x000000100000 : "u-boot"

Yes, that was when the MTD partitions were not defined correctly. Since we have looked at the stock u-boot envs again, it showed there should be only 2 mtds. And the mtd0 size is not 1M.

console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 15, 2018 05:03PM
Ok. I'll do another dump and see if it works.
Re: UART Boot DNS-320 B1 with broken NAND
December 19, 2018 04:07AM
Got another Dump of 768K.
Named it mtd0.dns-320l.
kwbooting works fine like usual.
But no self booting from NAND :(

root@debian:/dns-320l/uboot# kwboot -t -B 115200 /dev/ttyUSB0 -b mtd0.dns-320l -p
Sending boot message. Please reboot the target...|
Sending boot image...
  0 % [......................................................................]
 .....
 99 % [......................................................]
[Type Ctrl-\ + c to quit]


 ** MARVELL BOARD: DB-88F6702A-BP LE 

U-Boot 1.1.4 (Apr 19 2012 - 11:21:19) Marvell version: 3.6.0.DNS-320B.01

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz 

DRAM (DDR2) CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 
Marvell>> setenv ethaddr AC:F1:DF:12:DF:9A
Marvell>> setenv ipaddr 192.168.1.110
Marvell>> setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0xc0000@0(uboot),0x7f00000@0x100000(root) earlyprintk=serial'
Marvell>> setenv bootcmd_usb 'usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv bootcmd 'setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000'
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> printenv
bootargs=root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
baudrate=115200
loads_echo=0
serverip=2.66.66.32
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=1
ethprime=egiga0
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
bootdelay=1
disaMvPnp=no
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
enaAutoRecovery=yes
pcieTune=no
ethact=egiga0
ethaddr=AC:F1:DF:12:DF:9A
ipaddr=192.168.1.110
bootargs_usb=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0xc0000@0(uboot),0x7f00000@0x100000(root) earlyprintk=serial
bootcmd_usb=usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd
bootcmd=setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000

Environment size: 1505/131068 bytes
Marvell>> boot
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
1 Storage Device(s) found
....
.
......
............
.........................
...................................................
......................................................................................................
.........................................................................................................................................................................

3832764 bytes read
....
.........................................................................................................................................................................................................................................................................................................................................................................................................................
.................................................................................................................................................................................................................................................................................................................................................

7702201 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2018-12-03   8:43:13 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3832700 Bytes =  3.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-4.12.1-kirkwood-tld-1
   Created:      2018-12-02  14:09:34 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7702137 Bytes =  7.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.12.1-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: D-Link DNS-320L
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0xc0000@0(uboot),0x7f00000@0x100000(root) earlyprintk=serial
[    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: 108980K/131072K available (8192K kernel code, 716K rwdata, 1972K rodata, 1024K init, 288K bss, 22092K reserved, 0K cma-reserved)
[    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]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)
[    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
[    0.000000]       .data : 0xc0d00000 - 0xc0db3274   ( 717 kB)
[    0.000000]        .bss : 0xc0db9b9c - 0xc0e01e60   ( 289 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000008] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.007915] Switching to timer-based delay loop, resolution 6ns
[    0.014387] Console: colour dummy device 80x30
[    0.018971] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666)
[    0.029583] pid_max: default: 32768 minimum: 301
[    0.034480] Security Framework initialized
[    0.038821] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.045499] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.053563] CPU: Testing write buffer coherency: ok
[    0.059608] Setting up static identity map for 0x100000 - 0x100058
[    0.066119] mvebu-soc-id: MVEBU SoC ID=0x6702, Rev=0x3
[    0.074933] devtmpfs: initialized
[    0.083066] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.093029] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.099662] prandom: seed boundary self test passed
[    0.109119] prandom: 100 self tests passed
[    0.113284] pinctrl core: initialized pinctrl subsystem
[    0.119837] NET: Registered protocol family 16
[    0.124824] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.133515] cpuidle: using governor ladder
[    0.137744] cpuidle: using governor menu
[    0.142274] Feroceon L2: Enabling L2
[    0.145951] Feroceon L2: Cache support initialised.
[    0.151316] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.167433] No ATAGs?
[    0.177847] vgaarb: loaded
[    0.183359] SCSI subsystem initialized
[    0.187709] usbcore: registered new interface driver usbfs
[    0.193381] usbcore: registered new interface driver hub
[    0.198870] usbcore: registered new device driver usb
[    0.205216] clocksource: Switched to clocksource orion_clocksource
[    0.314389] VFS: Disk quotas dquot_6.6.0
[    0.318531] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.337187] NET: Registered protocol family 2
[    0.342418] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.349497] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.355945] TCP: Hash tables configured (established 1024 bind 1024)
[    0.362438] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.368367] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.374874] NET: Registered protocol family 1
[    0.379778] RPC: Registered named UNIX socket transport module.
[    0.385838] RPC: Registered udp transport module.
[    0.390608] RPC: Registered tcp transport module.
[    0.395412] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.402161] Unpacking initramfs...
[    1.192183] Freeing initrd memory: 7524K
[    1.196448] NetWinder Floating Point Emulator V0.97 (double precision)
[    1.204109] audit: initializing netlink subsys (disabled)
[    1.210139] Initialise system trusted keyrings
[    1.214701] Key type blacklist registered
[    1.218857] audit: type=2000 audit(1.194:1): state=initialized audit_enabled=0 res=1
[    1.226855] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    1.233419] zbud: loaded
[    1.237168] NFS: Registering the id_resolver key type
[    1.242304] Key type id_resolver registered
[    1.246616] Key type id_legacy registered
[    1.250707] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.257495] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    1.264115] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    1.271448] fuse init (API version 7.26)
[    1.275865] orangefs_debugfs_init: called with debug mask: :none: :0:
[    1.282671] orangefs_init: module version upstream loaded
[    1.288165] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[    2.565224] random: fast init done
[    8.309812] Key type asymmetric registered
[    8.313983] Asymmetric key parser 'x509' registered
[    8.319257] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    8.326848] io scheduler noop registered
[    8.330838] io scheduler deadline registered
[    8.335311] io scheduler cfq registered (default)
[    8.341505] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    8.350953] mv_xor f1060800.xor: Marvell shared XOR driver
[    8.416099] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.423961] mv_xor f1060900.xor: Marvell shared XOR driver
[    8.486104] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.494182] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    8.502042] console [ttyS0] disabled
[    8.505813] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 10416666) is a 16550A
[    8.514858] console [ttyS0] enabled
[    8.514858] console [ttyS0] enabled
[    8.521940] bootconsole [earlycon0] disabled
[    8.521940] bootconsole [earlycon0] disabled
[    8.531278] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 26, base_baud = 10416666) is a 16550A
[    8.549815] loop: module loaded
[    8.553547] sata_mv f1080000.sata: slots 32 ports 2
[    8.561468] scsi host0: sata_mv
[    8.565077] scsi host1: sata_mv
[    8.568519] ata1: SATA max UDMA/133 irq 33
[    8.572597] ata2: SATA max UDMA/133 irq 33
[    8.577926] nand: Could not find valid ONFI parameter page; aborting
[    8.584267] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    8.590672] nand: Hynix NAND 128MiB 3,3V 8-bit
[    8.595095] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    8.602659] Scanning device for bad blocks
[    8.721165] 2 cmdlinepart partitions found on MTD device orion_nand
[    8.727428] Creating 2 MTD partitions on "orion_nand":
[    8.732553] 0x000000000000-0x0000000c0000 : "uboot"
[    8.738840] 0x000000100000-0x000008000000 : "root"
[    8.747335] libphy: Fixed MDIO Bus: probed
[    8.752331] libphy: orion_mdio_bus: probed
[    8.761885] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    8.866541] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:50:43:00:02:02
[    8.875405] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.881958] ehci-pci: EHCI PCI platform driver
[    8.886483] ehci-orion: EHCI orion driver
[    8.890747] orion-ehci f1050000.ehci: EHCI Host Controller
[    8.896301] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    8.904189] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    8.910136] ata1: SATA link down (SStatus 0 SControl F300)
[    8.945253] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    8.951489] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    8.958285] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.965498] usb usb1: Product: EHCI Host Controller
[    8.970358] usb usb1: Manufacturer: Linux 4.12.1-kirkwood-tld-1 ehci_hcd
[    8.977048] usb usb1: SerialNumber: f1050000.ehci
[    8.982582] hub 1-0:1.0: USB hub found
[    8.986414] hub 1-0:1.0: 1 port detected
[    8.991022] usbcore: registered new interface driver usb-storage
[    8.997414] mousedev: PS/2 mouse device common for all mice
[    9.246805] ata2: SATA link down (SStatus 0 SControl F300)
[    9.345254] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    9.536198] usb 1-1: New USB device found, idVendor=21c4, idProduct=8005
[    9.542885] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    9.550028] usb 1-1: Product: USB Flash Disk
[    9.554283] usb 1-1: Manufacturer: General
[    9.558382] usb 1-1: SerialNumber: 0475660000006AA4
[    9.564043] usb-storage 1-1:1.0: USB Mass Storage device detected
[    9.570506] scsi host2: usb-storage 1-1:1.0
[   10.015249] rtc-mv f1010300.rtc: internal RTC not ticking
[   10.020813] i2c /dev entries driver
[   10.026090] hidraw: raw HID events driver (C) Jiri Kosina
[   10.031862] drop_monitor: Initializing network drop monitor service
[   10.038402] NET: Registered protocol family 17
[   10.042921] Key type dns_resolver registered
[   10.048067] registered taskstats version 1
[   10.052144] Loading compiled-in X.509 certificates
[   10.057003] zswap: loaded using pool lzo/zbud
[   10.072131] Key type big_key registered
[   10.086316] Key type encrypted registered
[   10.091738] hctosys: unable to open rtc device (rtc0)
[   10.100303] Freeing unused kernel memory: 1024K
Loading, please wait...
starting version 232
[   10.533278] usbcore: registered new interface driver uas
[   10.579186] scsi 2:0:0:0: Direct-Access     General  USB Flash Disk   1.00 PQ: 0 ANSI: 4
[   10.596505] sd 2:0:0:0: [sda] 15702112 512-byte logical blocks: (8.04 GB/7.49 GiB)
[   10.610182] sd 2:0:0:0: [sda] Write Protect is off
[   10.620243] sd 2:0:0:0: [sda] No Caching mode page found
[   10.630948] sd 2:0:0:0: [sda] Assuming drive cache: write through
[   10.648740]  sda: sda1
[   10.655502] sd 2:0:0:0: [sda] Attached SCSI removable disk
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Will now check root file system ... fsck from util-linux 2.29.2
[/sbin/fsck.ext2 (1) -- /dev/sda1] fsck.ext2 -a -C0 /dev/sda1 
rootfs was not cleanly unmounted, check forced.
rootfs:                                                                        Inodes that were part of a corrupted orphan linked list found.  

rootfs: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
	(i.e., without -a or -p options)
fsck exited with status code 4
done.
Failure: File system check of the root filesystem failed
The root filesystem on /dev/sda1 requires a manual fsck


BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) fsck /dev/sda1
fsck from util-linux 2.29.2
e2fsck 1.43.4 (31-Jan-2017)
rootfs contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
[   59.963865] random: crng init done
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (1781990, counted=1781797).
Fix<y>? yes
Free inodes count wrong (476918, counted=476917).
Fix<y>? yes

rootfs: ***** FILE SYSTEM WAS MODIFIED *****
rootfs: 14603/491520 files (5.5% non-contiguous), 180699/1962496 blocks
(initramfs) exit
Begin: Will now check root file system ... fsck from util-linux 2.29.2
[/sbin/fsck.ext2 (1) -- /dev/sda1] fsck.ext2 -a -C0 /dev/sda1 
rootfs: clean, 14603/491520 files, 180699/1962496 blocks
done.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
[ ok ] Setting hostname to 'debian'...done.
[....] Starting the hotplug events dispatcher: systemd-udevdstarting version 232
. ok 
[  246.134616] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[ ok                                             done.
[....] Waiting for /dev to be fully populated...[  246.489209] marvell-cesa f1030000.crypto: CESA device successfully registered
[  246.535452] orion_wdt: Initial timeout 25 sec
[  246.603328] sd 2:0:0:0: Attached scsi generic sg0 type 0
done.
[ ok ] Activating swap:.
[ ok ] Will now activate lvm and md swap:done.
[info] Will now check all file systems.
fsck from util-linux 2.29.2
Checking all file systems.
LABEL=rootfs is mounted
[....] Done checking file systems. A log is being saved in /var/log/fsck/checkfs[ ok hat location is writable..
[ ok ] Cleaning up temporary files...[....] Cleaning /tmp...done.
[ ok .
[ ok ] Will now mount local filesystems:.
[ ok ] Will now activate swapfile swap:done.
[ ok ] Checking minimum space in /tmp...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables...done.
[ ok ] Initializing random number generator...done.
[  253.862608] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[....] Configuring network interfaces...Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:50:43:00:02:02
Sending on   LPF/eth0/00:50:43:00:02:02
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
[  261.063613] NET: Registered protocol family 10
[  261.071092] Segment Routing with IPv6
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPREQUEST of 192.168.1.114 on eth0 to 255.255.255.255 port 67
DHCPOFFER of 192.168.1.114 from 192.168.1.1
DHCPACK of 192.168.1.114 from 192.168.1.1
bound to 192.168.1.114 -- renewal in 1073741824 seconds.
done.
[ ok ] Starting RPC port mapper daemon: rpcbind.
[ ok ] Starting NFS common utilities: statd idmapd.
[ ok ] Cleaning up temporary files....
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
[....] Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
1297 (syslogd)
. ok 
[ ok ] Starting NFS common utilities: statd idmapd.
[ ok ] Starting system message bus: dbus.
[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[warn] Not starting NFS kernel daemon: no exports. ... (warning).
[ ok ] Starting NTP server: ntpd.
[....] Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
1300 (klogd)
. ok 
[ ok ] Starting OpenBSD Secure Shell server: sshd.
[ ok ] Running local boot scripts (/etc/rc.local).

Debian GNU/Linux 9 debian ttyS0

debian login: root
Password: 
Last login: Wed Dec 31 16:00:51 PST 1969 on ttyS0
Linux debian 4.12.1-kirkwood-tld-1 #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@debian:~# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.12.1-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: D-Link DNS-320L
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat c0d9e084, node_mem_map c7ef9000
[    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] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0xc0000@0(uboot),0x7f00000@0x100000(root) earlyprintk=serial
[    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: 108980K/131072K available (8192K kernel code, 716K rwdata, 1972K rodata, 1024K init, 288K bss, 22092K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
                   lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
                   modules : 0xbf000000 - 0xc0000000   (  16 MB)
                     .text : 0xc0008000 - 0xc0900000   (9184 kB)
                     .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
                     .data : 0xc0d00000 - 0xc0db3274   ( 717 kB)
                      .bss : 0xc0db9b9c - 0xc0e01e60   ( 289 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000008] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.007915] Switching to timer-based delay loop, resolution 6ns
[    0.014387] Console: colour dummy device 80x30
[    0.018971] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666)
[    0.029583] pid_max: default: 32768 minimum: 301
[    0.034480] Security Framework initialized
[    0.038821] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.045499] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.053563] CPU: Testing write buffer coherency: ok
[    0.059608] Setting up static identity map for 0x100000 - 0x100058
[    0.066119] mvebu-soc-id: MVEBU SoC ID=0x6702, Rev=0x3
[    0.074933] devtmpfs: initialized
[    0.083066] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.093029] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.099662] prandom: seed boundary self test passed
[    0.109119] prandom: 100 self tests passed
[    0.113284] pinctrl core: initialized pinctrl subsystem
[    0.119837] NET: Registered protocol family 16
[    0.124824] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.133515] cpuidle: using governor ladder
[    0.137744] cpuidle: using governor menu
[    0.142274] Feroceon L2: Enabling L2
[    0.145951] Feroceon L2: Cache support initialised.
[    0.151316] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.167433] No ATAGs?
[    0.177847] vgaarb: loaded
[    0.183359] SCSI subsystem initialized
[    0.187378] libata version 3.00 loaded.
[    0.187709] usbcore: registered new interface driver usbfs
[    0.193381] usbcore: registered new interface driver hub
[    0.198870] usbcore: registered new device driver usb
[    0.205216] clocksource: Switched to clocksource orion_clocksource
[    0.314389] VFS: Disk quotas dquot_6.6.0
[    0.318531] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.337187] NET: Registered protocol family 2
[    0.342418] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.349497] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.355945] TCP: Hash tables configured (established 1024 bind 1024)
[    0.362438] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.368367] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.374874] NET: Registered protocol family 1
[    0.379778] RPC: Registered named UNIX socket transport module.
[    0.385838] RPC: Registered udp transport module.
[    0.390608] RPC: Registered tcp transport module.
[    0.395412] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.401913] PCI: CLS 0 bytes, default 32
[    0.402161] Unpacking initramfs...
[    1.192183] Freeing initrd memory: 7524K
[    1.196448] NetWinder Floating Point Emulator V0.97 (double precision)
[    1.204109] audit: initializing netlink subsys (disabled)
[    1.210139] Initialise system trusted keyrings
[    1.214701] Key type blacklist registered
[    1.218857] audit: type=2000 audit(1.194:1): state=initialized audit_enabled=0 res=1
[    1.226855] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    1.233419] zbud: loaded
[    1.237168] NFS: Registering the id_resolver key type
[    1.242304] Key type id_resolver registered
[    1.246616] Key type id_legacy registered
[    1.250707] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.257495] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    1.264115] jffs2: version 2.2. (NAND) (SUMMARY)  \xffffffc2\xffffffa9 2001-2006 Red Hat, Inc.
[    1.271448] fuse init (API version 7.26)
[    1.275865] orangefs_debugfs_init: called with debug mask: :none: :0:
[    1.282671] orangefs_init: module version upstream loaded
[    1.288165] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[    2.565224] random: fast init done
[    8.309812] Key type asymmetric registered
[    8.313983] Asymmetric key parser 'x509' registered
[    8.319257] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    8.326848] io scheduler noop registered
[    8.330838] io scheduler deadline registered
[    8.335311] io scheduler cfq registered (default)
[    8.341505] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    8.350953] mv_xor f1060800.xor: Marvell shared XOR driver
[    8.416099] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.423961] mv_xor f1060900.xor: Marvell shared XOR driver
[    8.486104] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.494182] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    8.502042] console [ttyS0] disabled
[    8.505813] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 10416666) is a 16550A
[    8.514858] console [ttyS0] enabled
[    8.521940] bootconsole [earlycon0] disabled
[    8.531278] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 26, base_baud = 10416666) is a 16550A
[    8.549815] loop: module loaded
[    8.553254] sata_mv f1080000.sata: version 1.28
[    8.553547] sata_mv f1080000.sata: slots 32 ports 2
[    8.561468] scsi host0: sata_mv
[    8.565077] scsi host1: sata_mv
[    8.568519] ata1: SATA max UDMA/133 irq 33
[    8.572597] ata2: SATA max UDMA/133 irq 33
[    8.577926] nand: Could not find valid ONFI parameter page; aborting
[    8.584267] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    8.590672] nand: Hynix NAND 128MiB 3,3V 8-bit
[    8.595095] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    8.602659] Scanning device for bad blocks
[    8.721165] 2 cmdlinepart partitions found on MTD device orion_nand
[    8.727428] Creating 2 MTD partitions on "orion_nand":
[    8.732553] 0x000000000000-0x0000000c0000 : "uboot"
[    8.738840] 0x000000100000-0x000008000000 : "root"
[    8.747335] libphy: Fixed MDIO Bus: probed
[    8.752331] libphy: orion_mdio_bus: probed
[    8.761885] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    8.866541] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:50:43:00:02:02
[    8.875405] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.881958] ehci-pci: EHCI PCI platform driver
[    8.886483] ehci-orion: EHCI orion driver
[    8.890747] orion-ehci f1050000.ehci: EHCI Host Controller
[    8.896301] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    8.904189] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    8.910136] ata1: SATA link down (SStatus 0 SControl F300)
[    8.945253] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    8.951489] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    8.958285] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.965498] usb usb1: Product: EHCI Host Controller
[    8.970358] usb usb1: Manufacturer: Linux 4.12.1-kirkwood-tld-1 ehci_hcd
[    8.977048] usb usb1: SerialNumber: f1050000.ehci
[    8.982582] hub 1-0:1.0: USB hub found
[    8.986414] hub 1-0:1.0: 1 port detected
[    8.991022] usbcore: registered new interface driver usb-storage
[    8.997414] mousedev: PS/2 mouse device common for all mice
[    9.246805] ata2: SATA link down (SStatus 0 SControl F300)
[    9.345254] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    9.536198] usb 1-1: New USB device found, idVendor=21c4, idProduct=8005
[    9.542885] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    9.550028] usb 1-1: Product: USB Flash Disk
[    9.554283] usb 1-1: Manufacturer: General
[    9.558382] usb 1-1: SerialNumber: 0475660000006AA4
[    9.564043] usb-storage 1-1:1.0: USB Mass Storage device detected
[    9.570506] scsi host2: usb-storage 1-1:1.0
[   10.015249] rtc-mv f1010300.rtc: internal RTC not ticking
[   10.020813] i2c /dev entries driver
[   10.026090] hidraw: raw HID events driver (C) Jiri Kosina
[   10.031862] drop_monitor: Initializing network drop monitor service
[   10.038402] NET: Registered protocol family 17
[   10.042921] Key type dns_resolver registered
[   10.048067] registered taskstats version 1
[   10.052144] Loading compiled-in X.509 certificates
[   10.057003] zswap: loaded using pool lzo/zbud
[   10.072131] Key type big_key registered
[   10.086316] Key type encrypted registered
[   10.091738] hctosys: unable to open rtc device (rtc0)
[   10.097184] PM: Hibernation image not present or could not be loaded.
[   10.100303] Freeing unused kernel memory: 1024K
[   10.533278] usbcore: registered new interface driver uas
[   10.579186] scsi 2:0:0:0: Direct-Access     General  USB Flash Disk   1.00 PQ: 0 ANSI: 4
[   10.596505] sd 2:0:0:0: [sda] 15702112 512-byte logical blocks: (8.04 GB/7.49 GiB)
[   10.610182] sd 2:0:0:0: [sda] Write Protect is off
[   10.614997] sd 2:0:0:0: [sda] Mode Sense: 03 00 00 00
[   10.620243] sd 2:0:0:0: [sda] No Caching mode page found
[   10.630948] sd 2:0:0:0: [sda] Assuming drive cache: write through
[   10.648740]  sda: sda1
[   10.655502] sd 2:0:0:0: [sda] Attached SCSI removable disk
[   59.963865] random: crng init done
[  246.134616] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[  246.489209] marvell-cesa f1030000.crypto: CESA device successfully registered
[  246.535452] orion_wdt: Initial timeout 25 sec
[  246.603328] sd 2:0:0:0: Attached scsi generic sg0 type 0
[  253.862608] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[  261.063613] NET: Registered protocol family 10
[  261.071092] Segment Routing with IPv6
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000c0000 00020000 "uboot"
mtd1: 07f00000 00020000 "root"
root@debian:~# dmesg | grep -i bad
[    8.602659] Scanning device for bad blocks
root@debian:~# cd /backup
root@debian:/backup# flash_erase /dev/mtd0 0 0
Erasing 128 Kibyte @ 7f62df5c00000064 --  6 % complete 
root@debian:/backup# nandwrite /dev/mtd0 mtd0.dns-320l
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
Writing data to block 5 at offset 0xa0000
root@debian:/backup# reboot

Broadcast message from root@debian (ttyS0) (Wed Dec 31 16:06:30 1969):

I[info] Using makefile-style concurrent boot in runlevel 6.
[....] Stopping busybox' klogd implementation: klogd1300 (klogd)
Stopped klogd (pid 1300).
. ok 
[ ok ] Stopping Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[....] Stopping busybox' syslogd implementation: syslogd1297 (syslogd)
. ok 
[ ok ] Stopping NFS kernel daemon: mountd nfsd.
[ ok ] Unexporting directories for NFS kernel daemon....
[ ok ] Asking all remaining processes to terminate...done.
[ ok ] All processes ended within 1 seconds...done.
[ ok ] Saving random seed...done.
[ ok ] Stopping RPC port mapper daemon: rpcbind.
[ ok ] Stopping NFS common utilities: idmapd statd.
[info] Saving the system clock.
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
[....] Deconfiguring network interfaces...Removed stale PID file
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:50:43:00:02:02
Sending on   LPF/eth0/00:50:43:00:02:02
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.1.1 port 67
done.
[....] Will now unmount temporary filesystems:umount: /tmp unmounted
. ok 
[ ok ] Will now deactivate swap:.
[ ok ] Mounting root filesystem read-only...done.
[info] Will now restart.
[  398.292806] reboot: Restarting system

Re: UART Boot DNS-320 B1 with broken NAND
December 20, 2018 03:21AM
Ironaxe,

I did not see anything that could prevent the box to boot that mtd0 image.

The only thing I can think of is you have 2 different variations of this DSN-320 boxes. But you do have 2 DNS-320 boxes with the same model?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 20, 2018 04:02AM
Yea.
Both Boxes are the same Model and Revision.
Re: UART Boot DNS-320 B1 with broken NAND
December 20, 2018 04:52AM
Ironaxe,

> Yea.
> Both Boxes are the same Model and Revision.

I'm out of idea :)

However, do you have a serial boot log for the good box? I don't recall seeing in this thread.

What I want to take another look at:

- Stock serial boot log with u-boot envs listed in serial console prompt
- Boot all the way into stock OS
- and then cat /proc/mtd in stock OS shell

I could have missed some info about the NAND partitions. I think we should give it a last shot before giving up :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 20, 2018 06:34AM
Problem is, the "Good" Box has the Bad NAND ( needs freezing or kwboot to boot ) and had ( The last few Days ) the New NAND Chip.
To test the Stock OS / and get another Dump i needed to swap the NAND Chips again. ^^
( Can do this maximum one more Time till the Pads on the PCB break )
The "Broken" Box has no NAND atm, but can be kwboot'ed

So probably the best way would be to bypass the NAND at all if it would be somehow possible.

Anyway. There ya go:

root@debian:/dns-320l/uboot# kwboot -t -B 115200 /dev/ttyUSB0 -b mtd0.dns-320l -p
Sending boot message. Please reboot the target...-
Sending boot image...
  0 % [......................................................................]
  .....
 99 % [......................................................]
[Type Ctrl-\ + c to quit]

 ** MARVELL BOARD: DB-88F6702A-BP LE 

U-Boot 1.1.4 (Apr 19 2012 - 11:21:19) Marvell version: 3.6.0.DNS-320B.01

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz 

DRAM (DDR2) CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 

Marvell>> printenv 
bootargs=root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
bootcmd=nand read.e 0xa00000 0x100000 0x300000;nand read.e 0xf00000 0x600000 0x300000;bootm 0xa00000 0xf00000
baudrate=115200
loads_echo=0
ipaddr=2.66.66.201
serverip=2.66.66.32
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=1
ethprime=egiga0
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
bootdelay=1
disaMvPnp=no
ethaddr=00:50:43:00:02:02
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
enaAutoRecovery=yes
pcieTune=no
ethact=egiga0

Environment size: 1272/131068 bytes

Marvell>> boot

NAND read: device 0 offset 0x100000, size 0x300000
load addr ....  =a00000

 3145728 bytes read: OK

NAND read: device 0 offset 0x600000, size 0x300000
load addr ....  =f00000

 3145728 bytes read: OK
## Booting image at 00a00000 ...
   Image Name:   Linux-2.6.31.8
   Created:      2012-01-17  10:46:18 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2610908 Bytes =  2.5 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 00f00000 ...
   Image Name:   Ramdisk
   Created:      2012-07-06  11:53:44 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    1750186 Bytes =  1.7 MB
   Load Address: 00e00000
   Entry Point:  00e00000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux........................................................................................................................................................................ done, booting the kernel.
Linux version 2.6.31.8 (jack@swtest5) (gcc version 4.3.2 (sdk3.3-ct-ng-1.4.1) ) #3 Tue Jan 17 18:46:16 CST 2012
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Feroceon-KW
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 32512
Kernel command line: root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 115468KB available (4924K code, 334K data, 136K init, 0K highmem)
Hierarchical RCU implementation.
NR_IRQS:128
Console: colour dummy device 80x30
Calibrating delay loop... 999.42 BogoMIPS (lpj=4997120)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Feroceon L2: Enabling L2
Feroceon L2: Cache support initialised.

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 128MB 
SDRAM_CS1 ....disable
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base e0000000, size 128MB 
PEX0_IO ....base f2000000, size   1MB 
PEX1_MEM ....no such
PEX1_IO ....no such
INTER_REGS ....base f1000000, size   1MB 
NFLASH_CS ....base fa000000, size   2MB 
SPI_CS ....base f4000000, size  16MB 
BOOT_ROM_CS ....no such
DEV_BOOTCS ....no such
CRYPT_ENG ....base f0000000, size   2MB 

  Marvell Development Board (LSP Version KW_LSP_5.1.3_patch29)-- DB-88F6702A-BP  Soc: 88F6702 A1 LE

 Detected Tclk 166666667 and SysClk 400000000 
MV Buttons Device Load
Marvell USB EHCI Host controller #0: c403e740
PEX0 interface detected no Link.
PCI: bus0: Fast back to back transfers enabled
mvPexLocalBusNumSet: ERR. Invalid PEX interface 1
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 1708K
RTC has been updated!!!
rtc mv_rtc: rtc core: registered kw-rtc as rtc0
RTC registered
cpufreq: Init kirkwood cpufreq driver
XOR registered 4 channels
XOR 2nd invalidate WA enabled
cesadev_init(c000ed5c)
mvCesaInit: sessions=640, queue=64, pSram=f0000000
MV Buttons Driver Load
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
NTFS driver 2.1.29 [Flags: R/O].
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.12)
msgmni has been set to 229
alg: No test for cipher_null (cipher_null-generic)
alg: No test for ecb(cipher_null) (ecb-cipher_null)
alg: No test for digest_null (digest_null-generic)
alg: No test for compress_null (compress_null-generic)
alg: No test for lzma (lzma-generic)
alg: No test for stdrng (krng)
alg: No test for hmac(digest_null) (hmac(digest_null-generic))
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler anticipatory registered (default)
Initializing ths8200_init
Initializing dove_adi9889_init
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
brd: module loaded
loop: module loaded
Integrated Sata device found
IRQ 21/mvSata: IRQF_DISABLED is not guaranteed on shared IRQs
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
Loading Marvell Ethernet Driver:
  o Cached descriptors in DRAM
  o DRAM SW cache-coherency
  o 2 Giga ports supported
  o Single RX Queue support - ETH_DEF_RXQ=0
  o Single TX Queue support - ETH_DEF_TXQ=0
  o TCP segmentation offload (TSO) supported
  o Large Receive offload (LRO) supported
  o Receive checksum offload supported
  o Transmit checksum offload supported
  o Network Fast Processing (Routing) supported - (Disabled)
  o Driver ERROR statistics enabled
  o Proc tool API enabled
  o SKB Reuse supported - (Disabled)
  o SKB Recycle supported - (Disabled)
  o Rx descripors: q0=128
  o Tx descripors: q0=532
  o Loading network interface(s):
     o register under mv88fx_eth platform
     o egiga0, ifindex = 2, GbE port = 0

Warning: Giga 1 is Powered Off

mvFpRuleDb (c4569000): 1024 entries, 4096 bytes
Counter=0, opIdx=6, overhead=16
Counter=1, opIdx=2, overhead=0
Counter=2, opIdx=1, overhead=18
Counter=3, opIdx=2, overhead=0
NAND device: Manufacturer ID: 0xad, Chip ID: 0xf1 (Hynix NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 1013 at 0x000007ea0000
Using static partition definition
Creating 7 MTD partitions on "nand_mtd":
0x000000000000-0x000000100000 : "u-boot"
0x000000100000-0x000000600000 : "uImage"
0x000000600000-0x000000b00000 : "ramdisk"
0x000000b00000-0x000006f00000 : "image"
0x000006f00000-0x000007900000 : "rescue firmware"
0x000007900000-0x000007e00000 : "config"
0x000007e00000-0x000008000000 : "my-dlink"
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci_marvell ehci_marvell.70059: Marvell Orion EHCI
ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
ehci_marvell ehci_marvell.70059: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
uhci_hcd: USB Universal Host Controller Interface driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
device-mapper: ioctl: 4.15.0-ioctl (2009-04-01) initialised: dm-devel@redhat.com
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
rtc mv_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
md: ... autorun DONE.
RAMDISK: gzip image found at block 0
EXT4-fs (ram0): no journal
EXT4-fs (ram0): delayed allocation enabled
EXT4-fs: mballoc enabled
EXT4-fs (ram0): mounted filesystem without journal
VFS: Mounted root (ext4 filesystem) on device 1:0.
Freeing init memory: 136K
init started: BusyBox v1.11.2 (2012-06-28 16:57:05 CST)
starting pid 538, tty '': '/etc/rc.sh'
** Mounting /etc/fstab
umount: proc: not mounted
umount: proc: not mounted
umount: /usr/local/modules: not mounted
sh: can't open /usr/sbin/pre_usb.sh
insmod: applet not found
umount: /usr/local/tmp/image.cfs: not found
umount: /usr/local/tmp: not mounted
first good block is 0
image len = 25034752 , image checksum = 8b73f1e3
dump image checksum=8b73f1e3
rmmod: applet not found
Empty flash at 0x00003948 ends at 0x00004000
ln: /lib/./libnss_dns-2.8.so: File exists
ln: /lib/./libnss_dns.so.2: File exists
ln: /usr/sbin/./system_init: File exists
mknod: /dev/REG: File exists
hardware init
GbE port 0: TxEnable WA - Enabled, deep=1, tx_en_bk=1

mtd check v1.01.05292012
/usr/local/config free size is 4730880
** copy config files
cp: cannot stat '/usr/local/config/user.log.old': No such file or directory
usbcore: registered new interface driver usblp
** set loopback interface
old ver:20120712
new ver:20120712
first good block is 0
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB sizegiga0: mac address changed
e 64
Dumping data starting at 0x00000000 and ending at 0x00000800...
mac1 = AC:F1:DF:12:DF:9A
lan0:ifconfig egiga0 hw ether AC:F1:DF:12:DF:9A
egiga0: link down
egiga0: started
DNS-320B function
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
ADDRCONF(NETDEV_UP): egiga0: link is not ready
IPv6 over IPv4 tunneling driver
sit0: Disabled Privacy Extensions
egiga0: link up, full duplex, speed 1 Gbps
ADDRCONF(NETDEV_CHANGE): egiga0: link becomes ready
ip6tnl0: Disabled Privacy Extensions
IPv4 over IPv4 tunneling driver
tunl0: Disabled Privacy Extensions
net.ipv6.conf.default.accept_dad = 2
net.ipv6.conf.egiga0.accept_dad = 2
net.ipv6.conf.default.dad_transmits = 1
net.ipv6.conf.egiga0.dad_transmits = 1
net.ipv6.conf.default.forwarding = 0
net.ipv6.conf.default.accept_redirects = 1
*** execute rc.init.sh
awk: /var/run/udhcpc0.pid: No such file or directory
udhcpc (v1.11.2) started
Sending discover...
Sending select for 192.168.1.110...
Lease of 192.168.1.110 obtained, lease time 268435455
sh: you need to specify whom to kill
crond[1313]: crond (busybox 1.11.2) started, log level 8

deleting routers
route: SIOCDELRT: No such process
call load_module network
ip: RTNETLINK answers: Operation not supported
ip: RTNETLINK answers: Operation not supported
crond[1349]: crond (busybox 1.11.2) started, log level 8

*** get Time from rtc and set it into system ****
rtc: RTC time = 2018/12/20 Thu 12:12:15
Thu Dec 20 12:12:15 UTC 2018
*** set Time Zone ****
Thu Dec 20 12:12:15 GMT 2018
*** Do not adjust RTC time ***

Module IPC SERVER Version:(1.00.20090706)

ads=0
created mail daemon thread 0
ifconfig: egiga1: error fetching interface information: Device not found
Command: wget -T5 -t3 -q http://cfaj.freeshell.org/ipaddr.cgi -O /tmp/exip.0
system daemon v1.03.0529212
chk_io v1.02.20120118
2018-12-20 12:12:27: (../../src/log.c.166) server started 

mfg_start version 1.00(2012-07-12)

Thu Dec 20 12:12:30 2018


Please press Enter to activate this console. 2018-12-20 12:12:30: (../../src/server.c.1396) [note] graceful shutdown started 
cp: cannot stat '/usr/local/config/ups_slave.dat': No such file or directory
2018-12-20 12:12:30: (../../src/log.c.166) server started 
LED_POWER_ON
2018-12-20 12:12:30: (../../src/server.c.1512) server stopped by UID = 0 PID = 1484 

starting pid 1566, tty '/dev/ttyS0': '/bin/login'
Password of admin: 


BusyBox v1.11.2 (2012-06-28 16:57:05 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00500000 00020000 "uImage"
mtd2: 00500000 00020000 "ramdisk"
mtd3: 06400000 00020000 "image"
mtd4: 00a00000 00020000 "rescue firmware"
mtd5: 00500000 00020000 "config"
mtd6: 00200000 00020000 "my-dlink"
#



Edited 1 time(s). Last edit at 12/20/2018 06:34AM by Ironaxe.
Re: UART Boot DNS-320 B1 with broken NAND
December 20, 2018 07:59AM
Ironaxe,

I see. We’ve came back the full circle :))

The mtd0 is 1MB, according to this log :) I’ll come back tomorrow, will explain what I understood, and what I think we can try.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 20, 2018 08:43AM
OK. :)
Take your time.
Re: UART Boot DNS-320 B1 with broken NAND
December 21, 2018 12:59AM
Ironaxe,

This stock kernel has hardcoded mtdparts. So the NAND partition in the DTS is correct. However, the definition should be passed in by u-boot.

So repeat your kwboot with the bad box using mtd0 backup of 1MB like before. Add adjust the mtdparts env and boot.

setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial'
setenv bootcmd_usb 'usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000'
boot

And then log into Debian,

cat /proc/mtd

It should show mtd0 as the only one mtd.

Flash 1M u-boot image.
flash_erase /dev/mtd0 0 0
nandwrite /dev/mtd0 mtd0.dns-320l

And cross your finger and reboot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 23, 2018 04:23PM
Unfortunately still not working :(

root@debian:/dns-320l/uboot# kwboot -t -B 115200 /dev/ttyUSB0 -b mtd0.dns-320l -p
Sending boot message. Please reboot the target.../
Sending boot image...
  0 % [......................................................................]
  .....
 99 % [......................................................]
[Type Ctrl-\ + c to quit]

 ** MARVELL BOARD: DB-88F6702A-BP LE 

U-Boot 1.1.4 (Apr 19 2012 - 11:21:19) Marvell version: 3.6.0.DNS-320B.01

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz 

DRAM (DDR2) CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 
Marvell>> setenv ethaddr AC:F1:DF:12:DF:9A
Marvell>> setenv ipaddr 192.168.1.110
Marvell>> setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial'
Marvell>> setenv bootcmd_usb 'usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv bootcmd 'setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000'
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> printenv
bootargs=root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
baudrate=115200
loads_echo=0
serverip=2.66.66.32
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=1
ethprime=egiga0
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
bootdelay=1
disaMvPnp=no
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
enaAutoRecovery=yes
pcieTune=no
ethact=egiga0
ethaddr=AC:F1:DF:12:DF:9A
ipaddr=192.168.1.110
bootargs_usb=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial
bootcmd_usb=usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd
bootcmd=setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000

Environment size: 1474/131068 bytes
Marvell>> boot
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
1 Storage Device(s) found
....
.
......
............
.........................
...................................................
......................................................................................................
.........................................................................................................................................................................

3832764 bytes read
....
.........................................................................................................................................................................................................................................................................................................................................................................................................................
.................................................................................................................................................................................................................................................................................................................................................

7702201 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2018-12-03   8:43:13 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3832700 Bytes =  3.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-4.12.1-kirkwood-tld-1
   Created:      2018-12-02  14:09:34 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7702137 Bytes =  7.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.12.1-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: D-Link DNS-320L
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial
[    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: 108980K/131072K available (8192K kernel code, 716K rwdata, 1972K rodata, 1024K init, 288K bss, 22092K reserved, 0K cma-reserved)
[    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]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)
[    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
[    0.000000]       .data : 0xc0d00000 - 0xc0db3274   ( 717 kB)
[    0.000000]        .bss : 0xc0db9b9c - 0xc0e01e60   ( 289 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000008] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.007915] Switching to timer-based delay loop, resolution 6ns
[    0.014389] Console: colour dummy device 80x30
[    0.018969] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666)
[    0.029582] pid_max: default: 32768 minimum: 301
[    0.034480] Security Framework initialized
[    0.038822] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.045498] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.053560] CPU: Testing write buffer coherency: ok
[    0.059591] Setting up static identity map for 0x100000 - 0x100058
[    0.066101] mvebu-soc-id: MVEBU SoC ID=0x6702, Rev=0x3
[    0.074950] devtmpfs: initialized
[    0.083086] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.093058] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.099694] prandom: seed boundary self test passed
[    0.109152] prandom: 100 self tests passed
[    0.113320] pinctrl core: initialized pinctrl subsystem
[    0.119871] NET: Registered protocol family 16
[    0.124863] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.133566] cpuidle: using governor ladder
[    0.137796] cpuidle: using governor menu
[    0.142325] Feroceon L2: Enabling L2
[    0.146003] Feroceon L2: Cache support initialised.
[    0.151369] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.167483] No ATAGs?
[    0.177876] vgaarb: loaded
[    0.183388] SCSI subsystem initialized
[    0.187733] usbcore: registered new interface driver usbfs
[    0.193405] usbcore: registered new interface driver hub
[    0.198889] usbcore: registered new device driver usb
[    0.205233] clocksource: Switched to clocksource orion_clocksource
[    0.314406] VFS: Disk quotas dquot_6.6.0
[    0.318551] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.337205] NET: Registered protocol family 2
[    0.342433] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.349513] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.355954] TCP: Hash tables configured (established 1024 bind 1024)
[    0.362447] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.368376] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.374881] NET: Registered protocol family 1
[    0.379781] RPC: Registered named UNIX socket transport module.
[    0.385839] RPC: Registered udp transport module.
[    0.390608] RPC: Registered tcp transport module.
[    0.395403] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.402151] Unpacking initramfs...
[    1.192322] Freeing initrd memory: 7524K
[    1.196585] NetWinder Floating Point Emulator V0.97 (double precision)
[    1.204245] audit: initializing netlink subsys (disabled)
[    1.210272] Initialise system trusted keyrings
[    1.214846] Key type blacklist registered
[    1.219003] audit: type=2000 audit(1.194:1): state=initialized audit_enabled=0 res=1
[    1.227005] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    1.233566] zbud: loaded
[    1.237308] NFS: Registering the id_resolver key type
[    1.242440] Key type id_resolver registered
[    1.246745] Key type id_legacy registered
[    1.250837] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.257626] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    1.264246] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    1.271577] fuse init (API version 7.26)
[    1.275994] orangefs_debugfs_init: called with debug mask: :none: :0:
[    1.282800] orangefs_init: module version upstream loaded
[    1.288296] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[    2.565240] random: fast init done
[    8.309923] Key type asymmetric registered
[    8.314095] Asymmetric key parser 'x509' registered
[    8.319365] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    8.326951] io scheduler noop registered
[    8.330942] io scheduler deadline registered
[    8.335409] io scheduler cfq registered (default)
[    8.341601] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    8.351045] mv_xor f1060800.xor: Marvell shared XOR driver
[    8.416122] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.423987] mv_xor f1060900.xor: Marvell shared XOR driver
[    8.486120] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.494202] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    8.502062] console [ttyS0] disabled
[    8.505840] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 10416666) is a 16550A
[    8.514885] console [ttyS0] enabled
[    8.514885] console [ttyS0] enabled
[    8.521965] bootconsole [earlycon0] disabled
[    8.521965] bootconsole [earlycon0] disabled
[    8.531298] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 26, base_baud = 10416666) is a 16550A
[    8.549824] loop: module loaded
[    8.553551] sata_mv f1080000.sata: slots 32 ports 2
[    8.561473] scsi host0: sata_mv
[    8.565073] scsi host1: sata_mv
[    8.568519] ata1: SATA max UDMA/133 irq 33
[    8.572596] ata2: SATA max UDMA/133 irq 33
[    8.577935] nand: Could not find valid ONFI parameter page; aborting
[    8.584278] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    8.590681] nand: Hynix NAND 128MiB 3,3V 8-bit
[    8.595104] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    8.602668] Scanning device for bad blocks
[    8.721179] 1 cmdlinepart partitions found on MTD device orion_nand
[    8.727436] Creating 1 MTD partitions on "orion_nand":
[    8.732552] 0x000000000000-0x000000100000 : "u-boot"
[    8.740173] libphy: Fixed MDIO Bus: probed
[    8.745152] libphy: orion_mdio_bus: probed
[    8.754660] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    8.856505] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:50:43:00:02:02
[    8.865375] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.871928] ehci-pci: EHCI PCI platform driver
[    8.876449] ehci-orion: EHCI orion driver
[    8.880689] orion-ehci f1050000.ehci: EHCI Host Controller
[    8.886235] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    8.894077] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    8.910175] ata1: SATA link down (SStatus 0 SControl F300)
[    8.925265] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    8.931618] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    8.938434] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.945644] usb usb1: Product: EHCI Host Controller
[    8.950503] usb usb1: Manufacturer: Linux 4.12.1-kirkwood-tld-1 ehci_hcd
[    8.957193] usb usb1: SerialNumber: f1050000.ehci
[    8.962703] hub 1-0:1.0: USB hub found
[    8.966555] hub 1-0:1.0: 1 port detected
[    8.971218] usbcore: registered new interface driver usb-storage
[    8.977653] mousedev: PS/2 mouse device common for all mice
[    9.266830] ata2: SATA link down (SStatus 0 SControl F300)
[    9.325268] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    9.516211] usb 1-1: New USB device found, idVendor=21c4, idProduct=8005
[    9.522900] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    9.530044] usb 1-1: Product: USB Flash Disk
[    9.534298] usb 1-1: Manufacturer: General
[    9.538398] usb 1-1: SerialNumber: 0475660000006AA4
[    9.544205] usb-storage 1-1:1.0: USB Mass Storage device detected
[    9.550665] scsi host2: usb-storage 1-1:1.0
[   10.015267] rtc-mv f1010300.rtc: internal RTC not ticking
[   10.020828] i2c /dev entries driver
[   10.026051] hidraw: raw HID events driver (C) Jiri Kosina
[   10.031833] drop_monitor: Initializing network drop monitor service
[   10.038373] NET: Registered protocol family 17
[   10.042890] Key type dns_resolver registered
[   10.048042] registered taskstats version 1
[   10.052126] Loading compiled-in X.509 certificates
[   10.056989] zswap: loaded using pool lzo/zbud
[   10.072154] Key type big_key registered
[   10.086415] Key type encrypted registered
[   10.091825] hctosys: unable to open rtc device (rtc0)
[   10.100385] Freeing unused kernel memory: 1024K
Loading, please wait...
starting version 232
[   10.528954] usbcore: registered new interface driver uas
[   10.580827] scsi 2:0:0:0: Direct-Access     General  USB Flash Disk   1.00 PQ: 0 ANSI: 4
[   10.599643] sd 2:0:0:0: [sda] 15702112 512-byte logical blocks: (8.04 GB/7.49 GiB)
[   10.612395] sd 2:0:0:0: [sda] Write Protect is off
[   10.622265] sd 2:0:0:0: [sda] No Caching mode page found
[   10.633302] sd 2:0:0:0: [sda] Assuming drive cache: write through
[   10.649753]  sda: sda1
[   10.657760] sd 2:0:0:0: [sda] Attached SCSI removable disk
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Will now check root file system ... fsck from util-linux 2.29.2
[/sbin/fsck.ext2 (1) -- /dev/sda1] fsck.ext2 -a -C0 /dev/sda1 
rootfs: clean, 14603/491520 files, 180700/1962496 blocks
done.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
[ ok ] Setting hostname to 'debian'...done.
[....] Starting the hotplug events dispatcher: systemd-udevdstarting version 232
. ok 
[....] Synthesizing the initial hotplug events...[   24.157972] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[ ok                                             done.
[....] Waiting for /dev to be fully populated...[   24.437667] orion_wdt: Initial timeout 25 sec
[   24.552808] marvell-cesa f1030000.crypto: CESA device successfully registered
[   24.612305] sd 2:0:0:0: Attached scsi generic sg0 type 0
done.
[ ok ] Activating swap:.
[   25.804536] random: crng init done
[ ok ] Will now activate lvm and md swap:done.
[info] Will now check all file systems.
fsck from util-linux 2.29.2
Checking all file systems.
LABEL=rootfs is mounted
[ ok ] Done checking file systems. A log is being saved in /var/log/fsck/checkfs if that location is writable..
[ ok ] Cleaning up temporary files...[....] Cleaning /tmp...done.
[ ok .
[ ok ] Will now mount local filesystems:.
[ ok ] Will now activate swapfile swap:done.
[ ok ] Checking minimum space in /tmp...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables...done.
[ ok ] Initializing random number generator...done.
[   33.300472] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[....] Configuring network interfaces...Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:50:43:00:02:02
Sending on   LPF/eth0/00:50:43:00:02:02
Sending on   Socket/fallback
DHCPREQUEST of 192.168.1.114 on eth0 to 255.255.255.255 port 67
[   39.939251] NET: Registered protocol family 10
[   39.946664] Segment Routing with IPv6
DHCPREQUEST of 192.168.1.114 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.114 from 192.168.1.1
bound to 192.168.1.114 -- renewal in 1073741823 seconds.
done.
[ ok ] Starting RPC port mapper daemon: rpcbind.
[ ok ] Starting NFS common utilities: statd idmapd.
[ ok ] Cleaning up temporary files....
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
[....] Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
1294 (syslogd)
. ok 
[ ok ] Starting NFS common utilities: statd idmapd.
[ ok ] Starting system message bus: dbus.
[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[warn] Not starting NFS kernel daemon: no exports. ... (warning).
[ ok ] Starting NTP server: ntpd.
[....] Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
1297 (klogd)
. ok 
[ ok ] Starting OpenBSD Secure Shell server: sshd.
[ ok ] Running local boot scripts (/etc/rc.local).

Debian GNU/Linux 9 debian ttyS0

debian login: root
Password: 
Last login: Wed Dec 31 16:05:10 PST 1969 on ttyS0
Linux debian 4.12.1-kirkwood-tld-1 #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
root@debian:~# cd /backup
root@debian:/backup# flash_erase /dev/mtd0 0 0
Erasing 128 Kibyte @ 7f656f5c00000064 --  8 % complete 
root@debian:/backup# ls
.   dlink.uboot   mtd0.dns-320-hacked  mtd0.dns-320l
..  mtd0.dns-320  mtd0.dns-320-short
root@debian:/backup# nandwrite /dev/mtd0 mtd0.dns-320 
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
Writing data to block 5 at offset 0xa0000
Writing data to block 6 at offset 0xc0000
Writing data to block 7 at offset 0xe0000

Even dumped the NAND again and made a File comparison...

root@debian:/backup# nanddump -n -f test /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00100000...
root@debian:/backup# cmp -b -l test mtd0.dns-320

No Output so no Error i guess...

root@debian:/backup# reboot

Broadcast message from root@debian (ttyS0) (Sun Dec 23 14:17:08 2018):

I[info] Using makefile-style concurrent boot in runlevel 6.
[....] Stopping busybox' klogd implementation: klogd1297 (klogd)
Stopped klogd (pid 1297).
. ok 
[ ok ] Stopping Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[....] Stopping busybox' syslogd implementation: syslogd1294 (syslogd)
. ok 
[ ok ] Stopping NFS kernel daemon: mountd nfsd.
[ ok ] Unexporting directories for NFS kernel daemon....
[ ok ] Asking all remaining processes to terminate...done.
[ ok ] All processes ended within 1 seconds...done.
[ ok ] Saving random seed...done.
[ ok ] Stopping RPC port mapper daemon: rpcbind.
[ ok ] Stopping NFS common utilities: idmapd statd.
[info] Saving the system clock.
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
[....] Deconfiguring network interfaces...Removed stale PID file
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:50:43:00:02:02
Sending on   LPF/eth0/00:50:43:00:02:02
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.1.1 port 67
done.
[....] Will now unmount temporary filesystems:umount: /tmp unmounted
. ok 
[ ok ] Will now deactivate swap:.
[ ok ] Mounting root filesystem read-only...done.
[info] Will now restart.
[  472.153668] reboot: Restarting system

Re: UART Boot DNS-320 B1 with broken NAND
December 23, 2018 09:45PM
Damn! I'm out of idea :)

However, one last hope is: compare the envs listing of the above kwboot run with the good box envs. See if there is any difference.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 25, 2018 06:19AM
It seems to me, that every time i restart the Box, the Envs get reset to defaults or the Envs that are Hardcoded inside the mtd0.dns-320 File.
Re: UART Boot DNS-320 B1 with broken NAND
December 25, 2018 04:29PM
Ironaxe,

> It seems to me, that every time i restart the Box,
> the Envs get reset to defaults or the Envs that
> are Hardcoded inside the mtd0.dns-320 File.

No, that's not likely. The envs were used are in NAND. The mtd0.dns-320 file does contain the envs. But when u-boot starts, it will read envs from NAND.

So when you kwboot, the only thing being used is u-boot image, which was loaded and run. And then it will read NAND to load envs. The only time that it will used its own internal uboot envs is when the NAND area does not contain valid envs (the checksum was verified).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
December 25, 2018 04:50PM
OK, but when i set "our" Envs, and do a

saveenv

command, it schould load the Envs i just set up and saved to NAND.
But that does not happen, according to

printenv
Re: UART Boot DNS-320 B1 with broken NAND
December 25, 2018 05:13PM
What you've missed was one step at the end.

You have set the envs in u-boot console to boot,

Marvell>> setenv ethaddr AC:F1:DF:12:DF:9A
Marvell>> setenv ipaddr 192.168.1.110
Marvell>> setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial'
Marvell>> setenv bootcmd_usb 'usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv bootcmd 'setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000'
Marvell>> saveenv


Annd then

Marvell>> boot


And flash u-boot in Debian

root@debian:/backup# flash_erase /dev/mtd0 0 0
root@debian:/backup# nandwrite /dev/mtd0 mtd0.dns-320


At this point, the envs were restored back to default. You need to readjust them:

See if the location is correct. If not, you need to edit this file.
cat /etc/fw_en.config

And,
fw_setenv ethaddr AC:F1:DF:12:DF:9A
fw_setenv ipaddr 192.168.1.110
fw_setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial'
fw_setenv bootcmd_usb 'usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd'
fw_setenv bootcmd 'setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000'

And list to see the changes

fw_printenv


And reboot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 12/25/2018 05:15PM by bodhi.
Re: UART Boot DNS-320 B1 with broken NAND
December 31, 2018 05:48AM
Unfortunately still the same...:(

root@debian:/dns-320l/uboot# kwboot -t -B 115200 /dev/ttyUSB0 -b mtd0.dns-320-short -p
Sending boot message. Please reboot the target...-
Sending boot image...
  0 % [......................................................................]
  .....
 99 % [...]
[Type Ctrl-\ + c to quit]

 ** MARVELL BOARD: DB-88F6702A-BP LE 

U-Boot 1.1.4 (Apr 19 2012 - 11:21:19) Marvell version: 3.6.0.DNS-320B.01

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz 

DRAM (DDR2) CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 
Marvell>> printenv   
bootargs=root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
bootcmd=nand read.e 0xa00000 0x100000 0x300000;nand read.e 0xf00000 0x600000 0x300000;bootm 0xa00000 0xf00000
baudrate=115200
loads_echo=0
ipaddr=2.66.66.201
serverip=2.66.66.32
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=1
ethprime=egiga0
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
bootdelay=1
disaMvPnp=no
ethaddr=00:50:43:00:02:02
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
enaAutoRecovery=yes
pcieTune=no
ethact=egiga0

Environment size: 1272/131068 bytes
Marvell>> setenv ethaddr AC:F1:DF:12:DF:9A
Marvell>> setenv ipaddr 192.168.1.110
Marvell>> setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial'
Marvell>> setenv bootcmd_usb 'usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv bootcmd 'setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000'
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> boot
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
1 Storage Device(s) found
....
.
......
............
.........................
...................................................
......................................................................................................
.........................................................................................................................................................................

3832764 bytes read
....
.........................................................................................................................................................................................................................................................................................................................................................................................................................
.................................................................................................................................................................................................................................................................................................................................................

7702201 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2018-12-03   8:43:13 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3832700 Bytes =  3.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-4.12.1-kirkwood-tld-1
   Created:      2018-12-02  14:09:34 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7702137 Bytes =  7.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.12.1-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: D-Link DNS-320L
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial
[    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: 108980K/131072K available (8192K kernel code, 716K rwdata, 1972K rodata, 1024K init, 288K bss, 22092K reserved, 0K cma-reserved)
[    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]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)
[    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
[    0.000000]       .data : 0xc0d00000 - 0xc0db3274   ( 717 kB)
[    0.000000]        .bss : 0xc0db9b9c - 0xc0e01e60   ( 289 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000009] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.007915] Switching to timer-based delay loop, resolution 6ns
[    0.014388] Console: colour dummy device 80x30
[    0.018967] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666)
[    0.029585] pid_max: default: 32768 minimum: 301
[    0.034474] Security Framework initialized
[    0.038810] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.045491] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.053556] CPU: Testing write buffer coherency: ok
[    0.059589] Setting up static identity map for 0x100000 - 0x100058
[    0.066101] mvebu-soc-id: MVEBU SoC ID=0x6702, Rev=0x3
[    0.074944] devtmpfs: initialized
[    0.083070] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.093040] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.099677] prandom: seed boundary self test passed
[    0.109136] prandom: 100 self tests passed
[    0.113301] pinctrl core: initialized pinctrl subsystem
[    0.119859] NET: Registered protocol family 16
[    0.124854] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.133551] cpuidle: using governor ladder
[    0.137789] cpuidle: using governor menu
[    0.142314] Feroceon L2: Enabling L2
[    0.145994] Feroceon L2: Cache support initialised.
[    0.151360] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.167484] No ATAGs?
[    0.177870] vgaarb: loaded
[    0.183388] SCSI subsystem initialized
[    0.187734] usbcore: registered new interface driver usbfs
[    0.193406] usbcore: registered new interface driver hub
[    0.198888] usbcore: registered new device driver usb
[    0.205237] clocksource: Switched to clocksource orion_clocksource
[    0.314429] VFS: Disk quotas dquot_6.6.0
[    0.318575] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.337236] NET: Registered protocol family 2
[    0.342466] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.349546] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.355988] TCP: Hash tables configured (established 1024 bind 1024)
[    0.362481] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.368410] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.374918] NET: Registered protocol family 1
[    0.379821] RPC: Registered named UNIX socket transport module.
[    0.385881] RPC: Registered udp transport module.
[    0.390651] RPC: Registered tcp transport module.
[    0.395454] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.402205] Unpacking initramfs...
[    1.192380] Freeing initrd memory: 7524K
[    1.196641] NetWinder Floating Point Emulator V0.97 (double precision)
[    1.204303] audit: initializing netlink subsys (disabled)
[    1.210334] Initialise system trusted keyrings
[    1.214892] Key type blacklist registered
[    1.219049] audit: type=2000 audit(1.194:1): state=initialized audit_enabled=0 res=1
[    1.227063] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    1.233625] zbud: loaded
[    1.237363] NFS: Registering the id_resolver key type
[    1.242499] Key type id_resolver registered
[    1.246806] Key type id_legacy registered
[    1.250898] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.257686] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    1.264306] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    1.271637] fuse init (API version 7.26)
[    1.276051] orangefs_debugfs_init: called with debug mask: :none: :0:
[    1.282861] orangefs_init: module version upstream loaded
[    1.288356] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[    2.565245] random: fast init done
[    8.309824] Key type asymmetric registered
[    8.313992] Asymmetric key parser 'x509' registered
[    8.319263] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    8.326845] io scheduler noop registered
[    8.330838] io scheduler deadline registered
[    8.335312] io scheduler cfq registered (default)
[    8.341509] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    8.350942] mv_xor f1060800.xor: Marvell shared XOR driver
[    8.416119] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.423978] mv_xor f1060900.xor: Marvell shared XOR driver
[    8.486118] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.494203] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    8.502055] console [ttyS0] disabled
[    8.505834] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 10416666) is a 16550A
[    8.514875] console [ttyS0] enabled
[    8.514875] console [ttyS0] enabled
[    8.521958] bootconsole [earlycon0] disabled
[    8.521958] bootconsole [earlycon0] disabled
[    8.531296] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 26, base_baud = 10416666) is a 16550A
[    8.549823] loop: module loaded
[    8.553550] sata_mv f1080000.sata: slots 32 ports 2
[    8.561471] scsi host0: sata_mv
[    8.565076] scsi host1: sata_mv
[    8.568519] ata1: SATA max UDMA/133 irq 33
[    8.572598] ata2: SATA max UDMA/133 irq 33
[    8.577936] nand: Could not find valid ONFI parameter page; aborting
[    8.584277] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    8.590680] nand: Hynix NAND 128MiB 3,3V 8-bit
[    8.595104] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    8.602668] Scanning device for bad blocks
[    8.721183] 1 cmdlinepart partitions found on MTD device orion_nand
[    8.727446] Creating 1 MTD partitions on "orion_nand":
[    8.732561] 0x000000000000-0x000000100000 : "u-boot"
[    8.740185] libphy: Fixed MDIO Bus: probed
[    8.745156] libphy: orion_mdio_bus: probed
[    8.754732] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    8.856541] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:50:43:00:02:02
[    8.865410] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.871962] ehci-pci: EHCI PCI platform driver
[    8.876482] ehci-orion: EHCI orion driver
[    8.880725] orion-ehci f1050000.ehci: EHCI Host Controller
[    8.886279] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    8.894202] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    8.910296] ata1: SATA link down (SStatus 0 SControl F300)
[    8.925268] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    8.931632] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    8.938444] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.945662] usb usb1: Product: EHCI Host Controller
[    8.950519] usb usb1: Manufacturer: Linux 4.12.1-kirkwood-tld-1 ehci_hcd
[    8.957210] usb usb1: SerialNumber: f1050000.ehci
[    8.962726] hub 1-0:1.0: USB hub found
[    8.966572] hub 1-0:1.0: 1 port detected
[    8.971232] usbcore: registered new interface driver usb-storage
[    8.977672] mousedev: PS/2 mouse device common for all mice
[    9.266833] ata2: SATA link down (SStatus 0 SControl F300)
[    9.325274] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    9.516210] usb 1-1: New USB device found, idVendor=21c4, idProduct=8005
[    9.522901] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    9.530044] usb 1-1: Product: USB Flash Disk
[    9.534298] usb 1-1: Manufacturer: General
[    9.538399] usb 1-1: SerialNumber: 0475660000006AA4
[    9.544201] usb-storage 1-1:1.0: USB Mass Storage device detected
[    9.550662] scsi host2: usb-storage 1-1:1.0
[   10.015272] rtc-mv f1010300.rtc: internal RTC not ticking
[   10.020838] i2c /dev entries driver
[   10.026060] hidraw: raw HID events driver (C) Jiri Kosina
[   10.031845] drop_monitor: Initializing network drop monitor service
[   10.038379] NET: Registered protocol family 17
[   10.042898] Key type dns_resolver registered
[   10.048048] registered taskstats version 1
[   10.052127] Loading compiled-in X.509 certificates
[   10.056989] zswap: loaded using pool lzo/zbud
[   10.072055] Key type big_key registered
[   10.086368] Key type encrypted registered
[   10.091773] hctosys: unable to open rtc device (rtc0)
[   10.100333] Freeing unused kernel memory: 1024K
Loading, please wait...
starting version 232
[   10.528717] usbcore: registered new interface driver uas
[   10.579695] scsi 2:0:0:0: Direct-Access     General  USB Flash Disk   1.00 PQ: 0 ANSI: 4
[   10.597282] sd 2:0:0:0: [sda] 15702112 512-byte logical blocks: (8.04 GB/7.49 GiB)
[   10.611652] sd 2:0:0:0: [sda] Write Protect is off
[   10.621146] sd 2:0:0:0: [sda] No Caching mode page found
[   10.631998] sd 2:0:0:0: [sda] Assuming drive cache: write through
[   10.649001]  sda: sda1
[   10.656507] sd 2:0:0:0: [sda] Attached SCSI removable disk
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Will now check root file system ... fsck from util-linux 2.29.2
[/sbin/fsck.ext2 (1) -- /dev/sda1] fsck.ext2 -a -C0 /dev/sda1 
rootfs: clean, 14606/491520 files, 181343/1962496 blocks
done.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
[ ok ] Setting hostname to 'debian'...done.
[....] Starting the hotplug events dispatcher: systemd-udevdstarting version 232
. ok 
[ ok ] Synthesizing the initial hotplug events...done.
[   24.186695] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[....] Waiting for /dev to be fully populated...[   24.543281] orion_wdt: Initial timeout 25 sec
[   24.658174] marvell-cesa f1030000.crypto: CESA device successfully registered
[   24.675516] sd 2:0:0:0: Attached scsi generic sg0 type 0
done.
[ ok ] Activating swap:.
[   25.907158] random: crng init done
[ ok ] Will now activate lvm and md swap:done.
[info] Will now check all file systems.
fsck from util-linux 2.29.2
Checking all file systems.
LABEL=rootfs is mounted
[ ok ] Done checking file systems. A log is being saved in /var/log/fsck/checkfs if that location is writable..
[ ok ] Cleaning up temporary files...[....] Cleaning /tmp...done.
[ ok .
[ ok ] Will now mount local filesystems:.
[ ok ] Will now activate swapfile swap:done.
[ ok ] Checking minimum space in /tmp...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables...done.
[ ok ] Initializing random number generator...done.
[   31.697799] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[....] Configuring network interfaces...Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:50:43:00:02:02
Sending on   LPF/eth0/00:50:43:00:02:02
Sending on   Socket/fallback
DHCPREQUEST of 192.168.1.114 on eth0 to 255.255.255.255 port 67
[   38.450958] NET: Registered protocol family 10
[   38.458606] Segment Routing with IPv6
DHCPREQUEST of 192.168.1.114 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.114 from 192.168.1.1
bound to 192.168.1.114 -- renewal in 1073741824 seconds.
done.
[ ok ] Starting RPC port mapper daemon: rpcbind.
[ ok ] Starting NFS common utilities: statd idmapd.
[ ok ] Cleaning up temporary files....
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
[....] Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
1288 (syslogd)
. ok 
[ ok ] Starting NFS common utilities: statd idmapd.
[ ok ] Starting system message bus: dbus.
[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[warn] Not starting NFS kernel daemon: no exports. ... (warning).
[ ok ] Starting NTP server: ntpd.
[....] Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
1289 (klogd)
. ok 
[ ok ] Starting OpenBSD Secure Shell server: sshd.
[ ok ] Running local boot scripts (/etc/rc.local).

Debian GNU/Linux 9 debian ttyS0

debian login: root
Password: 
Last login: Wed Dec 31 16:03:31 PST 1969 on ttyS0
Linux debian 4.12.1-kirkwood-tld-1 #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@debian:~# cat /etc/fw_env.config
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000
root@debian:~# flash_erase /dev/mtd0 0 0
Erasing 128 Kibyte @ 7f609f5c00000064 --  8 % complete 
root@debian:~# cd /backup
root@debian:/backup# nandwrite /dev/mtd0 mtd0.dns-320
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
Writing data to block 5 at offset 0xa0000
Writing data to block 6 at offset 0xc0000
Writing data to block 7 at offset 0xe0000
root@debian:/backup# fw_setenv ethaddr AC:F1:DF:12:DF:9A
root@debian:/backup# fw_setenv ipaddr 192.168.1.110
tfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial'oot=LABEL=root
000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd'load usb 0:1 0x008000
otcmd_usb ; bootm 0x00800000 0x2100000''setenv bootargs ${bootargs_usb} ; run boo
root@debian:/backup# fw_printenv
bootargs=
bootdelay=2
baudrate=115200
arch=sandbox
cpu=sandbox
board=sandbox
board_name=sandbox
stdin=serial,cros-ec-keyb,usbkbd
stdout=serial,vidconsole
stderr=serial,vidconsole
eth1addr=00:00:11:22:33:45
eth3addr=00:00:11:22:33:46
eth5addr=00:00:11:22:33:47
host_boot=if host dev ${devnum}; then setenv devtype host; run scan_dev_for_boot_part; fi
boot_net_pci_enum=pci enum
boot_net_usb_start=usb start
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_script_dhcp=boot.scr.uimg
boot_targets=host1 host0 
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
bootcmd_host1=setenv devnum 1; run host_boot
bootcmd_host0=setenv devnum 0; run host_boot
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
bootm_size=0x10000000
kernel_addr_r=0x1000000
fdt_addr_r=0xc00000
ramdisk_addr_r=0x2000000
scriptaddr=0x1000
pxefile_addr_r=0x2000
ethaddr=AC:F1:DF:12:DF:9A
ipaddr=192.168.1.110
bootargs_usb=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial
bootcmd_usb=usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd
bootcmd=setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000
root@debian:/backup# rebot
-bash: rebot: command not found
root@debian:/backup# reboot

Broadcast message from root@debian (ttyS0) (Mon Dec 31 03:45:41 2018):

I[info] Using makefile-style concurrent boot in runlevel 6.
[ ok ] Stopping Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[....] Stopping busybox' klogd implementation: klogd1289 (klogd)
Stopped klogd (pid 1289).
. ok 
[....] Stopping busybox' syslogd implementation: syslogd1288 (syslogd)
. ok 
[ ok ] Stopping NFS kernel daemon: mountd nfsd.
[ ok ] Unexporting directories for NFS kernel daemon....
[ ok ] Saving random seed...done.
[ ok ] Asking all remaining processes to terminate...done.
[ ok ] All processes ended within 1 seconds...done.
[ ok ] Stopping RPC port mapper daemon: rpcbind.
[ ok ] Stopping NFS common utilities: idmapd statd.
[info] Saving the system clock.
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
[....] Deconfiguring network interfaces...Removed stale PID file
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:50:43:00:02:02
Sending on   LPF/eth0/00:50:43:00:02:02
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.1.1 port 67
done.
[....] Will now unmount temporary filesystems:umount: /tmp unmounted
. ok 
[ ok ] Will now deactivate swap:.
[ ok ] Mounting root filesystem read-only...done.
[info] Will now restart.
[ 1289.467925] reboot: Restarting system


Re: UART Boot DNS-320 B1 with broken NAND
January 01, 2019 10:48PM
I'm keeing this on a tab so I can come back later for a close look.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
January 15, 2019 01:55PM
Any ideas?

What i dont get, the Nand seems to work.
Loading the Kernel from Nand works.
So why does it refuse to boot U-Boot from Nand?
Maybe Nand serial bond to CPU?
Got no clue.....

Btw. Would it help to get the GPL Source as a Linux Noob ?? :)



Edited 1 time(s). Last edit at 01/15/2019 02:00PM by Ironaxe.
Re: UART Boot DNS-320 B1 with broken NAND
January 15, 2019 11:27PM
Ironaxe,

Yes, it is time to see the GPL source for this u-boot!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
January 16, 2019 03:36AM
Ok.
I just downloaded a copy.
You can get it here
Re: UART Boot DNS-320 B1 with broken NAND
February 13, 2019 09:09AM
Have been really busy lately, so not much time to have a look into the source.

You got some hints where to start?
Re: UART Boot DNS-320 B1 with broken NAND
February 13, 2019 04:22PM
Ironaxe Wrote:
-------------------------------------------------------
> Have been really busy lately, so not much time to
> have a look into the source.
>
> You got some hints where to start?

I have not looked at the GPL yet, so will take a peek later today.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Boot DNS-320 B1 with broken NAND
March 01, 2019 02:05AM
Ironaxe,

I forgot one test.

root@debian:/dns-320l/uboot# kwboot -t -B 115200 /dev/ttyUSB0 -b mtd0.dns-320-short -p
Sending boot message. Please reboot the target...-
Sending boot image...
  0 % [......................................................................]
  .....
 99 % [...]
[Type Ctrl-\ + c to quit]

 ** MARVELL BOARD: DB-88F6702A-BP LE 

U-Boot 1.1.4 (Apr 19 2012 - 11:21:19) Marvell version: 3.6.0.DNS-320B.01

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz 

DRAM (DDR2) CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 
Marvell>> printenv   
bootargs=root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
bootcmd=nand read.e 0xa00000 0x100000 0x300000;nand read.e 0xf00000 0x600000 0x300000;bootm 0xa00000 0xf00000
baudrate=115200
loads_echo=0
ipaddr=2.66.66.201
serverip=2.66.66.32
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=1
ethprime=egiga0
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
bootdelay=1
disaMvPnp=no
ethaddr=00:50:43:00:02:02
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
enaAutoRecovery=yes
pcieTune=no
ethact=egiga0

Environment size: 1272/131068 bytes
Marvell>> setenv ethaddr AC:F1:DF:12:DF:9A
Marvell>> setenv ipaddr 192.168.1.110
Marvell>> setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot) earlyprintk=serial'
Marvell>> setenv bootcmd_usb 'usb start ; ext2load usb 0:1 0x00800000 /boot/uImage ; ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv bootcmd 'setenv bootargs ${bootargs_usb} ; run bootcmd_usb ; bootm 0x00800000 0x2100000'
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done

At this point. Wait a few seconds. Unplug power.

And then run kwboot again. Plug in power cord. Interrupt serial console and,

printenv
See if the envs were successfully saved permanently.


UPDATE:

Also, that GPL has a different u-boot. So not sure it's worth look into.

./include/configs/mv_kw.h:#define CONFIG_IDENT_STRING	" Marvell version: 3.6.0.DNS-320L.01" //alpha.jack.20110511+"

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/01/2019 02:18AM by bodhi.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: