Compile modules for R7000

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
gbordier
DD-WRT Novice


Joined: 13 May 2014
Posts: 3

PostPosted: Mon Jun 09, 2014 7:56    Post subject: Compile modules for R7000 Reply with quote
Hi there,
I'm in a process of phasing out WNR3500L for a brand new R7000 running kong arm K30 build.

Everything goes smoothly thanks to the hard work he put in including optware support. (aside from a slight git issue)

however, I need to use vlan 100 on my network and the current robo-switch code only has 16 vlans.

With WNR3500L I was able to recompile and upped to 160 vlans since the chip supports it with minimal code change.

However I can't seem to find the correct toolchain to recompile :
toolchain-arm_v6k_gcc-linaro_uClibc-0.9.32_eabi does compile and I was able to load some modules without issue, but not switch-robo and unloading my simple test module caused a kernel panic.

any help zeroing on the right toolchain or help compiling it much appreciated.
Sponsor
<Kong>
DD-WRT Guru


Joined: 15 Dec 2010
Posts: 1932
Location: Germany

PostPosted: Mon Jun 09, 2014 8:54    Post subject: Re: Compile modules for R7000 Reply with quote
gbordier wrote:
Hi there,
I'm in a process of phasing out WNR3500L for a brand new R7000 running kong arm K30 build.

Everything goes smoothly thanks to the hard work he put in including optware support. (aside from a slight git issue)

however, I need to use vlan 100 on my network and the current robo-switch code only has 16 vlans.

With WNR3500L I was able to recompile and upped to 160 vlans since the chip supports it with minimal code change.

However I can't seem to find the correct toolchain to recompile :
toolchain-arm_v6k_gcc-linaro_uClibc-0.9.32_eabi does compile and I was able to load some modules without issue, but not switch-robo and unloading my simple test module caused a kernel panic.

any help zeroing on the right toolchain or help compiling it much appreciated.


Use the latest arm toolchain gcc 4.7 in here:

ftp://ftp.dd-wrt.com/others/sourcecode/toolchains/

If you manage to get it working you can give a patch and we can integrate it.

_________________
Development Units I use for Development:
R7000/R6300V2/R6300

Kong K3 AC DD-WRT Builds for Mipsel R6300/WNDR4500/D1800H/AC66U/EA6500V1
Kong K3 AC DD-WRT Builds for ARM 1450AC/R6250/R6300v2/R7000/AC56U/AC68U/DIR-868
Kong DD-WRT Guides
gbordier
DD-WRT Novice


Joined: 13 May 2014
Posts: 3

PostPosted: Mon Jun 09, 2014 14:05    Post subject: Re: Compile modules for R7000 Reply with quote
[quote="<Kong>"]
Use the latest arm toolchain gcc 4.7 in here:

ftp://ftp.dd-wrt.com/others/sourcecode/toolchains/

If you manage to get it working you can give a patch and we can integrate it.[/quote]

Hi Kong,

thanks for the reply,

The tarball does not seem to contain an arm v7.1 toolchain that I can (know how to) use.

I'm using .config.northstar_smp as my base config file and since R7000 seems to have a northstar baseboard
with a Cortex A9 dual-core processor.

Here is what I'm doing:
as a test I have just added a printk command to cdrom.c

PATH=/dd-wrt/ddwrt/toolchains/toolchain-arm_v7-a_gcc-4.7-linaro_uClibc-0.9.33.2_eabi/bin:$PATH
make modules CROSS_COMPILE=arm-openwrt-linux- ARCH=arm SUBDIRS=drivers/net/cdrom

compiles ok, but loading the uploaded module reboots


If I use:
PATH=/dd-wrt/ddwrt/toolchains/toolchain-arm_v6k_gcc-linaro_uClibc-0.9.32_eabi:$PATH
make modules CROSS_COMPILE=arm-openwrt-linux- ARCH=arm SUBDIRS=drivers/net/cdrom

it compiles ok, loads ok (I get my witness message in dmesg) but attempting to unload the driver reboots

a recompiled switch-core.ko also loads, but switch-robo.ko reboots as well (I suppose kernel panic)


I though I read somewhere that kernel modules needed to be compiled with gcc 4.5.3, but I can't find a toolchain for arm v7 with gcc 4.5.3

If you would be so kind as to share your .config file and the toolchain you use to compile kernel modules that would be great.

Alternatively if you can't / don't want to, I would settle for a version of switch-robo.ko that has
switch_driver driver = {
.name = DRIVER_NAME,
.version = DRIVER_VERSION,
.interface = device,
.cpuport = 5,
.ports = 6,
.vlans = 160,
.driver_handlers = cfg,
.port_handlers = port,
.vlan_handlers = vlan,
};

instead of
switch_driver driver = {
.name = DRIVER_NAME,
.version = DRIVER_VERSION,
.interface = device,
.cpuport = 5,
.ports = 6,
.vlans = 16,
.driver_handlers = cfg,
.port_handlers = port,
.vlan_handlers = vlan,
};

