Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 09:11AM
doppelgospelhm Wrote:
-------------------------------------------------------
> Could you provide installation steps please? For
> me this didn't work:

1. You're only building the uImage, not the uInitrd
2. You need to ensure that your USB disk is FAT formatted
3. You need to copy uImage and uInitrd to a /boot/ folder on the USB, and rename uInitrd to uRamdisk
4. You may also need to modify your bootargs on the device, this needs to be done on the device itself otherwise it won't find your root partition and you'll get flashing red light (see the last steps under step 4 in osa's tutorial

The additional instructions look like this:
# Before chroot
mkdir /mnt/usb/boot
# Inside chroot
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-6.6.2-mvebu-tld-1 -d initrd.img-6.6.2-mvebu-tld-1 uInitrd
# Exit chroot
cp /mnt/sdb3/boot/uImage /mnt/usb/boot/uImage
cp /mnt/sdb3/boot/uInitrd /mnt/usb/boot/uRamdisk

Then the command to set the boot args is
fw_setenv bootargs 'root=/dev/sda3 console=ttyS0,115200'
but it has to be done on the device as it alters the contents of the flash.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 10:02AM
So decompiling u-boot wasn't a complete waste :)
Setting the bootcmd variable doesn't work, but the built-in process is as follows:
### Loading Firmware from USB 2.0 Disk ###
usb reset; fatload usb 0:1 0xa00000 /boot/uImage; fatload usb 0:1 0xf00000 /boot/uRamdisk
### Loading Firmware from Disk ###
ide reset; ext2load ide 0:3 0xa00000 /boot/uImage; ext2load ide 0:3 0xf00000 /boot/uRamdisk
### Loading Rescure Firmware from Disk ###
ext2load ide 0:5 0xa00000 /boot/uImage; ext2load ide 0:5 0xf00000 /boot/uRamdisk
### Start network installation ###
dhcp; tftp 0xa00000 uImage

Knowing this, instead of bootstrapping with a USB, I just created a third partition on the disk, formatted ext2, created /boot folder and put uImage/uRamdisk in there. Could even script it in post-update.d. It's an extra step when upgrading kernel but better than needing a USB to boot from HDD.
I can updated bootargs, but even if I couldn't, I can embed them in the .dts so that would solve that too. Finally a useable board!
Thanks @bodhi for all your work!
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 10:19AM
megal0maniac Wrote:
-------------------------------------------------------

> Then the command to set the boot args is
>
> fw_setenv bootargs 'root=/dev/sda3
> console=ttyS0,115200'
>
> but it has to be done on the device as it alters
> the contents of the flash.

Thank you! Is set the boot args mandatorily? Because I relied on Franceso's post and there is no bootargs set. Also is it safe to set boot args, like can I bricking my device with this settings? Or I can just format sda3 if something goes wrong and start it again?
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 06, 2024 10:31AM
megal0maniac Wrote:
-------------------------------------------------------

>
> The additional instructions look like this:
>
> cp /mnt/sdb3/boot/uImage /mnt/usb/boot/uImage
> cp /mnt/sdb3/boot/uInitrd /mnt/usb/boot/uRamdisk
>

why we need to copy uImage and uRamdisk on USB? As I know device boot from sda3, so rootfs, uImage and uRamdisk are supposed to be there.

in my case i use FAT32 USB with boot folder with these files in it https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/usbrecovery.tar.gz, so device booted from USB correctly with Fox's mini OS, then i connect to device with telnet and do all stuff.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 07, 2024 07:48AM
doppelgospelhm Wrote:
-------------------------------------------------------
> why we need to copy uImage and uRamdisk on USB? As
> I know device boot from sda3, so rootfs, uImage
> and uRamdisk are supposed to be there.

Sorry, I think that you and I are trying to do things quite differently so I'm still getting up to speed with the other process. In my case, I don't have the original drive (or firmware), just the bare board with serial port access so I'm fairly free to do whatever - I'm not trying to preserve anything.

Once you have Fox's mini OS installed on a USB, there's no reason to do anything with a USB so the instructions you posted confused me. Are you trying to preserve the original firmware?

The bootargs, as far as I understand, are necessary. At a minimum they tell the kernel where to find the root filesystem. There is a way to embed the bootargs in the dtb file, but that isn't done here so I don't see how the system would boot based on those instructions. Default bootargs points to /dev/ram for rootfs. I'm waiting for @bodhi to jump in and make all of this clear :P
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 07, 2024 03:42PM
> based on those instructions. Default bootargs
> points to /dev/ram for rootfs. I'm waiting for
> @bodhi to jump in and make all of this clear :P

Actually I don't know how to help. Since we don't have a complete installation instruction here for this box, I need to see all the steps that you guys use for installation.

- Can this u-boot read from USB and/or HDD using ext2load?
- Can you save the envs at u-boot prompt? especially the bootcmd.
- If you can save envs, does the bootcmd got reset by this u-boot each time it powers up?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 07, 2024 11:18PM
bodhi Wrote:
-------------------------------------------------------
> - Can this u-boot read from USB and/or HDD using
> ext2load?
It can. It has ext4load and fatload as well.

> - Can you save the envs at u-boot prompt?
> especially the bootcmd.
Nope. I have not found a way to persist any env vars from within u-boot. Once booted, fw_saveenv works if you provide initial variables in a file, then it can write the whole environment. BUT, this overwrites the MAC address and serial at the tail end of the flash (could be corrected by making the environment smaller)

> - If you can save envs, does the bootcmd got reset
> by this u-boot each time it powers up?
Yip. All changes and new variables set by fw_setenv reflect in u-boot EXCEPT for bootcmd which gets defaulted by some boot routine. Even then, it seems to be ignored anyway, so you need to configure storage to satisfy one of the three built in commands.

I also made a backup of mtd0 which I’m happy to share. Flash is only 1MiB.
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 08, 2024 12:41AM
@megal0maniac,

> Nope. I have not found a way to persist any env
> vars from within u-boot.

> Yip. All changes and new variables set by
> fw_setenv reflect in u-boot EXCEPT for bootcmd
> which gets defaulted by some boot routine. Even
> then, it seems to be ignored anyway, so you need
> to configure storage to satisfy one of the three
> built in commands.
>

OK. Thanks for the refresher. I dealt with too many boards so really hard to keep track things, unless I own the HW or there is an installation guide written here.

Let me build an armada-375 reference board u-boot, hoppefully if it is bootable with kwboot then that's what we will see if it will solve the problem. It might not have everything, but if it is able to set envs and save envs and boot into Debian would make life easier.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
May 08, 2024 02:31PM
Please try kwboot the attached u-boot image.

uboot.2024.07-rc2-tld-1.db-88f6720.kwb
md5:
806ec0f497725b46b9e0d322719b4d5e
sha256:
c595b3a5794ddb9f7a60e27917b8c2e87db9819039e30b4a64fbcb2407f91955

An example of running kwboot (if you have not run it before): https://forum.doozan.com/read.php?3,51739,51919#msg-51919

If it loads and runs OK, interrupt the count down and see if you can bring up the USB and ping the router:
usb start
setenv ipaddr <some valid IP address in the subnet that this box is connected to>
ping <router IP address>

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - uboot.2024.07-rc2-tld-1.db-88f6720.kwb (498.8 KB)
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 03, 2024 04:54PM
Hi, nice to see some progress ;-)

