armnommu-versatile.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. From 77c038d93769c92ef54cdbb50388564d1b37987b Mon Sep 17 00:00:00 2001
  2. From: Greg Ungerer <gerg@kernel.org>
  3. Date: Fri, 23 Sep 2016 13:37:34 +1000
  4. Subject: [PATCH] ARM: versatile: support configuring versatile machine for no-MMU
  5. Allow the arm versatile machine to be configured for no-MMU operation.
  6. Older kernels had the ability to build the versatile machine with the MMU
  7. disabled (!CONFIG_MMU). Recent changes to convert the versatile machine
  8. to device tree lost this ability. (Although older kernels could be built
  9. they did not run due to a bug in the IO_ADDRESS() mapping on this machine).
  10. The motivation for this is that the versatile machine is well supported
  11. in qemu. And this provides an excellent platform for development and
  12. testing no-MMU support on ARM in general.
  13. This patch adds a versatile platform selection in the upper level arm
  14. system type menu - where it appeared in older kernel versions - when
  15. configuring for the no-MMU case. There is no visible change to the way
  16. versatile is selected for the MMU enabled case.
  17. Signed-off-by: Greg Ungerer <gerg@kernel.org>
  18. ---
  19. arch/arm/Kconfig | 13 ++++++++++++-
  20. arch/arm/include/asm/mach/map.h | 1 +
  21. arch/arm/mach-versatile/Kconfig | 2 +-
  22. arch/arm/mach-versatile/versatile.c | 4 ++++
  23. 4 files changed, 18 insertions(+), 2 deletions(-)
  24. diff --git a/arch/arm/mach-versatile/versatile.c b/arch/arm/mach-versatile/versatile.c
  25. index 02ba68abe533..835b51bc597b 100644
  26. --- a/arch/arm/mach-versatile/versatile.c
  27. +++ b/arch/arm/mach-versatile/versatile.c
  28. @@ -22,7 +22,11 @@
  29. #include <asm/mach/map.h>
  30. /* macro to get at MMIO space when running virtually */
  31. +#ifdef CONFIG_MMU
  32. #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
  33. +#else
  34. +#define IO_ADDRESS(x) (x)
  35. +#endif
  36. #define __io_address(n) ((void __iomem __force *)IO_ADDRESS(n))
  37. /*
  38. diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
  39. index 2b8970d8e5a2..41844ab6aec5 100644
  40. --- a/arch/arm/include/asm/mach/map.h
  41. +++ b/arch/arm/include/asm/mach/map.h
  42. @@ -60,6 +60,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
  43. #else
  44. #define iotable_init(map,num) do { } while (0)
  45. #define vm_reserve_area_early(a,s,c) do { } while (0)
  46. +#define debug_ll_io_init() do { } while (0)
  47. #endif
  48. #endif
  49. diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
  50. index e24a9820e12f..342e1efa583a 100644
  51. --- a/arch/arm/Kconfig
  52. +++ b/arch/arm/Kconfig
  53. @@ -307,12 +307,23 @@ config MMU
  54. Select if you want MMU-based virtualised addressing space
  55. support by paged memory management. If unsure, say 'Y'.
  56. +choice
  57. + prompt "ARM system type"
  58. + depends on !MMU
  59. + default ARM_SINGLE_ARMV7M
  60. +
  61. config ARM_SINGLE_ARMV7M
  62. - def_bool !MMU
  63. + bool "ARMv7-M based platforms (Cortex-M0/M3/M4)"
  64. select ARM_NVIC
  65. select CPU_V7M
  66. select NO_IOPORT_MAP
  67. +config ARM_SINGLE_ARM926
  68. + bool "ARM926 based platforms"
  69. + select CPU_ARM926T
  70. +
  71. +endchoice
  72. +
  73. config ARCH_MMAP_RND_BITS_MIN
  74. default 8
  75. diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
  76. index b1519b4dc03a..2f1bf95daeb0 100644
  77. --- a/arch/arm/mach-versatile/Kconfig
  78. +++ b/arch/arm/mach-versatile/Kconfig
  79. @@ -1,7 +1,7 @@
  80. # SPDX-License-Identifier: GPL-2.0
  81. config ARCH_VERSATILE
  82. bool "ARM Ltd. Versatile family"
  83. - depends on ARCH_MULTI_V5
  84. + depends on ARCH_MULTI_V5 || ARM_SINGLE_ARM926
  85. depends on CPU_LITTLE_ENDIAN
  86. select ARM_AMBA
  87. select ARM_TIMER_SP804
  88. --
  89. 2.25.1