summaryrefslogtreecommitdiff
path: root/sys/arch/solbourne/conf
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-04-19 21:30:21 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-04-19 21:30:21 +0000
commitf8113ea52367852315892e656e7e49e3ea7e957c (patch)
treef1a8704d1210070606065840879eea1909dd61cd /sys/arch/solbourne/conf
parent21df6903b631dbf2a966418f3e9d09aba3fa262e (diff)
As a late birthday present, a preliminary port to the Solbourne IDT systems
(S3000, S4000 and S4000DX). Currently limited to diskless and serial console, and userland has issues. Things will get better in the near future.
Diffstat (limited to 'sys/arch/solbourne/conf')
-rw-r--r--sys/arch/solbourne/conf/GENERIC31
-rw-r--r--sys/arch/solbourne/conf/Makefile.solbourne191
-rw-r--r--sys/arch/solbourne/conf/files.solbourne35
-rw-r--r--sys/arch/solbourne/conf/ld.script49
4 files changed, 306 insertions, 0 deletions
diff --git a/sys/arch/solbourne/conf/GENERIC b/sys/arch/solbourne/conf/GENERIC
new file mode 100644
index 00000000000..80721546304
--- /dev/null
+++ b/sys/arch/solbourne/conf/GENERIC
@@ -0,0 +1,31 @@
+# $OpenBSD: GENERIC,v 1.1 2005/04/19 21:30:17 miod Exp $
+
+# Machine architecture; required by config(8)
+machine solbourne sparc
+
+include "../../../conf/GENERIC"
+
+maxusers 32 # estimated number of users
+option SOLBOURNE # necessary for proper config(8) operation
+
+# Generic swap; second partition of root disk or network.
+config bsd swap generic
+
+# Main bus and CPU .. all systems.
+mainbus0 at root
+cpu0 at mainbus0
+obio0 at mainbus0
+
+# Oki MSM62X42BRS TODclock
+tod0 at obio0
+
+# Zilog 8530 serial chips. Each has two-channels.
+# zs0 is ttya and ttyb. zs1 is the keyboard and mouse.
+zs0 at obio0
+zs1 at obio0
+
+zstty* at zs?
+zsclock0 at zs1
+
+# On-board Ethernet
+le0 at obio0
diff --git a/sys/arch/solbourne/conf/Makefile.solbourne b/sys/arch/solbourne/conf/Makefile.solbourne
new file mode 100644
index 00000000000..c1f11229bb4
--- /dev/null
+++ b/sys/arch/solbourne/conf/Makefile.solbourne
@@ -0,0 +1,191 @@
+# $OpenBSD: Makefile.solbourne,v 1.1 2005/04/19 21:30:17 miod Exp $
+
+# Makefile for OpenBSD
+#
+# This makefile is constructed from a machine description:
+# config machineid
+# Most changes should be made in the machine description
+# /sys/arch/solbourne/conf/``machineid''
+# after which you should do
+# config machineid
+# Machine generic makefile changes should be made in
+# /sys/arch/solbourne/conf/Makefile.solbourne
+# after which config should be rerun for all machines of that type.
+#
+# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
+# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
+#
+# -DTRACE compile in kernel tracing hooks
+# -DQUOTA compile in file system quotas
+
+# DEBUG is set to -g if debugging.
+# PROF is set to -pg if profiling.
+
+.include <bsd.own.mk>
+
+MKDEP?= mkdep
+SIZE?= size
+STRIP?= strip
+
+# source tree is located via $S relative to the compilation directory
+.ifndef S
+S!= cd ../../../..; pwd
+.endif
+SOLBOURNE= $S/arch/solbourne
+
+INCLUDES= -nostdinc -I. -I$S/arch -I$S
+CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Dsparc -Dsolbourne
+
+CDIAGFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
+ -Wno-uninitialized -Wno-format -Wno-main
+
+CMACHFLAGS= -fno-builtin-printf -fno-builtin-log
+.if ${IDENT:M-DNO_PROPOLICE}
+CMACHFLAGS+= -fno-stack-protector
+.endif
+
+CFLAGS= ${DEBUG} -O2 ${CDIAGFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
+# add `-mno-fpu' to work around gcc (last noticed in v2.7.2) bug
+CFLAGS+= -mno-fpu
+AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
+LINKFLAGS= -N -e start -T ${SOLBOURNE}/conf/ld.script -Ttext FD084000
+STRIPFLAGS= -g -X -x
+
+HOSTCC= ${CC}
+HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
+HOSTED_CFLAGS= ${CFLAGS}
+
+### find out what to use for libkern
+.include "$S/lib/libkern/Makefile.inc"
+.ifndef PROF
+LIBKERN= ${KERNLIB}
+.else
+LIBKERN= ${KERNLIB_PROF}
+.endif
+
+### find out what to use for libcompat
+.include "$S/compat/common/Makefile.inc"
+.ifndef PROF
+LIBCOMPAT= ${COMPATLIB}
+.else
+LIBCOMPAT= ${COMPATLIB_PROF}
+.endif
+
+# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
+# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
+# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
+# is marked as config-dependent.
+
+NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
+NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
+
+DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
+DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
+
+NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
+NORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
+
+HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
+
+%OBJS
+
+%CFILES
+
+%SFILES
+
+# load lines for config "xxx" will be emitted as:
+# xxx: ${SYSTEM_DEP} swapxxx.o
+# ${SYSTEM_LD_HEAD}
+# ${SYSTEM_LD} swapxxx.o
+# ${SYSTEM_LD_TAIL}
+SYSTEM_OBJ= locore.o \
+ param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
+SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
+SYSTEM_LD_HEAD= @rm -f $@
+SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
+ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
+SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
+
+DEBUG?=
+.if ${DEBUG} == "-g"
+LINKFLAGS+= -X
+SYSTEM_LD_TAIL+=; \
+ echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
+ echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
+.else
+LINKFLAGS+= -S -x
+.endif
+
+%LOAD
+
+assym.h: $S/kern/genassym.sh ${SOLBOURNE}/solbourne/genassym.cf Makefile
+ sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
+ ${PARAM} < ${SOLBOURNE}/solbourne/genassym.cf > assym.h.tmp && \
+ mv -f assym.h.tmp assym.h
+
+param.c: $S/conf/param.c
+ rm -f param.c
+ cp $S/conf/param.c .
+
+param.o: param.c Makefile
+ ${NORMAL_C_C}
+
+ioconf.o: ioconf.c
+ ${NORMAL_C}
+
+newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
+ sh $S/conf/newvers.sh
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
+
+
+clean::
+ rm -f eddep *bsd *bsd.gdb tags *.[io] [a-z]*.s \
+ [Ee]rrs linterrs makelinks genassym genassym.o assym.h
+
+lint:
+ @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
+ ${CFILES} ioconf.c param.c | \
+ grep -v 'static function .* unused'
+
+tags:
+ @echo "see $S/kern/Makefile for tags"
+
+links:
+ egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
+ sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
+ echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
+ sort -u | comm -23 - dontlink | \
+ sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
+ sh makelinks && rm -f dontlink
+
+SRCS= ${SOLBOURNE}/solbourne/locore.s \
+ param.c ioconf.c ${CFILES} ${SFILES}
+depend:: .depend
+.depend: ${SRCS} assym.h param.c
+ ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${SOLBOURNE}/solbourne/locore.s
+ ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
+.if !empty(SFILES)
+ ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
+.endif
+ sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
+ ${CPPFLAGS} < ${SOLBOURNE}/solbourne/genassym.cf
+ @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
+ @rm -f assym.dep
+
+
+locore.o: ${SOLBOURNE}/solbourne/locore.s assym.h
+ ${NORMAL_S}
+
+# The install target can be redefined by putting a
+# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
+MACHINE_NAME!= uname -n
+install: install-kernel-${MACHINE_NAME}
+.if !target(install-kernel-${MACHINE_NAME}})
+install-kernel-${MACHINE_NAME}:
+ rm -f /obsd
+ ln /bsd /obsd
+ cp bsd /nbsd
+ mv /nbsd /bsd
+.endif
+
+%RULES
diff --git a/sys/arch/solbourne/conf/files.solbourne b/sys/arch/solbourne/conf/files.solbourne
new file mode 100644
index 00000000000..7d4426e371d
--- /dev/null
+++ b/sys/arch/solbourne/conf/files.solbourne
@@ -0,0 +1,35 @@
+# $OpenBSD: files.solbourne,v 1.1 2005/04/19 21:30:17 miod Exp $
+
+# Kernel configuration rules for OpenBSD/solbourne.
+# Most device definitions and files rules are imported from
+# sys/arch/sparc/conf/files.sparc and are not repeated here.
+# Hence, this file only lists solbourne-specific changes from
+# the sparc port.
+
+maxpartitions 16
+
+maxusers 2 8 64
+
+# obio on solbourne is just an administrative wrapper on which
+# all on-board devices attach.
+file arch/solbourne/dev/obio.c obio
+
+# OKI TODclock chip
+device tod
+attach tod at obio
+file arch/solbourne/dev/tod.c tod
+
+# Z8530 clock hijack
+device zsclock
+attach zsclock at zs
+file arch/solbourne/dev/zsclock.c zsclock
+
+file dev/clock_subr.c
+
+file arch/solbourne/solbourne/autoconf.c
+file arch/solbourne/solbourne/clock.c
+file arch/solbourne/solbourne/machdep.c
+file arch/solbourne/solbourne/mem.c
+file arch/solbourne/solbourne/pmap.c
+file arch/solbourne/solbourne/prom_machdep.c
+file arch/solbourne/solbourne/trap.c
diff --git a/sys/arch/solbourne/conf/ld.script b/sys/arch/solbourne/conf/ld.script
new file mode 100644
index 00000000000..c34aec9bc01
--- /dev/null
+++ b/sys/arch/solbourne/conf/ld.script
@@ -0,0 +1,49 @@
+/* $OpenBSD: ld.script,v 1.1 2005/04/19 21:30:17 miod Exp $ */
+/*
+ * Copyright (c) 2005, Miodrag Vallat
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+OUTPUT_FORMAT("a.out-sparc-netbsd")
+OUTPUT_ARCH(sparc)
+ENTRY(start)
+SECTIONS
+{
+ .text :
+ {
+ *(.text)
+ . = ALIGN(0x2000);
+ PROVIDE(etext = ABSOLUTE(.));
+ }
+ .data :
+ {
+ *(.rodata)
+ *(.data)
+ PROVIDE(edata = ABSOLUTE(.));
+ }
+ .bss :
+ {
+ *(.bss)
+ }
+ PROVIDE(end = ABSOLUTE(.));
+}