kwboot does not work for me. Upload start, but original uboot runs
kwboot version 2022.01+dfsg-2ubuntu2.5
Patching image boot signature to UART
Aligning image header to Xmodem block size
Sending boot message. Please reboot the target...-
Waiting 2s and flushing tty
Sending boot image header (33152 bytes)...
  0 % [......................................................................]
 27 % [......................................................................]
 54 % [......................................................................]
 81 % [.................................................                     ]
Done

BootROM - 1.51
Booting from SPI flash


General initialization - Version: 1.0.0
High speed PHY - Version: 0.1.1 (COM-PHY-V20) 
USB2 UTMI PHY initialized succesfully
USB2 UTMI PHY initialized succesfully
High speed PHY - Ended Successfully

DDR3 Training Sequence - Ver 5.7.1
DDR3 Training Sequence - Run with PBS.
DDR3 Training Sequence - Ended Successfully 
BootROM: Image checksum verification PASSED

 ** LOADER **


U-Boot 2013.01_v1.03 (Nov 20 2014 - 16:39:45) Marvell version: 2014_T2.0p3

Board: WD_Glacier_DB-88F6720-V2

I flashed nand with your uboot (filled with zeros to match flash size) and it goes into loop
BootROM - 1.51
Booting from SPI flash

BootROM - 1.51
Booting from SPI flash

