Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/luna68k Pull OpenBSD/luna88k board.h to define SX91...



details:   https://anonhg.NetBSD.org/src/rev/25c1fb4533ef
branches:  trunk
changeset: 461686:25c1fb4533ef
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jun 30 05:04:48 2019 +0000

description:
Pull OpenBSD/luna88k board.h to define SX9100 board device addresses.

Also replace magic addresses with macro where appropriate.

diffstat:

 sys/arch/luna68k/dev/if_le.c           |   12 ++-
 sys/arch/luna68k/dev/lcd.c             |   11 +-
 sys/arch/luna68k/dev/lunafb.c          |   10 +-
 sys/arch/luna68k/dev/omrasopsvar.h     |   12 +-
 sys/arch/luna68k/dev/xp.c              |   13 ++-
 sys/arch/luna68k/include/board.h       |  117 +++++++++++++++++++++++++++++++++
 sys/arch/luna68k/luna68k/locore.s      |   15 ++-
 sys/arch/luna68k/luna68k/machdep.c     |   11 +-
 sys/arch/luna68k/stand/boot/autoconf.c |   11 +-
 sys/arch/luna68k/stand/boot/bmd.c      |   15 ++-
 sys/arch/luna68k/stand/boot/getsecs.c  |    5 +-
 sys/arch/luna68k/stand/boot/if_le.c    |    7 +-
 sys/arch/luna68k/stand/boot/sio.c      |    7 +-
 13 files changed, 192 insertions(+), 54 deletions(-)

diffs (truncated from 623 to 300 lines):

diff -r 8dab8989070a -r 25c1fb4533ef sys/arch/luna68k/dev/if_le.c
--- a/sys/arch/luna68k/dev/if_le.c      Sun Jun 30 02:11:56 2019 +0000
+++ b/sys/arch/luna68k/dev/if_le.c      Sun Jun 30 05:04:48 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le.c,v 1.8 2019/06/30 02:11:56 tsutsui Exp $ */
+/* $NetBSD: if_le.c,v 1.9 2019/06/30 05:04:48 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -73,7 +73,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.8 2019/06/30 02:11:56 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.9 2019/06/30 05:04:48 tsutsui Exp $");
 
 #include "opt_inet.h"
 
@@ -94,6 +94,7 @@
 
 #include <machine/cpu.h>
 #include <machine/autoconf.h>
+#include <machine/board.h>
 
 #include <luna68k/luna68k/isr.h>
 
@@ -104,6 +105,9 @@
 
 #include "ioconf.h"
 
+#define TRI_PORT_RAM_LANCE_OFFSET      0x10000 /* first 64KB is used by XP */
+#define TRI_PORT_RAM_LANCE_SIZE                0x10000 /* 64KB */
+
 /*
  * LANCE registers.
  */
@@ -178,10 +182,10 @@
        /* Map control registers. */
        lesc->sc_r1 = (struct lereg1 *)ma->ma_addr;     /* LANCE */
 
-       sc->sc_mem = (void *)0x71010000;                /* SRAM */
+       sc->sc_mem = (void *)(TRI_PORT_RAM + TRI_PORT_RAM_LANCE_OFFSET);
        sc->sc_conf3 = LE_C3_BSWP;
        sc->sc_addr = (u_long)sc->sc_mem & 0xffffff;
-       sc->sc_memsize = 64 * 1024;                     /* 64KB */
+       sc->sc_memsize = TRI_PORT_RAM_LANCE_SIZE;
 
        myetheraddr(sc->sc_enaddr);
 
