Date: Sun, 29 Apr 2012 09:42:34 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 210344 for review Message-ID: <201204290942.q3T9gYxj005470@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@210344?ac=10 Change 210344 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/04/29 09:41:59 Provide basic glue to allow syscons to be used on MIPS, modelled on PowerPC support. This was clearly not something syscons was designed to do (very specific assumptions about the nature of VGA consoles on PCs), but fortunately others have long since blazed the way on making it work regardless of that. Currently, no display drivers attach so this is nascent and under-tested support. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/conf/files.mips#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/conf/options.mips#4 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/fb/fbreg.h#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/syscons/schistory.c#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/syscons/scterm-teken.c#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/syscons/syscons.c#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/include/sc_machdep.h#1 branch .. //depot/projects/ctsrd/beribsd/src/sys/mips/mips/sc_machdep.c#1 branch Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/conf/files.mips#3 (text+ko) ==== @@ -126,3 +126,9 @@ 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 ==== //depot/projects/ctsrd/beribsd/src/sys/conf/options.mips#4 (text+ko) ==== @@ -55,6 +55,10 @@ 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 ==== //depot/projects/ctsrd/beribsd/src/sys/dev/fb/fbreg.h#2 (text+ko) ==== @@ -84,6 +84,29 @@ 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)) ==== //depot/projects/ctsrd/beribsd/src/sys/dev/syscons/schistory.c#2 (text+ko) ==== @@ -42,7 +42,7 @@ #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> ==== //depot/projects/ctsrd/beribsd/src/sys/dev/syscons/scterm-teken.c#2 (text+ko) ==== @@ -40,7 +40,7 @@ #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> ==== //depot/projects/ctsrd/beribsd/src/sys/dev/syscons/syscons.c#2 (text+ko) ==== @@ -62,7 +62,7 @@ #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>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204290942.q3T9gYxj005470>