Source-Changes-HG archive

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

[src/trunk]: src/sys Added Lemote Yeeloong Notebook support.



details:   https://anonhg.NetBSD.org/src/rev/bf988f27fbcc
branches:  trunk
changeset: 777713:bf988f27fbcc
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Fri Mar 02 13:20:57 2012 +0000

description:
Added Lemote Yeeloong Notebook support.

diffstat:

 sys/arch/evbmips/conf/LOONGSON                |   39 +-
 sys/arch/evbmips/conf/files.loongson          |   29 +-
 sys/arch/evbmips/loongson/autoconf.c          |   17 +-
 sys/arch/evbmips/loongson/bonito_mainbus.c    |   30 +-
 sys/arch/evbmips/loongson/dev/glx.c           |   16 +-
 sys/arch/evbmips/loongson/loongson_bus_defs.h |    5 +-
 sys/arch/evbmips/loongson/loongson_bus_io.c   |   27 +-
 sys/arch/evbmips/loongson/machdep.c           |   57 +-
 sys/arch/evbmips/loongson/yeeloong_machdep.c  |  117 +-
 sys/dev/pci/files.pci                         |    7 +-
 sys/dev/pci/lynxfb.c                          |  808 ++++++++++++++++++++++++++
 sys/dev/pci/lynxfbreg.h                       |   74 ++
 sys/dev/pci/lynxfbvar.h                       |   29 +
 13 files changed, 1147 insertions(+), 108 deletions(-)

diffs (truncated from 1715 to 300 lines):

diff -r dfe48813339f -r bf988f27fbcc sys/arch/evbmips/conf/LOONGSON
--- a/sys/arch/evbmips/conf/LOONGSON    Fri Mar 02 13:11:57 2012 +0000
+++ b/sys/arch/evbmips/conf/LOONGSON    Fri Mar 02 13:20:57 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: LOONGSON,v 1.8 2011/12/18 05:49:26 dholland Exp $
+# $NetBSD: LOONGSON,v 1.9 2012/03/02 13:20:57 nonaka Exp $
 #
 # LOONGSON machine description file
 # 
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GDIUM-$Revision: 1.8 $"
+#ident                 "LOONGSON-$Revision: 1.9 $"
 
 maxusers       16
 
@@ -74,13 +74,13 @@
 file-system    MSDOSFS         # MS-DOS file system
 #file-system   FDESC           # /dev/fd
 file-system    KERNFS          # /kern (kernel informational filesystem)
-#file-system   NULLFS          # loopback file system
+file-system    NULLFS          # loopback file system
 #file-system   OVERLAY         # overlay file system
 file-system    PROCFS          # /proc
 #file-system   UMAPFS          # NULLFS + uid and gid remapping
 file-system    UNION
 file-system    PTYFS           # /dev/pts/N support
-#file-system   TMPFS           # Efficient memory file-system
+file-system    TMPFS           # Efficient memory file-system
 #file-system   UDF             # experimental - OSTA UDF CD/DVD file-system
 
 options        NFSSERVER       # Sun NFS-compatible filesystem (server)
@@ -162,10 +162,11 @@
 voyager0       at pci0 dev ? function ?        # SM502 on GDIUM
 voyagerfb0     at voyager0                     # framebuffer portion
 iic*           at voyager0
-strtc* at iic? addr 0x68       # GDIUM's real time clock
-options        STRTC_NO_USERRAM
-lmtemp*        at iic? addr 0x48       # GDIUM's temperature sensor
-stvii* at iic? addr 0x40       # GDIUM's onboard microcontroller
+strtc*         at iic? addr 0x68               # GDIUM's real time clock
+options        STRTC_NO_USERRAM
+lmtemp*                at iic? addr 0x48               # GDIUM's temperature sensor
+stvii*         at iic? addr 0x40               # GDIUM's onboard microcontroller
+lynxfb0                at pci0 dev ? function ?        # SM712 on Yeeloong Notebook
 #genfb0                at pci0 dev ? function ?
 wsdisplay*     at wsemuldisplaydev?
 ehci*          at pci0 dev ? function ?
@@ -173,17 +174,28 @@
 ohci*          at pci0 dev ? function ?
 #options       OHCI_DEBUG, USB_DEBUG, UHUB_DEBUG
 
-gcscpcib* at pci? dev ? function ?     # AMD CS5535/CS5536 PCI-ISA w/
-gpio*   at gcscpcib?                   # timecounter, watchdog and GPIO
-isa0   at gcscpcib?
+gcscpcib*      at pci? dev ? function ?        # AMD CS5535/CS5536 PCI-ISA w/
+gpio*          at gcscpcib?                    # timecounter, watchdog and GPIO
+isa0           at gcscpcib?
+
+pcib*          at pci?
+isa0           at pcib?
 
