public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Help getting started: PCI/USB
@ 2006-04-06 21:18 stevemors
  2006-04-06 21:26 ` Andrew Lunn
  2006-04-11  6:19 ` Robin Randhawa
  0 siblings, 2 replies; 4+ messages in thread
From: stevemors @ 2006-04-06 21:18 UTC (permalink / raw)
  To: ecos-discuss

Dear group,

I have been tasked with a project that involves a PCI-to-USB slave
device on a PC platform. This is supposed to allow the PC to act as a
USB slave. I'm trying to get my head around what all I need to do to
get this up and running, while trying to understand eCos, and hope
someone out there can shed some light. Here are some thoughts:

1. Would the driver for this device be a USB driver wrapped in a PCI
driver? Would I look at existing eCos PCI and USB drivers and create
some sort of hybrid of these?

2. The PC bios configures the PCI bus and devices. This means CPU-PCI
address translation is unknown to eCos, correct? How can I fill in
this information when this configuration has been skipped? (Doesn't
redboot have to do this?)

3. Is this something that might be contributable to the eCos project
when complete?

That's all for now. Thanks for any help!

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Help getting started: PCI/USB
  2006-04-06 21:18 [ECOS] Help getting started: PCI/USB stevemors
@ 2006-04-06 21:26 ` Andrew Lunn
  2006-04-11  6:19 ` Robin Randhawa
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2006-04-06 21:26 UTC (permalink / raw)
  To: stevemors; +Cc: ecos-discuss

On Thu, Apr 06, 2006 at 02:18:25PM -0700, stevemors@gmail.com wrote:
> Dear group,
> 
> I have been tasked with a project that involves a PCI-to-USB slave
> device on a PC platform. This is supposed to allow the PC to act as a
> USB slave. I'm trying to get my head around what all I need to do to
> get this up and running, while trying to understand eCos, and hope
> someone out there can shed some light. Here are some thoughts:
> 
> 1. Would the driver for this device be a USB driver wrapped in a PCI
> driver? Would I look at existing eCos PCI and USB drivers and create
> some sort of hybrid of these?

There is not really any PCI drivers. There are drivers which make use
of PCI, eg ethernet device drivers. Looking at a PCI ethernet driver
will give you the idea of how to find a PCI device, allocate it memory
etc.
 
> 2. The PC bios configures the PCI bus and devices. This means CPU-PCI
> address translation is unknown to eCos, correct? How can I fill in
> this information when this configuration has been skipped? (Doesn't
> redboot have to do this?)

I've never really studied PCI, but eCos does have the ability to
allocate resouces to devices etc. Only PC's have BIOS's. For the rest
of the world there is other ways to do it. 
 
> 3. Is this something that might be contributable to the eCos project
> when complete?

Sure, especially if you use a common PCI device. Do you have any idea
what it will be yet? Has the hardware been chosen?

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Help getting started: PCI/USB
  2006-04-06 21:18 [ECOS] Help getting started: PCI/USB stevemors
  2006-04-06 21:26 ` Andrew Lunn
@ 2006-04-11  6:19 ` Robin Randhawa
  2006-04-11 13:18   ` Frank Pagliughi
  1 sibling, 1 reply; 4+ messages in thread
From: Robin Randhawa @ 2006-04-11  6:19 UTC (permalink / raw)
  To: ecos-discuss; +Cc: stevemors

On Friday 07 April 2006 02:48, stevemors@gmail.com wrote:

> I have been tasked with a project that involves a PCI-to-USB slave
> device on a PC platform. This is supposed to allow the PC to act as a
> USB slave.

Chipsets that provide a USB Host controller Interface AND a slave device 
interface are becoming increasingly common. Not surprising to see a slave 
only interface for PCs. Would aid slave side USB development I guess.

> 1. Would the driver for this device be a USB driver wrapped in a PCI
> driver? Would I look at existing eCos PCI and USB drivers and create
> some sort of hybrid of these?

As Andrew pointed out, there aren't any drivers for PCI per se. PCI is a 
busing scheme that allows access to peripheral memory with a view to 
dynamically mapping the devices in the CPU's address space and also allowing 
access to the device's configuration space.

In order to use PCI as an access mechanism, a PCI Host controller needs to be 
setup and that is usually done first by the BIOS.

> 2. The PC bios configures the PCI bus and devices. This means CPU-PCI
> address translation is unknown to eCos, correct? How can I fill in
> this information when this configuration has been skipped? (Doesn't
> redboot have to do this?)

The address mappings done for each PCI-accessible device are done via device 
specific Base Address Registers. These are filled in by the BIOS as a 
temporary mapping to allow stuff like ethernet controllers etc to work at 
boot-time. The BARs are re-written by the OS as deemed necessary. I would 
think that eCos would do the same to suit the address map of the platform in 
question.

The key here is to understand that a USB Slave controller is a USB device that 
is accessible to the CPU via a PCI bus.

Cheers,
Robin


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Help getting started: PCI/USB
  2006-04-11  6:19 ` Robin Randhawa
