diff options
| author | Max Filippov <jcmvbkbc@gmail.com> | 2014-06-15 23:25:06 -0400 |
|---|---|---|
| committer | Max Filippov <jcmvbkbc@gmail.com> | 2014-08-14 03:59:08 -0400 |
| commit | 420ae9518404c4aeda3abc8e017c8fdcc3a13d6b (patch) | |
| tree | 36c40eae5e715e35a8cb77899154d9e1398fa95f | |
| parent | 64aa90f26c06e1cb2aacfb98a7d0eccfbd6c1a91 (diff) | |
xtensa: simplify addition of new core variants
Instead of adding new Kconfig options and Makefile rules for each new
core variant provide XTENSA_VARIANT_CUSTOM variant and record variant
name in the XTENSA_VARIANT_NAME variable. Adding new core variant now
means providing directory structure under arch/xtensa/variant and
specifying correct name in kernel configuration.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
| -rw-r--r-- | arch/xtensa/Kconfig | 36 | ||||
| -rw-r--r-- | arch/xtensa/Makefile | 7 |
2 files changed, 37 insertions, 6 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 3a617af60d46..7feca8dfdff2 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
| @@ -62,7 +62,9 @@ config TRACE_IRQFLAGS_SUPPORT | |||
| 62 | def_bool y | 62 | def_bool y |
| 63 | 63 | ||
| 64 | config MMU | 64 | config MMU |
| 65 | def_bool n | 65 | bool |
| 66 | default n if !XTENSA_VARIANT_CUSTOM | ||
| 67 | default XTENSA_VARIANT_MMU if XTENSA_VARIANT_CUSTOM | ||
| 66 | 68 | ||
| 67 | config VARIANT_IRQ_SWITCH | 69 | config VARIANT_IRQ_SWITCH |
| 68 | def_bool n | 70 | def_bool n |
| @@ -102,8 +104,40 @@ config XTENSA_VARIANT_S6000 | |||
| 102 | select VARIANT_IRQ_SWITCH | 104 | select VARIANT_IRQ_SWITCH |
| 103 | select ARCH_REQUIRE_GPIOLIB | 105 | select ARCH_REQUIRE_GPIOLIB |
| 104 | select XTENSA_CALIBRATE_CCOUNT | 106 | select XTENSA_CALIBRATE_CCOUNT |
| 107 | |||
| 108 | config XTENSA_VARIANT_CUSTOM | ||
| 109 | bool "Custom Xtensa processor configuration" | ||
| 110 | select MAY_HAVE_SMP | ||
| 111 | select HAVE_XTENSA_GPIO32 | ||
| 112 | help | ||
| 113 | Select this variant to use a custom Xtensa processor configuration. | ||
| 114 | You will be prompted for a processor variant CORENAME. | ||
| 105 | endchoice | 115 | endchoice |
| 106 | 116 | ||
| 117 | config XTENSA_VARIANT_CUSTOM_NAME | ||
| 118 | string "Xtensa Processor Custom Core Variant Name" | ||
| 119 | depends on XTENSA_VARIANT_CUSTOM | ||
| 120 | help | ||
| 121 | Provide the name of a custom Xtensa processor variant. | ||
| 122 | This CORENAME selects arch/xtensa/variant/CORENAME. | ||
| 123 | Dont forget you have to select MMU if you have one. | ||
| 124 | |||
| 125 | config XTENSA_VARIANT_NAME | ||
| 126 | string | ||
| 127 | default "dc232b" if XTENSA_VARIANT_DC232B | ||
| 128 | default "dc233c" if XTENSA_VARIANT_DC233C | ||
| 129 | default "fsf" if XTENSA_VARIANT_FSF | ||
| 130 | default "s6000" if XTENSA_VARIANT_S6000 | ||
| 131 | default XTENSA_VARIANT_CUSTOM_NAME if XTENSA_VARIANT_CUSTOM | ||
| 132 | |||
| 133 | config XTENSA_VARIANT_MMU | ||
| 134 | bool "Core variant has a Full MMU (TLB, Pages, Protection, etc)" | ||
| 135 | depends on XTENSA_VARIANT_CUSTOM | ||
| 136 | default y | ||
| 137 | help | ||
| 138 | Build a Conventional Kernel with full MMU support, | ||
| 139 | ie: it supports a TLB with auto-loading, page protection. | ||
| 140 | |||
| 107 | config XTENSA_UNALIGNED_USER | 141 | config XTENSA_UNALIGNED_USER |
| 108 | bool "Unaligned memory access in use space" | 142 | bool "Unaligned memory access in use space" |
| 109 | help | 143 | help |
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index 81250ece3062..472533064b46 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | # for more details. | 4 | # for more details. |
| 5 | # | 5 | # |
| 6 | # Copyright (C) 2001 - 2005 Tensilica Inc. | 6 | # Copyright (C) 2001 - 2005 Tensilica Inc. |
| 7 | # Copyright (C) 2014 Cadence Design Systems Inc. | ||
| 7 | # | 8 | # |
| 8 | # This file is included by the global makefile so that you can add your own | 9 | # This file is included by the global makefile so that you can add your own |
| 9 | # architecture-specific flags and dependencies. Remember to do have actions | 10 | # architecture-specific flags and dependencies. Remember to do have actions |
| @@ -13,11 +14,7 @@ | |||
| 13 | # Core configuration. | 14 | # Core configuration. |
| 14 | # (Use VAR=<xtensa_config> to use another default compiler.) | 15 | # (Use VAR=<xtensa_config> to use another default compiler.) |
| 15 | 16 | ||
| 16 | variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf | 17 | variant-y := $(patsubst "%",%,$(CONFIG_XTENSA_VARIANT_NAME)) |
| 17 | variant-$(CONFIG_XTENSA_VARIANT_DC232B) := dc232b | ||
| 18 | variant-$(CONFIG_XTENSA_VARIANT_DC233C) := dc233c | ||
| 19 | variant-$(CONFIG_XTENSA_VARIANT_S6000) := s6000 | ||
| 20 | variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom | ||
| 21 | 18 | ||
| 22 | VARIANT = $(variant-y) | 19 | VARIANT = $(variant-y) |
| 23 | export VARIANT | 20 | export VARIANT |
