Module Name:    src
Committed By:   uwe
Date:           Sat Jul 25 23:38:48 UTC 2020

Modified Files:
        src/sys/arch/evbsh3/conf: std.nextvod
        src/sys/arch/evbsh3/evbsh3: machdep.c
        src/sys/arch/sh3/sh3: cache_sh4.c

Log Message:
Start teaching sh3 code about STX7105.

Kernel option STX7105 to select CPU product (TODO: all of the options
that select CPU product should be defflag'ed to opt_cputype.h).

The ST40 cache sizes can be customized for each product.  For now just
hardcode the STx7105 values in the switch, but may be they should be
kernel options.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbsh3/conf/std.nextvod
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/evbsh3/evbsh3/machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sh3/sh3/cache_sh4.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbsh3/conf/std.nextvod
diff -u src/sys/arch/evbsh3/conf/std.nextvod:1.1 src/sys/arch/evbsh3/conf/std.nextvod:1.2
--- src/sys/arch/evbsh3/conf/std.nextvod:1.1	Sun Jul 19 23:44:36 2020
+++ src/sys/arch/evbsh3/conf/std.nextvod	Sat Jul 25 23:38:48 2020
@@ -1,4 +1,4 @@
-# $NetBSD: std.nextvod,v 1.1 2020/07/19 23:44:36 uwe Exp $
+# $NetBSD: std.nextvod,v 1.2 2020/07/25 23:38:48 uwe Exp $
 
 include "arch/evbsh3/conf/std.evbsh3.el"
 include "arch/evbsh3/conf/files.nextvod"
@@ -9,7 +9,7 @@ makeoptions	BOARDMKFRAG="${THISSH3}/conf
 
 # CPU support
 options 	SH4
-options 	SH7751R		# a white lie to get it to compile
+options 	STX7105
 options 	DONT_INIT_BSC
 
 options 	IOM_RAM_BEGIN=0x00000000 	# NB: physical address

Index: src/sys/arch/evbsh3/evbsh3/machdep.c
diff -u src/sys/arch/evbsh3/evbsh3/machdep.c:1.75 src/sys/arch/evbsh3/evbsh3/machdep.c:1.76
--- src/sys/arch/evbsh3/evbsh3/machdep.c:1.75	Thu Jun 19 13:20:13 2014
+++ src/sys/arch/evbsh3/evbsh3/machdep.c	Sat Jul 25 23:38:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.75 2014/06/19 13:20:13 msaitoh Exp $	*/
+/*	$NetBSD: machdep.c,v 1.76 2020/07/25 23:38:48 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75 2014/06/19 13:20:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.76 2020/07/25 23:38:48 uwe Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -286,6 +286,8 @@ initSH3(void *pc)	/* XXX return address 
 	sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_7751);
 #elif defined(SH7751R)
 	sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_7751R);
+#elif defined(STX7105)
+	sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_STX7105);
 #else
 #error "unsupported SH4 variants"
 #endif

Index: src/sys/arch/sh3/sh3/cache_sh4.c
diff -u src/sys/arch/sh3/sh3/cache_sh4.c:1.24 src/sys/arch/sh3/sh3/cache_sh4.c:1.25
--- src/sys/arch/sh3/sh3/cache_sh4.c:1.24	Tue May 14 14:11:43 2013
+++ src/sys/arch/sh3/sh3/cache_sh4.c	Sat Jul 25 23:38:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache_sh4.c,v 1.24 2013/05/14 14:11:43 tsutsui Exp $	*/
+/*	$NetBSD: cache_sh4.c,v 1.25 2020/07/25 23:38:48 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cache_sh4.c,v 1.24 2013/05/14 14:11:43 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cache_sh4.c,v 1.25 2020/07/25 23:38:48 uwe Exp $");
 
 #include "opt_cache.h"
 
@@ -104,6 +104,17 @@ sh4_cache_config(void)
 		r = SH4_CCR_EMODE|SH4_CCR_ICE|SH4_CCR_OCE|SH4_CCR_WT;
 		break;
 #endif
+
+	/*
+	 * The ST40 cache sizes can be customized for each product.
+	 * Refer to product-specific documentation for the cache sizes.
+	 */
+	case CPU_PRODUCT_STX7105:
+		icache_size = 32 * 1024;
+		dcache_size = 32 * 1024;
+		ways = 2;
+		r = SH4_CCR_EMODE|SH4_CCR_ICE|SH4_CCR_OCE|SH4_CCR_WT;
+		break;
 	}
 #if defined(SH4_CACHE_DISABLE_ICACHE)
 	r &= ~SH4_CCR_ICE;

Reply via email to