I know it is enough for my need.
Although if I could compile it myself, I'd like to add the possiblity of having vlan number <> vlan ID, most of the switches have this possibility and that would be much more elegant than having 100 kernel structures just to reach vlan ID 100.

That would also help with older routers (like WRT54G) that really have only 16 vlans possible, I've done a working POC for that on K24 a few years ago.

I've looked at the specs last year and I think I know where to write the VLANID in the switches registers.

Guillaume
<Kong>
DD-WRT Guru


Joined: 15 Dec 2010
Posts: 1932
Location: Germany

PostPosted: Mon Jun 09, 2014 20:26    Post subject: Reply with quote
Sorry I just looked again you need the gcc4.8, you are already using the correct config, but you need to use toolchain-arm_cortex-a9_gcc-4.8-linaro_uClibc-0.9.33.2_eabi
_________________
Development Units I use for Development:
R7000/R6300V2/R6300

Kong K3 AC DD-WRT Builds for Mipsel R6300/WNDR4500/D1800H/AC66U/EA6500V1
Kong K3 AC DD-WRT Builds for ARM 1450AC/R6250/R6300v2/R7000/AC56U/AC68U/DIR-868
Kong DD-WRT Guides
IcyTexx
DD-WRT Novice


Joined: 27 Feb 2012
Posts: 6

PostPosted: Fri Jun 13, 2014 12:45    Post subject: Reply with quote
gbordier, have you managed to do something about this problem?
_________________
Netgear R7000
gbordier
DD-WRT Novice


Joined: 13 May 2014
Posts: 3

PostPosted: Fri Jun 13, 2014 14:49    Post subject: Reply with quote
So yes,

I wanted to share my result but did not have time yet.

I ended up grabbing the toolchain-arm_cortex-a9_gcc-4.8-linaro_uClibc-0.9.33.2_eabi toolchain from ftp://bo.mirror.garr.it/pub/1/openwrt/snapshots/trunk/bcm53xx/OpenWrt-Toolchain-bcm53xx-for-arm_cortex-a9-gcc-4.8-linaro_uClibc-0.9.33.2_eabi.tar.bz2

since it is not part of the tarball on dd-wrt site.

in the end I did use the .config_northstar_mp and everyting went fine.

My guess is my previous attempt to this were failed because I did not do a make distclean between each try.

So thank you again Kong for bearing with me, I'll be working on putting together a patch to tag the VLAN ID without increasing the number of VLANs , I've seen several people that did this for different versions.

maybe eventually we can make insert this into the VLAN config page.

Guillaume
IcyTexx
DD-WRT Novice


Joined: 27 Feb 2012
Posts: 6

PostPosted: Fri Jun 13, 2014 16:59    Post subject: Reply with quote
This is awesome news!
I just entered the world of dd-wrt and I've not yet been able to catch up on how everything works.
I hope this gets implemented and released soon.

_________________
Netgear R7000
<Kong>
DD-WRT Guru


Joined: 15 Dec 2010
Posts: 1932
Location: Germany

PostPosted: Fri Jun 13, 2014 17:53    Post subject: Reply with quote
gbordier wrote:
So yes,

I wanted to share my result but did not have time yet.

I ended up grabbing the toolchain-arm_cortex-a9_gcc-4.8-linaro_uClibc-0.9.33.2_eabi toolchain from ftp://bo.mirror.garr.it/pub/1/openwrt/snapshots/trunk/bcm53xx/OpenWrt-Toolchain-bcm53xx-for-arm_cortex-a9-gcc-4.8-linaro_uClibc-0.9.33.2_eabi.tar.bz2

since it is not part of the tarball on dd-wrt site.

in the end I did use the .config_northstar_mp and everyting went fine.

My guess is my previous attempt to this were failed because I did not do a make distclean between each try.

So thank you again Kong for bearing with me, I'll be working on putting together a patch to tag the VLAN ID without increasing the number of VLANs , I've seen several people that did this for different versions.

maybe eventually we can make insert this into the VLAN config page.

Guillaume


Great, if it works fine I can integrate it.

_________________
Development Units I use for Development:
R7000/R6300V2/R6300

Kong K3 AC DD-WRT Builds for Mipsel R6300/WNDR4500/D1800H/AC66U/EA6500V1
Kong K3 AC DD-WRT Builds for ARM 1450AC/R6250/R6300v2/R7000/AC56U/AC68U/DIR-868
Kong DD-WRT Guides
IcyTexx
DD-WRT Novice


Joined: 27 Feb 2012
Posts: 6

PostPosted: Sat Jun 21, 2014 14:01    Post subject: Reply with quote
Any news regarding this?

Tomato works great with VLAN VIDs, I hope DD-WRT will as well.

_________________
Netgear R7000
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum