300-arch-arm-force-ZRELADDR-on-arch-qcom.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From b12e230f09d4481424e6a5d7e2ae566b6954e83f Mon Sep 17 00:00:00 2001
  2. From: Mathieu Olivari <mathieu@codeaurora.org>
  3. Date: Wed, 29 Apr 2015 15:21:46 -0700
  4. Subject: [PATCH] HACK: arch: arm: force ZRELADDR on arch-qcom
  5. ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
  6. on most ARM architectures. This automatically calculate ZRELADDR by
  7. masking PHYS_OFFSET with 0xf8000000.
  8. However, on IPQ806x, the first ~20MB of RAM is reserved for the hardware
  9. network accelerators, and the bootloader removes this section from the
  10. layout passed from the ATAGS (when used).
  11. For newer bootloader, when DT is used, this is not a problem, we just
  12. reserve this memory in the device tree. But if the bootloader doesn't
  13. have DT support, then ATAGS have to be used. In this case, the ARM
  14. decompressor will position the kernel in this low mem, which will not be
  15. in the RAM section mapped by the bootloader, which means the kernel will
  16. freeze in the middle of the boot process trying to map the memory.
  17. As a work around, this patch allows disabling AUTO_ZRELADDR when
  18. ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
  19. which don't support device-tree, which is the case on certain early
  20. IPQ806x based designs.
  21. Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
  22. ---
  23. arch/arm/Kconfig | 2 +-
  24. arch/arm/Makefile | 2 ++
  25. arch/arm/mach-qcom/Makefile.boot | 1 +
  26. 3 files changed, 4 insertions(+), 1 deletion(-)
  27. create mode 100644 arch/arm/mach-qcom/Makefile.boot
  28. --- a/arch/arm/Kconfig
  29. +++ b/arch/arm/Kconfig
  30. @@ -324,7 +324,7 @@ config ARCH_MULTIPLATFORM
  31. select ARCH_WANT_OPTIONAL_GPIOLIB
  32. select ARM_HAS_SG_CHAIN
  33. select ARM_PATCH_PHYS_VIRT
  34. - select AUTO_ZRELADDR
  35. + select AUTO_ZRELADDR if !ARCH_QCOM
  36. select CLKSRC_OF
  37. select COMMON_CLK
  38. select GENERIC_CLOCKEVENTS
  39. --- a/arch/arm/Makefile
  40. +++ b/arch/arm/Makefile
  41. @@ -256,9 +256,11 @@ MACHINE := arch/arm/mach-$(word 1,$(mac
  42. else
  43. MACHINE :=
  44. endif
  45. +ifeq ($(CONFIG_ARCH_QCOM),)
  46. ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
  47. MACHINE :=
  48. endif
  49. +endif
  50. machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
  51. platdirs := $(patsubst %,arch/arm/plat-%/,$(sort $(plat-y)))
  52. --- /dev/null
  53. +++ b/arch/arm/mach-qcom/Makefile.boot
  54. @@ -0,0 +1 @@
  55. +zreladdr-y+= 0x42208000