-pcib*  at pci?
-isa0   at pcib?
+pckbc0         at isa?                         # PC keyboard controller
+pckbd*         at pckbc?                       # PC keyboard
+pms*           at pckbc?                       # PS/2 mouse for wsmouse
+options        PMS_SYNAPTICS_TOUCHPAD  # Enable support for Synaptics Touchpads
+options        PMS_ELANTECH_TOUCHPAD   # Enable support for Elantech Touchpads
+wskbd*         at pckbd? console ?
+wsmouse*       at pms? mux 0
 
 mcclock*       at isa? port 0x70               # mc146818-compatible
 com0           at isa? port 0x2f8 irq 3        # Fuloong 2F only
 com1           at isa? port 0x3f8 irq 4        # Fuloong 2F only (IR port)
 
+gcscaudio*     at pci?
+audio*         at audiobus?
+
 pciide*        at pci? dev ? function ? flags 0x0000   # GENERIC pciide driver
 viaide*        at pci? dev ? function ?        # VIA/AMD/Nvidia IDE controllers
 options        WDC_NO_IDS #workaround CS5536+JMH330 interrupt disable bug
@@ -297,6 +309,7 @@
 pseudo-device  clockctl                # user control of clock subsystem
 
 pseudo-device  wsmux                   # mouse & keyboard multiplexor
+pseudo-device  wsfont
 #pseudo-device md                      # memory disk device (ramdisk)
 
 #pseudo-device raid            8       # RAIDframe disk driver
diff -r dfe48813339f -r bf988f27fbcc sys/arch/evbmips/conf/files.loongson
--- a/sys/arch/evbmips/conf/files.loongson      Fri Mar 02 13:11:57 2012 +0000
+++ b/sys/arch/evbmips/conf/files.loongson      Fri Mar 02 13:20:57 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.loongson,v 1.2 2011/09/01 14:07:36 macallan Exp $
+#      $NetBSD: files.loongson,v 1.3 2012/03/02 13:20:57 nonaka Exp $
 
 # Standard stanzas config(8) can't run without
 maxpartitions 16
@@ -13,7 +13,7 @@
 file   arch/evbmips/loongson/gdium_machdep.c
 file   arch/evbmips/loongson/generic2e_machdep.c
 file   arch/evbmips/loongson/yeeloong_machdep.c
-file   arch/evbmips/loongson/isa_machdep.c             isa
+file   arch/evbmips/loongson/isa_machdep.c     isa
 file   arch/evbmips/loongson/loongson2_machdep.c
 file   arch/evbmips/loongson/machdep.c
 
@@ -26,18 +26,19 @@
 
 include "dev/ata/files.ata"
 include "dev/scsipi/files.scsipi"
-include        "dev/i2o/files.i2o"
-include        "dev/isa/files.isa"
-include        "dev/pci/files.pci"
-include        "dev/pci/files.agp"
-include        "dev/usb/files.usb"
+include "dev/i2o/files.i2o"
+include "dev/isa/files.isa"
+include "dev/pci/files.pci"
+include "dev/pci/files.agp"
+include "dev/usb/files.usb"
 include "dev/bluetooth/files.bluetooth"
+include "dev/pckbport/files.pckbport"
 
 device mainbus {[addr = -1] }
 attach mainbus at root
-file   arch/evbmips/loongson/mainbus.c                 mainbus
+file   arch/evbmips/loongson/mainbus.c         mainbus
 
-file   arch/evbmips/loongson/bonito_mainbus.c          bonito_mainbus
+file   arch/evbmips/loongson/bonito_mainbus.c  bonito_mainbus
 
 device cpu
 attach cpu at mainbus
@@ -52,8 +53,8 @@
 file   arch/evbmips/loongson/dev/glx.c         bonito & pci
 
 # AMD Geode CS5535/CS5536 PCI-ISA bridge
-device  gcscpcib: isabus, sysmon_wdog, gpiobus
-attach  gcscpcib at pci with gcscpcib_pci
+device gcscpcib: isabus, sysmon_wdog, gpiobus
+attach gcscpcib at pci with gcscpcib_pci
 file   arch/evbmips/loongson/dev/gcscpcib_pci.c gcscpcib_pci
 file   dev/ic/gcscpcib.c                       gcscpcib
 
@@ -71,14 +72,14 @@
 # Lemote Yeeloong KB3310B Embedded Controller
 device ykbec
 attach ykbec at isa
-file   arch/evbmips/loongson/dev/kb3310.c              ykbec needs-flag
+file   arch/evbmips/loongson/dev/kb3310.c      ykbec needs-flag
 
 # Gdium ST7 controller
 device stvii
 attach stvii at iic
-file   arch/evbmips/loongson/dev/stvii.c                       stvii
+file   arch/evbmips/loongson/dev/stvii.c       stvii
 defflag opt_stvii.h STVII_DEBUG
 
 # SM502 OHCI
 #attach        ohci at voyager with ohci_voyager