@ 2006-04-11 13:18   ` Frank Pagliughi
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Pagliughi @ 2006-04-11 13:18 UTC (permalink / raw)
  To: stevemors; +Cc: Robin Randhawa, ecos-discuss

Robin Randhawa wrote:

>On Friday 07 April 2006 02:48, stevemors@gmail.com wrote:
>
>  
>
>>I have been tasked with a project that involves a PCI-to-USB slave
>>device on a PC platform. This is supposed to allow the PC to act as a
>>USB slave.
>>    
>>
>
>Chipsets that provide a USB Host controller Interface AND a slave device 
>interface are becoming increasingly common. Not surprising to see a slave 
>only interface for PCs. Would aid slave side USB development I guess.
>
>  
>
>>1. Would the driver for this device be a USB driver wrapped in a PCI
>>driver? Would I look at existing eCos PCI and USB drivers and create
>>some sort of hybrid of these?
>>    
>>
>
>As Andrew pointed out, there aren't any drivers for PCI per se. PCI is a 
>busing scheme that allows access to peripheral memory with a view to 
>dynamically mapping the devices in the CPU's address space and also allowing 
>access to the device's configuration space.
>
>In order to use PCI as an access mechanism, a PCI Host controller needs to be 
>setup and that is usually done first by the BIOS.
>
>  
>
>>2. The PC bios configures the PCI bus and devices. This means CPU-PCI
>>address translation is unknown to eCos, correct? How can I fill in
>>this information when this configuration has been skipped? (Doesn't
>>redboot have to do this?)
>>    
>>
>
>The address mappings done for each PCI-accessible device are done via device 
>specific Base Address Registers. These are filled in by the BIOS as a 
>temporary mapping to allow stuff like ethernet controllers etc to work at 
>boot-time. The BARs are re-written by the OS as deemed necessary. I would 
>think that eCos would do the same to suit the address map of the platform in 
>question.
>
>The key here is to understand that a USB Slave controller is a USB device that 
>is accessible to the CPU via a PCI bus.
>
>Cheers,
>Robin
>
>
>  
>
I'm doing the same thing right now. We started with a Philips D12 then 
an ISP1181 on the PC/104 (ISA) bus. Now we need some more speed, so the 
hardware guy has started on a PC/104+ (PCI) board using a PLX NET2280 
USB2 slave chip. So I'll probably be writing  the software by the end of 
the month.

If you haven't chosen hardware yet, have a look at the NET2280. It 
interfaces directly to the PCI bus, and there's already a Linux USB 
gadget driver written. Obviously, Linux and eCos drivers are 
significantly different, but at least it'll start giving you some ideas.

Frank Pagliughi


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-11 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-06 21:18 [ECOS] Help getting started: PCI/USB stevemors
2006-04-06 21:26 ` Andrew Lunn
2006-04-11  6:19 ` Robin Randhawa
2006-04-11 13:18   ` Frank Pagliughi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).