BootROM - 1.51
Booting from SPI flash

BootROM - 1.51
Booting from SPI flash

BootROM - 1.51
Booting from SPI flash

BootROM - 1.51
Booting from SPI flash

BootROM - 1.51
Booting from SPI flash
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 03, 2024 07:55PM
Hi Osa,

Good to see you, too :)

Quote

kwboot version 2022.01+dfsg-2ubuntu2.5

This version is a bit old. Please try my latest kwboot build:

https://forum.doozan.com/read.php?3,27280

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 04, 2024 02:29AM
Still does not work for me.
./kwboot  -t -B 115200 /dev/ttyUSB0 -b uboot -p
kwboot version 2024.04-rc3-00001-g0861eab8ec-dirty
Detected kwbimage v1 with SPI boot signature
Patching image boot signature to UART
Aligning image header to Xmodem block size
Sending boot message. Please reboot the target...|
Sending boot image header (33152 bytes)...
  0 % [......................................................................]
 27 % [......................................................................]
 54 % [......................................................................]
 81 % [.................................................                     ]
Done

BootROM - 1.51
Booting from SPI flash


General initialization - Version: 1.0.0
High speed PHY - Version: 0.1.1 (COM-PHY-V20) 
USB2 UTMI PHY initialized succesfully
USB2 UTMI PHY initialized succesfully
High speed PHY - Ended Successfully

DDR3 Training Sequence - Ver 5.7.1
DDR3 Training Sequence - Run with PBS.
DDR3 Training Sequence - Ended Successfully 
BootROM: Image checksum verification PASSED

 ** LOADER **


U-Boot 2013.01_v1.03 (Nov 20 2014 - 16:39:45) Marvell version: 2014_T2.0p3

Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 05, 2024 01:19AM
Osa,

> ./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot -p

You forgot the u-boot image uboot.2024.07-rc2-tld-1.db-88f6720.kwb here? or did you rename to uboot?

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



Edited 1 time(s). Last edit at 06/05/2024 01:21AM by bodhi.
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 05, 2024 04:06PM
File was renamed
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 05, 2024 04:16PM
> File was renamed

