Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga/dev Update driver to support firmware v1.5+.
details: https://anonhg.NetBSD.org/src/rev/760480ce0ddf
branches: trunk
changeset: 356590:760480ce0ddf
user: rkujawa <rkujawa%NetBSD.org@localhost>
date: Wed Oct 04 09:44:09 2017 +0000
description:
Update driver to support firmware v1.5+.
>From Lukas F. Hartmann. With hopeful style fixes from me.
diffstat:
sys/arch/amiga/dev/mntva.c | 45 +++++++++++++++++++++++++++---------------
sys/arch/amiga/dev/mntvareg.h | 31 +++++++++++++++++++++++++---
sys/arch/amiga/dev/mntvavar.h | 2 +-
sys/arch/amiga/dev/zbus.c | 8 +++---
4 files changed, 61 insertions(+), 25 deletions(-)
diffs (213 lines):
diff -r ed9122853fab -r 760480ce0ddf sys/arch/amiga/dev/mntva.c
--- a/sys/arch/amiga/dev/mntva.c Wed Oct 04 09:10:37 2017 +0000
+++ b/sys/arch/amiga/dev/mntva.c Wed Oct 04 09:44:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mntva.c,v 1.2 2016/10/23 18:40:52 phx Exp $ */
+/* $NetBSD: mntva.c,v 1.3 2017/10/04 09:44:09 rkujawa Exp $ */
/*
* Copyright (c) 2012, 2016 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mntva.c,v 1.2 2016/10/23 18:40:52 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mntva.c,v 1.3 2017/10/04 09:44:09 rkujawa Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -147,7 +147,7 @@
sc->sc_isconsole = true;
#endif /* MNTVA_CONSOLE */
- printf(": MNTMN VA2000");
+ printf(": MNT VA2000");
if(sc->sc_isconsole)
printf(" (console)");
@@ -161,16 +161,16 @@
sc->sc_bst.absm = &amiga_bus_stride_1;
sc->sc_iot = &sc->sc_bst;
- if (bus_space_map(sc->sc_iot, MNTVA_OFF_FB, sc->sc_memsize + 0x1000,
- BUS_SPACE_MAP_LINEAR, &sc->sc_fbh)) {
- aprint_error_dev(sc->sc_dev, "mapping framebuffer failed\n");
- return;
- }
if (bus_space_map(sc->sc_iot, MNTVA_OFF_REG, MNTVA_REG_SIZE , 0,
&sc->sc_regh)) {
aprint_error_dev(sc->sc_dev, "mapping registers failed\n");
return;
}
+ if (bus_space_map(sc->sc_iot, MNTVA_OFF_FB, sc->sc_memsize,
+ BUS_SPACE_MAP_LINEAR, &sc->sc_fbh)) {
+ aprint_error_dev(sc->sc_dev, "mapping framebuffer failed\n");
+ return;
+ }
sc->sc_regpa = (bus_addr_t) kvtop((void*) sc->sc_regh);
sc->sc_fbpa = (bus_addr_t) kvtop((void*) sc->sc_fbh);
@@ -223,13 +223,13 @@
sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
- defattr);
+ defattr);
vcons_replay_msgbuf(&sc->sc_console_screen);
} else {
- if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
+ if (sc->sc_console_screen.scr_ri.ri_rows == 0)
vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
- &defattr);
- } else
+ &defattr);
+ else
(*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
}
@@ -298,9 +298,25 @@
static bool
mntva_mode_set(struct mntva_softc *sc)
{
+ mntva_reg_write(sc, MNTVA_CAPTURE_MODE, 0);
+
+ mntva_reg_write(sc, MNTVA_H_SYNC_START, 1390);
+ mntva_reg_write(sc, MNTVA_H_SYNC_END, 1430);
+ mntva_reg_write(sc, MNTVA_H_MAX, 1650);
+ mntva_reg_write(sc, MNTVA_V_SYNC_START, 725);
+ mntva_reg_write(sc, MNTVA_V_SYNC_END, 730);
+ mntva_reg_write(sc, MNTVA_V_MAX, 750);
+ mntva_reg_write(sc, MNTVA_PIXEL_CLK_SEL, MNTVA_CLK_75MHZ);
+
mntva_reg_write(sc, MNTVA_SCALEMODE, 0);
mntva_reg_write(sc, MNTVA_SCREENW, sc->sc_width);
mntva_reg_write(sc, MNTVA_SCREENH, sc->sc_height);
+ mntva_reg_write(sc, MNTVA_ROW_PITCH, 2048);
+ mntva_reg_write(sc, MNTVA_ROW_PITCH_SHIFT, 11);
+ mntva_reg_write(sc, MNTVA_BLITTER_ROW_PITCH, 2048);
+ mntva_reg_write(sc, MNTVA_BLITTER_ROW_PITCH_SHIFT, 11);
+ mntva_reg_write(sc, MNTVA_MARGIN_X, 8);
+ mntva_reg_write(sc, MNTVA_SAFE_X, 0x50);
if (sc->sc_bpp == 8)
mntva_reg_write(sc, MNTVA_COLORMODE, MNTVA_COLORMODE8);
@@ -314,9 +330,6 @@
mntva_reg_write(sc, MNTVA_BLITTERBASEHI, 0);
mntva_reg_write(sc, MNTVA_BLITTERBASELO, 0);
- /* XXX: should rectfill with bg color taken from wscons? */
- mntva_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height, 0xffffffff);
-
return true;
}
@@ -577,7 +590,7 @@
if (offset >= 0 && offset < sc->sc_memsize) {
pa = bus_space_mmap(sc->sc_iot, sc->sc_fbpa, offset, prot,
- BUS_SPACE_MAP_LINEAR);
+ BUS_SPACE_MAP_LINEAR);
return pa;
}
diff -r ed9122853fab -r 760480ce0ddf sys/arch/amiga/dev/mntvareg.h
--- a/sys/arch/amiga/dev/mntvareg.h Wed Oct 04 09:10:37 2017 +0000
+++ b/sys/arch/amiga/dev/mntvareg.h Wed Oct 04 09:44:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mntvareg.h,v 1.1 2016/10/03 14:26:02 rkujawa Exp $ */
+/* $NetBSD: mntvareg.h,v 1.2 2017/10/04 09:44:09 rkujawa Exp $ */
/*
* Copyright (c) 2012, 2016 The NetBSD Foundation, Inc.
@@ -34,10 +34,10 @@
#define MNTVA2000REG_H
/* address space */
-#define MNTVA_OFF_REG 0x5f0000 /* memory mapped registers */
-#define MNTVA_REG_SIZE 0xFF
+#define MNTVA_OFF_REG 0x000000 /* memory mapped registers */
+#define MNTVA_REG_SIZE 0x001000
-#define MNTVA_OFF_FB 0x000000 /* frame buffer */
+#define MNTVA_OFF_FB 0x010000 /* frame buffer */
#define MNTVA_FB_SIZE 0x5f0000
/* registers */
@@ -47,8 +47,11 @@
#define MNTVA_SCALEMODE3X 2
#define MNTVA_SCALEMODE4X 3
+#define MNTVA_LINEW 0x02
#define MNTVA_SCREENW 0x06
#define MNTVA_SCREENH 0x08
+#define MNTVA_MARGIN_X 0x0c
+#define MNTVA_SAFE_X 0x14
#define MNTVA_BLITTERBASEHI 0x1C /* [23:16] */
#define MNTVA_BLITTERBASELO 0x1E /* [15:0] */
@@ -100,7 +103,27 @@
#define MNTVA_COLORMODE16 __BIT(0)
#define MNTVA_COLORMODE32 __BIT(1)
+#define MNTVA_BLITTER_ROW_PITCH 0x42
+#define MNTVA_BLITTER_ROW_PITCH_SHIFT 0x44
+#define MNTVA_BLITTER_COLORMODE 0x46
+
#define MNTVA_PANPTRHI 0x38 /* [23:16] */
#define MNTVA_PANPTRLO 0x3A /* [15:0] */
+#define MNTVA_CAPTURE_MODE 0x4E
+
+#define MNTVA_ROW_PITCH 0x58
+#define MNTVA_ROW_PITCH_SHIFT 0x5c
+
+#define MNTVA_H_SYNC_START 0x70
+#define MNTVA_H_SYNC_END 0x72
+#define MNTVA_H_MAX 0x74
+#define MNTVA_V_SYNC_START 0x76
+#define MNTVA_V_SYNC_END 0x78
+#define MNTVA_V_MAX 0x7a
+
+#define MNTVA_PIXEL_CLK_SEL 0x7c
+#define MNTVA_CLK_75MHZ 0
+#define MNTVA_CLK_40MHZ 1
+
#endif /* MNTVA2000REG_H */
diff -r ed9122853fab -r 760480ce0ddf sys/arch/amiga/dev/mntvavar.h
--- a/sys/arch/amiga/dev/mntvavar.h Wed Oct 04 09:10:37 2017 +0000
+++ b/sys/arch/amiga/dev/mntvavar.h Wed Oct 04 09:44:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mntvavar.h,v 1.1 2016/10/03 14:26:02 rkujawa Exp $ */
+/* $NetBSD: mntvavar.h,v 1.2 2017/10/04 09:44:09 rkujawa Exp $ */
/*
* Copyright (c) 2012, 2016 The NetBSD Foundation, Inc.
diff -r ed9122853fab -r 760480ce0ddf sys/arch/amiga/dev/zbus.c
--- a/sys/arch/amiga/dev/zbus.c Wed Oct 04 09:10:37 2017 +0000
+++ b/sys/arch/amiga/dev/zbus.c Wed Oct 04 09:44:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zbus.c,v 1.74 2016/10/03 14:26:02 rkujawa Exp $ */
+/* $NetBSD: zbus.c,v 1.75 2017/10/04 09:44:09 rkujawa Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.74 2016/10/03 14:26:02 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.75 2017/10/04 09:44:09 rkujawa Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -193,8 +193,8 @@
{ "hyper3+", 5001, 7}, /* Hypercom3+ */
/* Matay Grzegorz Kraszewski */
{ "mppb", 44359, 1}, /* Prometheus PCI bridge */
- /* MNTMN */
- { "mntva", 28014, 1} /* MNTMN VA2000 */
+ /* MNT */
+ { "mntva", 28014, 1} /* MNT VA2000 */
};
static int naconfent = sizeof(aconftab) / sizeof(struct aconfdata);
Home |
Main Index |
Thread Index |
Old Index