From owner-freebsd-current Sat Dec 27 20:36:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA15373 for current-outgoing; Sat, 27 Dec 1997 20:36:46 -0800 (PST) (envelope-from owner-freebsd-current) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA15361 for ; Sat, 27 Dec 1997 20:36:38 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id PAA05460; Sun, 28 Dec 1997 15:32:59 +1100 Date: Sun, 28 Dec 1997 15:32:59 +1100 From: Bruce Evans Message-Id: <199712280432.PAA05460@godzilla.zeta.org.au> To: bde@zeta.org.au, julian@whistle.com Subject: Re: Remote gdb (was: no boot: config -g and options DDB) Cc: freebsd-current@FreeBSD.ORG, grog@lemis.com, skynyrd@opus.cts.cwu.edu Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > make sure you have flags 0x10 in the config line for sio0 or it will not >work. This is a new requirement I only just started needing > It's been in -current since 1997/04/05. >> with the boot blocks about the port), and the h/w speed will be initialized >> (-current neglects to initialize when the speed registers wouldn't change, >> but this may leave the h/w behind the registers uninitialized after reset). >> > >this tends to introduce another place that things can get it wrong.. >I've seen the 'auto speed detection' get really screwy results on some >hardware. It should be safe enough when it is only used when intended - when the system is booted with -h. The following fixes all the screwy cases that I know about. diff -c2 sio.c~ sio.c *** sio.c~ Wed Dec 17 20:02:21 1997 --- sio.c Wed Dec 24 15:45:07 1997 *************** *** 2635,2642 **** struct consdev *cp; { struct isa_device *dvp; int s; struct siocnstate sp; - speed_t boot_speed; /* --- 2729,2737 ---- struct consdev *cp; { + speed_t boot_speed; + u_char cfcr; struct isa_device *dvp; int s; struct siocnstate sp; /* *************** *** 2666,2669 **** --- 2761,2782 ---- comdefaultrate = boot_speed; } + + /* + * Initialize the divisor latch. We can't rely on + * siocnopen() to do this the first time, since it + * avoids writing to the latch if the latch appears + * to have the correct value. Also, if we didn't + * just read the speed from the hardware, then we + * need to set the speed in hardware so that + * switching it later is null. + */ + cfcr = inb(siocniobase + com_cfcr); + outb(siocniobase + com_cfcr, CFCR_DLAB | cfcr); + outb(siocniobase + com_dlbl, + COMBRD(comdefaultrate) & 0xff); + outb(siocniobase + com_dlbh, + (u_int) COMBRD(comdefaultrate) >> 8); + outb(siocniobase + com_cfcr, cfcr); + siocnopen(&sp); splx(s); I usually use -D in /boot.config so I didn't notice this. Bruce