2006-12-02 02:43:19

by Lu, Yinghai

[permalink] [raw]
Subject: RE: [LinuxBIOS] #57: libusb host program for PLX NET20DC debug device

Thanks for the code.

In LinuxBIOS,
I put usbdevice_direct.c in lib/, and call it from usb2_init in
mcp55_usb2.c

Got
"No device in debug port"

Waiting for cable, hope to get that cable next Tuesday.

Will create usbdebug_direct_console.c in console/ for linuxbios_ram
code.
also usbdebug_direct_serial.c in pc80/ for cache_as_ram.c


YH




2006-12-02 14:04:03

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [LinuxBIOS] #57: libusb host program for PLX NET20DC debug device

"Lu, Yinghai" <[email protected]> writes:

> Thanks for the code.
>
> In LinuxBIOS,
> I put usbdevice_direct.c in lib/, and call it from usb2_init in
> mcp55_usb2.c
>
> Got
> "No device in debug port"
>
> Waiting for cable, hope to get that cable next Tuesday.
>
> Will create usbdebug_direct_console.c in console/ for linuxbios_ram
> code.
> also usbdebug_direct_serial.c in pc80/ for cache_as_ram.c


Please yank the direct out of the filename if you are making something
like this out of it. That was my note I was going direct to hardware
which is pretty much assumed if you are in LinuxBIOS.

Eric

2006-12-02 20:47:22

by yhlu

[permalink] [raw]
Subject: Re: [LinuxBIOS] #57: libusb host program for PLX NET20DC debug device

On 12/2/06, Eric W. Biederman <[email protected]> wrote:
> Please yank the direct out of the filename if you are making something
> like this out of it. That was my note I was going direct to hardware
> which is pretty much assumed if you are in LinuxBIOS.

Yes, I adapted the code to used in LinuxBIOS, including CAR stage code
and RAM satge code.

I didn't have debug cable plugged yet.

BTW in kernel earlyprintk or prink, you could use
read_pci_config/write_pci_config before PCI system is loaded.

YH

2006-12-03 11:52:21

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [LinuxBIOS] #57: libusb host program for PLX NET20DC debug device

yhlu <[email protected]> writes:

> On 12/2/06, Eric W. Biederman <[email protected]> wrote:
>> Please yank the direct out of the filename if you are making something
>> like this out of it. That was my note I was going direct to hardware
>> which is pretty much assumed if you are in LinuxBIOS.
>
> Yes, I adapted the code to used in LinuxBIOS, including CAR stage code
> and RAM satge code.
>
> I didn't have debug cable plugged yet.

Even if you did it wouldn't work right now. My initial
version does initialize the ehci properly so it won't
find any usb devices. I almost have that fixed,
but it looks like for the usb device reset I need
a usable delay function, so I can delay 50ms. Grr...

> BTW in kernel earlyprintk or prink, you could use
> read_pci_config/write_pci_config before PCI system is loaded.

Yep thanks that seems to be working. Now I just need
to find an early delay and I can try this mess out!

Eric

2006-12-03 12:01:33

by Stefan Reinauer

[permalink] [raw]
Subject: Re: [LinuxBIOS] #57: libusb host program for PLX NET20DC debug device

* Eric W. Biederman <[email protected]> [061203 12:51]:
> > BTW in kernel earlyprintk or prink, you could use
> > read_pci_config/write_pci_config before PCI system is loaded.
>
> Yep thanks that seems to be working. Now I just need
> to find an early delay and I can try this mess out!

you could use io delay, one outb uses roughly 1us iirc.

--
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [email protected]http://www.coresystems.de/

2006-12-03 12:42:44

by Segher Boessenkool

[permalink] [raw]
Subject: Re: [LinuxBIOS] #57: libusb host program for PLX NET20DC debug device

> you could use io delay, one outb uses roughly 1us iirc.

On LPC, yes -- or 0.5us or something like that. On ISA it's
a lot faster, on PCI too -- better do 20 or so outb's to be
safe. Or use a *real* timer instead, you'll have to abstract
this for portability anyway...


Segher

2006-12-03 12:52:56

by Stefan Reinauer

[permalink] [raw]
Subject: Re: [LinuxBIOS] #57: libusb host program for PLX NET20DC debug device

* Segher Boessenkool <[email protected]> [061203 13:42]:
> On LPC, yes -- or 0.5us or something like that. On ISA it's
> a lot faster, on PCI too -- better do 20 or so outb's to be
> safe.

The value's actually something we have been using as a rule of thumb
while doing outb to port 80. Don't think these are routed to LPC, are
they?

--
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [email protected]http://www.coresystems.de/

2006-12-03 13:13:11

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [LinuxBIOS] #57: libusb host program for PLX NET20DC debug device

Stefan Reinauer <[email protected]> writes:

> * Segher Boessenkool <[email protected]> [061203 13:42]:
>> On LPC, yes -- or 0.5us or something like that. On ISA it's
>> a lot faster, on PCI too -- better do 20 or so outb's to be
>> safe.
>
> The value's actually something we have been using as a rule of thumb
> while doing outb to port 80. Don't think these are routed to LPC, are
> they?

Depends on the destination address. For 0x80 you can be fairly
certain it will be an unacknowledged cycle subtractively decoded
to the slowest bus on the system. Or routed to 32 PCI or the LPC bus
if there is something to actually looking at the value so it is slow.

Since all I need is something that delays for about 50ms 50,000 outb
to port 0x80 looks like a good first approximation, and since it
only happens once it is probably better to just bump that count up
instead of trying to be precise about it and have an accurate timer.

I'm not at all convinced a usb console can be made sufficiently solid
to be useful. But it is at least worth trying so we can clearly say
it doesn't work well.

Eric