-#file  arch/loongson/dev/ohci_voyager.c                ohci_voyager
+#file  arch/loongson/dev/ohci_voyager.c        ohci_voyager
diff -r dfe48813339f -r bf988f27fbcc sys/arch/evbmips/loongson/autoconf.c
--- a/sys/arch/evbmips/loongson/autoconf.c      Fri Mar 02 13:11:57 2012 +0000
+++ b/sys/arch/evbmips/loongson/autoconf.c      Fri Mar 02 13:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.1 2011/08/27 13:42:44 bouyer Exp $      */
+/*     $NetBSD: autoconf.c,v 1.2 2012/03/02 13:20:57 nonaka Exp $      */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1 2011/08/27 13:42:44 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2012/03/02 13:20:57 nonaka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -131,4 +131,17 @@
                prop_dictionary_set_uint32(dict, "linebytes", 2048);
                prop_dictionary_set_uint32(dict, "address", 0x04000000);
        }
+       if (device_is_a(dev, "lynxfb")) {
+               dict = device_properties(dev);
+               /*
+                * this is a hack
+                * is_console and address need to be checked against reality
+                */
+               prop_dictionary_set_bool(dict, "is_console", 1);
+               prop_dictionary_set_uint32(dict, "width", 1024);
+               prop_dictionary_set_uint32(dict, "height", 600);
+               prop_dictionary_set_uint32(dict, "depth", 16);
+               prop_dictionary_set_uint32(dict, "linebytes", 2048);
+               prop_dictionary_set_bool(dict, "swapBR", 1);
+       }
 }
diff -r dfe48813339f -r bf988f27fbcc sys/arch/evbmips/loongson/bonito_mainbus.c
--- a/sys/arch/evbmips/loongson/bonito_mainbus.c        Fri Mar 02 13:11:57 2012 +0000
+++ b/sys/arch/evbmips/loongson/bonito_mainbus.c        Fri Mar 02 13:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bonito_mainbus.c,v 1.1 2011/08/27 13:42:44 bouyer Exp $        */
+/*     $NetBSD: bonito_mainbus.c,v 1.2 2012/03/02 13:20:57 nonaka Exp $        */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bonito_mainbus.c,v 1.1 2011/08/27 13:42:44 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bonito_mainbus.c,v 1.2 2012/03/02 13:20:57 nonaka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -70,18 +70,38 @@
 {
        struct pcibus_attach_args pba;
        pcireg_t rev;
+       bool compatible;
 
        self->dv_private = __UNCONST(&sys_platform->bonito_config);
 
        /*
+        * Loongson 2F processors do not use a real Bonito64 chip but
+        * their own derivative, which is no longer 100% compatible.
+        * We need to make sure we never try to access an unimplemented
+        * register...
+        */
+       if (loongson_ver >= 0x2f)
+               compatible = false;
+       else
+               compatible = true;
+
+       /*
         * There is only one PCI controller on a Loongson chip.
         */
 
        rev = PCI_REVISION(REGVAL(BONITO_PCICLASS));
+       if (compatible) {
+               aprint_normal(": BONITO Memory and PCI controller,"
+                   " %s rev. %d.%d\n", BONITO_REV_FPGA(rev) ? "FPGA" : "ASIC",
+                   BONITO_REV_MAJOR(rev), BONITO_REV_MINOR(rev));
+       } else {
+               aprint_normal(": Memory and PCI-X controller, rev. %d\n",
+                   PCI_REVISION(rev));
+       }
 
-       aprint_normal(": BONITO Memory and PCI controller, %s rev. %d.%d\n",
-           BONITO_REV_FPGA(rev) ? "FPGA" : "ASIC",
-           BONITO_REV_MAJOR(rev), BONITO_REV_MINOR(rev));
+       /*
+        * Attach PCI bus.
+        */
 
        pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = 0;
diff -r dfe48813339f -r bf988f27fbcc sys/arch/evbmips/loongson/dev/glx.c
--- a/sys/arch/evbmips/loongson/dev/glx.c       Fri Mar 02 13:11:57 2012 +0000
+++ b/sys/arch/evbmips/loongson/dev/glx.c       Fri Mar 02 13:20:57 2012 +0000
@@ -21,7 +21,7 @@
  * XXX too many hardcoded numbers... need to expand glxreg.h
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: glx.c,v 1.2 2012/02/14 22:22:45 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: glx.c,v 1.3 2012/03/02 13:20:57 nonaka Exp $");
 
 
 #include <sys/param.h>
@@ -136,7 +136,6 @@
        /*
         * Route usb and audio
         */
-
        msr = 0;
        msr |= 11 << 8;
        msr |= 9 << 16;
@@ -157,10 +156,17 @@
        msr |= 1 << 14;
        wrmsr(GCSC_PIC_IRQM_PRIM, msr);
 
+       /*
+        * keyboard and mouse interrupts
+        */
+       msr = 0;
+       msr |= 1 << 1;  /* keyboard */
+       msr |= 1 << 12; /* mouse */
+       wrmsr(GCSC_PIC_IRQM_LPC, msr);
+
        /* no interrupts from theses */
        wrmsr(GCSC_PIC_ZSEL_LOW, 0);
        wrmsr(GCSC_PIC_ZSEL_HIGH, 0);
-       wrmsr(GCSC_PIC_IRQM_LPC, 0);
 
        DPRINTF(("IO space 0x%" PRIx64 "\n", rdmsr(0x80000014)));



Home | Main Index | Thread Index | Old Index