Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 06, 2021 08:50AM
Hi everybody.

I have Ctera C200 V2 device. It's based on Marvell 88F6707. I got the device with invalid bootloader flash image. It fall into bootloop:

BootROM 1.08
Booting from NAND flash
BootROM: Invalid header checksum
BootROM: Bad header at offset 00010000
BootROM: Bad header at offset 00020000
BootROM: Bad header at offset 00030000
BootROM: Bad header at offset 00040000
BootROM: Bad header at offset 00050000
BootROM: Bad header at offset 00060000
BootROM: Bad header at offset 00070000
BootROM: Bad header at offset 00080000
(...)

but, if I ran u-boot dump via kwboot, it works:

 kwboot -p -t -o 500000 -b esmt_1MB.bin  /dev/ttyUSB0
Sending boot message. Please reboot the target...-
Sending boot image...
  0 % [......................................................................]
  0 % [......................................................................]
  1 % [......................................................................]
  2 % [......................................................................]
  3 % [......................................................................]
  4 % [......................................................................]
  5 % [......................................................................]
  6 % [.....................High speed PHY - Version: 2.1.2 (COM-PHY-V20)
mvBoardSerdesModulesScan: mvTwsiRead erro serdes to default ****High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver 4.4.0
DDR3 Training Sequence - Ended Successfully
Status = MV_OK
.................................................]
  7 % [......................................................................]
  8 % [......................................................................]
  8 % [......................................................................]
  9 % [......................................................................]
 10 % [......................................................................]
 11 % [......................................................................]
 12 % [......................................................................]
 13 % [......................................................................]
 14 % [......................................................................]
 15 % [......................................................................]
 16 % [......................................................................]
 17 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 19 % [......................................................................]
 20 % [......................................................................]
 21 % [......................................................................]
 22 % [......................................................................]
 23 % [......................................................................]
 24 % [......................................................................]
 25 % [......................................................................]
 25 % [......................................................................]
 26 % [......................................................................]
 27 % [......................................................................]
 28 % [......................................................................]
 29 % [......................................................................]
 30 % [......................................................................]
 31 % [......................................................................]
 32 % [......................................................................]
 33 % [......................................................................]
 34 % [......................................................................]
 34 % [......................................................................]
 35 % [......................................................................]
 36 % [......................................................................]
 37 % [......................................................................]
 38 % [......................................................................]
 39 % [......................................................................]
 40 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 43 % [......................................................................]
 43 % [......................................................................]
 44 % [......................................................................]
 45 % [......................................................................]
 46 % [......................................................................]
 47 % [......................................................................]
 48 % [......................................................................]
 49 % [......................................................................]
 50 % [......................................................................]
 51 % [......................................................................]
 51 % [......................................................................]
 52 % [......................................................................]
 53 % [......................................................................]
 54 % [......................................................................]
 55 % [......................................................................]
 56 % [......................................................................]
 57 % [......................................................................]
 58 % [......................................................................]
 59 % [......................................................................]
 60 % [......................................................................]
 60 % [......................................................................]
 61 % [......................................................................]
 62 % [......................................................................]
 63 % [......................................................................]
 64 % [......................................................................]
 65 % [......................................................................]
 66 % [......................................................................]
 67 % [......................................................................]
 68 % [......................................................................]
 69 % [......................................................................]
 69 % [......................................................................]
 70 % [......................................................................]
 71 % [......................................................................]
 72 % [......................................................................]
 73 % [......................................................................]
 74 % [......................................................................]
 75 % [......................................................................]
 76 % [......................................................................]
 77 % [......................................................................]
 77 % [......................................................................]
 78 % [......................................................................]
 79 % [......................................................................]
 80 % [......................................................................]
 81 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 84 % [......................................................................]
 85 % [......................................................................]
 86 % [......................................................................]
 86 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 89 % [......................................................................]
 90 % [......................................................................]
 91 % [......................................................................]
 92 % [......................................................................]
 93 % [......................................................................]
 94 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 96 % [......................................................................]
 97 % [......................................................................]
 98 % [......................................................................]
 99 % [...........................................]
