The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/chips/xcfb_hdw.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
    4  * All Rights Reserved.
    5  * 
    6  * Permission to use, copy, modify and distribute this software and its
    7  * documentation is hereby granted, provided that both the copyright
    8  * notice and this permission notice appear in all copies of the
    9  * software, derivative works or modified versions, and any portions
   10  * thereof, and that both notices appear in supporting documentation.
   11  * 
   12  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   13  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   14  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   15  * 
   16  * Carnegie Mellon requests users of this software to return to
   17  * 
   18  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   19  *  School of Computer Science
   20  *  Carnegie Mellon University
   21  *  Pittsburgh PA 15213-3890
   22  * 
   23  * any improvements or extensions that they make and grant Carnegie Mellon
   24  * the rights to redistribute these changes.
   25  */
   26 /*
   27  * HISTORY
   28  * $Log:        xcfb_hdw.c,v $
   29  * Revision 2.8  93/05/15  19:39:24  mrt
   30  *      machparam.h -> machspl.h
   31  * 
   32  * Revision 2.7  93/05/10  20:08:54  rvb
   33  *      Fixed types.
   34  *      [93/05/06  09:56:26  af]
   35  * 
   36  * Revision 2.6  93/01/14  17:22:23  danner
   37  *      Support for different monitors.
   38  *      [92/11/30            jtp]
   39  * 
   40  *      Proper spl typing.
   41  *      [92/11/30            af]
   42  * 
   43  * Revision 2.5  92/05/22  15:48:34  jfriedl
   44  *      Now all screens clearup at boot.
   45  *      [92/05/21            af]
   46  * 
   47  * Revision 2.4  92/05/05  10:05:08  danner
   48  *      Fixed setting of reset address (vdac_regs, not planemask!).
   49  *      [92/04/14  11:54:42  af]
   50  * 
   51  * Revision 2.3  92/03/05  11:37:04  rpd
   52  *      Cursor/VDAC chip works now.
   53  *      [92/03/04            af]
   54  * 
   55  * Revision 2.2  92/03/02  18:33:13  rpd
   56  *      Created.
   57  *      [92/03/02            af]
   58  * 
   59  */
   60 /*
   61  *      File: xcfb_hdw.c
   62  *      Author: Alessandro Forin, Carnegie Mellon University
   63  *      Date:   1/92
   64  *
   65  *      Driver for the MAXine Color Frame Buffer Display,
   66  *      hardware-level operations.
   67  */
   68 
   69 #include <xcfb.h>
   70 #if     (NXCFB > 0)
   71 
   72 #include <platforms.h>
   73 
   74 #include <machine/machspl.h>
   75 #include <mach/std_types.h>
   76 #include <chips/busses.h>
   77 
   78 #include <chips/screen_defs.h>
   79 #include <chips/pm_defs.h>
   80 #include <machine/machspl.h>
   81 
   82 #ifdef  MAXINE
   83 
   84 #include <chips/xcfb_monitor.h>
   85 
   86 #include <mips/PMAX/pmag_xine.h>
   87 #include <mips/PMAX/tc.h>
   88 #define enable_interrupt(s,o,x) (*tc_enable_interrupt)(s,o,x)
   89 
   90 #else   /* MAXINE */
   91 You must say the magic words to get the coockies:
   92 #define enable_interrupt(slot,on,xx)
   93 #define IMS332_ADDRESS
   94 #define VRAM_OFFSET
   95 #define IMS332_RESET_ADDRESS
   96 #endif  /* MAXINE */
   97 
   98 typedef pm_softc_t      xcfb_softc_t;
   99 
  100 
  101 /*
  102  * Definition of the driver for the auto-configuration program.
  103  */
  104 
  105 int     xcfb_probe(), xcfb_intr();
  106 static void     xcfb_attach();
  107 
  108 vm_offset_t     xcfb_std[NXCFB] = { 0 };
  109 struct  bus_device *xcfb_info[NXCFB];
  110 struct  bus_driver xcfb_driver = 
  111         { xcfb_probe, 0, xcfb_attach, 0, xcfb_std, "xcfb", xcfb_info,
  112           0, 0, BUS_INTR_DISABLED};
  113 
  114 /*
  115  * Probe/Attach functions
  116  */
  117 
  118 xcfb_probe( /* reg, ui */)
  119 {
  120         static probed_once = 0;
  121 
  122         /*
  123          * Probing was really done sweeping the TC long ago
  124          */
  125         if (tc_probe("xcfb") == 0)
  126                 return 0;
  127         if (probed_once++ > 1)
  128                 printf("[mappable] ");
  129         return 1;
  130 }
  131 
  132 static void
  133 xcfb_attach(ui)
  134         struct bus_device *ui;
  135 {
  136         /* ... */
  137         printf(": color display");
  138 }
  139 
  140 
  141 /*
  142  * Interrupt routine
  143  */
  144 
  145 xcfb_intr(unit,spllevel)
  146         spl_t   spllevel;
  147 {
  148         /* interrupt has been acknowledge already */
  149 #if 0
  150         splx(spllevel);
  151         /* XXX make it load the unsafe things */
  152 #endif
  153 }
  154 
  155 xcfb_vretrace(xcfb, on)
  156         xcfb_softc_t    *xcfb;
  157 {
  158         int i;
  159 
  160         for (i = 0; i < NXCFB; i++)
  161                 if (xcfb_info[i]->address == (vm_offset_t)xcfb->framebuffer)
  162                         break;
  163         if (i == NXCFB) return;
  164 
  165         enable_interrupt(xcfb_info[i]->adaptor, on, 0);
  166 }
  167 
  168 /*
  169  * Boot time initialization: must make device
  170  * usable as console asap.
  171  */
  172 
  173 /* some of these values are made up using ad hocery */
  174 static struct xcfb_monitor_type monitors[] = {
  175         { "VRM17", 1024, 768, 1024, 1024, 16, 33,
  176                   6, 2, 2, 21, 326, 16, 10, 10 },
  177         /* XXX Add VRC16 */
  178         { "VR262", 1024, 864, 1024, 1024, 16, 35,
  179                   5, 3, 3, 37, 330, 16, 10, 10 },
  180         { "VR299", 1024, 864, 1024, 1024, 16, 35,
  181                   5, 3, 3, 37, 330, 16, 10, 10 },
  182         { 0 }};
  183 
  184 /* set from prom command line */
  185 extern unsigned char *monitor_types[4];
  186 
  187 xcfb_monitor_type_t xcfb_get_monitor_type()
  188 {
  189         xcfb_monitor_type_t     m;
  190 
  191         m = monitors;
  192         if (monitor_types[3])
  193                 while (m->name) {       
  194                         /* xcfb is always on the motherboard (slot 3),
  195                            fix if you need */
  196                         if (!strcmp(monitor_types[3], m->name))
  197                                 break;
  198                         m++;
  199                 }
  200         if (!m->name)           /* the first is the default */
  201                 m = monitors;
  202         return m;
  203 }
  204         
  205 
  206 extern int
  207         xcfb_soft_reset(), xcfb_set_status(),
  208         ims332_pos_cursor(), ims332_video_on(),
  209         ims332_video_off(), xcfb_vretrace(),
  210         pm_get_status(), pm_char_paint(),
  211         pm_insert_line(), pm_remove_line(),
  212         pm_clear_bitmap(), pm_map_page();
  213 
  214 static struct screen_switch xcfb_sw = {
  215         screen_noop,            /* graphic_open */
  216         xcfb_soft_reset,        /* graphic_close */
  217         xcfb_set_status,        /* set_status */
  218         pm_get_status,          /* get_status */
  219         pm_char_paint,          /* char_paint */
  220         ims332_pos_cursor,      /* pos_cursor */
  221         pm_insert_line,         /* insert_line */
  222         pm_remove_line,         /* remove_line */
  223         pm_clear_bitmap,        /* clear_bitmap */
  224         ims332_video_on,        /* video_on */
  225         ims332_video_off,       /* video_off */
  226         xcfb_vretrace,          /* intr_enable */
  227         pm_map_page             /* map_page */
  228 };
  229 
  230 xcfb_cold_init(unit, up)
  231         user_info_t     *up;
  232 {
  233         xcfb_softc_t    *xcfb;
  234         screen_softc_t  sc = screen(unit);
  235         int             base = tc_probe("xcfb");
  236         xcfb_monitor_type_t m = xcfb_get_monitor_type();
  237 
  238         bcopy(&xcfb_sw, &sc->sw, sizeof(sc->sw));
  239 
  240         sc->flags |= COLOR_SCREEN; /* XXX should come from m->flags? */
  241         sc->frame_scanline_width = m->frame_scanline_width;
  242         sc->frame_height = m->frame_height;
  243         sc->frame_visible_width = m->frame_visible_width;
  244         sc->frame_visible_height = m->frame_visible_height;
  245 
  246         pm_init_screen_params(sc, up);
  247         (void) screen_up(unit, up);
  248 
  249         xcfb = pm_alloc(unit, IMS332_ADDRESS, base + VRAM_OFFSET, 0);
  250         xcfb->vdac_registers = (char *)IMS332_RESET_ADDRESS;
  251 
  252         screen_default_colors(up);
  253 
  254         xcfb_soft_reset(sc);
  255 
  256         /*
  257          * Clearing the screen at boot saves from scrolling
  258          * much, and speeds up booting quite a bit.
  259          */
  260         screen_blitc( unit, 'C'-'@');/* clear screen */
  261 }
  262 
  263 
  264 #endif  (NXCFB > 0)

Cache object: 55e2ec5fe1ddc736a4deafc3126ff8fd


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.