changeset 1702:1829b36abc97

Start of sh2 big endian (nommu!) support. Doesn't work yet (ash has an #error if you try to build it nommu).
author Rob Landley <rob@landley.net>
date Mon, 27 Oct 2014 17:02:14 -0500
parents e4ff2cf4ac62
children 828d2e318e26
files sources/patches/gcc-core-sh2.patch sources/targets/sh2eb
diffstat 2 files changed, 105 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/gcc-core-sh2.patch	Mon Oct 27 17:02:14 2014 -0500
@@ -0,0 +1,52 @@
+diff -ru gcc-core/gcc/config.gcc gcc-core.bak/gcc/config.gcc
+--- gcc-core/gcc/config.gcc	2014-10-11 13:03:43.993132192 -0500
++++ gcc-core.bak/gcc/config.gcc	2014-10-11 13:14:27.048275968 -0500
+@@ -1964,7 +1964,7 @@
+         ;;
+ sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
+ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
+-  sh-*-linux* | sh[346lbe]*-*-linux* | \
++  sh-*-linux* | sh[2346lbe]*-*-linux* | \
+   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+    sh64-*-netbsd* | sh64l*-*-netbsd*)
+ 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
+diff -ru gcc-core/gcc/config/sh/lib1funcs.asm gcc-core.bak/gcc/config/sh/lib1funcs.asm
+--- gcc-core/gcc/config/sh/lib1funcs.asm	2006-06-13 12:44:56.000000000 -0500
++++ gcc-core.bak/gcc/config/sh/lib1funcs.asm	2014-10-16 06:28:53.842282481 -0500
+@@ -3891,3 +3891,5 @@
+ 	ENDFUNC(GLOBAL(udiv_qrnnd_16))
+ #endif /* !__SHMEDIA__ */
+ #endif /* L_udiv_qrnnd_16 */
++
++#include "lib1funcs-Os-4-200.asm"
+diff -ru gcc-core/gcc/config/sh/lib1funcs.h gcc-core.bak/gcc/config/sh/lib1funcs.h
+--- gcc-core/gcc/config/sh/lib1funcs.h	2006-06-13 12:44:56.000000000 -0500
++++ gcc-core.bak/gcc/config/sh/lib1funcs.h	2014-10-16 06:27:44.361942821 -0500
+@@ -26,6 +26,9 @@
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.  */
+ 
++#ifndef LIB1FUNCS_H
++#define LIB1FUNCS_H 
++
+ #ifdef __ELF__
+ #define LOCAL(X)	.L_##X
+ #define FUNC(X)		.type X,@function
+@@ -79,3 +82,5 @@
+ #define SL1(branch, dest, in_slot) \
+ 	branch##/s dest; in_slot
+ #endif /* !__sh1__ */
++
++#endif
+diff -ruN gcc-core/gcc/config/sh/t-sh gcc-core.bak/gcc/config/sh/t-sh
+--- gcc-core/gcc/config/sh/t-sh	2006-06-13 12:44:56.000000000 -0500
++++ gcc-core.bak/gcc/config/sh/t-sh	2014-10-24 07:13:49.252759353 -0500
+@@ -5,7 +5,7 @@
+ LIB1ASMSRC = sh/lib1funcs.asm
+ LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movmem \
+   _movmem_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
+-  _div_table _udiv_qrnnd_16 \
++  _div_table _udiv_qrnnd_16 _udivsi3_i4i \
+   $(LIB1ASMFUNCS_CACHE)
+ 
+ # We want fine grained libraries, so use the new code to build the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/targets/sh2eb	Mon Oct 27 17:02:14 2014 -0500
@@ -0,0 +1,53 @@
+DESCRIPTION="
+See se-instruments.com and http://linux-sh.org.
+"
+
+KARCH=sh
+KERNEL_PATH=arch/${KARCH}/boot/zImage
+GCC_FLAGS= #"--with-cpu=m4-nofpu"
+BINUTILS_FLAGS=
+QEMU_TEST=$KARCH
+#CROSS_TARGET=sh2-unknown-linux
+
+ROOT=sda
+CONSOLE="ttySC1 noiotrap"
+
+UCLIBC_CONFIG="
+TARGET_sh=y
+CONFIG_SH2=y
+# UCLIBC_HAS_MMU is not set
+LINUXTHREADS_OLD=y
+"
+
+LINUX_CONFIG="
+CONFIG_CPU_SUBTYPE_SH7751R=y
+CONFIG_MMU=y
+CONFIG_MEMORY_START=0x0c000000
+CONFIG_VSYSCALL=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_SH_FPU=y
+CONFIG_SH_RTS7751R2D=y
+CONFIG_RTS7751R2D_PLUS=y
+CONFIG_SH_TIMER_TMU=y
+CONFIG_HW_PERF_EVENTS=y
+CONFIG_ATA=y
+CONFIG_SATA_PMP=y
+CONFIG_ATA_SFF=y
+CONFIG_ATA_BMDMA=y
+CONFIG_PATA_PLATFORM=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_SH_SCI=y
+CONFIG_SERIAL_SH_SCI_CONSOLE=y
+CONFIG_SPI=y
+CONFIG_SPI_SH_SCI=y
+CONFIG_MFD_SM501=y
+CONFIG_RTC_DRV_R9701=y
+"
+
+emulator_command()
+{
+  echo qemu-system-sh4 -M r2d $(qemu_defaults "$@") -monitor null -serial null -serial stdio
+}
+
+# qemu-system-sh4 -m 512 -nographic -monitor null -serial null -serial stdio -append 'earlyprintk=sh-sci.1 root=/dev/sda rw init=/bin/ash'