fvdw-sl on WD My Cloud

Re: fvdw-sl on WD My Cloud

Postby matt_max » Mon Aug 29, 2022 7:27 pm

There is nothing inside /sys/class/net
Code: Select all
~ # ls -al /sys/class/net/
total 0
drwxr-xr-x    2 root     root             0 Jul 12 19:39 .
drwxr-xr-x   35 root     root             0 Jul 12 19:39 ..
lrwxrwxrwx    1 root     root             0 Jul 12 19:39 lo -> ../../devices/virtual/net/lo

I've created /etc/network/interfaces file with sample content:
Code: Select all
~ # cat /etc/network/interfaces
iface eth1 inet static
address 192.168.1.200
netmask 255.255.255.0
gateway 192.168.1.1
~ #

...but if network device isn't available I can't bring it up.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby matt_max » Mon Aug 29, 2022 7:30 pm

fvdw wrote:think it goes wrong here, with p10rootfs when loading pfe module
Code: Select all
<snip>
[   71.192395] pfe_firmware_init: request firmware class_c2000.elf failed
[   71.198962] pfe_hif_exit
[   71.201525] pfe_hif_release_buffers
[   71.205202] pfe_hif_free_descr
[   71.208290] pfe_hif_lib_exit
[   71.211359] pfe_hw_exit
[   71.215030] pfe: probe of pfe.0 failed with error -110
[   71.220746] initcall pfe_module_init+0x0/0x1f [pfe] returned 0 after 59128626 usecs


with wd rootfs we see this
Code: Select all
[   41.516506] pfe_firmware_init: class firmware loaded 0xbc0 0xc3010000
[   41.522991] pfe_load_elf
[   41.527698] pfe_firmware_init: tmu firmware loaded 0x1a0
[   41.533049] pfe_load_elf
[   41.538214] pfe_firmware_init: util firmware loaded 0x1220
[   41.543933] pfe_ctrl_init
[   41.576006] timer_add 83661a50
[   41.579095] timer_add 836619f0
[   41.582167] timer_add 83661a20
[   41.585244] timer_add 83661990
[   41.588316] timer_add 83661978
[   41.591417] timer_add 836619a8
[   42.619101] pe_sync_stop: timeout, 3f 0
[   43.649097] pe_sync_stop: timeout, 3f 0
[   44.679102] pe_sync_stop: timeout, 3f 0
[   45.709098] pe_sync_stop: timeout, 3f 0
[   45.712959] Error updating ICC tables
[   45.716650] timer_add 836619c0
[   45.719742] ipsec_common_hard_init ipsec_baseaddr:90a00000 - espah_base:90a00000
[   45.728545] timer_add 83661960
[   45.731640] pfe_ctrl_init finished
[   45.735062] pfe_eth_init
[   45.738156] pfe_ctrl_timer
[   45.749270] Comcerto MDIO Bus: probed
[   46.779099] pe_sync_stop: timeout, 3f 0
[   46.785328] pfe_eth_init_one: preallocating rx & tx queue buffers
[   46.791745] eth0: pfe_eth_init_one: created interface, baseaddr: 93200000
[   46.798579] pfe_pcap_init
[   46.801768] initcall pfe_module_init+0x0/0x1f [pfe] returned 0 after 5539980 use

so it seems our problem is failing loading of firmware that this module need

That is right but there is class_c2000.elf inside /lib/firmware :scratch
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Mon Aug 29, 2022 7:32 pm

