diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/conf/files.mips | 6 | ||||
-rw-r--r-- | sys/conf/options.mips | 4 | ||||
-rw-r--r-- | sys/dev/fb/fbreg.h | 23 | ||||
-rw-r--r-- | sys/dev/syscons/schistory.c | 2 | ||||
-rw-r--r-- | sys/dev/syscons/scterm-teken.c | 2 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 2 | ||||
-rw-r--r-- | sys/mips/mips/sc_machdep.c | 90 |
7 files changed, 126 insertions, 3 deletions
diff --git a/sys/conf/files.mips b/sys/conf/files.mips index a7d650b..bc628d5 100644 --- a/sys/conf/files.mips +++ b/sys/conf/files.mips @@ -122,3 +122,9 @@ dev/ofw/ofw_fdt.c optional fdt dev/fdt/fdt_mips.c optional fdt +dev/fb/fb.c optional sc +dev/kbd/kbd.c optional sc +dev/syscons/scgfbrndr.c optional sc +dev/syscons/scterm-teken.c optional sc +dev/syscons/scvtb.c optional sc +mips/mips/sc_machdep.c optional sc diff --git a/sys/conf/options.mips b/sys/conf/options.mips index c0a7b34..51b8b99 100644 --- a/sys/conf/options.mips +++ b/sys/conf/options.mips @@ -46,6 +46,10 @@ CFE_CONSOLE opt_global.h CFE_ENV opt_global.h CFE_ENV_SIZE opt_global.h +GFB_DEBUG opt_gfb.h +GFB_NO_FONT_LOADING opt_gfb.h +GFB_NO_MODE_CHANGE opt_gfb.h + NOFPU opt_global.h TICK_USE_YAMON_FREQ opt_global.h diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h index c9689d3..a844c56 100644 --- a/sys/dev/fb/fbreg.h +++ b/sys/dev/fb/fbreg.h @@ -92,6 +92,29 @@ void ofwfb_fillw(int pat, void *base, size_t cnt); u_int16_t ofwfb_readw(u_int16_t *addr); void ofwfb_writew(u_int16_t *addr, u_int16_t val); +#elif defined(__mips__) + +/* + * Use amd64/i386-like settings under the assumption that MIPS-based display + * drivers will have to add a level of indirection between a syscons-managed + * frame buffer and the actual video hardware. We are forced to do this + * because syscons doesn't carry around required busspace handles and tags to + * use here. This is only really a problem for true VGA devices hooked up to + * MIPS, as others will be performing a translation anyway. + */ +#define bcopy_io(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bcopy_toio(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bcopy_fromio(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bzero_io(d, c) memset((void *)(d), 0, (c)) +#define fill_io(p, d, c) memset((void *)(d), (p), (c)) +static __inline void +fillw(int val, uint16_t *buf, size_t size) +{ + while (size--) + *buf++ = val; +} +#define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) + #else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) diff --git a/sys/dev/syscons/schistory.c b/sys/dev/syscons/schistory.c index 8eefb00..cb8cfe9 100644 --- a/sys/dev/syscons/schistory.c +++ b/sys/dev/syscons/schistory.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/malloc.h> -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include <machine/sc_machdep.h> #else #include <machine/pc/display.h> diff --git a/sys/dev/syscons/scterm-teken.c b/sys/dev/syscons/scterm-teken.c index 6762388..e3395cb 100644 --- a/sys/dev/syscons/scterm-teken.c +++ b/sys/dev/syscons/scterm-teken.c @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include <sys/consio.h> #include <sys/kbio.h> -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include <machine/sc_machdep.h> #else #include <machine/pc/display.h> diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 01b1150..bacbb73 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include <sys/power.h> #include <machine/clock.h> -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include <machine/sc_machdep.h> #else #include <machine/pc/display.h> diff --git a/sys/mips/mips/sc_machdep.c b/sys/mips/mips/sc_machdep.c new file mode 100644 index 0000000..a81ffdd --- /dev/null +++ b/sys/mips/mips/sc_machdep.c @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/bus.h> +#include <sys/cons.h> +#include <sys/kbio.h> +#include <sys/consio.h> +#include <sys/sysctl.h> + +#include <dev/syscons/syscons.h> + +static sc_softc_t sc_softcs[8]; + +int +sc_get_cons_priority(int *unit, int *flags) +{ + + *unit = 0; + *flags = 0; + return (CN_INTERNAL); +} + +int +sc_max_unit(void) +{ + return (1); +} + +sc_softc_t * +sc_get_softc(int unit, int flags) +{ + sc_softc_t *sc; + + if (unit < 0) + return (NULL); + sc = &sc_softcs[unit]; + sc->unit = unit; + if ((sc->flags & SC_INIT_DONE) == 0) { + sc->keyboard = -1; + sc->adapter = -1; + sc->cursor_char = SC_CURSOR_CHAR; + sc->mouse_char = SC_MOUSE_CHAR; + } + return (sc); +} + +void +sc_get_bios_values(bios_values_t *values) +{ + values->cursor_start = 0; + values->cursor_end = 32; + values->shift_state = 0; +} + +int +sc_tone(int hz) +{ + return (0); +} |