Date: Sun, 28 Dec 1997 15:32:59 +1100 From: Bruce Evans <bde@zeta.org.au> To: bde@zeta.org.au, julian@whistle.com Cc: freebsd-current@FreeBSD.ORG, grog@lemis.com, skynyrd@opus.cts.cwu.edu Subject: Re: Remote gdb (was: no boot: config -g and options DDB) Message-ID: <199712280432.PAA05460@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712280432.PAA05460>