OK. Might be kwboot problem with this SoC image. Let's try a pure UART booting u-boot then. I'll upload another build.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 05, 2024 06:44PM
The attached u-boot image is for UART booting only (don't flash it).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - uboot.2024.07-rc3-tld-1.db-88f6720.uart.kwb (486.4 KB)
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 06, 2024 05:03AM
Still no luck or i am doing something wrong
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2024.07-rc3-tld-1.db-88f6720.uart.kwb 
kwboot version 2024.04-rc3-00001-g0861eab8ec-dirty
Detected kwbimage v1 with UART boot signature
Sending boot message. Please reboot the target.../
Sending boot image header (22016 bytes)...
  0 % [......................................................................]
 41 % [......................................................................]
 81 % [................................                                      ]
Done

BootROM - 1.51
Booting from SPI flash

[blablablabla removed some output blablabla]

ERROR: can't get kernel image!
Marvell>> 

xmodem: Connection timed out


I tried to mess with other kwboot parameters and when setting -o (xmodem block timeout) to 0
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2024.07-rc3-tld-1.db-88f6720.uart.kwb -o 0
kwboot version 2024.04-rc3-00001-g0861eab8ec-dirty
Detected kwbimage v1 with UART boot signature
Sending boot message. Please reboot the target...-
Sending boot image header (22016 bytes)...
  0 % [+++++++++++++++EE
xmodem: Bad message
and system diode is red (no blinking) and i can use kwboot without turning off/on power
and then when -o is greater than 0 (ie 1 or 2)
root@debian:~# ./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2024.07-rc3-tld-1.db-88f6720.uart.kwb -o 1
kwboot version 2024.04-rc3-00001-g0861eab8ec-dirty
Detected kwbimage v1 with UART boot signature
Sending boot message. Please reboot the target...-
Sending boot image header (22016 bytes)...
  0 % [+++++++++.++++++++.++++++++.++++++++.+++++.+...................+......]
 18 % [......................................................................]
 58 % [...E
xmodem: Protocol error

But if i turn off board and execute kwboot with -o 1 (or bigger number) output is
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2024.07-rc3-tld-1.db-88f6720.uart.kwb -o 1
kwboot version 2024.04-rc3-00001-g0861eab8ec-dirty
Detected kwbimage v1 with UART boot signature
Sending boot message. Please reboot the target...|
Sending boot image header (22016 bytes)...
  0 % [++++++++++.++++++++.++++++++.++++++++.++++.+.....................+....]
 18 % [......................................................................]
 58 % [......................................................................]
 99 % [..                                                                    ]
Done
BootROM: Invalid header checksum
Booting from SPI flash


The same happends with rc2 uboot
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 06, 2024 01:42PM
Osa,

You're not doing any thing wrong, and it's not the timing (the header was sent successfully).

It looks like kwboot problem (i.e. MVEBU boot code) has problem with this Armada 375 SoC. I'll take a look at that code when I have a chance.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 06, 2024 02:01PM
Osa,

Can you kwboot your mtd0 backup?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
osa
Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 06, 2024 05:36PM
Old (debian 10) kwboot does not work, but kwboot 2024.04-rc3 works just fine with backup.
Funny (strange?) thing is that even changing order of kwboot parameters can cause upload errors

Here's successful (not interrupted by user and without drive connected) bootlog
./kwboot -t -b backup_wd.bin -B 115200 /dev/ttyUSB0 
kwboot version 2024.04-rc3-00001-g0861eab8ec-dirty
Detected kwbimage v1 with SPI boot signature
Patching image boot signature to UART
Aligning image header to Xmodem block size
Sending boot message. Please reboot the target.../
Sending boot image header (92032 bytes)...
  0 % [......................................................................]
  9 % [......................................................................]
 19 % [......................................................................]
 29 % [......................................................................]
 39 % [......................................................................]
 48 % [......................................................................]
 58 % [......................................................................]
 68 % [......................................................................]
 78 % [......................................................................]
 87 % [......................................................................]
 97 % [...................                                                   ]
Done


General initialization - Version: 1.0.0
High speed PHY - Version: 0.1.1 (COM-PHY-V20) 
USB2 UTMI PHY initialized succesfully
USB2 UTMI PHY initialized succesfully
High speed PHY - Ended Successfully

DDR3 Training Sequence - Ver 5.7.1
DDR3 Training Sequence - Run with PBS.
DDR3 Training Sequence - Ended Successfully 

Sending boot image data (837116 bytes)...
  0 % [......................................................................]
  1 % [......................................................................]
  2 % [......................................................................]
  3 % [......................................................................]
  4 % [......................................................................]
  5 % [......................................................................]
  6 % [......................................................................]
  7 % [......................................................................]
  8 % [......................................................................]
  9 % [......................................................................]
 10 % [......................................................................]
 11 % [......................................................................]
 12 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 16 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 19 % [......................................................................]
 20 % [......................................................................]
 21 % [......................................................................]
 22 % [......................................................................]
 23 % [......................................................................]
 24 % [......................................................................]
 25 % [......................................................................]
 26 % [......................................................................]
 27 % [......................................................................]
 28 % [......................................................................]
 29 % [......................................................................]
 31 % [......................................................................]
 32 % [......................................................................]
 33 % [......................................................................]
 34 % [......................................................................]
 35 % [......................................................................]
 36 % [......................................................................]
 37 % [......................................................................]
 38 % [......................................................................]
 39 % [......................................................................]
 40 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 43 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 47 % [......................................................................]
 48 % [......................................................................]
 49 % [......................................................................]
 50 % [......................................................................]
 51 % [......................................................................]
 52 % [......................................................................]
 53 % [......................................................................]
 54 % [......................................................................]
 55 % [......................................................................]
 56 % [......................................................................]
 57 % [......................................................................]
 58 % [......................................................................]
 59 % [......................................................................]
 61 % [......................................................................]
 62 % [......................................................................]
 63 % [......................................................................]
 64 % [......................................................................]
 65 % [......................................................................]
 66 % [......................................................................]
 67 % [......................................................................]
 68 % [......................................................................]
 69 % [......................................................................]
 70 % [......................................................................]
 71 % [......................................................................]
 72 % [......................................................................]
 73 % [......................................................................]
 74 % [......................................................................]
 76 % [......................................................................]
 77 % [......................................................................]
 78 % [......................................................................]
 79 % [......................................................................]
 80 % [......................................................................]
 81 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 84 % [......................................................................]
 85 % [......................................................................]
 86 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 89 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 93 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 96 % [......................................................................]
 97 % [......................................................................]
 98 % [......................................................................]
 99 % [..............................                                        ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]

 ** LOADER **


U-Boot 2013.01_v1.03 (Nov 20 2014 - 16:39:45) Marvell version: 2014_T2.0p3

Board: WD_Glacier_DB-88F6720-V2
SoC:   MV88F6720 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 800 [MHz]
       L2     @ 400 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 534 [MHz]
       DDR 16Bit Width, FastPath Memory Access, DLB Enabled
DRAM:  512 MiB

Map:   Code:		0x1fed6000:0x1ff92c90
       BSS:		0x1ffefa20
       Stack:		0x1f9c5f20
       Heap:		0x1f9c6000:0x1fed6000

SF: Detected MX25L8006E with page size 64 KiB, total 1 MiB
*** Warning - bad CRC, using default environment

PCI-e 0: Detected No Link.
PCI-e 1: Detected No Link.
SF: Detected MX25L8006E with page size 64 KiB, total 1 MiB
MAC addr: 00:90:A9:EB:5A:DA
### Loading Firmware from USB 3.0 Disk ###
USB2.0 0: Host Mode
USB2.0 1: Device Mode
USB3.0 0: Host Mode
Board configuration detected:
	GE-PHY-0 on MAC0
SERDES configuration:
	Lane #0: PCIe0
	Lane #1: PCIe1
	Lane #2: SATA0
	Lane #3: USB3
Net:   egiga0 [PRIME]
*** ERROR: ping address not given
Hit any key to stop autoboot:  0 
(Re)start USB...
USB0:   Port (usbActive) : 0	Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 0 **
## Booting image at 00a00000 ...
### Loading Firmware from USB 2.0 Disk ###
(Re)start USB...
USB0:   Port (usbActive) : 1	Interface (usbType = 2) : USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 0 **
## Booting image at 00a00000 ...
### Loading Firmware from Disk ###

Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found

** Bad device ide 0 **
** Bad device ide 0 **
## Booting image at 00a00000 ...
### Loading Rescure Firmware from Disk ###
** Bad device ide 0 **
** Bad device ide 0 **
## Booting image at 00a00000 ...
### Start network installation ###
RX_ICMP
rx_icmp(): Listening to incoming WD ICMP beacons for 3 second!
Error...
rxIcmp - rxIcmp

Usage:
rxIcmp Start Listening to incoming WD ICMP beacons
## Booting image at 00a00000 ...
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Marvell>> 
Marvell>> 
Marvell>> 

Re: WD MyCloud Gen2 (Glacier, Armada 375)
June 06, 2024 07:13PM
> Old (debian 10) kwboot does not work, but kwboot
> 2024.04-rc3 works just fine with backup.

Cool! the new kwboot has a lot of bug fixes. Boards that could not be kwboot before are now possible. Even the Zyxel NAS326 (Armada 380) can be kwboot (I have built a new u-boot for this, but there is some problem with the board serial port, so I have not released it). We're all indebted to Pali Rohar (a very smart guy).


> Here's successful (not interrupted by user and
> without drive connected) bootlog

Alright!

> Funny (strange?) thing is that even changing order
> of kwboot parameters can cause upload errors

It looks like kwboot did not have enough testing for the Armada 375 board. Most of the fixes have been tested on Armada 38x boards (by Pali, me, and a few other u-boot developers).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: