From: Zoltan HERPAI Date: Mon, 30 Jul 2018 14:00:54 +0000 (+0200) Subject: generic: groundwork for RISC-V X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=439c6793d88bcf492f568860a9e0dfbdaa353c40;p=openwrt%2Fstaging%2Fwigyori.git generic: groundwork for RISC-V Signed-off-by: Zoltan HERPAI --- diff --git a/include/kernel.mk b/include/kernel.mk index 97bcfe3f0b..c6050051b7 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -87,6 +87,8 @@ else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el )) LINUX_KARCH := mips else ifneq (,$(findstring $(ARCH) , powerpc64 )) LINUX_KARCH := powerpc +else ifneq (,$(findstring $(ARCH) , riscv64 )) + LINUX_KARCH := riscv else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 )) LINUX_KARCH := sh else ifneq (,$(findstring $(ARCH) , i386 x86_64 )) diff --git a/include/target.mk b/include/target.mk index 88beae5001..88c1bdc6ed 100644 --- a/include/target.mk +++ b/include/target.mk @@ -230,6 +230,10 @@ ifeq ($(DUMP),1) CPU_CFLAGS_arc700 = -mcpu=arc700 CPU_CFLAGS_archs = -mcpu=archs endif + ifeq ($(ARCH),riscv64) + CPU_TYPE ?= riscv64 + CPU_CFLAGS_riscv64:=-mabi=lp64d -march=rv64imafdc + endif ifneq ($(CPU_TYPE),) ifndef CPU_CFLAGS_$(CPU_TYPE) $(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type) diff --git a/scripts/config.sub b/scripts/config.sub index f018151c64..c28af27851 100755 --- a/scripts/config.sub +++ b/scripts/config.sub @@ -430,7 +430,7 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | riscv32-* | riscv64-* \ + | riscv32-* | riscv64-* | riscv-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ diff --git a/target/Config.in b/target/Config.in index 3cf4231f2a..b3d7a5fb68 100644 --- a/target/Config.in +++ b/target/Config.in @@ -167,6 +167,10 @@ config powerpc64 select ARCH_64BIT bool +config riscv64 + select ARCH_64BIT + bool + config sh3 bool @@ -206,6 +210,7 @@ config ARCH default "mips64el" if mips64el default "powerpc" if powerpc default "powerpc64" if powerpc64 + default "riscv64" if riscv64 default "sh3" if sh3 default "sh3eb" if sh3eb default "sh4" if sh4