On Mon, 2004-09-13 at 22:51, Lothar Wassmann wrote:
> The PXA processor doesn't have something like I/O address space.
> As far as I understand your device is a real PCI device. So you
> probably wouldn't use a platform_device as base, but a pci_dev.
> You should have a look at drivers/usb/core/hcd-pci.c. That's where
> part of my code in ohci-sl811.c comes from. ;)

Yes it is, though I'll try to make it as platform indipendent as
possible. I'm keeping the pci-specific code separate just like
ohci-pci.c. Apart from that, I do have a real PCI device, that
implements a USB HC with isp1160 and a PLX PCI bridge, as well as an
Altera FPGA, that I don't know it's purpose...

Anyway, I've studied already hcd-pci.c and I use it's functions in my
isp1160-pci.c code (that is #included in a #IFDEF PCI). But my question
persists:

in hcd-pci.c lies a function named usb_hcd_pci_probe(struct pci_dev,
const struct pci_device_id) that I use for probing the pci device. So I
create a pci_dev from my hc_driver struct, a proper pci_device_id and
call the function. Inside this function there is a branch that checks
the driver flags for bit HCD_MEMORY (0x0001) which states that the HC
regs use memory (else I/O). 
If flags&HCD_MEMORY==1, as in the case of OHCI, the function calls
request_mem_region and the ioremap_nocache for the region that was
requested.
Else, as in the case of UHCI, the function searches the resources of the
PCI device for regions that have the flag IORESOURCE_IO (as opposed to
the previous case where the flag is IORESOURCE_MEM, all defined in
include/linux/ioport.h) and allocates the first matching region. No
ioremap or something.
I obviously use the second case (UHCI-like) since my command and data
ports are accessed through IO ports...
So, to end this long description, if I don't have a "struct regs" that
is mapped to memory and accessed via read"x"/write"x", but rather strict
IO ports accesses via in"x"_p/out"x"_p (where "x" stands for b,l,w
etc.), 

------> how can I use the same method with you? <------

I mean, up until now, I have defined all the register addresses and
functions like [read/write]_reg[16/32](reg_address, [value]) to use
inw_p and outw_p to get or set the appropriate value, and this
differentiates a lot my work from OHCI, and is my main problem up until
now. Is there a way to map IO ports to memory and issue commands through
readw/writew fucntions???

I really want to work again for my driver and this keeps me from going.

Thanks,
Dimitris



-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to