[Type Ctrl-\ + c to quit]


U-Boot 2011.12-g29cf28a (Nov 17 2014 - 17:13:47) Marvell version: v2011.12 2013_Q1.0p2

Nanya-DDR
ESMT-2GB-NAND
   ** CTera BootCode: 3, CTera Board: 2Drive_A **
Board: DB-88F6710-BP
SoC:   MV6710 A1
CPU:   Marvell PJ4B v7 UP (Rev 1) LE
       CPU    @ 1000 [MHz]
       L2     @ 667 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 667 [MHz]
       DDR 16Bit Width, FastPath Memory Access
DRAM:  1 GiB
modInfo->boardMppGrp1Mod = 30
modInfo->boardMppGrp2Mod = 0
NR67 dose NOT use RGMII0, so disable it.
mvGppValueSet: Err. An attempt to set output value to GPP 27 in input mode.
mvGppValueSet: Err. An attempt to set output value to GPP 27 in input mode.

Map:   Code:            0x3fef5000:0x3ff9ebd0
       BSS:             0x3ffefa6c
       Stack:           0x3f9f4ef8
       Heap:            0x3f9f5000:0x3fef5000

NAND:
ID=0xdac8
256 MiB
MMC:   MRVL_MMC: 0
Using default environment

PEX 0.0(0): Detected No Link.
PEX 0.1(1): Detected No Link.
mvGppValueSet: Err. An attempt to set output value to GPP 27 in input mode.
FPU not initialized
USB 0: Host Mode
USB 1: Host Mode
mvGppValueSet: Err. An attempt to set output value to GPP 27 in input mode.
Modules/Interfaces Detected:
       RGMII1 Phy
       PEX0 (Lane 0)
       PEX1 (Lane 1)
       SATA0 (Lane 2)
       SATA1 (Lane 3)
mvGppValueSet: Err. An attempt to set output value to GPP 27 in input mode.
Not Marvell PHY id1 ffff id2 ffff
PHY_PAGE_ADDR_REG = 0
POL = 4400
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
nand_read_bbt: Bad block at 0x00000c8e0000
CTera device parameters:
------------------------
mac = 00:25:25:05:09:65
board_id = 2Drive_A
product_id = C200
vendor_id = <not set>
sn = S163107000146
extra = <not set>
agent_licenses_number = <not set>
agent_server_licenses_number = 1

reset_and_hold_sec=0
Net:   egiga1 [PRIME]
Warning: egiga1 MAC addresses don't match:
Address in SROM is         00:50:43:02:00:00
Address in environment is  00:50:43:02:02:00

CTera starting up ...
Loading "bank1" ...

    ** image (1/2) **
Type:          kernel
Arch:          ARM
Board          2Drive_A
Date:          Tue Aug  9 01:32:23 IDT 2016
Version:       5.5.165.61499
Run address:   0x0
Kernel cmd:    console=ttyS0,115200 root=/dev/ram0
Image Offset:  0x600
Image Size:    0x33c240
Firm Offset:   0x0
Firm Size:     0x33ce00
MD5:           0166d0bf911fbd35968ce75a44a78c32
    ** image (2/2) **
Type:          romdisk
InitRD:        Yes
Arch:          ARM
Board          2Drive_A
Date:          Tue Aug  9 01:32:23 IDT 2016
Version:       5.5.165.61499
Image Offset:  0x33d400
Image Size:    0x1873040
Firm Offset:   0x33ce00
Firm Size:     0x1873c00
MD5:           7dab92500db64bf792d06f4f4772d0b1

