Commit a89988a6 authored by Marek Vasut's avatar Marek Vasut Committed by Ley Foon Tan

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: default avatarMarek Vasut <marex@denx.de>
Cc: Ley Foon Tan <lftan@altera.com>
parent 4b40c1c0
...@@ -22,7 +22,10 @@ export MMU ...@@ -22,7 +22,10 @@ export MMU
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
KBUILD_AFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
KBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__ KBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__
KBUILD_CFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul) KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul)
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx) KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx)
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div) KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div)
......
...@@ -125,12 +125,14 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -125,12 +125,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, seq_printf(m,
"CPU:\t\tNios II/%s\n" "CPU:\t\tNios II/%s\n"
"REV:\t\t%i\n"
"MMU:\t\t%s\n" "MMU:\t\t%s\n"
"FPU:\t\tnone\n" "FPU:\t\tnone\n"
"Clocking:\t%u.%02u MHz\n" "Clocking:\t%u.%02u MHz\n"
"BogoMips:\t%lu.%02lu\n" "BogoMips:\t%lu.%02lu\n"
"Calibration:\t%lu loops\n", "Calibration:\t%lu loops\n",
cpuinfo.cpu_impl, cpuinfo.cpu_impl,
CONFIG_NIOS2_ARCH_REVISION,
cpuinfo.mmu ? "present" : "none", cpuinfo.mmu ? "present" : "none",
clockfreq / 1000000, (clockfreq / 100000) % 10, clockfreq / 1000000, (clockfreq / 100000) % 10,
(loops_per_jiffy * HZ) / 500000, (loops_per_jiffy * HZ) / 500000,
......
...@@ -52,6 +52,14 @@ config NIOS2_DTB_SOURCE ...@@ -52,6 +52,14 @@ config NIOS2_DTB_SOURCE
comment "Nios II instructions" comment "Nios II instructions"
config NIOS2_ARCH_REVISION
int "Select Nios II architecture revision"
range 1 2
default 1
help
Select between Nios II R1 and Nios II R2 . The architectures
are binary incompatible. Default is R1 .
config NIOS2_HW_MUL_SUPPORT config NIOS2_HW_MUL_SUPPORT
bool "Enable MUL instruction" bool "Enable MUL instruction"
default n default n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment