0027-ar71xx-add-zboot-support.patch 2.0 KB

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