Running kernel from 0x2000600, size 0x33c240 ...
Setting romdisk at 0x233d400, size 0x1873040 ...
## Booting kernel from Legacy Image at 02000600 ...
   Image Name:   Linux-3.2.54
   Created:      2016-08-08  21:15:53 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3392000 Bytes = 3.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 0233d400 ...
   Image Name:   CTera_romdisk
   Created:      2016-08-08  22:32:23 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    25636864 Bytes = 24.4 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 3.2.54 (build@zoozi-14-build) (gcc version 4.6.4 20120731 (prerelease) (Linaro GCC branch-4.6.4. Marvell GCC 201301-1645.aee66e26) ) #1 Tue Aug 9 00:15:47 IDT 2016

I attached my broken image. Could someone help me with repair the checksum error?
Attachments:
open | download - esmt_1MB.bin (976.6 KB)
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 06, 2021 10:07PM
chkdsk88,

Willy Tarreau did great job in doing that for the Mirabox (also Armada 370 board). The best source for what you are looking for.

http://wtarreau.blogspot.com/2013/02/mirabox-much-better-than-guruplug.html

Also, if you can find the recovery procedure/GPL for this Ctera box then they propbably have the stock u-boot image.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 09, 2021 10:41PM
Hey chkdsk88,

Thank you for your Ctera C200 V1 OpenWrt port. Thank you for providing this kwbootable binary from your Ctera C200 V2. I have been looking for this for a long time ever since your V1 port.

I hope this might help: I was able to use your kwboot to get a shell on my Ctera C200 V2 by modifying it as posted.
Attachments:
open | download - esmt_1MB.bin.bin (976.6 KB)
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 10, 2021 09:37AM
Relevant OpenWrt forum thread:

https://forum.openwrt.org/t/adding-openwrt-support-for-ctera-c200-v2/113042

@chkdsk88, tomorrow I will pass by the Lab and use `md` to dump the entire contents of NAND from my Ctera C200 V2 (and provide the u-boot script I used to do so).

I've also messaged you directly regarding serial access to my Ctera C200 V2.
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 11, 2021 04:39PM
hurricos Wrote:
-------------------------------------------------------
> Relevant OpenWrt forum thread:
>
> https://forum.openwrt.org/t/adding-openwrt-support-for-ctera-c200-v2/113042
>
> @chkdsk88, tomorrow I will pass by the Lab and use
> `md` to dump the entire contents of NAND from my
> Ctera C200 V2 (and provide the u-boot script I
> used to do so).
>
> I've also messaged you directly regarding serial
> access to my Ctera C200 V2.

Thanks for the image. It helped me go back to first bank after mistake. Can't wait for mtd0 dump. :) I still can't repair boot from nand.
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 20, 2021 01:27AM
It was the most stupid problem with hardware ever: UART adapter hold `Boot source[4]` in wrong state...
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 21, 2021 12:28AM
chkdsk88,

> It was the most stupid problem with hardware ever:
> UART adapter hold `Boot source[4]` in wrong
> state...

So the error was just artifact of the serial console connected? or was it real?

BootROM: Invalid header checksum

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 22, 2021 08:59AM
bodhi Wrote:
-------------------------------------------------------
>
> So the error was just artifact of the serial
> console connected? or was it real?
>

Serial console causes wrong initial nand configuration. The error was an artifact. It vanish without serial adapter connected.
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 22, 2021 02:55PM
> Serial console causes wrong initial nand
> configuration. The error was an artifact. It
> vanish without serial adapter connected.

Bummer. Indeed a stupid time wasting problem. The Zyxel NAS326 has a similar problem, most of the time it got stuck in the BooROM when serial console connected.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Help with rescue ARMADA-370 stock u-boot (Ctera C200 V2).
December 22, 2021 07:52PM
bodhi Wrote:
-------------------------------------------------------
> > Serial console causes wrong initial nand
> > configuration. The error was an artifact. It
> > vanish without serial adapter connected.
>
> Bummer. Indeed a stupid time wasting problem. The
> Zyxel NAS326 has a similar problem, most of the
> time it got stuck in the BooROM when serial
> console connected.

Actually, the NAS26 is worse. The serial console is silence while the BootROM is stuck waiting for kwboot handshake that never comes in a regular serial session.

-bodhi
===========================
Forum Wiki
bodhi's corner
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: