Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arc Add c_nec_eisa_cons_init() for NEC-J96A and NEC...



details:   https://anonhg.NetBSD.org/src/rev/529e3eb488ea
branches:  trunk
changeset: 542524:529e3eb488ea
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Jan 31 22:07:52 2003 +0000

description:
Add c_nec_eisa_cons_init() for NEC-J96A and NEC-R96 which have
Cirrus Logic GD5428 ISA VGA console to initialize its registers properly
for generic vga(4) driver(s).

diffstat:

 sys/arch/arc/arc/c_nec_eisa.c   |  101 +++++++++++++++++++++++++++++++++++++++-
 sys/arch/arc/arc/p_nec_j96a.c   |    4 +-
 sys/arch/arc/arc/p_nec_r96.c    |    4 +-
 sys/arch/arc/include/platform.h |    3 +-
 4 files changed, 105 insertions(+), 7 deletions(-)

diffs (194 lines):

diff -r e08f2e1e50b7 -r 529e3eb488ea sys/arch/arc/arc/c_nec_eisa.c
--- a/sys/arch/arc/arc/c_nec_eisa.c     Fri Jan 31 22:06:45 2003 +0000
+++ b/sys/arch/arc/arc/c_nec_eisa.c     Fri Jan 31 22:07:52 2003 +0000
@@ -1,6 +1,7 @@
-/*     $NetBSD: c_nec_eisa.c,v 1.4 2002/12/09 13:38:30 tsutsui Exp $   */
+/*     $NetBSD: c_nec_eisa.c,v 1.5 2003/01/31 22:07:52 tsutsui Exp $   */
 
 /*-
+ * Copyright (C) 2003 Izumi Tsutsui.
  * Copyright (C) 2000 Shuichiro URATA.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,6 +33,7 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/kcore.h>
 #include <sys/device.h>
 #include <uvm/uvm_extern.h>
 
@@ -42,12 +44,25 @@
 
 #include <dev/isa/isavar.h>
 
+#include <arc/arc/arcbios.h>
 #include <arc/arc/wired_map.h>
 #include <arc/jazz/pica.h>
 #include <arc/jazz/rd94.h>
 #include <arc/jazz/jazziovar.h>
 #include <arc/isa/isabrvar.h>
 
+#include "vga_isa.h"
+#if NVGA_ISA > 0
+#include <dev/ic/mc6845reg.h>
+#include <dev/ic/pcdisplayvar.h>
+#include <dev/ic/vgareg.h>
+#include <dev/ic/vgavar.h>
+
+#ifdef VGA_RESET
+static void gd54xx_initregs(struct vga_handle *);
+#endif
+#endif
+
 /*
  * chipset-dependent isa bus configuration
  */
@@ -100,7 +115,6 @@
            RD94_P_LOCAL_IO_BASE, RD94_V_LOCAL_IO_BASE,
            RD94_V_LOCAL_IO_BASE, RD94_S_LOCAL_IO_BASE);
 
-       /* XXX - not really confirmed */
        arc_bus_space_init(&arc_bus_io, "r94eisaio",
            RD94_P_PCI_IO, RD94_V_EISA_IO, 0, RD94_S_EISA_IO);
        arc_bus_space_init(&arc_bus_mem, "r94eisamem",
@@ -146,3 +160,86 @@
        /* chipset-dependent jazzio bus configuration */
        jazzio_conf = &jazzio_nec_eisa_conf;
 }