the files needed are in /lib/firmware
The reason of failure could be that the files there do not have executable permission
So do this
Code: Select all
chmod 755 /lib/firmware/*

Check that the files have now executable permission
Then boot again the wd cloud

ps there is also an " missing in /etc/init.d/rcS line 57
Code: Select all
echo "add ip 192.168.1.200

this should be
Code: Select all
echo "add ip 192.168.1.200"
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby fvdw » Mon Aug 29, 2022 7:37 pm

I edited my last post

....missing in /etc/init.d/rcS line 57..
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby matt_max » Mon Aug 29, 2022 7:46 pm

Still no luck with loading firmware - console output.
Code: Select all
~ # ls -ll /lib/firmware/
total 672
-rwxr-xr-x    1 root     root        363606 Nov 28  2015 class_c2000.elf
-rwxr-xr-x    1 root     root         33102 Nov 28  2015 tmu_c2000.elf
-rwxr-xr-x    1 root     root        277240 Nov 28  2015 util_c2000.elf
~ #

I found that
There are some words about firmware in Documentation/firmware_class (and this works in debian!) but also there is "Userspace firmware loading is deprecated, will go away, and sometimes causes problems" in
/usr/share/doc/systemd/README.

and late
In Fedora systemd is compiled without userspace firmware loading support, and requires at least kernel 3.7 to function properly. If you're using kernel 3.2 then things will break. You can recompile systemd (up to version 216)
with --with-firmware-path=... but this not supported by the distribution.

Someone tried to run Fedora on WD MyCloud.
Last edited by matt_max on Mon Aug 29, 2022 7:50 pm, edited 1 time in total.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Mon Aug 29, 2022 7:49 pm

I am going to look into wd firmware to see how they load the module
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby fvdw » Mon Aug 29, 2022 8:04 pm

seems this script /etc/init.d/kmod loads the modules using a file /etc/modules
this is the line we see as output in wd firmware when loading modules
Look to this part of kmod script
Code: Select all
.....
load_module() {
  local module args
  module="$1"
  args="$2"

  if [ "$VERBOSE" != no ]; then
    log_action_msg "Loading kernel module $module"
    modprobe $module $args || true
  else
    modprobe $module $args > /dev/null 2>&1 || true
  fi
}
..


the /etc/modules file contains this
Code: Select all
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
pfe lro_mode=1 tx_qos=1 alloc_on_init=1 disable_wifi_offload=1


So our modprobe line in rcS script should be
Code: Select all
modprobe pfe lro_mode=1 tx_qos=1 alloc_on_init=1 disable_wifi_offload=1


Try to modify the modprobe line like that
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby fvdw » Mon Aug 29, 2022 8:14 pm

when that does not work we we have to look into this possibility

Firmware loader for the Gen1 WD MyCloud network interface when there is no udev available
(https://gist.github.com/marcsello/3622b ... -loader-sh)
Code: Select all
#!/bin/sh

# Written for Alpine 3.13 userland
# The sleep stuff isn't necessary... it's just there to stand as safe guards

echo "Start loading of PFE kernel module"
modprobe pfe lro_mode=1 tx_qos=1 alloc_on_init=1 disable_wifi_offload=1 &
WAITPID=$!

sleep 1

while test -d /sys/devices/platform/pfe.0/firmware; do
        source /sys/devices/platform/pfe.0/firmware/pfe.0/uevent
        echo "Loading $FIRMWARE"
        echo 1 > /sys/devices/platform/pfe.0/firmware/pfe.0/loading
        cat "/lib/firmware/$FIRMWARE" > /sys/devices/platform/pfe.0/firmware/pfe.0/data
        echo 0 > /sys/devices/platform/pfe.0/firmware/pfe.0/loading
        sleep 2
done

wait $WAITPID


found here
https://gist.github.com/marcsello/3622b ... e18a44615d
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby matt_max » Mon Aug 29, 2022 8:17 pm

fvdw wrote:seems this script /etc/init.d/kmod loads the modules using a file /etc/modules
this is the line we see as output in wd firmware when loading modules
Look to this part of kmod script
Code: Select all
.....
load_module() {
  local module args
  module="$1"
  args="$2"

  if [ "$VERBOSE" != no ]; then
    log_action_msg "Loading kernel module $module"
    modprobe $module $args || true
  else
    modprobe $module $args > /dev/null 2>&1 || true
  fi
}
..


the /etc/modules file contains this
Code: Select all
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
pfe lro_mode=1 tx_qos=1 alloc_on_init=1 disable_wifi_offload=1


So our modprobe line in rcS script should be
Code: Select all
modprobe pfe lro_mode=1 tx_qos=1 alloc_on_init=1 disable_wifi_offload=1


Try to modify the modprobe line like that

First I remove module with rmmod pfe to be sure it is not loaded:
Code: Select all
~ # rmmod pfe
[ 1700.387597] here before:pfe_module_exit
[ 1700.391802] here after:pfe_module_exit
~ # lsmod
ipv6 221937 12 - Live 0x83666000

Then I try to load module with parameters:
Code: Select all
~ # modprobe pfe lro_mode=1 tx_qos=1 alloc_on_init=1 disable_wifi_offload=1
[ 1728.685859] calling  pfe_module_init+0x0/0x1f [pfe] @ 466
[ 1728.691321] pfe_module_init
[ 1728.694197] pfe_platform_probe
[ 1728.698585] ipsec: baseaddr :9a000000 --- 90c00000
[ 1728.704435] pfe_probe
[ 1728.706723] PFE Driver version:
[ 1728.706728] pfe_ctrl_nas_2_00_3
[ 1728.706732] built with pfe sources version: pfe_nas_2_00_3
[ 1728.718561] cbus_baseaddr: 96000000, ddr_baseaddr: 95000000, ddr_phys_baseaddr: 3400000, ddr_size: c00000
[ 1728.728187] pfe_hw_init
[ 1728.730660] CLASS version: 20
[ 1728.733645] TMU version: 1011231
[ 1728.736889] BMU1 version: 21
[ 1728.739784] BMU2 version: 21
[ 1728.742690] EMAC1 network cfg: 80000
[ 1728.746285] EMAC2 network cfg: 80000
[ 1728.749879] EMAC3 network cfg: 80000
[ 1728.753481] EGPI1 version: 50
[ 1728.756465] EGPI2 version: 50
[ 1728.759448] EGPI3 version: 50
[ 1728.762440] HGPI version: 50
[ 1728.765336] GPT version: 0
[ 1728.768057] HIF version: 10
[ 1728.770874] HIF NOPCY version: 10
[ 1728.774206] UTIL version: 20
[ 1728.777103] bmu_init(1) done
[ 1728.780000] bmu_init(2) done
[ 1728.791783] class_init() done
[ 1728.794774] tmu_init: mem init
[ 1728.797845] tmu_init: lmem init
[ 1728.801076] tmu_init() done
[ 1728.803884] util_init() done
[ 1728.806784] gpi_init(1) done
[ 1728.809683] gpi_init(2) done
[ 1728.812592] gpi_init(3) done
[ 1728.815492] gpi_init(hif) done
[ 1728.818561] bmu_enable(1) done
[ 1728.821639] bmu_enable(2) done
[ 1728.824711] pfe_hif_lib_init
[ 1728.827909] pfe_hif_init
[ 1728.830470] pfe_hif_alloc_descr
[ 1728.833772] pfe_hif_init_buffers
[ 1728.837194] pfe_firmware_init
[ 1789.115722] pfe_firmware_init: request firmware class_c2000.elf failed
[ 1789.122289] pfe_hif_exit
[ 1789.124850] pfe_hif_release_buffers
[ 1789.128517] pfe_hif_free_descr
[ 1789.131605] pfe_hif_lib_exit
[ 1789.134769] pfe_hw_exit
[ 1789.138439] pfe: probe of pfe.0 failed with error -110
[ 1789.144149] initcall pfe_module_init+0x0/0x1f [pfe] returned 0 after 59040321 usecs
~ #

Still the same error with loading firmware procedure.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby matt_max » Mon Aug 29, 2022 8:24 pm

fvdw wrote:when that does not work we we have to look into this possibility

Firmware loader for the Gen1 WD MyCloud network interface when there is no udev available
(https://gist.github.com/marcsello/3622b ... -loader-sh)
Code: Select all
#!/bin/sh

# Written for Alpine 3.13 userland
# The sleep stuff isn't necessary... it's just there to stand as safe guards

echo "Start loading of PFE kernel module"
modprobe pfe lro_mode=1 tx_qos=1 alloc_on_init=1 disable_wifi_offload=1 &
WAITPID=$!

sleep 1

while test -d /sys/devices/platform/pfe.0/firmware; do
        source /sys/devices/platform/pfe.0/firmware/pfe.0/uevent
        echo "Loading $FIRMWARE"
        echo 1 > /sys/devices/platform/pfe.0/firmware/pfe.0/loading
        cat "/lib/firmware/$FIRMWARE" > /sys/devices/platform/pfe.0/firmware/pfe.0/data
        echo 0 > /sys/devices/platform/pfe.0/firmware/pfe.0/loading
        sleep 2
done

wait $WAITPID


found here
https://gist.github.com/marcsello/3622b ... e18a44615d

There are no .../firmware or .../loading or .../data folders inside /sys/devices/platform/pfe.0 so this script is not going to work:
Code: Select all
~ # ls -ll /sys/devices/platform/pfe.0/
total 0
-r--r--r--    1 root     root          4096 Jul 12 19:00 modalias
drwxr-xr-x    2 root     root             0 Jul 12 19:00 power
lrwxrwxrwx    1 root     root             0 Jul 12 19:00 subsystem -> ../../../bus/platform
-rw-r--r--    1 root     root          4096 Jul 12 19:00 uevent
~ #


I was wrong! It's alive! :woohoo Check this:
Code: Select all
~ # ./network.sh
Start loading of PFE kernel module
[ 2531.928619] calling  pfe_module_init+0x0/0x1f [pfe] @ 501
[ 2531.934086] pfe_module_init
[ 2531.936964] pfe_platform_probe
[ 2531.941282] ipsec: baseaddr :9a000000 --- 90a00000
[ 2531.947110] pfe_probe
[ 2531.949397] PFE Driver version:
[ 2531.949401] pfe_ctrl_nas_2_00_3
[ 2531.949405] built with pfe sources version: pfe_nas_2_00_3
[ 2531.961254] cbus_baseaddr: 93000000, ddr_baseaddr: 92000000, ddr_phys_baseaddr: 3400000, ddr_size: c00000
[ 2531.970886] pfe_hw_init
[ 2531.973349] CLASS version: 20
[ 2531.976332] TMU version: 1011231
[ 2531.979577] BMU1 version: 21
[ 2531.982486] BMU2 version: 21
[ 2531.985383] EMAC1 network cfg: 80000
[ 2531.988976] EMAC2 network cfg: 80000
[ 2531.992582] EMAC3 network cfg: 80000
[ 2531.996176] EGPI1 version: 50
[ 2531.999159] EGPI2 version: 50
[ 2532.002169] EGPI3 version: 50
[ 2532.005153] HGPI version: 50
[ 2532.008049] GPT version: 0
[ 2532.010787] HIF version: 10
[ 2532.013596] HIF NOPCY version: 10
[ 2532.016928] UTIL version: 20
[ 2532.019825] bmu_init(1) done
[ 2532.022734] bmu_init(2) done
[ 2532.034517] class_init() done
[ 2532.037508] tmu_init: mem init
[ 2532.040595] tmu_init: lmem init
[ 2532.043818] tmu_init() done
[ 2532.046626] util_init() done
[ 2532.049525] gpi_init(1) done
[ 2532.052438] gpi_init(2) done
[ 2532.055338] gpi_init(3) done
[ 2532.058236] gpi_init(hif) done
[ 2532.061317] bmu_enable(1) done
[ 2532.064387] bmu_enable(2) done
[ 2532.067457] pfe_hif_lib_init
[ 2532.070667] pfe_hif_init
[ 2532.073215] pfe_hif_alloc_descr
[ 2532.076515] pfe_hif_init_buffers
[ 2532.079935] pfe_firmware_init
Loading class_c2000.elf
Loading tmu_c2000.elf
Loading util_c2000.elf
[ 2537.096335] pfe_load_elf
[ 2537.134334] PFE binary version: pfe_nas_2_00_3
[ 2537.138813] pfe_firmware_init: class firmware loaded 0xbc0 0xc3010000
[ 2537.145378] pfe_load_elf
[ 2537.150135] pfe_firmware_init: tmu firmware loaded 0x1a0
[ 2537.155527] pfe_load_elf
[ 2537.160735] pfe_firmware_init: util firmware loaded 0x1220
[ 2537.166445] pfe_ctrl_init
[ 2537.198637] timer_add 8364ba50
[ 2537.201726] timer_add 8364b9f0
[ 2537.204799] timer_add 8364ba20
[ 2537.207876] timer_add 8364b990
[ 2537.210970] timer_add 8364b978
[ 2537.214055] timer_add 8364b9a8
[ 2538.240077] pe_sync_stop: timeout, 3f 0
[ 2539.270086] pe_sync_stop: timeout, 3f 0
[ 2540.300070] pe_sync_stop: timeout, 3f 0
[ 2541.330072] pe_sync_stop: timeout, 3f 0
[ 2541.333935] Error updating ICC tables
[ 2541.337626] timer_add 8364b9c0
[ 2541.340719] ipsec_common_hard_init ipsec_baseaddr:90a00000 - espah_base:90a00000
[ 2541.349529] timer_add 8364b960
[ 2541.352622] pfe_ctrl_init finished
[ 2541.352638] pfe_ctrl_timer
[ 2541.358758] pfe_eth_init
[ 2541.380340] Comcerto MDIO Bus: probed
[ 2542.410071] pe_sync_stop: timeout, 3f 0
[ 2542.422001] pfe_eth_init_one: preallocating rx & tx queue buffers
[ 2542.428343] eth0: pfe_eth_init_one: created interface, baseaddr: 93200000
[ 2542.435194] pfe_pcap_init
[ 2542.438455] initcall pfe_module_init+0x0/0x1f [pfe] returned 0 after 10257873 usecs
~ # ip a
1: lo: <LOOPBACK> mtu 16436 qdisc noop
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:90:a9:d8:5e:ad brd ff:ff:ff:ff:ff:ff
~ #

Now I can assign ip address with ifconfig eth0 192.168.1.200
Last edited by matt_max on Mon Aug 29, 2022 8:35 pm, edited 1 time in total.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 13 guests