diff -r 8dab8989070a -r 25c1fb4533ef sys/arch/luna68k/dev/lcd.c
--- a/sys/arch/luna68k/dev/lcd.c        Sun Jun 30 02:11:56 2019 +0000
+++ b/sys/arch/luna68k/dev/lcd.c        Sun Jun 30 05:04:48 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lcd.c,v 1.10 2019/06/30 02:11:56 tsutsui Exp $ */
+/* $NetBSD: lcd.c,v 1.11 2019/06/30 05:04:48 tsutsui Exp $ */
 /* $OpenBSD: lcd.c,v 1.7 2015/02/10 22:42:35 miod Exp $ */
 
 /*-
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>         /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.10 2019/06/30 02:11:56 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.11 2019/06/30 05:04:48 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -43,6 +43,7 @@
 #include <sys/errno.h>
 
 #include <machine/autoconf.h>
+#include <machine/board.h>
 #include <machine/cpu.h>
 #include <machine/lcd.h>
 
@@ -280,7 +281,7 @@
 void
 lcdbusywait(void)
 {
-       struct pio *p1 = (struct pio *)0x4D000000;
+       struct pio *p1 = (struct pio *)OBIO_PIO1_BASE;
        int msb, s;
 
        s = splhigh();
@@ -301,7 +302,7 @@
 void
 lcdput(int cc)
 {
-       struct pio *p1 = (struct pio *)0x4D000000;
+       struct pio *p1 = (struct pio *)OBIO_PIO1_BASE;
        int s;
 
        lcdbusywait();
@@ -318,7 +319,7 @@
 void
 lcdctrl(int cc)
 {
-       struct pio *p1 = (struct pio *)0x4D000000;
+       struct pio *p1 = (struct pio *)OBIO_PIO1_BASE;
        int s;
 
        lcdbusywait();
diff -r 8dab8989070a -r 25c1fb4533ef sys/arch/luna68k/dev/lunafb.c
--- a/sys/arch/luna68k/dev/lunafb.c     Sun Jun 30 02:11:56 2019 +0000
+++ b/sys/arch/luna68k/dev/lunafb.c     Sun Jun 30 05:04:48 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lunafb.c,v 1.38 2019/06/30 02:11:56 tsutsui Exp $ */
+/* $NetBSD: lunafb.c,v 1.39 2019/06/30 05:04:48 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.38 2019/06/30 02:11:56 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.39 2019/06/30 05:04:48 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,10 +74,10 @@
        uint8_t          pad3[3];
 };
 
-#define        OMFB_RFCNT      0xB1000000      /* video h-origin/v-origin */
-#define        OMFB_RAMDAC     0xC1100000      /* Bt454/Bt458 RAMDAC */
+#define        OMFB_RFCNT      BMAP_RFCNT      /* video h-origin/v-origin */
+#define        OMFB_RAMDAC     BMAP_PALLET2    /* Bt454/Bt458 RAMDAC */
 
