2 * Copyright (c) 2012-2017 Oleksandr Tymoshenko <gonzo@freebsd.org>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 #include <sys/cdefs.h>
28 __FBSDID("$FreeBSD$");
30 #include <sys/param.h>
31 #include <sys/systm.h>
33 #include <sys/kernel.h>
34 #include <sys/module.h>
35 #include <sys/malloc.h>
38 #include <sys/consio.h>
41 #include <machine/bus.h>
42 #include <machine/cpu.h>
43 #include <machine/intr.h>
45 #include <dev/ofw/openfirm.h>
46 #include <dev/ofw/ofw_bus.h>
47 #include <dev/ofw/ofw_bus_subr.h>
49 #include <dev/fb/fbreg.h>
50 #include <dev/syscons/syscons.h>
52 #include <arm/versatile/versatile_scm.h>
54 #include <machine/bus.h>
56 #define PL110_VENDOR_ARM926PXP 1
58 #define CLCD_MODE_RGB888 0x0
59 #define CLCD_MODE_RGB555 0x01
60 #define CLCD_MODE_RBG565 0x02
61 #define CLCD_MODE_RGB565 0x03
63 #define CLCDC_TIMING0 0x00
64 #define CLCDC_TIMING1 0x04
65 #define CLCDC_TIMING2 0x08
66 #define CLCDC_TIMING3 0x0C
67 #define CLCDC_TIMING3 0x0C
68 #define CLCDC_UPBASE 0x10
69 #define CLCDC_LPBASE 0x14
70 #ifdef PL110_VENDOR_ARM926PXP
71 #define CLCDC_CONTROL 0x18
72 #define CLCDC_IMSC 0x1C
74 #define CLCDC_IMSC 0x18
75 #define CLCDC_CONTROL 0x1C
77 #define CONTROL_WATERMARK (1 << 16)
78 #define CONTROL_VCOMP_VS (0 << 12)
79 #define CONTROL_VCOMP_BP (1 << 12)
80 #define CONTROL_VCOMP_SAV (2 << 12)
81 #define CONTROL_VCOMP_FP (3 << 12)
82 #define CONTROL_PWR (1 << 11)
83 #define CONTROL_BEPO (1 << 10)
84 #define CONTROL_BEBO (1 << 9)
85 #define CONTROL_BGR (1 << 8)
86 #define CONTROL_DUAL (1 << 7)
87 #define CONTROL_MONO8 (1 << 6)
88 #define CONTROL_TFT (1 << 5)
89 #define CONTROL_BW (1 << 4)
90 #define CONTROL_BPP1 (0x00 << 1)
91 #define CONTROL_BPP2 (0x01 << 1)
92 #define CONTROL_BPP4 (0x02 << 1)
93 #define CONTROL_BPP8 (0x03 << 1)
94 #define CONTROL_BPP16 (0x04 << 1)
95 #define CONTROL_BPP24 (0x05 << 1)
96 #define CONTROL_EN (1 << 0)
97 #define CLCDC_RIS 0x20
98 #define CLCDC_MIS 0x24
99 #define INTR_MBERR (1 << 4)
100 #define INTR_VCOMP (1 << 3)
101 #define INTR_LNB (1 << 2)
102 #define INTR_FUF (1 << 1)
103 #define CLCDC_ICR 0x28
106 #define dprintf(fmt, args...) do { printf("%s(): ", __func__); \
107 printf(fmt,##args); } while (0)
109 #define dprintf(fmt, args...)
112 #define versatile_clcdc_read_4(sc, reg) \
113 bus_read_4((sc)->mem_res, (reg))
114 #define versatile_clcdc_write_4(sc, reg, val) \
115 bus_write_4((sc)->mem_res, (reg), (val))
117 struct versatile_clcdc_softc {
118 struct resource* mem_res;
126 bus_dma_tag_t dma_tag;
127 bus_dmamap_t dma_map;
133 struct video_adapter_softc {
134 /* Videoadpater part */
139 unsigned int fb_size;
146 unsigned int xmargin;
147 unsigned int ymargin;
160 static struct argb versatilefb_palette[16] = {
161 {0x00, 0x00, 0x00, 0x00},
162 {0x00, 0x00, 0x00, 0xaa},
163 {0x00, 0x00, 0xaa, 0x00},
164 {0x00, 0x00, 0xaa, 0xaa},
165 {0x00, 0xaa, 0x00, 0x00},
166 {0x00, 0xaa, 0x00, 0xaa},
167 {0x00, 0xaa, 0x55, 0x00},
168 {0x00, 0xaa, 0xaa, 0xaa},
169 {0x00, 0x55, 0x55, 0x55},
170 {0x00, 0x55, 0x55, 0xff},
171 {0x00, 0x55, 0xff, 0x55},
172 {0x00, 0x55, 0xff, 0xff},
173 {0x00, 0xff, 0x55, 0x55},
174 {0x00, 0xff, 0x55, 0xff},
175 {0x00, 0xff, 0xff, 0x55},
176 {0x00, 0xff, 0xff, 0xff}
179 /* mouse pointer from dev/syscons/scgfbrndr.c */
180 static u_char mouse_pointer[16] = {
181 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68,
182 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00
186 #define FB_HEIGHT 480
189 #define VERSATILE_FONT_HEIGHT 16
191 static struct video_adapter_softc va_softc;
193 static int versatilefb_configure(int);
194 static void versatilefb_update_margins(video_adapter_t *adp);
197 versatile_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err)
204 addr = (bus_addr_t*)arg;
205 *addr = segs[0].ds_addr;
209 versatile_clcdc_probe(device_t dev)
212 if (!ofw_bus_status_okay(dev))
215 if (ofw_bus_is_compatible(dev, "arm,pl110")) {
216 device_set_desc(dev, "PL110 CLCD controller");
217 return (BUS_PROBE_DEFAULT);
224 versatile_clcdc_attach(device_t dev)
226 struct versatile_clcdc_softc *sc = device_get_softc(dev);
227 struct video_adapter_softc *va_sc = &va_softc;
233 /* Request memory resources */
235 sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
236 if (sc->mem_res == NULL) {
237 device_printf(dev, "could not allocate memory resources\n");
241 err = versatile_scm_reg_read_4(SCM_CLCD, ®);
243 device_printf(dev, "failed to read SCM register\n");
246 clcdid = (reg >> SCM_CLCD_CLCDID_SHIFT) & SCM_CLCD_CLCDID_MASK;
249 device_printf(dev, "QEMU VGA 640x480\n");
254 device_printf(dev, "Unsupported: %d\n", clcdid);
258 reg &= ~SCM_CLCD_LCD_MODE_MASK;
259 reg |= CLCD_MODE_RGB565;
260 sc->mode = CLCD_MODE_RGB565;
261 versatile_scm_reg_write_4(SCM_CLCD, reg);
262 dma_size = sc->width*sc->height*2;
267 reg |= SCM_CLCD_PWR3V5VSWITCH | SCM_CLCD_NLCDIOON;
268 versatile_scm_reg_write_4(SCM_CLCD, reg);
271 * XXX: hardcoded timing for VGA. For other modes/panels
272 * we need to keep table of timing register values
277 versatile_clcdc_write_4(sc, CLCDC_TIMING0, 0x3F1F3F9C);
278 versatile_clcdc_write_4(sc, CLCDC_TIMING1, 0x090B61DF);
279 versatile_clcdc_write_4(sc, CLCDC_TIMING2, 0x067F1800);
283 * Now allocate framebuffer memory
285 err = bus_dma_tag_create(
286 bus_get_dma_tag(dev),
287 4, 0, /* alignment, boundary */
288 BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
289 BUS_SPACE_MAXADDR, /* highaddr */
290 NULL, NULL, /* filter, filterarg */
291 dma_size, 1, /* maxsize, nsegments */
292 dma_size, 0, /* maxsegsize, flags */
293 NULL, NULL, /* lockfunc, lockarg */
296 err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->fb_base,
299 device_printf(dev, "cannot allocate framebuffer\n");
303 err = bus_dmamap_load(sc->dma_tag, sc->dma_map, sc->fb_base,
304 dma_size, versatile_fb_dmamap_cb, &sc->fb_phys, BUS_DMA_NOWAIT);
307 device_printf(dev, "cannot load DMA map\n");
311 /* Make sure it's blank */
312 memset(sc->fb_base, 0x00, dma_size);
314 versatile_clcdc_write_4(sc, CLCDC_UPBASE, sc->fb_phys);
316 err = (sc_attach_unit(device_get_unit(dev),
317 device_get_flags(dev) | SC_AUTODETECT_KBD));
320 device_printf(dev, "failed to attach syscons\n");
325 * XXX: hardcoded for VGA
327 reg = CONTROL_VCOMP_BP | CONTROL_TFT | CONTROL_BGR | CONTROL_EN;
328 reg |= CONTROL_BPP16;
329 versatile_clcdc_write_4(sc, CLCDC_CONTROL, reg);
332 versatile_clcdc_write_4(sc, CLCDC_CONTROL, reg);
334 va_sc->fb_addr = (vm_offset_t)sc->fb_base;
335 va_sc->fb_size = dma_size;
336 va_sc->width = sc->width;
337 va_sc->height = sc->height;
339 va_sc->stride = sc->width * 2;
340 versatilefb_update_margins(&va_sc->va);
346 bus_dmamem_free(sc->dma_tag, sc->fb_base, sc->dma_map);
348 bus_dma_tag_destroy(sc->dma_tag);
352 static device_method_t versatile_clcdc_methods[] = {
353 DEVMETHOD(device_probe, versatile_clcdc_probe),
354 DEVMETHOD(device_attach, versatile_clcdc_attach),
359 static driver_t versatile_clcdc_driver = {
361 versatile_clcdc_methods,
362 sizeof(struct versatile_clcdc_softc),
365 static devclass_t versatile_clcdc_devclass;
367 DRIVER_MODULE(versatile_clcdc, simplebus, versatile_clcdc_driver, versatile_clcdc_devclass, 0, 0);
370 * Video driver routines and glue.
372 static vi_probe_t versatilefb_probe;
373 static vi_init_t versatilefb_init;
374 static vi_get_info_t versatilefb_get_info;
375 static vi_query_mode_t versatilefb_query_mode;
376 static vi_set_mode_t versatilefb_set_mode;
377 static vi_save_font_t versatilefb_save_font;
378 static vi_load_font_t versatilefb_load_font;
379 static vi_show_font_t versatilefb_show_font;
380 static vi_save_palette_t versatilefb_save_palette;
381 static vi_load_palette_t versatilefb_load_palette;
382 static vi_set_border_t versatilefb_set_border;
383 static vi_save_state_t versatilefb_save_state;
384 static vi_load_state_t versatilefb_load_state;
385 static vi_set_win_org_t versatilefb_set_win_org;
386 static vi_read_hw_cursor_t versatilefb_read_hw_cursor;
387 static vi_set_hw_cursor_t versatilefb_set_hw_cursor;
388 static vi_set_hw_cursor_shape_t versatilefb_set_hw_cursor_shape;
389 static vi_blank_display_t versatilefb_blank_display;
390 static vi_mmap_t versatilefb_mmap;
391 static vi_ioctl_t versatilefb_ioctl;
392 static vi_clear_t versatilefb_clear;
393 static vi_fill_rect_t versatilefb_fill_rect;
394 static vi_bitblt_t versatilefb_bitblt;
395 static vi_diag_t versatilefb_diag;
396 static vi_save_cursor_palette_t versatilefb_save_cursor_palette;
397 static vi_load_cursor_palette_t versatilefb_load_cursor_palette;
398 static vi_copy_t versatilefb_copy;
399 static vi_putp_t versatilefb_putp;
400 static vi_putc_t versatilefb_putc;
401 static vi_puts_t versatilefb_puts;
402 static vi_putm_t versatilefb_putm;
404 static video_switch_t versatilefbvidsw = {
405 .probe = versatilefb_probe,
406 .init = versatilefb_init,
407 .get_info = versatilefb_get_info,
408 .query_mode = versatilefb_query_mode,
409 .set_mode = versatilefb_set_mode,
410 .save_font = versatilefb_save_font,
411 .load_font = versatilefb_load_font,
412 .show_font = versatilefb_show_font,
413 .save_palette = versatilefb_save_palette,
414 .load_palette = versatilefb_load_palette,
415 .set_border = versatilefb_set_border,
416 .save_state = versatilefb_save_state,
417 .load_state = versatilefb_load_state,
418 .set_win_org = versatilefb_set_win_org,
419 .read_hw_cursor = versatilefb_read_hw_cursor,
420 .set_hw_cursor = versatilefb_set_hw_cursor,
421 .set_hw_cursor_shape = versatilefb_set_hw_cursor_shape,
422 .blank_display = versatilefb_blank_display,
423 .mmap = versatilefb_mmap,
424 .ioctl = versatilefb_ioctl,
425 .clear = versatilefb_clear,
426 .fill_rect = versatilefb_fill_rect,
427 .bitblt = versatilefb_bitblt,
428 .diag = versatilefb_diag,
429 .save_cursor_palette = versatilefb_save_cursor_palette,
430 .load_cursor_palette = versatilefb_load_cursor_palette,
431 .copy = versatilefb_copy,
432 .putp = versatilefb_putp,
433 .putc = versatilefb_putc,
434 .puts = versatilefb_puts,
435 .putm = versatilefb_putm,
438 VIDEO_DRIVER(versatilefb, versatilefbvidsw, versatilefb_configure);
440 static vr_init_t clcdr_init;
441 static vr_clear_t clcdr_clear;
442 static vr_draw_border_t clcdr_draw_border;
443 static vr_draw_t clcdr_draw;
444 static vr_set_cursor_t clcdr_set_cursor;
445 static vr_draw_cursor_t clcdr_draw_cursor;
446 static vr_blink_cursor_t clcdr_blink_cursor;
447 static vr_set_mouse_t clcdr_set_mouse;
448 static vr_draw_mouse_t clcdr_draw_mouse;
451 * We use our own renderer; this is because we must emulate a hardware
454 static sc_rndr_sw_t clcdrend = {
466 RENDERER(versatilefb, 0, clcdrend, gfb_set);
467 RENDERER_MODULE(versatilefb, gfb_set);
470 clcdr_init(scr_stat* scp)
475 clcdr_clear(scr_stat* scp, int c, int attr)
480 clcdr_draw_border(scr_stat* scp, int color)
485 clcdr_draw(scr_stat* scp, int from, int count, int flip)
487 video_adapter_t* adp = scp->sc->adp;
491 /* Normal printing */
492 vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count);
494 /* This is for selections and such: invert the color attribute */
495 for (i = count; i-- > 0; ++from) {
496 c = sc_vtb_getc(&scp->vtb, from);
497 a = sc_vtb_geta(&scp->vtb, from) >> 8;
498 vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4));
504 clcdr_set_cursor(scr_stat* scp, int base, int height, int blink)
509 clcdr_draw_cursor(scr_stat* scp, int off, int blink, int on, int flip)
511 video_adapter_t* adp = scp->sc->adp;
512 struct video_adapter_softc *sc;
517 sc = (struct video_adapter_softc *)adp;
519 if (scp->curs_attr.height <= 0)
522 if (sc->fb_addr == 0)
525 if (off >= adp->va_info.vi_width * adp->va_info.vi_height)
528 /* calculate the coordinates in the video buffer */
529 row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight;
530 col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth;
532 addr = (uint8_t *)sc->fb_addr
533 + (row + sc->ymargin)*(sc->stride)
534 + (sc->depth/8) * (col + sc->xmargin);
536 /* our cursor consists of simply inverting the char under it */
537 for (i = 0; i < adp->va_info.vi_cheight; i++) {
538 for (j = 0; j < adp->va_info.vi_cwidth; j++) {
541 addr[2*j + 1] ^= 0xff;
549 clcdr_blink_cursor(scr_stat* scp, int at, int flip)
554 clcdr_set_mouse(scr_stat* scp)
559 clcdr_draw_mouse(scr_stat* scp, int x, int y, int on)
561 vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8);
565 static uint16_t versatilefb_static_window[ROW*COL];
566 extern u_char dflt_font_16[];
569 * Update videoadapter settings after changing resolution
572 versatilefb_update_margins(video_adapter_t *adp)
574 struct video_adapter_softc *sc;
577 sc = (struct video_adapter_softc *)adp;
580 sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2;
581 sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2;
585 versatilefb_configure(int flags)
587 struct video_adapter_softc *va_sc;
591 if (va_sc->initialized)
594 va_sc->width = FB_WIDTH;
595 va_sc->height = FB_HEIGHT;
596 va_sc->depth = FB_DEPTH;
598 versatilefb_init(0, &va_sc->va, 0);
600 va_sc->initialized = 1;
606 versatilefb_probe(int unit, video_adapter_t **adp, void *arg, int flags)
613 versatilefb_init(int unit, video_adapter_t *adp, int flags)
615 struct video_adapter_softc *sc;
618 sc = (struct video_adapter_softc *)adp;
621 vid_init_struct(adp, "versatilefb", -1, unit);
623 sc->font = dflt_font_16;
624 vi->vi_cheight = VERSATILE_FONT_HEIGHT;
627 vi->vi_width = sc->width/8;
628 vi->vi_height = sc->height/vi->vi_cheight;
631 * Clamp width/height to syscons maximums
633 if (vi->vi_width > COL)
635 if (vi->vi_height > ROW)
638 sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2;
639 sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2;
641 adp->va_window = (vm_offset_t) versatilefb_static_window;
642 adp->va_flags |= V_ADP_FONT /* | V_ADP_COLOR | V_ADP_MODECHANGE */;
644 vid_register(&sc->va);
650 versatilefb_get_info(video_adapter_t *adp, int mode, video_info_t *info)
652 bcopy(&adp->va_info, info, sizeof(*info));
657 versatilefb_query_mode(video_adapter_t *adp, video_info_t *info)
663 versatilefb_set_mode(video_adapter_t *adp, int mode)
669 versatilefb_save_font(video_adapter_t *adp, int page, int size, int width,
670 u_char *data, int c, int count)
676 versatilefb_load_font(video_adapter_t *adp, int page, int size, int width,
677 u_char *data, int c, int count)
679 struct video_adapter_softc *sc = (struct video_adapter_softc *)adp;
687 versatilefb_show_font(video_adapter_t *adp, int page)
693 versatilefb_save_palette(video_adapter_t *adp, u_char *palette)
699 versatilefb_load_palette(video_adapter_t *adp, u_char *palette)
705 versatilefb_set_border(video_adapter_t *adp, int border)
707 return (versatilefb_blank_display(adp, border));
711 versatilefb_save_state(video_adapter_t *adp, void *p, size_t size)
717 versatilefb_load_state(video_adapter_t *adp, void *p)
723 versatilefb_set_win_org(video_adapter_t *adp, off_t offset)
729 versatilefb_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
737 versatilefb_set_hw_cursor(video_adapter_t *adp, int col, int row)
744 versatilefb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
745 int celsize, int blink)
751 versatilefb_blank_display(video_adapter_t *adp, int mode)
754 struct video_adapter_softc *sc;
756 sc = (struct video_adapter_softc *)adp;
757 if (sc && sc->fb_addr)
758 memset((void*)sc->fb_addr, 0, sc->fb_size);
764 versatilefb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,
765 int prot, vm_memattr_t *memattr)
767 struct video_adapter_softc *sc;
769 sc = (struct video_adapter_softc *)adp;
772 * This might be a legacy VGA mem request: if so, just point it at the
773 * framebuffer, since it shouldn't be touched
775 if (offset < sc->stride*sc->height) {
776 *paddr = sc->fb_addr + offset;
784 versatilefb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data)
791 versatilefb_clear(video_adapter_t *adp)
794 return (versatilefb_blank_display(adp, 0));
798 versatilefb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy)
805 versatilefb_bitblt(video_adapter_t *adp, ...)
812 versatilefb_diag(video_adapter_t *adp, int level)
819 versatilefb_save_cursor_palette(video_adapter_t *adp, u_char *palette)
826 versatilefb_load_cursor_palette(video_adapter_t *adp, u_char *palette)
833 versatilefb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n)
840 versatilefb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a,
841 int size, int bpp, int bit_ltor, int byte_ltor)
848 versatilefb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a)
850 struct video_adapter_softc *sc;
856 uint8_t fg, bg, color;
859 sc = (struct video_adapter_softc *)adp;
861 if (sc->fb_addr == 0)
864 if (off >= adp->va_info.vi_width * adp->va_info.vi_height)
867 row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight;
868 col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth;
869 p = sc->font + c*VERSATILE_FONT_HEIGHT;
870 addr = (uint8_t *)sc->fb_addr
871 + (row + sc->ymargin)*(sc->stride)
872 + (sc->depth/8) * (col + sc->xmargin);
877 for (i = 0; i < VERSATILE_FONT_HEIGHT; i++) {
878 for (j = 0, k = 7; j < 8; j++, k--) {
879 if ((p[i] & (1 << k)) == 0)
886 rgb = (versatilefb_palette[color].r >> 3) << 11;
887 rgb |= (versatilefb_palette[color].g >> 2) << 5;
888 rgb |= (versatilefb_palette[color].b >> 3);
889 addr[2*j] = rgb & 0xff;
890 addr[2*j + 1] = (rgb >> 8) & 0xff;
892 /* Not supported yet */
897 addr += (sc->stride);
904 versatilefb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len)
908 for (i = 0; i < len; i++)
909 versatilefb_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8);
915 versatilefb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image,
916 uint32_t pixel_mask, int size, int width)
923 * Define a stub keyboard driver in case one hasn't been
924 * compiled into the kernel
926 #include <sys/kbio.h>
927 #include <dev/kbd/kbdreg.h>
929 static int dummy_kbd_configure(int flags);
931 keyboard_switch_t bcmdummysw;
934 dummy_kbd_configure(int flags)
939 KEYBOARD_DRIVER(bcmdummy, bcmdummysw, dummy_kbd_configure);