diff options
author | Marek Vasut <marex@denx.de> | 2017-04-19 07:19:00 -0400 |
---|---|---|
committer | Ley Foon Tan <ley.foon.tan@intel.com> | 2017-05-08 04:59:19 -0400 |
commit | a89988a6e00c5a099ee23619cd91dc8dc7ec9328 (patch) | |
tree | d9e64b92b35f2a147c59295f512964192cd2be41 | |
parent | 4b40c1c092a932b5b5ab8154235080f02ae19a34 (diff) |
nios2: Add NIOS2_ARCH_REVISION to select between R1 and R2
Allow user to select between Nios2 R1 and R2. Since R1 and R2 are
not binary compatible, we cannot have a single kernel binary and
there is no point in having DT property for discerning these two.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ley Foon Tan <lftan@altera.com>
-rw-r--r-- | arch/nios2/Makefile | 3 | ||||
-rw-r--r-- | arch/nios2/kernel/cpuinfo.c | 2 | ||||
-rw-r--r-- | arch/nios2/platform/Kconfig.platform | 8 |
3 files changed, 13 insertions, 0 deletions
diff --git a/arch/nios2/Makefile b/arch/nios2/Makefile index e74afc12d516..38da17e4c908 100644 --- a/arch/nios2/Makefile +++ b/arch/nios2/Makefile | |||
@@ -22,7 +22,10 @@ export MMU | |||
22 | 22 | ||
23 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) | 23 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) |
24 | 24 | ||
25 | KBUILD_AFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION) | ||
26 | |||
25 | KBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__ | 27 | KBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__ |
28 | KBUILD_CFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION) | ||
26 | KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul) | 29 | KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul) |
27 | KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx) | 30 | KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx) |
28 | KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div) | 31 | KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div) |
diff --git a/arch/nios2/kernel/cpuinfo.c b/arch/nios2/kernel/cpuinfo.c index 1cccc36877bc..b4a6242b0f1c 100644 --- a/arch/nios2/kernel/cpuinfo.c +++ b/arch/nios2/kernel/cpuinfo.c | |||
@@ -125,12 +125,14 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
125 | 125 | ||
126 | seq_printf(m, | 126 | seq_printf(m, |
127 | "CPU:\t\tNios II/%s\n" | 127 | "CPU:\t\tNios II/%s\n" |
128 | "REV:\t\t%i\n" | ||
128 | "MMU:\t\t%s\n" | 129 | "MMU:\t\t%s\n" |
129 | "FPU:\t\tnone\n" | 130 | "FPU:\t\tnone\n" |
130 | "Clocking:\t%u.%02u MHz\n" | 131 | "Clocking:\t%u.%02u MHz\n" |
131 | "BogoMips:\t%lu.%02lu\n" | 132 | "BogoMips:\t%lu.%02lu\n" |
132 | "Calibration:\t%lu loops\n", | 133 | "Calibration:\t%lu loops\n", |
133 | cpuinfo.cpu_impl, | 134 | cpuinfo.cpu_impl, |
135 | CONFIG_NIOS2_ARCH_REVISION, | ||
134 | cpuinfo.mmu ? "present" : "none", | 136 | cpuinfo.mmu ? "present" : "none", |
135 | clockfreq / 1000000, (clockfreq / 100000) % 10, | 137 | clockfreq / 1000000, (clockfreq / 100000) % 10, |
136 | (loops_per_jiffy * HZ) / 500000, | 138 | (loops_per_jiffy * HZ) / 500000, |
diff --git a/arch/nios2/platform/Kconfig.platform b/arch/nios2/platform/Kconfig.platform index d3e5df9fb36b..b7ac5b90c399 100644 --- a/arch/nios2/platform/Kconfig.platform +++ b/arch/nios2/platform/Kconfig.platform | |||
@@ -52,6 +52,14 @@ config NIOS2_DTB_SOURCE | |||
52 | 52 | ||
53 | comment "Nios II instructions" | 53 | comment "Nios II instructions" |
54 | 54 | ||
55 | config NIOS2_ARCH_REVISION | ||
56 | int "Select Nios II architecture revision" | ||
57 | range 1 2 | ||
58 | default 1 | ||
59 | help | ||
60 | Select between Nios II R1 and Nios II R2 . The architectures | ||
61 | are binary incompatible. Default is R1 . | ||
62 | |||
55 | config NIOS2_HW_MUL_SUPPORT | 63 | config NIOS2_HW_MUL_SUPPORT |
56 | bool "Enable MUL instruction" | 64 | bool "Enable MUL instruction" |
57 | default n | 65 | default n |