* PCMCIA Porting
@ 2003-04-23 13:54 Gerhard TAEUBL
2003-04-23 15:09 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Gerhard TAEUBL @ 2003-04-23 13:54 UTC (permalink / raw)
To: linuxppc-embedded
Hi!
The last 2 weeks I worked full time on PCMCIA. We have a custom board with a MPC860T 10/100MBit Ethernet one PCMCIA slot 8MB flash and 32MB RAM.
First at all: It works now fine. And I want to thank everyone who posted information to this issue (Magnus Damm, Matthew Locke, Wolfgang Denk and all others). But this the point for my mail:
It was/is very difficult to get all needed information, to get it to work, so I want to list my steps there, that it is maybe easier to do this work again.
O.K. here is a history of my work:
I linked the pcmcia stuff directly to the kernel (driver/pcmcia), because I think I understand it right Wolfgang, your PCMCIA onyl works if PPCBoot setup the PCMCIA port. But we don't use PPCBoot (shame about that .... ) and it seems to be to complicated/more work to add the whole stuff into our boot up sequence. I know that we loose the possibilty to mount root from a flash card, but we could live with that. Maybe Wolfgang has another hint for me ... :-)
However, I start of course where everyone startet:
http://lists.linuxppc.org/linuxppc-embedded/200002/msg00093.html and http://lists.linuxppc.org/linuxppc-embedded/200005/msg00227.html.
We portet also the mvista kernel 2.4.2 to the denx kernel 2.4.4
Then I add the _IO_BASE etc to the board specific h file and ioremap it as desribed (arch/ppc/kernem/mm/init.c)
-Fine-
Next step was to add the m8xx_pcmcia.c file to drivers/pcmcia and adapt the Config.in and Makefile. Then I do the board specific stuff for power supply in m8xx_pcmcia.c. Till now everything works fine.
But from this point on it becomes difficult, because from now on the interrupts comes up.
The first issue was in cs.c in drivers/pcmcia in the function pcmcia_request_irq
/* Short cut: if there are no ISA interrupts, then it is PCI */
#if 0
if (!s->cap.irq_mask) {
irq = s->cap.pci_irq;
ret = (irq) ? 0 : CS_IN_USE;
printk("Uhu: %08x %08x\n",s->cap.irq_mask,s->cap.pci_irq);
#endif
if (s->cap.irq_mask == (1 << s->cap.pci_irq)) {
irq = s->cap.pci_irq;
printk("Uhu: %08x %08x\n",s->cap.irq_mask,s->cap.pci_irq);
#ifdef CONFIG_ISA
} else if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must match */
irq = s->irq.AssignedIRQ;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int mask = req->IRQInfo2 & s->cap.irq_mask;
ret = ((mask >> irq) & 1) ? 0 : CS_BAD_ARGS;
} else
ret = ((req->IRQInfo1&IRQ_MASK) == irq) ? 0 : CS_BAD_ARGS;
} else {
ret = CS_IN_USE;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int try, mask = req->IRQInfo2 & s->cap.irq_mask;
for (try = 0; try < 2; try++) {
for (irq = 0; irq < 32; irq++)
if ((mask >> irq) & 1) {
ret = try_irq(req->Attributes, irq, try);
if (ret == 0) break;
}
if (ret == 0) break;
}
} else {
irq = req->IRQInfo1 & IRQ_MASK;
ret = try_irq(req->Attributes, irq, 1);
}
#else /* Right now m8xx specific */
} else if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must match */
irq = s->irq.AssignedIRQ;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
mask = req->IRQInfo2 & s->cap.irq_mask;
ret = ((mask >> irq) & 1) ? 0 : CS_BAD_ARGS;
} else
ret = ((req->IRQInfo1&IRQ_MASK) == irq) ? 0 : CS_BAD_ARGS;
} else {
ret = 0;
irq = 7; //SIU_LEVEL4
#endif
}
The #if 0 and #if CONFIG_ISA tree is the original one, and the #else /*Right now m8xx specific */ part was taken from sourceforge pcmcia-cs 3.2.4.
The last point was the request_irq function. I don't change the defines in the h files, I change the function itself: arch/ppc/kernel/ppc8xx_pic.c. There (in request_irq) I call always the request_8xxirq function.
>From now on it works. I used for the first steps the file system from the eldk and copy then the necessary files (cardctl, cardmgr, scripts) to our filesystem.
I hope I didn't forget anything, please tell me if I've done a lot of nonsense, and I hope this will help in future if anyone has to do these steps anyway
best regards
Gerhard
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: PCMCIA Porting
2003-04-23 13:54 PCMCIA Porting Gerhard TAEUBL
@ 2003-04-23 15:09 ` Wolfgang Denk
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2003-04-23 15:09 UTC (permalink / raw)
To: Gerhard TAEUBL; +Cc: linuxppc-embedded
Hi,
in message <sea6b726.000@mail.frequentis.com> you wrote:
>
> The last 2 weeks I worked full time on PCMCIA. We have a custom board with a MPC860T 10/100MBit Ethernet one PCMCIA slot 8MB flash and 32MB RAM.
Ummm... may I ask why you re-invented the wheel?
> I linked the pcmcia stuff directly to the kernel (driver/pcmcia), because I think I understand it right Wolfgang, your PCMCIA onyl works if PPCBoot setup the PCMCIA port. But we don't use PPCBoot (shame about that .... ) and it seems to be to complicate
If you use the direct IDE support as implemented in our kernel tree,
Linux reads the memory map of the PCMCIA port from the pcmc_pbrX /
pcmc_porX registers. That's all. Initializing these registers in
Linux is trivial. The reason we avoid it is because this may be
board-dependend.
> d/more work to add the whole stuff into our boot up sequence. I know that we loose the possibilty to mount root from a flash card, but we could live with that. Maybe Wolfgang has another hint for me ... :-)
We include both the direct IDE interface and the full PCMCIA card
services package with our ELDK. It has been tested and is working
fine on a couple of differenrt boards. We even support both PCMCIA
slots on MPC860 systems.
> However, I start of course where everyone startet:
I'm sorry, but this is ancient stuff. Why didn't you use more recent
code for your work?
> We portet also the mvista kernel 2.4.2 to the denx kernel 2.4.4
What exactly do you mean with this statement?
> >From now on it works. I used for the first steps the file system from the eldk and copy then the necessary files (cardctl, cardmgr, scripts) to our filesystem.
All of this (and more) is included and ready for use in the ELDK.
It's a pity you wasted so much work without asking earlier :-(
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
Perfection is reached, not when there is no longer anything to add,
but when there is no longer anything to take away.
- Antoine de Saint-Exupery
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <sea6cbef.014@mail.frequentis.com>]
* Re: PCMCIA Porting
[not found] <sea6cbef.014@mail.frequentis.com>
@ 2003-04-23 17:18 ` Wolfgang Denk
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2003-04-23 17:18 UTC (permalink / raw)
To: Gerhard TAEUBL; +Cc: linuxppc-embedded
In message <sea6cbef.014@mail.frequentis.com> you wrote:
>
> So the question is again: do you support every pcmcia card (not only ide) =
> within the kernel?
I cannot claim to support _every_ PCMCIA card.
We have tested the code with flash disk cards, CompactFlash adapters,
ATA harddisk adapters, network cards, WLAN cards, and modem cards.
I am pretty confident that any PCMCIA card that runs on a MAC under
Linux will run with our CS package as well.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
What can it profit a man to gain the whole world and to come to his
property with a gastric ulcer, a blown prostate, and bifocals?
-- John Steinbeck, _Cannery Row_
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-04-23 17:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-23 13:54 PCMCIA Porting Gerhard TAEUBL
2003-04-23 15:09 ` Wolfgang Denk
[not found] <sea6cbef.014@mail.frequentis.com>
2003-04-23 17:18 ` Wolfgang Denk
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 NNTP newsgroup(s).