[Devel] Gen1 possible kernel bump to 3.19

I’ve been working on bringing a newer kernel to my WDMyCloud Gen1 (sequoia) device for some time and got to v3.2.101 mostly working, w/o 64K pages and netatop causing kernel panic, but it is still 3.2. I was not able to move past 3.2 with all attempts thwarted by changes in ARM GIC handling between those versions, that I could not figure how to work around.

WD does not appear to have any incentive/capabilities to upgrade the device past officially-supported Mindsped/NXP SDK versions based on kernel 3.2.

However, I was able to launch kernel 3.19.3 using mainline + patches from https://github.com/bitdefender/boxv2-firmware for comcerto2000 target (which is also known under FreeScale/NXP QorIQ LS1024A name, and the SOC is still being sold by NXP). I updated the load address to match sequoia, patched includes in board-c2kevm.c and got to rootfs initialization:

Barebox-C2K >/env/bin bootm /dev/mem.uImage
   Verifying Checksum ... OK
   Image Name:   Linux-3.19.3test1
   Created:      2019-08-28   4:40:45 UTC
   Image Type:   <NULL> <NULL> <NULL> (<NULL>)
   Data Size:    1549632 Bytes =  1.5 MB
   Load Address: 0f008000
   Entry Point:  0f008000
OK

Starting kernel ...

commandline: console=ttyS0,115200n8, init=/sbin/init rootfstype=ext4 rw noinitrd mac_addr=00:11:22:33:44:55 model= serial= board_test= btn_status=0
arch_number: 1094
Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x900
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.19.3test1 (rye@bling) (gcc version 4.8.5 (Linaro GCC 4.8-2015.06) ) #3 SMP Wed Aug 28 04:35:38 UTC 2019
[    0.000000] CPU: ARMv7 Processor [412fc091] revision 1 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Comcerto 2000 EVM
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] PERCPU: Embedded 10 pages/cpu @cfdee000 s9792 r8192 d22976 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 59904
[    0.000000] Kernel command line: console=ttyS0,115200n8, init=/sbin/init rootfstype=ext4 rw noinitrd mac_addr=00:11:22:33:44:55 model= serial= board_test= btn_status=0
...
[    0.104076] Brought up 1 CPUs
[    0.104105] SMP: Total of 1 processors activated (1292.69 BogoMIPS).
[    0.104116] CPU: All CPU(s) started in SVC mode.
...
[    4.977713] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -19
[    4.985328] Please append a correct "root=" boot option; here are the available partitions:
[    4.993803] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    5.002121] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W      3.19.3test1 #3
[    5.009640] Hardware name: Comcerto 2000 EVM
[    5.013932] Backtrace:
...
[    5.129690]  r4:00000000 r3:cf832000
[    5.133317] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Just want this information out for somebody with enough cycles to tackle the board bringup and tailoring the patched kernel for sequoia.

1 Like

If you want - i can upload it to my website and ask for tests Russian community (4pda.ru).
And, please, share compiled kernel and config for test.

Well, at this point it is too early for anything to share, I’ve switched to gcc-7, got initramfs working with busybox and got SMP back in board-c2kevm which sequoia appears to be based on:

/ # uname -a
Linux (none) 3.19.3-00009-g17f729b4cbb2-dirty #23 SMP Tue Sep 3 02:57:00 UTC 2019 armv7l GNU/Linux
/ # dmesg | grep gcc
[    0.000000] Linux version 3.19.3-00009-g17f729b4cbb2-dirty (rye@bling) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11) ) #23 SMP Tue Sep 3 02:57:00 UTC 2019
/ # cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 1292.69
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc09
CPU revision    : 1

processor       : 1
model name      : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 1292.69
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc09
CPU revision    : 1

Hardware        : Comcerto 2000 EVM
Revision        : 0001
Serial          : 0000000000000000

However, the current config is quite unusable - I am pulling the kernel over tftp, accessing the console over serial connection without networking or SATA support, and still in process of discovering what else is broken.

My understanding is that the gen2 uses busybox not gen1.

Initial ramdisk present in both generations. But not used in gen1.

@gen1, you can use my initrd for gen2 devices. Just add network module and edit init script.

I decided to proceed with bringing up the board, and currently is not very usable.
I’ve pushed my patched kernel based on vanilla 3.19.3 to GitHub.

I’ve booted the board into unmodified armhf Debian Jessie with sequoia_defconfig, and notable things that do not work are:

  • PFE (so no built-in Ethernet)
  • LEDs

Things that surprisingly work are:

  • SATA
  • USB (including USB Ethernet based on RTL8152 which I’m using while PFE is broken)
  • BCM PHY (we can now get the link, but it is useless without PFE)

Next update will be if and when I get PFE working.

You should also find that usfd and jnl don’t work either.

Yup, netatop started crashing kernel on 3.2.101, so I did not even look at any modules that are not absolutely essential to get it running, such as ufsd. Granted, this lowers the appeal of any work on updating the kernel, but hey, I’ve haven’t bricked it yet, so that’s something.

I mentioned these two modules because when I tried to rebuilt the kernel with btrace enabled on the gen2 device. I got errors with ufsd and jnl. Turns out the source to rebuild them is available. Was able to rebuild them but the link would fail missing a file. You need a .bin file to link them. I was never able to find the .bin file.

I’ve got PFE working, and it turned out I’ve been using incomplete modprobe implementation from busybox which would not apply kernel module parameters, so pfe.ko was always running with defaults.

Just use my Initrd (ramdisk). Its have almost all, what need for start system and test basic functional.