Netgear D7800 build

Hello,
I have D7800 with last LEDE and some modifications (TARGET_OPTIMIZATION .. hard, memory - 512MB - wifi firmware loading ... ) .
I'm trying compile packages for dsl/vdsl VRX300 .. but I'm stuck on first -- ltq-ifxos ...
error below :

  drv_ifxos: Making Linux 2.6.x kernel object
    /LEDEO3/build_dir/target-arm_cortex-a15+neon-vfpv4_glibc-2.24_eabi/linux-ipq806x/lib_ifxos-1.5.19/src/linux/ifxos_linux_socket_drv.c: In function 'IFXOS_SocketSendTo':
  /LEDEO3/build_dir/target-arm_cortex-a15+neon-vfpv4_glibc-2.24_eabi/linux-ipq806x/lib_ifxos-1.5.19/src/linux/ifxos_linux_socket_drv.c:183:33: error: 'WRITE' undeclared (first use in this function)
        iov_iter_init(&msg.msg_iter, WRITE, &iov, 1, bufSize_byte);

Can anyone help me with the build of packages ?
Sry I'm not a developer ...

Hi,
Good to see someone else doing the exact same thing I am doing. Unfortunately I am not much of a dev either, however hopefully we can work together to figure it out, and maybe a real dev will chime in with tips.
To hopefully answer your question (well this is what I did anyway) was to change WRITE to 1 (assumption based on other defines of WRITE) and it recompiled fine. Google is a bit vague on what the valid values are for the direction parameter for iov_iter_init().
Ideally you do this change as a patch using quilt (https://lede-project.org/docs/guide-developer/use-patches-with-buildsystem).

Unfortunately it gets a bit harder after this, so good to have help!

As a bit of background this is how far I have gotten to get the D7800 DSL interface working with LEDE trunk (git.lede-project.org/source.git):

  1. Flash https://www.myopenrouter.com/download/openwrt-firmware-netgear-d7800-official-release (Attitude Adjustment 12.09.1) to D7800 and get ADSL working.
  2. Analyse configuration to see what packages/modules are used to configure and run the DSL interface. This list may contain extraneous items, or I may have missed some (let me know):
    dsl-cpe-api-vrx - 4.16.5.4-1
    dsl-cpe-api-vrx-nonbond - 4.16.5.4-1
    dsl-cpe-control-vrx - 4.16.5.4-1
    dsl-cpe-control-vrx-nonbond - 4.16.5.4-1
    dsl-cpe-mei-vrx - 1.4.9.7-1
    dsl-cpe-mei-vrx-nonbond - 1.4.9.7-1
    dsl-vr10-firmware-xdsl - 07.07.04.03.00.07_07.07.01.08.00.01-1
    dsl-vr10-firmware-xdsl-b - 07.07.03.03.00.07_07.07.01.0C.00.02-1
    kmod-dni_enet - 3.4.103-1
    kmod-ltq-ifxos - 3.4.103+1.5.14-3
    kmod-ppp - 3.4.103-1
    kmod-pppoa - 3.4.103-1
    ltq-oam - 2.4.0.7-1
    ltq_qoscmd - 2.3.7-2
    ltq_vrx320_datapath_drv - 1.0.0-1
    ppp - 2.4.5-10
    ppp-mod-pppoa - 2.4.5-10
  3. Download Netgear open source http://kb.netgear.com/2649/NETGEAR-Open-Source-Code-for-Programmers-GPL?cid=wmt_netgear_organic (v1.0.0.48), latest archive was corrupted for some reason.
  4. Get DSL package source from this archive. As above, let me know if I missed anything:
    dsl-cpe-api-vrx : INSTALLS: drv_dsl_cpe_api_vrx-4.16.5.4.tar.gz
    dsl-cpe-api-vrx-nonbond : as above
    dsl-cpe-control-vrx : INSTALLS: dsl_cpe_control_vrx-4.16.5.4.tar.gz
    dsl-cpe-control-vrx-nonbond : as above
    dsl-cpe-mei-vrx-nonbond : as above
    dsl-vr10-firmware-xdsl : INSTALLS: dsl_vr10_firmware_xdsl-07.07.06.0E.01.07_07.07.02.08.00.01.tar.gz
    dsl-vr10-firmware-xdsl-b : INSTALLS: dsl_vr10_firmware_xdsl-07.07.03.03.00.07_07.07.01.0C.00.02.tar.gz
    ltq-oam : INSTALLS: none
    ltq_qoscmd : INSTALLS: none
    ltq_vrx320_datapath_drv : INSTALLS: none
    dsl-cpe-mei-vrx : INSTALLS: drv_mei_cpe-1.4.9.7.tar.gz
    kmod-dni_enet : INSTALLS: acquired partial source from R7800 sources (dni_enet.c from R7800 qca-nss-gmac)
    qca-nss-gmac : INSTALLS: custom src in package
    kmod-ltq-ifxos : INSTALLS: lib_ifxos-1.5.14.tar.gz
    kmod-ppp : ALREADY IN TRUNK
    kmod-pppoa : ALREADY IN TRUNK
    ppp : ALREADY IN TRUNK
    ppp-mod-pppoa : ALREADY IN TRUNK
  5. Determine if any of these packages map to a more recent package in trunk. Some of the lantiq packages did so I edited the package Makefile to include TARGET_ipq806x:
    dsl-cpe-api-vrx = TRUNK PACKAGE: package/kernel/lantiq/ltq-vdsl
    dsl-cpe-api-vrx-nonbond : as above
    dsl-cpe-control-vrx = TRUNK PACKAGE: package/network/config/ltq-vdsl-app
    dsl-cpe-control-vrx-nonbond : as above
    dsl-cpe-mei-vrx-nonbond : as above
    dsl-vr10-firmware-xdsl = SIMILAR TO TRUNK PACKAGE: package/firmware/lantiq/dsl-vrx200-firmware-xdsl
    dsl-vr10-firmware-xdsl-b = SIMILAR TO TRUNK PACKAGE: package/firmware/lantiq/dsl-vrx200-firmware-xdsl
    ltq-oam : NO EQUIVALENT IN TRUNK - Port?
    ltq_qoscmd : NO EQUIVALENT IN TRUNK - Port?
    ltq_vrx320_datapath_drv : NO EQUIVALENT IN TRUNK - Port?
    dsl-cpe-mei-vrx = TRUNK PACKAGE: package/kernel/lantiq/ltq-vdsl-mei
    kmod-dni_enet : NO EQUIVALENT IN TRUNK, not required since qca-nss-gmac was removed?
    qca-nss-gmac : REPLACED WITH stmmac (lists.openwrt.org/pipermail/openwrt-devel/2015-May/033269.html) - OK?
    kmod-ltq-ifxos = TRUNK PACKAGE: /kernel/lantiq/ltq-ifxos
    kmod-ppp : EXISTING - OK?
    kmod-pppoa : EXISTING - OK?
    ppp : EXISTING - OK?
    ppp-mod-pppoa : EXISTING - OK?

So where have I got to? The package build order is evolving and I have so far managed to build all the EXISTING items in the list above, and ltq-ifxos and kmod-dni_enet.
I am currently stuck on building dsl-cpe-mei-vrx (which is ltq-vdsl-mei in trunk). I am getting errors like "-mfloat-abi=hard and soft cannot be used together" and when I "fix" that the errors continue.
So I am going back to first principles and looking at recreating the package Makefile and patching the source (drv_mei_cpe-1.5.17.6.tar.gz) to work with trunk.
As I mentioned before I am new to this and any advice or background on what has changed between Attitude Adjustment 12.09.1 and trunk, that may help to determine which packages are required would be great.
Thanks.

Hi,
Like you I did exactly the same steps :slight_smile: (even I sent info to netgear about broken archive ...)
Also I changed memory size in qcom-ipq8064-d7800.dts file to : reg = <0x42000000 0x1e000000> "
( D7800 have 512 MB RAM) ...and other small changes ..
It looks like it works everything except dls/vdsl ...
I'm not sure whether we need all these packages ....
ltq-oam :
ltq_qoscmd :
kmod-dni_enet :
qca-nss-gmac

Regards,

1 Like

Cool, so between this post and the one on OpenWRT: https://forum.openwrt.org/viewtopic.php?pid=351629#p351629, hopefully we'll be able to figure this out. I'll ignore the packages you mentioned, just need to know which one to build next. If you agree it should be ltq-vdsl-mei then we need to sort the required patches to go from lantiq to ipq806x. Any ideas?

Yes, ltq-vdsl-mei -- drv_mei_cpe-1.5.17.6.tar.gz it's the next what we need ...
I think Lantiq dsl is on PCIe bus so we need ltq_vrx320_datapath_drv driver (I'm working on it now :slight_smile: )
How about" -mfloat-abi=hard and soft " have you any ideas ?
For sure it's related to use hard float optimization, but we have fpu so why not use it fully.
My settings -- CONFIG_TARGET_OPTIMIZATION="-O2 -pipe -march=armv7-a -mcpu=cortex-a9 -mfpu=neon-vfpv4 -mtune=cortex-a15 -mfloat-abi=hard" .

From what I have googled, the kernel is always compiled with -mfloat-abi=soft so it doesn't have to rely on the hardware fpu (more reliable?), so that means kernel modules cannot use -mfloat-abi=hard. So assuming need to use soft...

OK. But soft or softfp ? I will try with soft and softfp ...

ltq_vrx320_datapath_drv driver

root@LEDE:/# modprobe lantiq_vrx320_vectoring.ko
[ 281.993338] res = dc189600

root@LEDE:/# modprobe lantiq_vrx320_e1.ko
^[[6~[ 287.322165] VRX318: loading PPE driver and firmware (PTM)
[ 287.322223] base->us_fastpath_des_base=0x5f600000
[ 287.326554] base->us_fastpath_des_num=0x20
[ 287.331366] base->us_cpupath_des_base=0x5f601000
[ 287.335235] base->us_cpupath_des_num=0x20
[ 287.340119] base->ds_des_base=0x5f602000
[ 287.343912] base->ds_des_num=0x40
[ 287.347904] base->ds_oam_des_base=0x0
[ 287.351235] base->ds_oam_des_num=0x0
[ 287.354766] ppe_init failed to get total device number
1 module could not be probed

  • lantiq_vrx320_e1

root@LEDE:/# modprobe lantiq_vrx320_a1.ko
[ 291.640181] vrx320: loading PPE driver and firmware (ATM)
[ 291.640212] base->us_fastpath_des_base=0x5f603000
[ 291.644551] base->us_fastpath_des_num=0x20
[ 291.649337] base->us_cpupath_des_base=0x5f604000
[ 291.653231] base->us_cpupath_des_num=0x20
[ 291.658004] base->ds_des_base=0x5f605000
[ 291.661984] base->ds_des_num=0x20
[ 291.665903] base->ds_oam_des_base=0x5f606000
[ 291.669179] base->ds_oam_des_num=0x20
[ 291.673509] ppe_init failed to get total device number
1 module could not be probed

  • lantiq_vrx320_a1

seems something working ... probably need drv_mei_cpe module ...

drv_mei_cpe configure does have device parameters: --with-max-device=1 and --with-lines-per-device=1, so I'm looking at compiling that too. So far no luck, I did find the following in source/rules.mk:
ifeq ($(CONFIG_SOFT_FLOAT),y)
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
TARGET_CFLAGS+= -mfloat-abi=soft
else
SOFT_FLOAT_CONFIG_OPTION:=
TARGET_CFLAGS+= -mfloat-abi=hard

However setting CONFIG_SOFT_FLOAT breaks the compiler... May need to recompile the lot...

Hi,

where did you get the info that it has 512MB RAM? EDIT: Found it in Spec-Sheet from Netgear.
Everywhere i was looking it says only 256MB.

Do you make a pull request to get the changes to everyone?

Hi,
From my D7800 router :slight_smile:

Console :slight_smile:

U-Boot 2012.07 [local,local] (Jul 01 2015 - 13:18:15)

U-boot 2012.07 dni1 V1.1 for DNI HW ID: 29764958 NOR flash 0MB NAND flash 128MB RAM 512MB 1st Radio 4x4 2nd Radio 4x4 + xDSL
smem ram ptable found: ver: 0 len: 5
DRAM: 491 MiB
.....

Booting Linux on physical CPU 0
Linux version 3.4.103 (figo.yan@dni-l-sw02) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 SMP Tue Jul 26 14:05:47 EDT 2016
CPU: ARMv7 Processor [512f04d0] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
....
Memory: 49MB 436MB = 485MB total
Memory: 482508k/488652k available, 14132k reserved, 0K highmem

....
Regards,

:+1:

are you able to send a patch to the devs?

In file target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts
change :

    memory@0 {

'-' reg = <0x42000000 0xe000000>;
'+' reg = <0x42000000 0x1e000000>;
device_type = "memory";

I'm almost sure we have to set proper CFLAGS or other flags in Makefile for drv_mei_cpe and other dsl packages ... regarding "-mfloat-abi=hard and soft cannot be used together" ...
We need a real developer to look into dsl packages compile problems ...

Regards,

just connected to serial console and this is what i get:

U-Boot 2012.07-21984-gd7d026f [local,local] (Apr 15 2015 - 10:49:55)

U-boot 2012.07 dni1 V0.9 for DNI HW ID: 29764958 NOR flash 0MB NAND flash 128MB RAM 256MB 1st Radio 4x4 2nd Radio 4x4 + xDSL
smem ram ptable found: ver: 0 len: 5
DRAM: 235 MiB

If i change the dts-file my d7800 doesn't start.

In this case there are two hardware versions ... :frowning:

D7800 may have the same thing
https://github.com/lede-project/source/commit/3ac5eb914169a7169f5522799fbb0f90f1234c1c

Sometimes r7500v2 and R7800 do not start when kernel tries to use this space

@dissent1 yeah maybe. Or maybe my device has only 256MB RAM. (Now as i think about it: i remember that my D7800 is a BETA-Test Unit. Maybe they switched then to more RAM in production) I had never a problem with starting the kernel.
Only as i tried the 512MB Patch and this was very funny because the router then don't react on anything. Only power off.
Reset button is also dead.

One question , on netgear fw have 6 PCI devices

 00:00.0 PCI bridge: Airgo Networks Inc Device 0101 (prog-if 00 [Normal decode])
 01:00.0 Network controller: Atheros Communications Inc. Device 0040
 02:00.0 PCI bridge: Airgo Networks Inc Device 0101 (prog-if 00 [Normal decode])
 03:00.0 Network controller: Atheros Communications Inc. Device 0040
 04:00.0 PCI bridge: Airgo Networks Inc Device 0101 (prog-if 00 [Normal decode])
 05:00.0 Network controller: Device 1bef:0020 (rev 01)

on LEDE only 4

0000:00:00.0 PCI bridge: Qualcomm Device 0101
0000:01:00.0 Network controller: Qualcomm Atheros QCA9980/9990 802.11ac Wireless Network Adapter
0001:00:00.0 PCI bridge: Qualcomm Device 0101
0001:01:00.0 Network controller: Qualcomm Atheros QCA9980/9990 802.11ac Wireless Network Adapter

Which element is responsible for detecting pci devices ? Why cant find Device 1bef:0020 on LEDE ?
Regards,