-#define        OMFB_SIZE       (0xB1300000 - 0xB1080000 + PAGE_SIZE)
+#define        OMFB_SIZE       (BMAP_FN0 - BMAP_BMP + PAGE_SIZE)
 
 struct hwcmap {
 #define CMAP_SIZE 256
diff -r 8dab8989070a -r 25c1fb4533ef sys/arch/luna68k/dev/omrasopsvar.h
--- a/sys/arch/luna68k/dev/omrasopsvar.h        Sun Jun 30 02:11:56 2019 +0000
+++ b/sys/arch/luna68k/dev/omrasopsvar.h        Sun Jun 30 05:04:48 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omrasopsvar.h,v 1.3 2014/10/04 16:58:17 tsutsui Exp $ */
+/* $NetBSD: omrasopsvar.h,v 1.4 2019/06/30 05:04:48 tsutsui Exp $ */
 /*
  * Copyright (c) 2013 Kenji Aoyama
  *
@@ -20,10 +20,12 @@
  * XXX: We consider only 1bpp and 4bpp for now
  */
 
-#define OMFB_PLANEMASK 0xB1040000      /* BMSEL register */
-#define OMFB_FB_WADDR  0xB1080008      /* common plane */
-#define OMFB_FB_RADDR  0xB10C0008      /* plane #0 */
-#define OMFB_ROPFUNC   0xB12C0000      /* common ROP function */
+#include <machine/board.h>
+
+#define OMFB_PLANEMASK BMAP_BMSEL      /* BMSEL register */
+#define OMFB_FB_WADDR  (BMAP_BMP + 8)  /* common plane */
+#define OMFB_FB_RADDR  (BMAP_BMAP0 + 8)/* plane #0 */
+#define OMFB_ROPFUNC   BMAP_FN         /* common ROP function */
 
 /*
  * Helper macros
diff -r 8dab8989070a -r 25c1fb4533ef sys/arch/luna68k/dev/xp.c
--- a/sys/arch/luna68k/dev/xp.c Sun Jun 30 02:11:56 2019 +0000
+++ b/sys/arch/luna68k/dev/xp.c Sun Jun 30 05:04:48 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xp.c,v 1.4 2017/06/01 02:45:06 chs Exp $ */
+/* $NetBSD: xp.c,v 1.5 2019/06/30 05:04:48 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2016 Izumi Tsutsui.  All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xp.c,v 1.4 2017/06/01 02:45:06 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xp.c,v 1.5 2019/06/30 05:04:48 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -42,13 +42,16 @@
 #include <uvm/uvm_extern.h>
 
 #include <machine/autoconf.h>
+#include <machine/board.h>
 #include <machine/xpio.h>
 
 #include "ioconf.h"
 
-#define XP_SHM_BASE    0x71000000
+#define TRI_PORT_RAM_XP_OFFSET 0x00000
+
+#define XP_SHM_BASE    (TRI_PORT_RAM + TRI_PORT_RAM_XP_OFFSET)
 #define XP_SHM_SIZE    0x00010000      /* 64KB for XP; rest 64KB for lance */
-#define XP_TAS_ADDR    0x61000000
+#define XP_TAS_ADDR    OBIO_TAS
 
 struct xp_softc {
        device_t        sc_dev;
@@ -105,7 +108,7 @@
  *
  * XXX: PIO port functions should be shared with machdep.c for DIP SWs
  */
-#define PIO_ADDR       0x49000000
+#define PIO_ADDR       OBIO_PIO0_BASE
 #define PORT_A         0
 #define PORT_B         1
 #define PORT_C         2
diff -r 8dab8989070a -r 25c1fb4533ef sys/arch/luna68k/include/board.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/luna68k/include/board.h  Sun Jun 30 05:04:48 2019 +0000
@@ -0,0 +1,117 @@
+/*     $NetBSD: board.h,v 1.1 2019/06/30 05:04:48 tsutsui Exp $        */
+/*     $OpenBSD: board.h,v 1.15 2017/11/03 06:55:08 aoyama Exp $       */
+/*
+ * Mach Operating System
+ * Copyright (c) 1993-1991 Carnegie Mellon University
+ * Copyright (c) 1991 OMRON Corporation
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON AND OMRON ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION.  CARNEGIE MELLON AND OMRON DISCLAIM ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#ifndef _MACHINE_BOARD_H_
+#define _MACHINE_BOARD_H_
+
+/*
+ *      OMRON SX9100DT CPU board constants
+ */
+
+/*
+ * Something to put append a 'U' to a long constant if it's C so that
+ * it'll be unsigned in both ANSI and traditional.
+ */
+#if defined(_LOCORE)
+#define U(num)  num
+#elif defined(__STDC__)
+#define U(num)  num ## U
+#else
+#define U(num)  num/**/U
+#endif
+
+#define PROM_ADDR      U(0x41000000)   /* PROM */
+#define PROM_SPACE     U(0x00040000) 
+#define NVRAM_ADDR     U(0x45000000)   /* Non Volatile */
+#define NVRAM_SPACE    U(0x00001FDC) 
+#define        FUSE_ROM_ADDR   U(0x43000000)   /* FUSE_ROM */
+#define        FUSE_ROM_SPACE          1024
+#define        OBIO_CLOCK_BASE U(0x45000000)   /* Mostek or Dallas TimeKeeper */
+#define OBIO_PIO0_BASE U(0x49000000)   /* PIO-0 */
+#define OBIO_PIO0_SPACE        U(0x00000004) 
+#define OBIO_PIO0A     U(0x49000000)   /* PIO-0 port A */
+#define OBIO_PIO0B     U(0x49000001)   /* PIO-0 port B */
+#define OBIO_PIO0C     U(0x49000002)   /* PIO-0 port C*/
+#define OBIO_PIO0      U(0x49000003)   /* PIO-0 control */
+#define OBIO_PIO1_BASE U(0x4D000000)   /* PIO-1 */
+#define OBIO_PIO1_SPACE U(0x00000004) 
+#define OBIO_PIO1A     U(0x4D000000)   /* PIO-1 port A */
+#define OBIO_PIO1B     U(0x4D000001)   /* PIO-1 port B */
+#define OBIO_PIO1C     U(0x4D000002)   /* PIO-1 port C*/
+#define OBIO_PIO1      U(0x4D000003)   /* PIO-1 control */
+#define OBIO_SIO       U(0x51000000)   /* SIO */
+#define        OBIO_TAS        U(0x61000000)   /* TAS register */
+#define        OBIO_CLOCK      U(0x63000000)   /* system clock */
+
+#define TRI_PORT_RAM   U(0x71000000)   /* 3 port RAM */
+#define TRI_PORT_RAM_SPACE     0x20000
+#define EXT_A_ADDR     U(0x81000000)   /* extension board A */
+#define EXT_A_SPACE    U(0x02000000) 
+#define EXT_B_ADDR     U(0x83000000)   /* extension board B */
+#define EXT_B_SPACE    U(0x01000000) 
+#define        PC_BASE         U(0x90000000)   /* pc-98 extension board */
+#define        PC_SPACE        U(0x02000000) 
+
+#define MROM_ADDR      U(0xA1000000)   /* Mask ROM address */
+#define MROM_SPACE             0x400000
+#define        BMAP_START      U(0xB1000000)   /* Bitmap start address */
+#define        BMAP_SPACE      (BMAP_END - BMAP_START)
+#define BMAP_RFCNT     U(0xB1000000)   /* RFCNT register */
+#define BMAP_BMSEL     U(0xB1040000)   /* BMSEL register */
+#define BMAP_BMP       U(0xB1080000)   /* common bitmap plane */
+#define BMAP_BMAP0     U(0xB10C0000)   /* bitmap plane 0 */
+#define BMAP_BMAP1     U(0xB1100000)   /* bitmap plane 1 */
+#define BMAP_BMAP2     U(0xB1140000)   /* bitmap plane 2 */



Home | Main Index | Thread Index | Old Index