Commit Graph

12 Commits (f5b3cd15395c2617585e36b4acf40999616cc60c)

Author SHA1 Message Date
Baptiste Jonglez f5b3cd1539 ar71xx: Fix gigabit switch support for Mikrotik RB951G-2HnD
Without this patch, when using rev 3 of the Atheros AR9344 SoC, the
gigabit switch (AR8327) does not work or works very erratically.

This is a re-spin of http://patchwork.ozlabs.org/patch/419857/ with a
different PLL value, according to the feedback from several users
(including myself) as shown here:

  https://openwrt.org/toh/mikrotik/rb2011uias#tracking_reported_experience_with_suggested_patch_for_the_5_gige_ports

Performance is acceptable: testing L3 forwarding without NAT yields a
performance of 370 Mbit/s (iperf3 TCP) and 41 Kpps (iperf3 UDP with 64
bytes payload). Both tests show that 100% of CPU time is spent on softirq.

A similar fix for a different device (RB2011) was added in e457d22261
("Make GBit switch work on RB2011").

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
(cherry picked from commit 247043c968)
4 years ago
Koen Vandeputte 743654f30d ar71xx: add missing include for checking kernel version
Fixes these build errors:

arch/mips/ath79/mach-rb2011.c:20:5: error: "LINUX_VERSION_CODE" is not defined, evaluates to 0 [-Werror=undef]
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
     ^~~~~~~~~~~~~~~~~~
arch/mips/ath79/mach-rb2011.c:20:26: error: "KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
                          ^~~~~~~~~~~~~~
arch/mips/ath79/mach-rb2011.c:20:40: error: missing binary operator before token "("
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
                                        ^

Fixes: 318e19ba67 ("ar71xx: add v4.14 support")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
John Crispin 318e19ba67 ar71xx: add v4.14 support
adds v4.14 patches for testing but leaves v4.9 as default for now.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Gabor Juhos 665bb27499 ar71xx: fix invalid pointer dereference in rb95x_nand_scan_fixup()
Since Linux 4.6, mtd->priv no longer points to the NAND specific
structure. Under 4.9 it contains NULL, thus using it to access
chip->options causes an invalid pointer dereference (FS#1200).

Update the code to use the mtd_to_nand() helper under 4.9 to obtain
the address of the chip specific data.

Fixes: 7bbf4117c6 ("ar71xx: Add kernel 4.9 support")
Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
6 years ago
Hauke Mehrtens 7bbf4117c6 ar71xx: Add kernel 4.9 support
This add support for kernel 4.9 to the ar71xx target.
It was compile tested with the generic, NAND and mikrotik subtarget.
Multiple members of the community tested it on their boards and did not
report any major problem so far.

Especially the NAND part received some changes to adapt to the new
kernel APIs. The serial driver hack used for the Arduino Yun was not
ported because the kernel changed there a lot.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Sergey Sergeev 9e1bc27e6d ar71xx: Fix UBIFS work on Mikrotik RB95x devices
If nand chip has no NAND_NO_SUBPAGE_WRITE flag on its options
ubifs can't use it mtd devices and the kernel crashes with error:
__nand_correct_data: uncorrectable ECC error

Signed-off-by: Sergey Sergeev <adron@yapic.net>
7 years ago
Felix Fietkau 9db9072d67 ar71xx: convert mikrotik routerboard support to UBI
Remove the wget2nand script, drop the need for manual installation,
use sysupgrade instead.

There are now two different NAND images, one for 64 MiB flashes, the
other for >= 128 MiB

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Gabor Juhos 47dfbb5bc6 ar71xx: rb95x: use correct SPI flash address
The flash address passed to rb_init_info() is bogus,
use the predefined AR71XX_SPI_BASE macro instead.

Compile tested only.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 39891
10 years ago
Gabor Juhos d19b868b12 ar71xx: Add support for MikroTik RB951Ui-2HnD
I noticed that the patch at http://patchwork.openwrt.org/patch/4017/
for adding support for the MikroTik RouterBOARD 951Ui-2HnD had been
abandoned because it wasn't generated and sent to the mailing list
correctly and doesn't apply as a result.  I have cleaned up this patch.

When testing this on real hardware, I also noticed that wireless didn't
work, so this patch fixes that as well.

This patch applies cleanly to SVN 39392.

Signed-off-by: Matthew Reeve <mreeve@tenxnetworks.com>
Patchwork: http://patchwork.openwrt.org/patch/4773/
[juhosg:
  - drop the 'rb951ui_wlan_init' function and rework the code to
    use the recently introduced rb95x_wlan_init function instead,
  - fix GPIO number of the port5 LED,
  - rename LEDs according to the standard LED naming conventions,
    and use 'rb' prefix in the names]
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 39641
10 years ago
Gabor Juhos 627651dfca ar71xx: rb95x: use the rb_get_wlan_data helper
Also remove unused RB_* defines.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 39092
11 years ago
Gabor Juhos 728c2c6cff ar71xx: rb95x: nuke rb95x_gpio_init
Set up the chipselect GPIO directly in rb95x_nand_init
instead.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 39087
11 years ago
Gabor Juhos 7a709573d7 ar71xx: add kernel support for the Mikrotik RB951G board
This is platform definition for the RB951G device. It's mostly rework
of RB2011UAS patchset with network taken from the RB751 patches.
The main difference is the flash layout used by this device.

[juhosg:
  - remove dead code from mach-rb951g
  - add "-2HnD" suffix to the machine name
  - use a separate 615-MIPS-ath79-RB951G-support.patch]

Patchwork: http://patchwork.openwrt.org/patch/3257/
Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35633
11 years ago