Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-10]: src/sys/arch/next68k Pull up following revision(s) (requeste...
details: https://anonhg.NetBSD.org/src/rev/18b5ff2a9c65
branches: netbsd-10
changeset: 373546:18b5ff2a9c65
user: martin <martin%NetBSD.org@localhost>
date: Wed Feb 15 19:35:14 2023 +0000
description:
Pull up following revision(s) (requested by tsutsui in ticket #88):
sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29
Misc KNF and cosmetics.
Use proper C99 int types.
Remove trailing spaces and TABs.
Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html
Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.
NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.
Bump version again to denote NeXT_CUBE_TURBO support.
diffstat:
sys/arch/next68k/dev/intio.c | 49 +++++++++---
sys/arch/next68k/dev/intiovar.h | 10 +-
sys/arch/next68k/dev/nextcons.c | 23 +++--
sys/arch/next68k/dev/nextdisplay.c | 113 ++++++++++++-----------------
sys/arch/next68k/dev/nextdisplayvar.h | 22 ++--
sys/arch/next68k/include/bus_space.h | 57 +++++---------
sys/arch/next68k/include/cpu.h | 14 +--
sys/arch/next68k/next68k/locore.s | 32 ++++----
sys/arch/next68k/next68k/nextrom.c | 44 ++++++++++-
sys/arch/next68k/next68k/nextrom.h | 3 +-
sys/arch/next68k/next68k/pmap_bootstrap.c | 39 ++++------
sys/arch/next68k/stand/boot/boot.c | 6 +-
sys/arch/next68k/stand/boot/version | 3 +-
13 files changed, 216 insertions(+), 199 deletions(-)
diffs (truncated from 1034 to 300 lines):
diff -r 1a7d69988f9b -r 18b5ff2a9c65 sys/arch/next68k/dev/intio.c
--- a/sys/arch/next68k/dev/intio.c Wed Feb 15 19:16:43 2023 +0000
+++ b/sys/arch/next68k/dev/intio.c Wed Feb 15 19:35:14 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intio.c,v 1.16 2021/08/07 16:19:01 thorpej Exp $ */
+/* $NetBSD: intio.c,v 1.16.6.1 2023/02/15 19:35:14 martin Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,14 +34,15 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.16 2021/08/07 16:19:01 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.16.6.1 2023/02/15 19:35:14 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/device.h>
+#include <sys/device.h>
#include <sys/reboot.h>
#include <machine/autoconf.h>
+#include <machine/cpu.h>
#include <next68k/dev/intiovar.h>
@@ -53,12 +54,6 @@
CFATTACH_DECL_NEW(intio, 0,
intiomatch, intioattach, NULL, NULL);
-#if 0
-struct cfdriver intio_cd = {
- NULL, "intio", DV_DULL
-};
-#endif
-
static bool intio_attached;
int
@@ -66,9 +61,9 @@
{
/* Allow only one instance. */
if (intio_attached)
- return (0);
+ return 0;
- return (1);
+ return 1;
}
void
@@ -92,24 +87,48 @@
if (ia->ia_addr)
aprint_normal(" addr %p", ia->ia_addr);
- return (UNCONF);
+ return UNCONF;
}
int
intiosearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
- struct mainbus_attach_args *mba = (struct mainbus_attach_args *) aux;
+ struct mainbus_attach_args *mba = aux;
struct intio_attach_args ia;
do {
ia.ia_addr = NULL;
ia.ia_bst = NEXT68K_INTIO_BUS_SPACE;
ia.ia_dmat = mba->mba_dmat;
-
+
if (!config_probe(parent, cf, &ia))
break;
config_attach(parent, cf, &ia, intioprint, CFARGS_NONE);
} while (cf->cf_fstate == FSTATE_STAR);
- return (0);
+ return 0;
}
+
+int
+bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size,
+ int flags, bus_space_handle_t *bsh)
+{
+
+ if (addr >= INTIOBASE && (addr + size) < INTIOTOP) {
+ *bsh = IIOV(addr);
+ return 0;
+ }
+
+ return EINVAL;
+}
+
+paddr_t
+bus_space_mmap(bus_space_tag_t bst, bus_addr_t addr, off_t offset, int prot,
+ int flags)
+{
+
+ if (addr >= INTIOBASE && (addr + offset) < INTIOTOP)
+ return m68k_btop(addr + offset);
+
+ return -1;
+}
diff -r 1a7d69988f9b -r 18b5ff2a9c65 sys/arch/next68k/dev/intiovar.h
--- a/sys/arch/next68k/dev/intiovar.h Wed Feb 15 19:16:43 2023 +0000
+++ b/sys/arch/next68k/dev/intiovar.h Wed Feb 15 19:35:14 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intiovar.h,v 1.7 2011/01/02 08:19:03 tsutsui Exp $ */
+/* $NetBSD: intiovar.h,v 1.7.90.1 2023/02/15 19:35:14 martin Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
extern vaddr_t intiobase;
extern vaddr_t intiolimit;
-extern vaddr_t monobase;
-extern vaddr_t monolimit;
-extern vaddr_t colorbase;
-extern vaddr_t colorlimit;
+extern vaddr_t fbbase;
+extern vaddr_t fblimit;
+extern paddr_t fbbasepa;
+extern paddr_t fblimitpa;
diff -r 1a7d69988f9b -r 18b5ff2a9c65 sys/arch/next68k/dev/nextcons.c
--- a/sys/arch/next68k/dev/nextcons.c Wed Feb 15 19:16:43 2023 +0000
+++ b/sys/arch/next68k/dev/nextcons.c Wed Feb 15 19:35:14 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nextcons.c,v 1.11 2010/04/24 19:58:13 dbj Exp $ */
+/* $NetBSD: nextcons.c,v 1.11.90.1 2023/02/15 19:35:14 martin Exp $ */
/*
* Copyright (c) 1999 Darrin B. Jewell
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nextcons.c,v 1.11 2010/04/24 19:58:13 dbj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nextcons.c,v 1.11.90.1 2023/02/15 19:35:14 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,13 +63,14 @@
nextcnprobe(struct consdev *cp)
{
- if ((rom_machine_type == NeXT_WARP9)
- || (rom_machine_type == NeXT_X15)
- || (rom_machine_type == NeXT_WARP9C)
- || (rom_machine_type == NeXT_TURBO_MONO)
- || (rom_machine_type == NeXT_TURBO_COLOR))
+ if (rom_machine_type == NeXT_WARP9 ||
+ rom_machine_type == NeXT_X15 ||
+ rom_machine_type == NeXT_WARP9C ||
+ rom_machine_type == NeXT_TURBO_MONO ||
+ rom_machine_type == NeXT_TURBO_COLOR ||
+ rom_machine_type == NeXT_CUBE_TURBO)
cp->cn_pri = CN_INTERNAL;
- else
+ else
cp->cn_pri = CN_DEAD;
cp->cn_dev = NODEV;
@@ -78,6 +79,7 @@
void
nextcninit(struct consdev *cp)
{
+
nextkbd_cnattach(NEXT68K_INTIO_BUS_SPACE);
nextdisplay_cnattach();
}
@@ -85,17 +87,20 @@
int
nextcngetc (dev_t dev)
{
+
return wskbd_cngetc(dev);
}
void
nextcnputc(dev_t dev, int c)
{
- wsdisplay_cnputc(dev,c);
+
+ wsdisplay_cnputc(dev,c);
}
void
nextcnpollc(dev_t dev, int on)
{
+
wskbd_cnpollc(dev,on);
}
diff -r 1a7d69988f9b -r 18b5ff2a9c65 sys/arch/next68k/dev/nextdisplay.c
--- a/sys/arch/next68k/dev/nextdisplay.c Wed Feb 15 19:16:43 2023 +0000
+++ b/sys/arch/next68k/dev/nextdisplay.c Wed Feb 15 19:35:14 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nextdisplay.c,v 1.25 2021/08/07 16:19:01 thorpej Exp $ */
+/* $NetBSD: nextdisplay.c,v 1.25.6.1 2023/02/15 19:35:14 martin Exp $ */
/*
* Copyright (c) 1998 Matt DeBergalis
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nextdisplay.c,v 1.25 2021/08/07 16:19:01 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nextdisplay.c,v 1.25.6.1 2023/02/15 19:35:14 martin Exp $");
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
@@ -136,8 +136,8 @@
static int
nextdisplay_is_console(vaddr_t addr)
{
- return (nextdisplay_console_dc.isconsole
- && (addr == nextdisplay_consaddr));
+ return nextdisplay_console_dc.isconsole &&
+ addr == nextdisplay_consaddr;
}
int
@@ -147,10 +147,11 @@
rom_machine_type == NeXT_X15 ||
rom_machine_type == NeXT_WARP9C ||
rom_machine_type == NeXT_TURBO_MONO ||
- rom_machine_type == NeXT_TURBO_COLOR)
- return (1);
- else
- return (0);
+ rom_machine_type == NeXT_TURBO_COLOR ||
+ rom_machine_type == NeXT_CUBE_TURBO)
+ return 1;
+ else
+ return 0;
}
void
@@ -162,19 +163,13 @@
/* printf("in nextdisplay_init\n"); */
- if (color) {
- dc->dc_vaddr = colorbase;
- dc->dc_paddr = COLORBASE;
- dc->dc_size = NEXT_P_C16_VIDEOSIZE;
- } else {
- dc->dc_vaddr = monobase;
- dc->dc_paddr = MONOBASE;
- dc->dc_size = NEXT_P_VIDEOSIZE;
- }
+ dc->dc_vaddr = fbbase;
+ dc->dc_paddr = fbbasepa;
+ dc->dc_size = color ? NEXT_P_C16_VIDEOSIZE : NEXT_P_VIDEOSIZE;
dc->dc_wid = 1120;
dc->dc_ht = 832;
- dc->dc_depth = color ? 16 : 2;
+ dc->dc_depth = color ? 16 : 2;
dc->dc_rowbytes = (turbo ? 1120 : 1152) * dc->dc_depth / 8;
dc->dc_videobase = dc->dc_vaddr;
@@ -182,8 +177,8 @@
#if 0
printf("intiobase at: %08x\n", intiobase);
printf("intiolimit at: %08x\n", intiolimit);
- printf("videobase at: %08x\n", color ? colorbase : monobase);
- printf("videolimit at: %08x\n", color ? colorlimit : monolimit);
+ printf("videobase at: %08x\n", fbbase);
+ printf("videolimit at: %08x\n", fblimit);
printf("virtual fb at: %08x\n", dc->dc_vaddr);
printf("physical fb at: %08x\n", dc->dc_paddr);
@@ -197,16 +192,16 @@
#endif
/* clear the screen */
- for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(u_int32_t))
- *(u_int32_t *)(dc->dc_videobase + i) =
- (color ? 0x0 : 0xffffffff);
+ for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(uint32_t))
+ *(uint32_t *)(dc->dc_videobase + i) =
+ color ? 0x0 : 0xffffffff;
rap = &dc->dc_raster;
rap->width = dc->dc_wid;
rap->height = dc->dc_ht;
rap->depth = color ? 16 : 2;
- rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t);
- rap->pixels = (u_int32_t *)dc->dc_videobase;
+ rap->linelongs = dc->dc_rowbytes / sizeof(uint32_t);
+ rap->pixels = (uint32_t *)dc->dc_videobase;
/* initialize the raster console blitter */
rcp = &dc->dc_rcons;
@@ -217,11 +212,11 @@
rcons_init(rcp, 34, 80);
Home |
Main Index |
Thread Index |
Old Index