Browse Source

mikrotik-rb4xx: update kernel patches

- add zboot support
- workaround link state bug

Signed-off-by: Phil Sutter <phil@nwl.cc>
Phil Sutter 10 years ago
parent
commit
c3a5e3e51f

+ 64 - 0
target/mips/mikrotik-rb4xx/patches/3.14.45/0027-ar71xx-add-zboot-support.patch

@@ -0,0 +1,64 @@
+From 38af1d72bd5c760623996c7a8978e05e007f0e96 Mon Sep 17 00:00:00 2001
+From: Phil Sutter <phil@nwl.cc>
+Date: Mon, 23 Jun 2014 02:51:10 +0200
+Subject: [PATCH] ar71xx: add zboot support
+
+This also contains a workaround for the decompressor overwriting the
+bootloader-passed kernel parameters in memory.
+---
+ arch/mips/Kconfig                      | 2 ++
+ arch/mips/boot/compressed/Makefile     | 6 ++++++
+ arch/mips/boot/compressed/uart-16550.c | 6 ++++++
+ 3 files changed, 14 insertions(+)
+
+diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
+index 95fa1f1..3bb5324 100644
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -106,6 +106,8 @@ config ATH79
+ 	select SYS_HAS_EARLY_PRINTK
+ 	select SYS_SUPPORTS_32BIT_KERNEL
+ 	select SYS_SUPPORTS_BIG_ENDIAN
++	select SYS_SUPPORTS_ZBOOT
++	select SYS_SUPPORTS_ZBOOT_UART16550
+ 	help
+ 	  Support for the Atheros AR71XX/AR724X/AR913X SoCs.
+ 
+diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
+index 61af6b6..5a4491d 100644
+--- a/arch/mips/boot/compressed/Makefile
++++ b/arch/mips/boot/compressed/Makefile
+@@ -13,7 +13,13 @@
+ #
+ 
+ # set the default size of the mallocing area for decompressing
++ifeq ($(CONFIG_ATH79_MACH_RB4XX),y)
++# this needs to be smaller, otherwise the routerboot passed
++# kernel parameters fall into bss area (and are therefore zeroed)
++BOOT_HEAP_SIZE := 0x100000
++else
+ BOOT_HEAP_SIZE := 0x400000
++endif
+ 
+ # Disable Function Tracer
+ KBUILD_CFLAGS := $(shell echo $(KBUILD_CFLAGS) | sed -e "s/-pg//")
+diff --git a/arch/mips/boot/compressed/uart-16550.c b/arch/mips/boot/compressed/uart-16550.c
+index 237494b..25cb145 100644
+--- a/arch/mips/boot/compressed/uart-16550.c
++++ b/arch/mips/boot/compressed/uart-16550.c
+@@ -12,6 +12,12 @@
+ #define PORT(offset) (CKSEG1ADDR(UART_BASE) + (offset))
+ #endif
+ 
++#ifdef CONFIG_SOC_AR71XX
++#include <ar71xx_regs.h>
++#define PORT(offset) (CKSEG1ADDR(AR71XX_UART_BASE) + (4 * offset))
++#define IOTYPE unsigned int
++#endif
++
+ #ifdef CONFIG_AR7
+ #include <ar7.h>
+ #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset))
+-- 
+1.8.5.3
+

+ 39 - 0
target/mips/mikrotik-rb4xx/patches/3.14.45/0028-ag71xx-workaround-some-link-state-bug.patch

@@ -0,0 +1,39 @@
+From 02dc26588275d19a49d47abf2210c41b071cd796 Mon Sep 17 00:00:00 2001
+From: Phil Sutter <phil@nwl.cc>
+Date: Sat, 28 Jun 2014 17:07:52 +0200
+Subject: [PATCH] ag71xx: workaround some link state bug
+
+This happens when routing 100mbit/s traffic with masquerading, link
+supposedly drops to 10HD for a few seconds leading to the driver
+reinitialising the NIC and therefore causing a throughput drop. Ignoring
+those link changes allows for constant bandwidth, therefore this seems
+not to be a real problem of the hardware but one of an overreacting
+driver.
+---
+ drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c b/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
+index 9de77e9..a83707e 100644
+--- a/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
++++ b/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
+@@ -25,7 +25,15 @@ static void ag71xx_phy_link_adjust(struct net_device *dev)
+ 	if (phydev->link) {
+ 		if (ag->duplex != phydev->duplex
+ 		    || ag->speed != phydev->speed) {
+-			status_change = 1;
++			/* Completely ignore speed/duplex changes as long
++			 * as the link stays up as they're probably spurious
++			 * (the internal link should not change any way).
++			 *
++			 * This is actually a workaround, as the link seems to
++			 * drop to 10HD from 1000FD under routing load when at
++			 * least masquerading is also in use.
++			 */
++			//status_change = 1;
+ 		}
+ 	}
+ 
+-- 
+1.8.5.3
+

+ 1 - 0
target/mips/systems/mikrotik-rb4xx

@@ -8,6 +8,7 @@ config ADK_TARGET_SYSTEM_MIKROTIK_RB4XX
 	select ADK_TARGET_WITH_WATCHDOG
 	select ADK_TARGET_WITH_WATCHDOG
 	select ADK_TARGET_WITH_NAND
 	select ADK_TARGET_WITH_NAND
 	select ADK_TARGET_WITH_LEDS
 	select ADK_TARGET_WITH_LEDS
+	select ADK_TARGET_KERNEL_VMLINUZ
 	help
 	help
 	  Support for Mikrotik RB411/RB433/RB493g.
 	  Support for Mikrotik RB411/RB433/RB493g.