generic: groundwork for RISC-V
authorZoltan HERPAI <wigyori@uid0.hu>
Mon, 30 Jul 2018 14:00:54 +0000 (16:00 +0200)
committerZoltan HERPAI <wigyori@uid0.hu>
Mon, 30 Jul 2018 14:05:25 +0000 (16:05 +0200)
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
include/kernel.mk
include/target.mk
scripts/config.sub
target/Config.in

index c169550f488f45de29dfb2137a7bb29441da1855..b57b6c32532a0dd2b32ca39532e091bc0225b72f 100644 (file)
@@ -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 ))
index 6eee068336e86b6d2d9cca77e2a916974d1322df..7e94a2e8f758b1269ae9457df41432cc31eb83da 100644 (file)
@@ -231,6 +231,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)
index f018151c64b5baeb9e05eff62250b58571891f83..c28af27851f39dab9b04fdaf0eecfd6759ce9cb5 100755 (executable)
@@ -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-* \
index 3aef76890dba3c18ac3fafa588cba61ce72009d7..b222f7cbae440f6cbc8ef4ec80692c1d302932fc 100644 (file)
@@ -161,6 +161,10 @@ config powerpc64
        select ARCH_64BIT
        bool
 
+config riscv64
+       select ARCH_64BIT
+       bool
+
 config sh3
        bool
 
@@ -200,6 +204,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