Index: conf/files.powerpc =================================================================== RCS file: /home/ncvs/src/sys/conf/files.powerpc,v retrieving revision 1.31 diff -u -r1.31 files.powerpc --- conf/files.powerpc 28 Jun 2003 08:53:49 -0000 1.31 +++ conf/files.powerpc 16 Dec 2003 12:32:38 -0000 @@ -9,6 +9,25 @@ # # +font.h optional sc \ + compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ + no-obj no-implicit-rule before-depend \ + clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" + +dev/fb/fb.c optional sc +dev/kbd/kbd.c optional sc + +dev/syscons/scgfbrndr.c optional sc +dev/syscons/schistory.c optional sc +dev/syscons/scmouse.c optional sc +dev/syscons/scterm.c optional sc +dev/syscons/scterm-dumb.c optional sc +dev/syscons/scterm-sc.c optional sc +dev/syscons/scvidctl.c optional sc +dev/syscons/scvtb.c optional sc +dev/syscons/syscons.c optional sc +dev/syscons/sysmouse.c optional sc + geom/geom_apple.c standard powerpc/powerpc/atomic.S standard powerpc/powerpc/autoconf.c standard @@ -33,6 +52,7 @@ powerpc/powerpc/openpic.c standard powerpc/powerpc/pic_if.m standard powerpc/powerpc/pmap.c standard +powerpc/powerpc/sc_machdep.c optional sc powerpc/powerpc/setjmp.S standard powerpc/powerpc/sigcode.S standard powerpc/powerpc/suswintr.c standard @@ -71,6 +91,7 @@ powerpc/ofw/ofw_pci.c optional pci powerpc/ofw/ofw_pcib_pci.c optional pci +powerpc/ofw/ofw_syscons.c optional sc powerpc/powermac/uninorth.c optional powermac pci powerpc/powermac/macio.c optional powermac pci Index: conf/options.powerpc =================================================================== RCS file: /home/ncvs/src/sys/conf/options.powerpc,v retrieving revision 1.7 diff -u -r1.7 options.powerpc --- conf/options.powerpc 12 Apr 2003 09:40:37 -0000 1.7 +++ conf/options.powerpc 21 Dec 2003 00:27:00 -0000 @@ -4,5 +4,11 @@ OEA opt_global.h IPKDB +GFB_DEBUG opt_gfb.h +GFB_NO_FONT_LOADING opt_gfb.h +GFB_NO_MODE_CHANGE opt_gfb.h + POWERMAC opt_platform.h PSIM + +SC_OFWFB opt_ofwfb.h Index: dev/fb/fbreg.h =================================================================== RCS file: /home/ncvs/src/sys/dev/fb/fbreg.h,v retrieving revision 1.17 diff -u -r1.17 fbreg.h --- dev/fb/fbreg.h 26 Sep 2003 10:41:43 -0000 1.17 +++ dev/fb/fbreg.h 16 Dec 2003 11:45:51 -0000 @@ -75,7 +75,23 @@ while (size--) *buf++ = val; } -#else /* !__i386__ && !__ia64__ && !__amd64__ */ +#elif __powerpc__ + +#define bcopy_io(s, d, c) ofwfb_bcopy((void *)(s), (void *)(d), (c)) +#define bcopy_toio(s, d, c) ofwfb_bcopy((void *)(s), (void *)(d), (c)) +#define bcopy_fromio(s, d, c) ofwfb_bcopy((void *)(s), (void *)(d), (c)) +#define bzero_io(d, c) ofwfb_bzero((void *)(d), (c)) +#define fillw(p, d, c) ofwfb_fillw((p), (void *)(d), (c)) +#define fillw_io(p, d, c) ofwfb_fillw((p), (void *)(d), (c)) +#define readw(a) ofwfb_readw((u_int16_t *)(a)) +#define writew(a, v) ofwfb_writew((u_int16_t *)(a), (v)) +void ofwfb_bcopy(const void *s, void *d, size_t c); +void ofwfb_bzero(void *d, size_t c); +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); + +#else /* !__i386__ && !__ia64__ && !__amd64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) #define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c)) Index: dev/ofw/ofw_console.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ofw/ofw_console.c,v retrieving revision 1.17 diff -u -r1.17 ofw_console.c --- dev/ofw/ofw_console.c 28 Sep 2003 06:51:47 -0000 1.17 +++ dev/ofw/ofw_console.c 12 Dec 2003 09:42:11 -0000 @@ -240,6 +240,8 @@ } } +static int ofw_nopoll = 0; + static void ofw_timeout(void *v) { @@ -247,13 +249,14 @@ int c; tp = (struct tty *)v; - - while ((c = ofw_cons_checkc(NULL)) != -1) { - if (tp->t_state & TS_ISOPEN) { - (*linesw[tp->t_line].l_rint)(c, tp); + + if (ofw_nopoll == 0) + while ((c = ofw_cons_checkc(NULL)) != -1) { + if (tp->t_state & TS_ISOPEN) { + (*linesw[tp->t_line].l_rint)(c, tp); + } } - } - + ofw_timeouthandle = timeout(ofw_timeout, tp, polltime); } Index: dev/syscons/scgfbrndr.c =================================================================== RCS file: /home/ncvs/src/sys/dev/syscons/scgfbrndr.c,v retrieving revision 1.18 diff -u -r1.18 scgfbrndr.c --- dev/syscons/scgfbrndr.c 25 Aug 2003 21:32:00 -0000 1.18 +++ dev/syscons/scgfbrndr.c 21 Dec 2003 00:26:15 -0000 @@ -34,6 +34,9 @@ #ifdef __sparc64__ #include "opt_creator.h" #endif +#ifdef __powerpc__ +#include "opt_ofwfb.h" +#endif #include #include @@ -210,7 +213,7 @@ static int pxlblinkrate = 0; -#ifdef DEV_CREATOR +#if defined(DEV_CREATOR) || defined(SC_OFWFB) static void gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) { Index: dev/syscons/schistory.c =================================================================== RCS file: /home/ncvs/src/sys/dev/syscons/schistory.c,v retrieving revision 1.18 diff -u -r1.18 schistory.c --- dev/syscons/schistory.c 24 Aug 2003 18:17:23 -0000 1.18 +++ dev/syscons/schistory.c 16 Dec 2003 07:13:43 -0000 @@ -42,7 +42,7 @@ #include #include -#ifdef __sparc64__ +#if __sparc64__ || __powerpc__ #include #else #include Index: dev/syscons/scterm-dumb.c =================================================================== RCS file: /home/ncvs/src/sys/dev/syscons/scterm-dumb.c,v retrieving revision 1.5 diff -u -r1.5 scterm-dumb.c --- dev/syscons/scterm-dumb.c 24 Aug 2003 18:17:24 -0000 1.5 +++ dev/syscons/scterm-dumb.c 16 Dec 2003 07:14:31 -0000 @@ -33,7 +33,7 @@ #include #include -#ifdef __sparc64__ +#if __sparc64__ || __powerpc__ #include #else #include Index: dev/syscons/scterm-sc.c =================================================================== RCS file: /home/ncvs/src/sys/dev/syscons/scterm-sc.c,v retrieving revision 1.19 diff -u -r1.19 scterm-sc.c --- dev/syscons/scterm-sc.c 24 Aug 2003 18:17:24 -0000 1.19 +++ dev/syscons/scterm-sc.c 16 Dec 2003 07:14:58 -0000 @@ -35,7 +35,7 @@ #include #include -#ifdef __sparc64__ +#if __sparc64__ || __powerpc__ #include #else #include Index: dev/syscons/syscons.c =================================================================== RCS file: /home/ncvs/src/sys/dev/syscons/syscons.c,v retrieving revision 1.409 diff -u -r1.409 syscons.c --- dev/syscons/syscons.c 29 Oct 2003 20:48:13 -0000 1.409 +++ dev/syscons/syscons.c 16 Dec 2003 07:12:44 -0000 @@ -54,7 +54,7 @@ #include #include -#ifdef __sparc64__ +#if __sparc64__ || __powerpc__ #include #else #include @@ -150,7 +150,7 @@ static int scparam(struct tty *tp, struct termios *t); static void scstart(struct tty *tp); static void scinit(int unit, int flags); -#if __i386__ || __ia64__ || __amd64__ || __sparc64__ +#if __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ static void scterm(int unit, int flags); #endif static void scshutdown(void *arg, int howto); @@ -1378,7 +1378,7 @@ static void sccnprobe(struct consdev *cp) { -#if __i386__ || __ia64__ || __amd64__ || __sparc64__ +#if __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ int unit; int flags; @@ -1396,7 +1396,7 @@ /* initialize required fields */ sprintf(cp->cn_name, "consolectl"); -#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ */ +#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ */ #if __alpha__ /* @@ -1411,7 +1411,7 @@ static void sccninit(struct consdev *cp) { -#if __i386__ || __ia64__ || __amd64__ || __sparc64__ +#if __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ int unit; int flags; @@ -1419,7 +1419,7 @@ scinit(unit, flags | SC_KERNEL_CONSOLE); sc_console_unit = unit; sc_console = SC_STAT(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]); -#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ */ +#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ */ #if __alpha__ /* SHOULDN'T REACH HERE */ @@ -1434,7 +1434,7 @@ if (sc_console_unit < 0) return; /* shouldn't happen */ -#if __i386__ || __ia64__ || __amd64__ || __sparc64__ +#if __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ #if 0 /* XXX */ sc_clear_screen(sc_console); sccnupdate(sc_console); @@ -1442,7 +1442,7 @@ scterm(sc_console_unit, SC_KERNEL_CONSOLE); sc_console_unit = -1; sc_console = NULL; -#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ */ +#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ */ #if __alpha__ /* do nothing XXX */ @@ -2845,7 +2845,7 @@ sc->flags |= SC_INIT_DONE; } -#if __i386__ || __ia64__ || __amd64__ || __sparc64__ +#if __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ static void scterm(int unit, int flags) { @@ -2901,7 +2901,7 @@ sc->keyboard = -1; sc->adapter = -1; } -#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ */ +#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__ */ static void scshutdown(void *arg, int howto) Index: powerpc/conf/GENERIC =================================================================== RCS file: /home/ncvs/src/sys/powerpc/conf/GENERIC,v retrieving revision 1.30 diff -u -r1.30 GENERIC --- powerpc/conf/GENERIC 8 Jun 2003 02:03:01 -0000 1.30 +++ powerpc/conf/GENERIC 21 Dec 2003 00:37:41 -0000 @@ -82,6 +82,12 @@ device cd # CD device pass # Passthrough device (direct SCSI access) +# syscons is the default console driver, resembling an SCO console +device sc +options SC_OFWFB # OFW frame buffer +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 + # Serial (COM) ports #device sio # 8250, 16[45]50 based serial ports device zs # Zilog 8350 based serial ports @@ -99,28 +105,31 @@ device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" -device ofwd # OpenFirmware disks device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying/(translation) +device ofwd # OpenFirmware disks # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! device bpf #Berkeley packet filter # USB support -#device uhci # UHCI PCI->USB interface -#device ohci # OHCI PCI->USB interface -#device usb # USB Bus (required) -#device ugen # Generic -#device uhid # "Human Interface Devices" -#device ukbd # Keyboard -#device ulpt # Printer -#device umass # Disks/Mass storage - Requires scbus and da0 -#device ums # Mouse -# USB Ethernet -#device aue # ADMtek USB ethernet -#device cue # CATC USB ethernet -#device kue # Kawasaki LSI USB ethernet +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device usb # USB Bus (required) +device ugen # Generic +device uhid # "Human Interface Devices" +device ukbd # Keyboard +device ulpt # Printer +device umass # Disks/Mass storage - Requires scbus and da0 +device ums # Mouse +device urio # Diamond Rio 500 MP3 player +device uscanner # Scanners +# USB Ethernet, requires mii +device aue # ADMtek USB ethernet +device axe # ASIX Electronics USB ethernet +device cue # CATC USB ethernet +device kue # Kawasaki LSI USB ethernet # FireWire support device firewire # FireWire bus code Index: powerpc/powerpc/clock.c =================================================================== RCS file: /home/ncvs/src/sys/powerpc/powerpc/clock.c,v retrieving revision 1.16 diff -u -r1.16 clock.c --- powerpc/powerpc/clock.c 26 Sep 2003 09:02:24 -0000 1.16 +++ powerpc/powerpc/clock.c 16 Dec 2003 13:16:55 -0000 @@ -330,3 +330,13 @@ cpu_stopprofclock(void) { } + +/* + * XXX Needed by syscons + */ +int +sysbeep(int pitch, int period) +{ + + return (0); +} Index: powerpc/powerpc/nexus.c =================================================================== RCS file: /home/ncvs/src/sys/powerpc/powerpc/nexus.c,v retrieving revision 1.6 diff -u -r1.6 nexus.c --- powerpc/powerpc/nexus.c 19 Feb 2003 05:47:42 -0000 1.6 +++ powerpc/powerpc/nexus.c 21 Dec 2003 00:03:42 -0000 @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -125,6 +126,7 @@ /* * Local routines */ +static void nexus_add_syscons(device_t); static device_t create_device_from_node(device_t, phandle_t); static device_method_t nexus_methods[] = { @@ -193,6 +195,8 @@ if (sc->sc_pic == NULL) printf("nexus_probe: failed to create PIC device"); + nexus_add_syscons(dev); + child = root; while (child != 0) { if (child != pic) @@ -378,6 +382,28 @@ panic("nexus_release_resource: no pic attached\n"); return (PIC_RELEASE_INTR(sc->sc_pic, child, rid, res)); +} + +/* + * Add the dummy nexus device at the end of the child device list + * so it is probed/attached last + */ +static void +nexus_add_syscons(device_t root) +{ + device_t child; + struct nexus_devinfo *dinfo; + + child = device_add_child_ordered(root, INT_MAX, "sc", 0); + if (child != NULL) { + dinfo = malloc(sizeof(*dinfo), M_NEXUS, M_WAITOK); + dinfo->ndi_node = -1; + dinfo->ndi_name = "sc"; + dinfo->ndi_device_type = "sc"; + dinfo->ndi_compatible = "syscons"; + device_set_ivars(child, dinfo); + } else + panic("could not allocate syscons device"); } static device_t