+
+void
+c_nec_eisa_cons_init()
+{
+
+#if NVGA_ISA > 0
+       if (!com_console) {
+               if (strcmp(arc_displayc_id, "necvdfrb") == 0) {
+                       /* NEC RISCserver 2200 R4400 EISA [NEC-R96] */
+                       /* NEC Express5800/240 R4400 EISA [NEC-J96A] */
+#ifdef VGA_RESET
+                       struct vga_handle handle;
+
+                       handle.vh_memt = &arc_bus_mem;
+                       handle.vh_iot = &arc_bus_io;
+                       vga_reset(&handle, gd54xx_initregs);
+#endif
+
+                       vga_no_builtinfont = 1;
+               }
+       }
+#endif
+
+       c_jazz_eisa_cons_init();
+}
+
+#if NVGA_ISA > 0 && defined(VGA_RESET)
+
+/* values to intialize cirrus GD54xx specific ext registers */
+/* XXX these values are taken from PC XXX */
+static const u_int8_t vga_ts_gd54xx[] = {
+       0x0f,   /* 05: ??? */
+       0x12,   /* 06: enable ext reg (?) */
+       0x00,   /* 07: reset ext sequence (?) */
+       0x00,   /* 08: ??? */
+       0x5c,   /* 09: ??? */
+       0x09,   /* 0A: BIOS Scratch register for 542x (?) */
+       0x4a,   /* 0B: ??? */
+       0x5b,   /* 0C: ??? */
+       0x42,   /* 0D: VCLK2 frequency */
+       0x00,   /* 0E: VCLK3 frequency */
+       0x09,   /* 0F: ??? */
+       0x00,   /* 10: ??? */
+       0x00,   /* 11: ??? */
+       0x00,   /* 12: ??? */
+       0x00,   /* 13: ??? */
+       0x00,   /* 14: BIOS scratch register for 546x (?) */
+       0x00,   /* 15: ??? */
+       0xd8,   /* 16: ??? */
+       0x39,   /* 17: ??? */
+       0x00,   /* 18: ??? */
+       0x01,   /* 19: ??? */
+       0x00,   /* 1A: ??? */
+       0x2b,   /* 1B: ??? */
+       0x2f,   /* 1C: ??? */
+       0x1f,   /* 1D: VCLK2 denominator and post-scalar value */
+       0x00,   /* 1E: VCLK3 denominator and post-scalar value */
+       0x19    /* 1F: MCLK (?) */
+};
+
+static void
+gd54xx_initregs(vh)
+       struct vga_handle *vh;
+{
+       int i;
+
+       /* disable video */
+       vga_ts_write(vh, mode, vga_ts_read(vh, mode) | VGA_TS_MODE_BLANK);
+
+       /* enable access to GD54xx ext regs */
+       _vga_ts_write(vh, 0x06, 0x12);
+
+       /* setup GD54xx ext regs */
+       for (i = 0; i < sizeof(vga_ts_gd54xx); i++)
+               _vga_ts_write(vh, VGA_TS_NREGS + i, vga_ts_gd54xx[i]);
+       
+       /* disable access to GD54xx ext regs */
+       _vga_ts_write(vh, 0x06, 0x0);
+
+       /* reenable video */
+       vga_ts_write(vh, mode, vga_ts_read(vh, mode) & ~VGA_TS_MODE_BLANK);
+}
+#endif
diff -r e08f2e1e50b7 -r 529e3eb488ea sys/arch/arc/arc/p_nec_j96a.c
--- a/sys/arch/arc/arc/p_nec_j96a.c     Fri Jan 31 22:06:45 2003 +0000
+++ b/sys/arch/arc/arc/p_nec_j96a.c     Fri Jan 31 22:07:52 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: p_nec_j96a.c,v 1.3 2002/12/09 13:36:27 tsutsui Exp $   */
+/*     $NetBSD: p_nec_j96a.c,v 1.4 2003/01/31 22:07:52 tsutsui Exp $   */
 
 /*-
  * Copyright (C) 2002 Izumi Tsutsui.  All rights reserved.
@@ -43,7 +43,7 @@
        c_jazz_eisa_mainbusdevs,
        platform_generic_match,
        c_nec_eisa_init,
-       c_jazz_eisa_cons_init,
+       c_nec_eisa_cons_init,
        jazzio_reset,
        c_nec_jazz_set_intr,
 };
diff -r e08f2e1e50b7 -r 529e3eb488ea sys/arch/arc/arc/p_nec_r96.c
--- a/sys/arch/arc/arc/p_nec_r96.c      Fri Jan 31 22:06:45 2003 +0000
+++ b/sys/arch/arc/arc/p_nec_r96.c      Fri Jan 31 22:07:52 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: p_nec_r96.c,v 1.1 2001/06/13 15:35:04 soda Exp $       */
+/*     $NetBSD: p_nec_r96.c,v 1.2 2003/01/31 22:07:52 tsutsui Exp $    */
 
 /*-
  * Copyright (C) 2000 Shuichiro URATA.  All rights reserved.
@@ -49,7 +49,7 @@
        c_jazz_eisa_mainbusdevs,
        platform_generic_match,
        c_nec_eisa_init,
-       c_jazz_eisa_cons_init,
+       c_nec_eisa_cons_init,
        jazzio_reset,
        c_nec_jazz_set_intr,
 };
diff -r e08f2e1e50b7 -r 529e3eb488ea sys/arch/arc/include/platform.h
--- a/sys/arch/arc/include/platform.h   Fri Jan 31 22:06:45 2003 +0000
+++ b/sys/arch/arc/include/platform.h   Fri Jan 31 22:07:52 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: platform.h,v 1.2 2002/11/30 19:23:47 tsutsui Exp $     */
+/*     $NetBSD: platform.h,v 1.3 2003/01/31 22:07:53 tsutsui Exp $     */
 /*     NetBSD: cpuconf.h,v 1.12 2000/06/08 03:10:06 thorpej Exp        */
 
 /*
@@ -92,6 +92,7 @@
 void c_magnum_init __P((void));
 
 void c_nec_eisa_init __P((void));
+void c_nec_eisa_cons_init __P((void));
 
 void c_nec_jazz_set_intr __P((int, int (*) __P((u_int, struct clockframe *)),
     int));



Home | Main Index | Thread Index | Old Index