From al.graziano at gmail.com  Sun Apr  1 07:35:09 2007
From: al.graziano at gmail.com (Al Graziano)
Date: Sun, 01 Apr 2007 12:35:09 +0100
Subject: Changing PCMCIA card drivers
Message-ID: <460F98ED.1010109@gmail.com>

Hello,

I am trying to change the driver binding to my PCMCIA wireless card, 
from orinoco to hostap, as I need to put the card in master mode and the 
orinoco driver doesn't support it. This is what I get from pccardctl

# pccardctl info
PRODID_1="INTERSIL"
PRODID_2="HFA384x/IEEE"
PRODID_3="Version 01.02"
PRODID_4=""
MANFID=0156,0002
FUNCID=6

# pccardctl status
Socket 0:
  3.3V 16-bit PC Card
  Subdevice 0 (function 0) bound to driver "orinoco_cs"


I run Fedora 6 and after a lot of reading and googling I realize that 
much of the PCMCIA stuff has changed alot with the new 2.6 kernel. I was 
thinking of using the /etc/pcmcia/conf file and put the mapping for the 
new binding there, and then restart the PCMCIA service. However, all is 
changed and I am struggling to understand how I can change mapping 
between the card and drivers. It appears as though the 
/etc/pcmcia/conf.opts is still used

Any help is greatly appreciated, please :-)

Ciao
Al



From un_chezhiyan at mafoi.com  Mon Apr  2 06:44:25 2007
From: un_chezhiyan at mafoi.com (NED)
Date: Mon, 2 Apr 2007 16:14:25 +0530
Subject: ZTE MC315 CDMA wireless PCMCIA data card on Linux
Message-ID: <002501c77513$e39a30f0$aace92d0$@com>

Dear Dominik:

 

Any workaround fetches some result?

 

Regards / NED (Ilugc-India)

 

*** PLEASE BE ADVISED ***

This email contains confidential information that may also be legally
privileged and which is intended only for the use of the above-named
addressee. If you are not the intended recipient, please be advised that any
copy, dissemination, or use of the information contained on this email is
strictly prohibited. If this email has been received in error, please
contact us immediately. Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20070402/08a6eb4a/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: un_chezhiyan at mafoi.com.vcf
Type: application/octet-stream
Size: 143 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20070402/08a6eb4a/attachment.obj 

From david-b at pacbell.net  Mon Apr  2 15:51:47 2007
From: david-b at pacbell.net (David Brownell)
Date: Mon, 2 Apr 2007 12:51:47 -0700
Subject: [patch 2.6.21-rc5-git] omap_cf oops-in-suspend fix
Message-ID: <200704021251.48245.david-b@pacbell.net>

Convert omap_cf into a platform_driver ... this resolves oopsing during
suspend/resume.

Evidently folk haven't tried suspend/resume on an OSK (the main platform
for this driver) since September or so, which is when platform_device
learned about suspend_late()/resume_early() and stopped being able to
suspend/resume without a having a real platform_driver.

Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>
---
Could I get an ACK if this gets merged via linux-pcmcia?  The last time
I submitted a patch it didn't get merged, so I'm wondering if that list
is functioning for patch submission.

--- osk2.orig/drivers/pcmcia/omap_cf.c	2007-03-17 21:00:49.000000000 -0700
+++ osk2/drivers/pcmcia/omap_cf.c	2007-04-01 22:05:16.000000000 -0700
@@ -202,15 +202,14 @@ static struct pccard_operations omap_cf_
  * "what chipselect is used".  Boards could want more.
  */
 
-static int __devinit omap_cf_probe(struct device *dev)
+static int __init omap_cf_probe(struct platform_device *pdev)
 {
 	unsigned		seg;
 	struct omap_cf_socket	*cf;
-	struct platform_device	*pdev = to_platform_device(dev);
 	int			irq;
 	int			status;
 
-	seg = (int) dev->platform_data;
+	seg = (int) pdev->dev.platform_data;
 	if (seg == 0 || seg > 3)
 		return -ENODEV;
 
@@ -227,7 +226,7 @@ static int __devinit omap_cf_probe(struc
 	cf->timer.data = (unsigned long) cf;
 
 	cf->pdev = pdev;
-	dev_set_drvdata(dev, cf);
+	platform_set_drvdata(pdev, cf);
 
 	/* this primarily just shuts up irq handling noise */
 	status = request_irq(irq, omap_cf_irq, IRQF_SHARED,
@@ -291,7 +290,7 @@ static int __devinit omap_cf_probe(struc
 		omap_cf_present() ? "present" : "(not present)");
 
 	cf->socket.owner = THIS_MODULE;
-	cf->socket.dev.parent = dev;
+	cf->socket.dev.parent = &pdev->dev;
 	cf->socket.ops = &omap_cf_ops;
 	cf->socket.resource_ops = &pccard_static_ops;
 	cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
@@ -318,9 +317,9 @@ fail0:
 	return status;
 }
 
-static int __devexit omap_cf_remove(struct device *dev)
+static int __exit omap_cf_remove(struct platform_device *pdev)
 {
-	struct omap_cf_socket *cf = dev_get_drvdata(dev);
+	struct omap_cf_socket *cf = platform_get_drvdata(pdev);
 
 	cf->active = 0;
 	pcmcia_unregister_socket(&cf->socket);
@@ -332,26 +331,36 @@ static int __devexit omap_cf_remove(stru
 	return 0;
 }
 
-static struct device_driver omap_cf_driver = {
-	.name		= (char *) driver_name,
-	.bus		= &platform_bus_type,
-	.probe		= omap_cf_probe,
-	.remove		= __devexit_p(omap_cf_remove),
-	.suspend	= pcmcia_socket_dev_suspend,
-	.resume		= pcmcia_socket_dev_resume,
+static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
+{
+	return pcmcia_socket_dev_suspend(&pdev->dev, mesg);
+}
+
+static int omap_cf_resume(struct platform_device *pdev)
+{
+	return pcmcia_socket_dev_resume(&pdev->dev);
+}
+
+static struct platform_driver omap_cf_driver = {
+	.driver = {
+		.name	= (char *) driver_name,
+	},
+	.remove		= __exit_p(omap_cf_remove),
+	.suspend	= omap_cf_suspend,
+	.resume		= omap_cf_resume,
 };
 
 static int __init omap_cf_init(void)
 {
 	if (cpu_is_omap16xx())
-		return driver_register(&omap_cf_driver);
+		return platform_driver_probe(&omap_cf_driver, omap_cf_probe);
 	return -ENODEV;
 }
 
 static void __exit omap_cf_exit(void)
 {
 	if (cpu_is_omap16xx())
-		driver_unregister(&omap_cf_driver);
+		platform_driver_unregister(&omap_cf_driver);
 }
 
 module_init(omap_cf_init);


From tony at atomide.com  Tue Apr  3 15:48:14 2007
From: tony at atomide.com (tony at atomide.com)
Date: Tue, 3 Apr 2007 15:48:14 -0400
Subject: [patch 2.6.21-rc5-git] omap_cf oops-in-suspend fix
In-Reply-To: <200704021251.48245.david-b@pacbell.net>
References: <200704021251.48245.david-b@pacbell.net>
Message-ID: <20070403194813.GC24864@atomide.com>

* David Brownell <david-b at pacbell.net> [070402 16:44]:
> Convert omap_cf into a platform_driver ... this resolves oopsing during
> suspend/resume.
> 
> Evidently folk haven't tried suspend/resume on an OSK (the main platform
> for this driver) since September or so, which is when platform_device
> learned about suspend_late()/resume_early() and stopped being able to
> suspend/resume without a having a real platform_driver.

FYI, while waiting for this to get integrated to Linus' tree, I've pushed
it to linux-omap tree.

Regards,

Tony


From s_j_newbury at yahoo.co.uk  Wed Apr  4 06:36:35 2007
From: s_j_newbury at yahoo.co.uk (Steven Newbury)
Date: Wed, 4 Apr 2007 11:36:35 +0100 (BST)
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <da6318370703190237h658cafe6ka396282bad0ca010@mail.gmail.com>
Message-ID: <28361.26201.qm@web25002.mail.ukl.yahoo.com>


--- Piotras <piotras at gmail.com> wrote:

> Hi all,
> 
> I already asked about this on comp.os.linux.hardware, but didn't
> get any responses.
> 
> CF+ and Compact Flash Specification (rev 4.0) specifies Ultra DMA
> as an optional protocol for PC Card:
>    "Ultra DMA operations can take place in any of the three basic
>    interface modes: PC Card Memory mode, PC Card I/O mode, and True
>    IDE (the original mode to support UDMA)." (page 54)
> 
> Has anyone tried this? What specific CF memory cards are know to
> implement UDMA in PC Card Memory or I/O mode?
> 
> I'm looking into experimenting with improving performance of CF
> memory card when using a passive adapter under PowerBook G3.
> The PC Card is bridged with TI PCI1131. In the datasheet for
> PCI1131 I found that it "supports 16-Bit Distributed Direct Memory
> Access (DMA) on both PC Card sockets". Also signal names match
> the CF specification. I don't have access to the PC Card (obsolete)
> specification so cannot check the details there. Does anyone know
> of reasons why CF UDMA should work with this controller?
> 
> I already experimented with using PC Card Memory mode in ide_cs
> (reusing patch from Thomas Kleffel [1]) with Kingston CF/512-S
> on Linux 2.6.20. This didn't give any significant performance
> improvements. I measured that both common memory and I/O access
> time for reading data is around 1us (or longer when wait states
> are enabled). It's much more that what I would expect looking
> at the PC Card timing diagrams. Is it possible that PCI-PC Card
> bridge give such a significant latency in signal propagation?
> 
> Also when working with the patch from Thomas Kleffel I noticed
> that it probes ide devices in I/O mode!
> 
The only way of getting CF devices to run in (U)DMA mode is to physically
attach them to an IDE controller.  CF devices can electrically operate as
either PCMCIA-like or IDE devices.  If operating as a PCMCIA device it can only
be accessed with IO or MMIO.  If you want more performance than the 300ns cycle
IO access time you need to use MMIO **and set the access speed to the correct
value for that CF device**, you'll then get much higher performace (upto
20MB/s).  Using a variation on Thomas Kleffel's patch I've tried before, not
completely managed to get it working, see this lists archives.  I couldn't get
the interrupt working for some reason.


Steve


		
___________________________________________________________ 
Now you can have your favourite RSS headlines come to you with the all new Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html


From michaelzwrk at gmail.com  Thu Apr  5 11:07:24 2007
From: michaelzwrk at gmail.com (Michael)
Date: Thu, 5 Apr 2007 17:07:24 +0200
Subject: Looking for a driver for Compact Flash access
Message-ID: <1ea6be8e0704050807k1c357870sf14f754a1da89c49@mail.gmail.com>

Hi,
I'm have an embedded system using Compact Flash device.
I'm trying to figure out what is the right driver to access the CF.

The HW configuration is as following:
The CF is connected directly to MPC8541 CPU (PowerQUICC III,
Freescale), via local bus.
It is connected in Memory Mode, with 8-bit interface.

The questions I have:
1. What is the appropriate driver? Since memory mode is
PCMCIA-compatible PC Card ATA, I assume it is ide-cs. Is it right?

2. The card doesn't issue interrupts in this mode. I got the
impression the IDE driver relies on interrupts. Does it make it
unusable for accessing a CF in Memory Mode?


Most grateful for your help,
                                            Michael


From stuge-linux-pcmcia at cdy.org  Thu Apr  5 12:53:07 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Thu, 5 Apr 2007 18:53:07 +0200
Subject: Looking for a driver for Compact Flash access
In-Reply-To: <1ea6be8e0704050807k1c357870sf14f754a1da89c49@mail.gmail.com>
References: <1ea6be8e0704050807k1c357870sf14f754a1da89c49@mail.gmail.com>
Message-ID: <20070405165307.14568.qmail@cdy.org>

On Thu, Apr 05, 2007 at 05:07:24PM +0200, Michael wrote:
> The CF is connected directly to MPC8541 CPU (PowerQUICC III,
> Freescale), via local bus.
> It is connected in Memory Mode, with 8-bit interface.
> 
> The questions I have:
> 1. What is the appropriate driver? Since memory mode is
> PCMCIA-compatible PC Card ATA, I assume it is ide-cs.
> Is it right?

I don't think so. ide-cs expects an IDE controller, but you don't
have one. There is no driver for this hardware yet.

Does the hardware support hotplugging? If not, ide-cs is definately
wrong.

Third, there's pcmcia_ata instead of ide-cs.

But none of this really applies to you because you have an IDE device
connected to a local bus instead of an IDE controller. I think the
linux-ide developers could help you better.


> 2. The card doesn't issue interrupts in this mode. I got the
> impression the IDE driver relies on interrupts. Does it make it
> unusable for accessing a CF in Memory Mode?

The non-PCMCIA IDE drivers can do PIO. It makes sense to investigate
the IDE drivers because you don't really have any PCMCIA-like
hardware.


//Peter


From stuge-linux-pcmcia at cdy.org  Thu Apr  5 12:56:51 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Thu, 5 Apr 2007 18:56:51 +0200
Subject: Looking for a driver for Compact Flash access
In-Reply-To: <20070405165307.14568.qmail@cdy.org>
References: <1ea6be8e0704050807k1c357870sf14f754a1da89c49@mail.gmail.com>
	<20070405165307.14568.qmail@cdy.org>
Message-ID: <20070405165651.15107.qmail@cdy.org>

On Thu, Apr 05, 2007 at 06:53:07PM +0200, Peter Stuge wrote:
> But none of this really applies to you because you have an IDE
> device connected to a local bus instead of an IDE controller. I
> think the linux-ide developers could help you better.

Or possibly linux-mtd of course.


//Peter


From piotras at gmail.com  Thu Apr  5 18:10:18 2007
From: piotras at gmail.com (Piotras)
Date: Thu, 5 Apr 2007 23:10:18 +0100
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <28361.26201.qm@web25002.mail.ukl.yahoo.com>
References: <da6318370703190237h658cafe6ka396282bad0ca010@mail.gmail.com>
	<28361.26201.qm@web25002.mail.ukl.yahoo.com>
Message-ID: <da6318370704051510l6a987d18t38614fb2feb33d94@mail.gmail.com>

Hi Steve,

Thanks for your replay.

My device supports 250ns cycle (according to CIS). I set it up
for MMIO (PCMCIA) using the Thomas Kleffel's patch and verified
the settings of the window registers in PCMCIA bridge. The
measured throughput for reading from the CF does not exceed 2MB/s.

I verified the actual time for MMIO reads from data register
by the CPU. The average time for reading 16-bits word is about
1us (it's consistent with the throughput). When I was changing
the cycle timing, the measured time for reads changed accordingly
(~750ns + cycle time). I cannot verify what causes this ~750ns
delay. Maybe it's the propagation delay introduced by the two
bridges (CPU-PCI and PCI-PCMCIA). If it would be the case, the
DMA by PCMCIA bridge could give significant improvement.

After I send the previous email I realized that the PCMCIA bridge
datasheet is older then ATA specification that introduced UDMA.
I think that the DMA supported by the PCMCIA bridge is something
similar to single-word/multi-word DMA. The Compact Flash
Specification does not specify any of these for PCMCIA. Still some
vendors could possibly implement it...


Piotr Krysiuk


On 4/4/07, Steven Newbury <s_j_newbury at yahoo.co.uk> wrote:
>
> --- Piotras <piotras at gmail.com> wrote:
>
> > Hi all,
> >
> > I already asked about this on comp.os.linux.hardware, but didn't
> > get any responses.
> >
> > CF+ and Compact Flash Specification (rev 4.0) specifies Ultra DMA
> > as an optional protocol for PC Card:
> >    "Ultra DMA operations can take place in any of the three basic
> >    interface modes: PC Card Memory mode, PC Card I/O mode, and True
> >    IDE (the original mode to support UDMA)." (page 54)
> >
> > Has anyone tried this? What specific CF memory cards are know to
> > implement UDMA in PC Card Memory or I/O mode?
> >
> > I'm looking into experimenting with improving performance of CF
> > memory card when using a passive adapter under PowerBook G3.
> > The PC Card is bridged with TI PCI1131. In the datasheet for
> > PCI1131 I found that it "supports 16-Bit Distributed Direct Memory
> > Access (DMA) on both PC Card sockets". Also signal names match
> > the CF specification. I don't have access to the PC Card (obsolete)
> > specification so cannot check the details there. Does anyone know
> > of reasons why CF UDMA should work with this controller?
> >
> > I already experimented with using PC Card Memory mode in ide_cs
> > (reusing patch from Thomas Kleffel [1]) with Kingston CF/512-S
> > on Linux 2.6.20. This didn't give any significant performance
> > improvements. I measured that both common memory and I/O access
> > time for reading data is around 1us (or longer when wait states
> > are enabled). It's much more that what I would expect looking
> > at the PC Card timing diagrams. Is it possible that PCI-PC Card
> > bridge give such a significant latency in signal propagation?
> >
> > Also when working with the patch from Thomas Kleffel I noticed
> > that it probes ide devices in I/O mode!
> >
> The only way of getting CF devices to run in (U)DMA mode is to physically
> attach them to an IDE controller.  CF devices can electrically operate as
> either PCMCIA-like or IDE devices.  If operating as a PCMCIA device it can only
> be accessed with IO or MMIO.  If you want more performance than the 300ns cycle
> IO access time you need to use MMIO **and set the access speed to the correct
> value for that CF device**, you'll then get much higher performace (upto
> 20MB/s).  Using a variation on Thomas Kleffel's patch I've tried before, not
> completely managed to get it working, see this lists archives.  I couldn't get
> the interrupt working for some reason.
>
>
> Steve
>
>
>
> ___________________________________________________________
> Now you can have your favourite RSS headlines come to you with the all new Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html
>


From s_j_newbury at yahoo.co.uk  Thu Apr  5 18:42:30 2007
From: s_j_newbury at yahoo.co.uk (Steven Newbury)
Date: Thu, 5 Apr 2007 23:42:30 +0100 (BST)
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <da6318370704051510l6a987d18t38614fb2feb33d94@mail.gmail.com>
Message-ID: <926447.11173.qm@web25006.mail.ukl.yahoo.com>


--- Piotras <piotras at gmail.com> wrote:

> Hi Steve,
> 
> Thanks for your replay.
> 
> My device supports 250ns cycle (according to CIS). I set it up
> for MMIO (PCMCIA) using the Thomas Kleffel's patch and verified
> the settings of the window registers in PCMCIA bridge. The
> measured throughput for reading from the CF does not exceed 2MB/s.
> 
> I verified the actual time for MMIO reads from data register
> by the CPU. The average time for reading 16-bits word is about
> 1us (it's consistent with the throughput). When I was changing
> the cycle timing, the measured time for reads changed accordingly
> (~750ns + cycle time). I cannot verify what causes this ~750ns
> delay. Maybe it's the propagation delay introduced by the two
> bridges (CPU-PCI and PCI-PCMCIA). If it would be the case, the
> DMA by PCMCIA bridge could give significant improvement.
> 
> After I send the previous email I realized that the PCMCIA bridge
> datasheet is older then ATA specification that introduced UDMA.
> I think that the DMA supported by the PCMCIA bridge is something
> similar to single-word/multi-word DMA. The Compact Flash
> Specification does not specify any of these for PCMCIA. Still some
> vendors could possibly implement it...

I actually have burst DMA working on the PXA PCMCIA interface.  I've actually
had transfers of >8MiB/s with a CF card although I was overclocking IO, rather
than using MMIO due to my inability to get it to deliver interrupts as I
mentioned previously...  I really need to have another look at that! 
> 


Steve


	
	
		
___________________________________________________________ 
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 


From piotras at gmail.com  Fri Apr  6 04:34:22 2007
From: piotras at gmail.com (Piotras)
Date: Fri, 6 Apr 2007 09:34:22 +0100
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <926447.11173.qm@web25006.mail.ukl.yahoo.com>
References: <da6318370704051510l6a987d18t38614fb2feb33d94@mail.gmail.com>
	<926447.11173.qm@web25006.mail.ukl.yahoo.com>
Message-ID: <da6318370704060134i4abf6d3frd21ccc79d04b2ec6@mail.gmail.com>

Am I correct to assume that the PXA DMA engine is using
DMA signaling on the PCMCIA bus? Do you use WIN_READDMA*/
WIN_WRITEDMA* commands to access the CF card?

Could you provide the details of your CF card?


Thanks,

Piotr


On 4/5/07, Steven Newbury <s_j_newbury at yahoo.co.uk> wrote:
>
> --- Piotras <piotras at gmail.com> wrote:
>
> > Hi Steve,
> >
> > Thanks for your replay.
> >
> > My device supports 250ns cycle (according to CIS). I set it up
> > for MMIO (PCMCIA) using the Thomas Kleffel's patch and verified
> > the settings of the window registers in PCMCIA bridge. The
> > measured throughput for reading from the CF does not exceed 2MB/s.
> >
> > I verified the actual time for MMIO reads from data register
> > by the CPU. The average time for reading 16-bits word is about
> > 1us (it's consistent with the throughput). When I was changing
> > the cycle timing, the measured time for reads changed accordingly
> > (~750ns + cycle time). I cannot verify what causes this ~750ns
> > delay. Maybe it's the propagation delay introduced by the two
> > bridges (CPU-PCI and PCI-PCMCIA). If it would be the case, the
> > DMA by PCMCIA bridge could give significant improvement.
> >
> > After I send the previous email I realized that the PCMCIA bridge
> > datasheet is older then ATA specification that introduced UDMA.
> > I think that the DMA supported by the PCMCIA bridge is something
> > similar to single-word/multi-word DMA. The Compact Flash
> > Specification does not specify any of these for PCMCIA. Still some
> > vendors could possibly implement it...
>
> I actually have burst DMA working on the PXA PCMCIA interface.  I've actually
> had transfers of >8MiB/s with a CF card although I was overclocking IO, rather
> than using MMIO due to my inability to get it to deliver interrupts as I
> mentioned previously...  I really need to have another look at that!
> >
>
>
> Steve


From s_j_newbury at yahoo.co.uk  Fri Apr  6 12:56:42 2007
From: s_j_newbury at yahoo.co.uk (Steven Newbury)
Date: Fri, 6 Apr 2007 17:56:42 +0100 (BST)
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <da6318370704060134i4abf6d3frd21ccc79d04b2ec6@mail.gmail.com>
Message-ID: <354049.31382.qm@web25014.mail.ukl.yahoo.com>


--- Piotras <piotras at gmail.com> wrote:

> Am I correct to assume that the PXA DMA engine is using
> DMA signaling on the PCMCIA bus? Do you use WIN_READDMA*/
> WIN_WRITEDMA* commands to access the CF card?
> 
> Could you provide the details of your CF card?
> 
The former, the PXA DMA engine is very flexible.  The card is initialised
normally and then subsequent IO requests are sent and recieved in mutli-byte
bursts over the bus.  The CF card just operates normally.  Similar performance
can be achieved by using multi-sector IDE transers if your CF card supports it
although with more CPU load.

I've attached a patch that is also integrated with Thomas' MMIO patch although
as I said I couldn't get it going unfortunately.

By the way I didn't originally write the PXA PIODMA patch I just cleaned it up
and fixed a few bugs, and I'm not sure who did.  I got it from Richard Purdie's
archive in the tosort directory, it was part of a larger somewhat broken patch
tof random local changes that somebody had sent to Richard.  He may remember
who it was...

Steve

[Yahoo mail isn't letting me send with attachments I'll try sending it again
later if you're interested in taking a look]

Steve


		
___________________________________________________________ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html


From s_j_newbury at yahoo.co.uk  Fri Apr  6 12:52:18 2007
From: s_j_newbury at yahoo.co.uk (Steven Newbury)
Date: Fri, 6 Apr 2007 17:52:18 +0100 (BST)
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <da6318370704060134i4abf6d3frd21ccc79d04b2ec6@mail.gmail.com>
Message-ID: <725691.19018.qm@web25004.mail.ukl.yahoo.com>


--- Piotras <piotras at gmail.com> wrote:

> Am I correct to assume that the PXA DMA engine is using
> DMA signaling on the PCMCIA bus? Do you use WIN_READDMA*/
> WIN_WRITEDMA* commands to access the CF card?
> 
> Could you provide the details of your CF card?
> 
The former, the PXA DMA engine is very flexible.  The card is initialised
normally and then subsequent IO requests are sent and recieved in mutli-byte
bursts over the bus.  The CF card just operates normally.  Similar performance
can be achieved by using multi-sector IDE transers if your CF card supports it
although with more CPU load.

I've attached a patch that is also integrated with Thomas' MMIO patch although
as I said I couldn't get it going unfortunately.

By the way I didn't originally write the PXA PIODMA patch I just cleaned it up
and fixed a few bugs, and I'm not sure who did.  I got it from Richard Purdie's
archive in the tosort directory, it was part of a larger somewhat broken patch
tof random local changes that somebody had sent to Richard.  He may remember
who it was...

Steve


		
___________________________________________________________ 
Now you can have your favourite RSS headlines come to you with the all new Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: piodma-r2.patch
Type: application/octet-stream
Size: 25411 bytes
Desc: 4000806450-piodma-r2.patch
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20070406/be2bda60/attachment-0001.obj 

From s_j_newbury at yahoo.co.uk  Fri Apr  6 12:54:42 2007
From: s_j_newbury at yahoo.co.uk (Steven Newbury)
Date: Fri, 6 Apr 2007 17:54:42 +0100 (BST)
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <da6318370704060134i4abf6d3frd21ccc79d04b2ec6@mail.gmail.com>
Message-ID: <91368.68563.qm@web25011.mail.ukl.yahoo.com>


--- Piotras <piotras at gmail.com> wrote:

> Am I correct to assume that the PXA DMA engine is using
> DMA signaling on the PCMCIA bus? Do you use WIN_READDMA*/
> WIN_WRITEDMA* commands to access the CF card?
> 
> Could you provide the details of your CF card?
> 
The former, the PXA DMA engine is very flexible.  The card is initialised
normally and then subsequent IO requests are sent and recieved in mutli-byte
bursts over the bus.  The CF card just operates normally.  Similar performance
can be achieved by using multi-sector IDE transers if your CF card supports it
although with more CPU load.

I've attached a patch that is also integrated with Thomas' MMIO patch although
as I said I couldn't get it going unfortunately.

By the way I didn't originally write the PXA PIODMA patch I just cleaned it up
and fixed a few bugs, and I'm not sure who did.  I got it from Richard Purdie's
archive in the tosort directory, it was part of a larger somewhat broken patch
tof random local changes that somebody had sent to Richard.  He may remember
who it was...

Steve


	
	
		
___________________________________________________________ 
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at
the Yahoo! Mail Championships. Plus: play games and win prizes. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 

Steve


	
	
		
___________________________________________________________ 
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: piodma-r2.patch
Type: text/x-patch
Size: 25411 bytes
Desc: 4000806450-piodma-r2.patch
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20070406/19af33c5/attachment.bin 

From s_j_newbury at yahoo.co.uk  Fri Apr  6 12:56:34 2007
From: s_j_newbury at yahoo.co.uk (Steven Newbury)
Date: Fri, 6 Apr 2007 17:56:34 +0100 (BST)
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <da6318370704060134i4abf6d3frd21ccc79d04b2ec6@mail.gmail.com>
Message-ID: <371914.80491.qm@web25001.mail.ukl.yahoo.com>


--- Piotras <piotras at gmail.com> wrote:

> Am I correct to assume that the PXA DMA engine is using
> DMA signaling on the PCMCIA bus? Do you use WIN_READDMA*/
> WIN_WRITEDMA* commands to access the CF card?
> 
> Could you provide the details of your CF card?
> 
The former, the PXA DMA engine is very flexible.  The card is initialised
normally and then subsequent IO requests are sent and recieved in mutli-byte
bursts over the bus.  The CF card just operates normally.  Similar performance
can be achieved by using multi-sector IDE transers if your CF card supports it
although with more CPU load.

I've attached a patch that is also integrated with Thomas' MMIO patch although
as I said I couldn't get it going unfortunately.

By the way I didn't originally write the PXA PIODMA patch I just cleaned it up
and fixed a few bugs, and I'm not sure who did.  I got it from Richard Purdie's
archive in the tosort directory, it was part of a larger somewhat broken patch
tof random local changes that somebody had sent to Richard.  He may remember
who it was...

Steve

[Yahoo mail isn't letting me send with attachments I'll try sending it again
later if you're interested in taking a look]

Steve


		
___________________________________________________________ 
What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 


From s_j_newbury at yahoo.co.uk  Fri Apr  6 15:31:05 2007
From: s_j_newbury at yahoo.co.uk (Steven Newbury)
Date: Fri, 6 Apr 2007 20:31:05 +0100 (BST)
Subject: UDMA for Compact Flash over PC Card?
In-Reply-To: <354049.31382.qm@web25014.mail.ukl.yahoo.com>
Message-ID: <780908.21904.qm@web25011.mail.ukl.yahoo.com>

Sorry about the multiple posts, Yahoo Mail is playing up.  It claimed it hadn't
sent at all!

Steve


		
___________________________________________________________ 
What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 


From michaelzwrk at gmail.com  Sun Apr  8 02:38:51 2007
From: michaelzwrk at gmail.com (Michael)
Date: Sun, 8 Apr 2007 08:38:51 +0200
Subject: Looking for a driver for Compact Flash access
In-Reply-To: <20070405165651.15107.qmail@cdy.org>
References: <1ea6be8e0704050807k1c357870sf14f754a1da89c49@mail.gmail.com>
	<20070405165307.14568.qmail@cdy.org>
	<20070405165651.15107.qmail@cdy.org>
Message-ID: <1ea6be8e0704072338p7203d37ag5eab099b68faf5cf@mail.gmail.com>

Thanks, Peter.

Is connecting a CF directly to the local bus an unusual practice?
Would it be significantly easier to connect the CF in IO mode, or in
true IDE mode?

Also, using memory mode, what drivers should I consider for using with
minimal adaptation - is it just ide-ata?

Thanks again,
                      Michael

On 4/5/07, Peter Stuge <stuge-linux-pcmcia at cdy.org> wrote:
> On Thu, Apr 05, 2007 at 06:53:07PM +0200, Peter Stuge wrote:
> > But none of this really applies to you because you have an IDE
> > device connected to a local bus instead of an IDE controller. I
> > think the linux-ide developers could help you better.
>
> Or possibly linux-mtd of course.
>
>
> //Peter
>
> _______________________________________________
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia
>


From swisslotto at swisslotto.ch  Mon Apr  9 05:13:43 2007
From: swisslotto at swisslotto.ch (SWISS LOTTO)
Date: Mon, 9 Apr 2007 11:13:43 +0200
Subject: CONGRATULATIONS!!!.....YOU HAVE WON &#8364;750,000 Euros....
Message-ID: <200704090913.l399Dhbf009827@mammoth.domenca.com>

SWISS LOTTO UK.
P O Box 1010 
Liverpool, L70 1NL 
UNITED KINGDOM 
https://www.swisslotto.ch 
    
     CONGRATULATIONS!!!.....YOU HAVE WON &#8364;750,000 Euros

You have have been awarded &#8364;750,000 Euros in the SWISS-LOTTO Satellite software email lottery in which e-mail addresses are picked Randomly by software powered by the Internet through the worldwide website. 
Your email address was amongst those chosen this year for the SWISS LOTTO Satellite lottery. And this promo is proudly sponsored by the SWISS-LOTTO UK organization. 
You can log on to our website for more information concerning our entire lottery promo https://www.swisslotto.ch .

Your email address,attached to Ref number 5, 7, 14, 17,18, 43 with Serial number 1979-12 drew the lucky Numbers 10, and consequently won the lottery in the "A" Category.
You have therefore been approved for a lump sum pay out of &#8364;750,000 Euros 
Please note that your lucky winning number falls within our European Booklet representative office in Europe as indicated in your play coupon. 

In View of this, your &#8364;750,000 Euros will be released to you by our security firm in Europe. Our European agent will immediately commence the process to facilitate the release of your funds as soon as you contact them.
All participants Were selected randomly from World Wide Web site through computer draw System and extracted from over 300,000 companies and individual email addresses.

This promotion takes place annually. For security reasons, you are advised to keep your winning information confidential till your claims is processed and your money remitted to you in whatever manner you deem fit to Claim your prize. This is part of our precautionary measure to avoid double claiming and unwarranted abuse of this program by some unscrupulous elements. 
To file for your claim, please contact our fiduciary agent:
Mr. Aron Baker,

Email:swisslottoclaimsagent06 at yahoo.co.uk 
Tel: +44 704 010 1519
Provide him with the information below:
1.Name:
2.Address:
3.Marital Status:
4.Occupation:
5.Age:
6.Sex:
7.Nationality:
8.Country Of Residence:
9.Telephone Number:
10.Fax Number:
11.Draw Number above:
 
This information facilitate the due process of the release of winnings avoid unnecessary delays and complications in the processing of your winnings. 
Always remember to quote your Reference / serial number in any correspondences with us or our Designated agent. 
 
Congratulations once more from all members and staff of This program and Thank you for being part of our promotional lottery program. 
 
Sincerely, 
Sharon Cole
Co-ordinator 
SWISS LOTTO UK.
P O Box 1010 
Liverpool, L70 1NL 
UNITED KINGDOM
https://www.swisslotto.ch
 
N:B - PLEASE NOTE THAT ALL CORRESPONDENT WILL BE TEMPORARILY BE VIA EMAIL UNTIL 24 HOURS BEFORE PAY-OUT THEN YOU WILL BE NOTIFIED VIA TELEPHONE






From marc at nocares.com  Mon Apr  9 21:20:41 2007
From: marc at nocares.com (Marc)
Date: Mon, 09 Apr 2007 21:20:41 -0400
Subject: PCMCIA IRQ problems on 2.4.34
Message-ID: <461AE669.40002@nocares.com>

I'm trying to get an AT&T Plug-n-Share 6700G 802.11g cardbus card 
working on my old Thinkpad 760XD.  I'm currently running Vector Linux 
5.8 Std.  The 2.6.18 kernel it came with would not recognize the card at 
all, so I built my own 2.4.34 kernel.  Now the card shows up in lspci, 
but I'm having problems getting an IRQ assigned to it.  Does anyone know 
the magic kernel options, boot options, or other configuration settings 
that will get my wireless card working?  Any help would be greatly 
appreciated!!!!

I've included the output from "uname -a", "dmesg", and "lspci -vv" below. 

Thanks in advance,

Marc

uname -a
=======
Linux vector.linux.net 2.4.34 #3 SMP Fri Apr 6 21:00:15 EDT 2007 i586 
pentium-mmx i386 GNU/Linux

dmesg
=====

Linux version 2.4.34 (root at vector.linux.net) (gcc version 3.4.6) #3 SMP 
Fri Apr 6 21:00:15 EDT 2007
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 0000000006800000 (usable)
 BIOS-e820: 00000000fffe0000 - 0000000100000000 (reserved)
104MB LOWMEM available.
On node 0 totalpages: 26624
zone(0): 4096 pages.
zone(1): 22528 pages.
zone(2): 0 pages.
DMI not present.
ACPI: Unable to locate RSDP
Kernel command line: BOOT_IMAGE=linux2.4.34 ro root=302 pnpbios=off 
pci=noacpi,routeirq,biosirq
PCI: Unknown option `routeirq'
No local APIC present or hardware disabled
Initializing CPU#0
Detected 165.792 MHz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 330.95 BogoMIPS
Memory: 102088k/106496k available (1737k kernel code, 4020k reserved, 
532k data, 120k init, 0k highmem)
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode cache hash table entries: 8192 (order: 4, 65536 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 32768 (order: 5, 131072 bytes)
Intel Pentium with F0 0F bug - workaround enabled.
CPU:     After generic, caps: 008001bf 00000000 00000000 00000000
CPU:             Common caps: 008001bf 00000000 00000000 00000000
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
CPU:     After generic, caps: 008001bf 00000000 00000000 00000000
CPU:             Common caps: 008001bf 00000000 00000000 00000000
CPU0: Intel Pentium MMX stepping 04
per-CPU timeslice cutoff: 159.86 usecs.
SMP motherboard not detected.
Local APIC not detected. Using dummy APIC emulation.
Waiting on wait_init_idle (map = 0x0)
All processors have done init_idle
ACPI: Subsystem revision 20040326
ACPI: Interpreter disabled.
PCI: PCI BIOS revision 2.10 entry at 0xfd930, last bus=6
PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
PCI: Using BIOS Interrupt Routing Table
PCI: Using BIOS for IRQ routing
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Installing knfsd (copyright (C) 1996 okir at monad.swb.de).
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ 
SERIAL_PCI ISAPNP enabled
Floppy drive(s): fd0 is 1.44M
FDC 0 is a National Semiconductor PC87306
Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 70M
agpgart: no supported devices found.
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
PIIXa: IDE controller at PCI slot 00:01.0
PIIXa: chipset revision 2
PIIXa: not 100% native mode: will probe irqs later
PIIXa: neither IDE port enabled (BIOS)
hda: IBM-DLGA-23080, ATA DISK drive
hdb: SANYO CRD-S58P, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: attached ide-disk driver.
hda: 6015744 sectors (3080 MB) w/96KiB Cache, CHS=746/128/63
hdb: attached ide-cdrom driver.
hdb: ATAPI 8X CD-ROM drive, 256kB Cache
Uniform CD-ROM driver Revision: 3.12
Partition check:
 hda: hda1 hda2 hda3
Linux Kernel Card Services 3.1.22
  options:  [pci] [cardbus] [pm]
PCI: No IRQ known for interrupt pin A of device 00:02.0.
PCI: No IRQ known for interrupt pin B of device 00:02.1.
Intel ISA PCIC probe: not found.
usb.c: registered new driver hub
Yenta ISA IRQ mask 0x06b8, PCI irq 0
Socket status: 30000006
Yenta ISA IRQ mask 0x06b8, PCI irq 0
Socket status: 30000020
host/uhci.c: USB Universal Host Controller Interface driver v1.1
Initializing Cryptographic API
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 8192 bind 8192)
IPv4 over IPv4 tunneling driver
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
cs: cb_alloc(bus 4): vendor 0x168c, device 0x0013
PCI: Enabling device 04:00.0 (0000 -> 0002)
PCI: No IRQ known for interrupt pin A of device 04:00.0.
FAT: bogus logical sector size 8455
FAT: bogus logical sector size 8455
reiserfs: found format "3.6" with standard journal
reiserfs: checking transaction log (device ide0(3,2)) ...
for (ide0(3,2))
ide0(3,2):Using r5 hash to sort names
VFS: Mounted root (reiserfs filesystem) readonly.
Freeing unused kernel memory: 120k freed
Adding Swap: 499928k swap-space (priority -1)
reiserfs: found format "3.6" with standard journal
reiserfs: checking transaction log (device ide0(3,3)) ...
for (ide0(3,3))
ide0(3,3):Using r5 hash to sort names
ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
wlan: 0.8.4.2 (0.9.3)
ath_pci: 0.9.4.5 (0.9.3)
PCI: No IRQ known for interrupt pin A of device 04:00.0.
wifi%d: request_irq failed


lspci -vv
======
00:00.0 Host bridge: Intel Corporation 430MX - 82437MX Mob. System Ctrlr 
(MTSC) & 82438MX Data Path (MTDP) (rev 02)
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort+ >SERR- <PERR-
        Latency: 32

00:01.0 ISA bridge: Intel Corporation 82371FB PIIX ISA [Triton I] (rev 02)
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 0

00:02.0 CardBus bridge: Texas Instruments PCI1130 (rev 04)
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 168, Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 0
        Region 0: Memory at 10812000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=01, subordinate=03, sec-latency=176
        Memory window 0: 10000000-103ff000 (prefetchable)
        Memory window 1: 10400000-107ff000
        I/O window 0: 00004000-000040ff
        I/O window 1: 00004400-000044ff
        BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt- 
PostWrite+
        16-bit legacy interface ports at 0001

00:02.1 CardBus bridge: Texas Instruments PCI1130 (rev 04)
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 168, Cache Line Size: 32 bytes
        Interrupt: pin B routed to IRQ 0
        Region 0: Memory at 10811000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=04, subordinate=06, sec-latency=176
        Memory window 0: 10c00000-10fff000 (prefetchable)
        Memory window 1: 11000000-113ff000
        I/O window 0: 00004800-000048ff
        I/O window 1: 00004c00-00004cff
        BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset- 16bInt+ 
PostWrite+
        16-bit legacy interface ports at 0001

00:03.0 VGA compatible controller: Trident Microsystems TGUI 
9660/938x/968x (rev d3) (prog-if 00 [VGA])
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Interrupt: pin A routed to IRQ 11
        Region 0: Memory at 08000000 (32-bit, non-prefetchable) [size=4M]
        Region 1: Memory at 08400000 (32-bit, non-prefetchable) [size=64K]
        Region 2: Memory at 08800000 (32-bit, non-prefetchable) [size=4M]
        Expansion ROM at 000c0000 [disabled] [size=64K]

00:05.0 Multimedia video controller: IBM MPEG PCI Bridge (rev 01)
        Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR+ FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Interrupt: pin A routed to IRQ 11
        Region 0: Memory at 10810000 (32-bit, non-prefetchable) [size=256]

04:00.0 Ethernet controller: Atheros Communications, Inc. AR5212 
802.11abg NIC (rev 01)
        Subsystem: Unknown device 18a3:0427
        Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Interrupt: pin A routed to IRQ 0
        Region 0: Memory at 11000000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [44] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=2 PME-



From stuge-linux-pcmcia at cdy.org  Tue Apr 10 01:14:02 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Tue, 10 Apr 2007 07:14:02 +0200
Subject: PCMCIA IRQ problems on 2.4.34
In-Reply-To: <461AE669.40002@nocares.com>
References: <461AE669.40002@nocares.com>
Message-ID: <20070410051402.19844.qmail@cdy.org>

On Mon, Apr 09, 2007 at 09:20:41PM -0400, Marc wrote:
> but I'm having problems getting an IRQ assigned to it.  Does anyone
> know the magic kernel options, boot options

> Linux Kernel Card Services 3.1.22
>   options:  [pci] [cardbus] [pm]
> PCI: No IRQ known for interrupt pin A of device 00:02.0.
> PCI: No IRQ known for interrupt pin B of device 00:02.1.

This is bad.


> Yenta ISA IRQ mask 0x06b8, PCI irq 0

irq 0, it can not work.


> cs: cb_alloc(bus 4): vendor 0x168c, device 0x0013
> PCI: Enabling device 04:00.0 (0000 -> 0002)
> PCI: No IRQ known for interrupt pin A of device 04:00.0.

Again, bad.


Check /usr/src/linux/Documentation/kernel-parameters.txt and look for
anything named irq. Here are some suggestions:

acpi=noirq
irqpoll
pci=biosirq
pci=usepirqmask
pci=routeirq

Check for success by reviewing dmesg and confirming that devices do
get valid IRQs assigned. You can also confirm this with:

cat /proc/interrupts

There you'll also see if interrupts actually arrive as they should.


//Peter


From jengelh at linux01.gwdg.de  Tue Apr 10 17:41:18 2007
From: jengelh at linux01.gwdg.de (Jan Engelhardt)
Date: Tue, 10 Apr 2007 23:41:18 +0200 (MEST)
Subject: [PATCH 27/30] Use menuconfig objects - PCMCIA
In-Reply-To: <Pine.LNX.4.61.0704102046520.32056@yvahk01.tjqt.qr>
References: <Pine.LNX.4.61.0704102046520.32056@yvahk01.tjqt.qr>
Message-ID: <Pine.LNX.4.61.0704102340370.32056@yvahk01.tjqt.qr>


Use menuconfigs instead of menus, so the whole menu can be disabled at        
once instead of going through all options.

Signed-off-by: Jan Engelhardt <jengelh at gmx.de>

Index: linux-2.6.21-rc5/drivers/pcmcia/Kconfig
===================================================================
--- linux-2.6.21-rc5.orig/drivers/pcmcia/Kconfig
+++ linux-2.6.21-rc5/drivers/pcmcia/Kconfig
@@ -2,9 +2,7 @@
 # PCCARD (PCMCIA/CardBus) bus subsystem configuration
 #
 
-menu "PCCARD (PCMCIA/CardBus) support"
-
-config PCCARD
+menuconfig PCCARD
 	tristate "PCCard (PCMCIA/CardBus) support"
 	depends on HOTPLUG
 	---help---
@@ -277,5 +275,3 @@ config PCCARD_IODYN
 	bool
 
 endif	# PCCARD
-
-endmenu
#<EOF>


From bugme-daemon at bugzilla.kernel.org  Wed Apr 11 12:28:58 2007
From: bugme-daemon at bugzilla.kernel.org (bugme-daemon at bugzilla.kernel.org)
Date: Wed, 11 Apr 2007 09:28:58 -0700
Subject: [Bug 7264] Yenta TI - irq 11 nobody cared
Message-ID: <200704111628.l3BGSwHR013422@fire-2.osdl.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7264





------- Additional Comments From goldenfish at bsys.cz  2007-04-11 09:28 -------
Created an attachment (id=11126)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=11126&action=view)
data from thinkpad dsdt tables parsed with grep -a C077 

Look for url at comment #8 and this text attachment.

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


From michaelzwrk at gmail.com  Wed Apr 11 13:04:43 2007
From: michaelzwrk at gmail.com (Michael)
Date: Wed, 11 Apr 2007 19:04:43 +0200
Subject: using PCMCIA driver for CF access
Message-ID: <1ea6be8e0704111004m26f51f1dw3f72a9a1b526a7b2@mail.gmail.com>

Hi.
I have a CF connected in PC Card ATA compatible IO mode.
It is connected directly to the host local bus.
The CPU is MPC8541 PowerQUICC III.

I'd like to use PCMCIA driver (ide-cs) to access the CF.
I expect to need minimal changes there:
- skipping reading the CIS and performing controller configuration - I
don't need it, I just need the ATA - conformant access.
- There is all the hotplug support thing that I obviously won't use,
but it shouldn't do any harm.

Are those reasonable assumptions, or I'm missing something here?

Thanks a lot.


From stuge-linux-pcmcia at cdy.org  Wed Apr 11 18:04:45 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Thu, 12 Apr 2007 00:04:45 +0200
Subject: using PCMCIA driver for CF access
In-Reply-To: <1ea6be8e0704111004m26f51f1dw3f72a9a1b526a7b2@mail.gmail.com>
References: <1ea6be8e0704111004m26f51f1dw3f72a9a1b526a7b2@mail.gmail.com>
Message-ID: <20070411220445.17886.qmail@cdy.org>

On Wed, Apr 11, 2007 at 07:04:43PM +0200, Michael wrote:
> I have a CF connected in PC Card ATA compatible IO mode.
> It is connected directly to the host local bus.
> The CPU is MPC8541 PowerQUICC III.
> 
> I'd like to use PCMCIA driver (ide-cs) to access the CF.

I still don't understand why you want to PCMCIA drivers when you have
no PCMCIA or Cardbus controller.

I think the regular ATA drivers or even linux-mtd (Memory Technology
Devices) drivers would be a better fit.


//Peter


From michaelzwrk at gmail.com  Thu Apr 12 02:46:35 2007
From: michaelzwrk at gmail.com (Michael)
Date: Thu, 12 Apr 2007 08:46:35 +0200
Subject: using PCMCIA driver for CF access
In-Reply-To: <20070411220445.17886.qmail@cdy.org>
References: <1ea6be8e0704111004m26f51f1dw3f72a9a1b526a7b2@mail.gmail.com>
	<20070411220445.17886.qmail@cdy.org>
Message-ID: <1ea6be8e0704112346k4f34e731l50f74518b3176d29@mail.gmail.com>

Hi.
It's a long story:
The reason is the HW configuration of the board I have.
The CF is connected to the host bus in memory mode.
In this mode, the CF does not issue interrupts, and utilizing the IDE
code in its current state to work in polling mode is a significant
effort.
We could enable the interrupts in PC Card ATA IO mode, but not in TRUE IDE mode.
The interface in PC Card ATA mode is, well, PC Card ATA (PCMCIA) compatible.
This make PCMCIA driver a natural choice - though it has
extra-capabilities I won't use (and probably will have to disable).
That's about it.

/Michael

On 4/12/07, Peter Stuge <stuge-linux-pcmcia at cdy.org> wrote:
> On Wed, Apr 11, 2007 at 07:04:43PM +0200, Michael wrote:
> > I have a CF connected in PC Card ATA compatible IO mode.
> > It is connected directly to the host local bus.
> > The CPU is MPC8541 PowerQUICC III.
> >
> > I'd like to use PCMCIA driver (ide-cs) to access the CF.
>
> I still don't understand why you want to PCMCIA drivers when you have
> no PCMCIA or Cardbus controller.
>
> I think the regular ATA drivers or even linux-mtd (Memory Technology
> Devices) drivers would be a better fit.
>
>
> //Peter
>
> _______________________________________________
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia
>


From zaitcev at redhat.com  Fri Apr 13 21:57:28 2007
From: zaitcev at redhat.com (Pete Zaitcev)
Date: Fri, 13 Apr 2007 18:57:28 -0700
Subject: if (!pcibios_assign_all_busses()) in parent fixup
Message-ID: <20070413185728.fbbb50b4.zaitcev@redhat.com>

Hi, Dominik:

Hope you're the right person to ask. I am wondering if this check is
really necessary:

static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
{
	struct pci_bus *parent = child->parent;

	/* Attempts to fix that up are really dangerous unless
	   we're going to re-assign all bus numbers. */
	if (!pcibios_assign_all_busses())
		return;
......

The problem is, Jay (on cc:) apparently has a laptop where a fixup is
necessary, and he would like to run it without pci=assign_buses
(have I got it right?).

This is what happens normally (actually, a current backport from
mainline to our 2.6.9 codebase, but same logic):

[root at postoak]# lspci -v | grep sub
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	Bus: primary=00, secondary=0a, subordinate=0a, sec-latency=32
	Bus: primary=0a, secondary=0b, subordinate=0e, sec-latency=176

Obviously the second subordinate 0x0a is too small. With the check
removed, Cardbus works:

[root at pinoak]# lspci -v |grep sub
       Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
       Bus: primary=00, secondary=0a, subordinate=0e, sec-latency=32
       Bus: primary=0a, secondary=0b, subordinate=0e, sec-latency=176

I thought about this, and perhaps Jay is right. If we see such a blatant
problem, there's no other way but force the subordinate number, right?

-- Pete

P.S. I'm adding Kristen because apparently she was poking at bus
numbers last.


From lucky854963 at 126.com  Sun Apr 15 05:27:21 2007
From: lucky854963 at 126.com (lucky854963 at 126.com)
Date: Sun, 15 Apr 2007 09:27:21 -0000
Subject: =?ISO-2022-JP?B?kKuXfoK+gq+CzY5+gt+C54LqgsiCojQwjc6IyI/jgsyCqILOgrOC8ZJC=?=
Message-ID: <20020511172612.28351@126.com>


****************************************************

???T?C?g??40???`50???????????W?????????????l???E?n??

???W???????{?????????????W?R?~?
?j?e?B?[?T?C?g?????B

****************************************************



?s?????p?????????????????t-------------------------------



?T?@?????p???j??????40???????????????????????????????B



?U?@?j???????????????v?????????????????W?????????B



?V?@?z?e???????????????????????????????????B





?s?????p???@?????????t-----------------------------------



?T?@?????]???n???E???[???A?h???X?E?p?X???[?h???????????????????B



?U?@???????P??????PR???????????????????B



?V?@???????W?????]?????????????????????????????B



?W?@?????p???????????l???E?n?????????S??????PR?????g??????????

?@?@???A?h???X???\???????????????????????????_?????????A????

?@?@???????????????\???????A?T?C?g?????????[???????A????????

?@?@???????\???????????D?????A?????@?????????????????B



?y?????z????PR?????A???????\?????????l???E?n????????

?@?@?@?@???????????????????W???????????A???????\????

?@?@?@?@???????A???x?????????????v???????B



**************************************************************

???{???A?n?????l???E?n???????????W?????]??????40?????????j????

?@http://cjbjj.com:112/ddd/hito-ot-f-sp/



???{???A?????????????????????~????40??????????????

?@http://cjbjj.com:112/ddd/hito-ot-f-sp/

**************************************************************

?????????????????????A???^?C?????????????m?F????????????

?@???o?C???i?g???d?b?j???????????I?X?X???v???????B

**************************************************************






From brian-list at walsh.ws  Mon Apr 16 00:54:58 2007
From: brian-list at walsh.ws (Brian Walsh)
Date: Mon, 16 Apr 2007 00:54:58 -0400
Subject: PCMCIA wireless CDMA card
Message-ID: <462301A2.1020003@walsh.ws>

I have a CDMA wireless card which I am trying to bring up.  However it does
not seem to be responding properly.  When trying to minicom to the device
to get an AT response I just get a bunch of garbage in the terminal
suggesting to me that it is not talking at a valid baud rate.

I have seen others on the list having similar problems with this card type.
 Has anyone had any luck with it?

I enabled debugging in the serial driver to try and get as much relevant
information as needed.  If any other information is needed please ask.

Thanks
Brian


-bash-2.05b# pccardctl insert 0
pccard: PCMCIA card inserted into slot 0
pcmcia: registering new device pcmcia0.0
pcmcia: request for exclusive IRQ could not be fulfilled.
pcmcia: the driver needs updating to supported shared IRQ lines.
ttyS2: autoconf (0x03e8, 0x00000000): iir=3 EFRv2 950id=16:c9:50:08
<4>ttyS2: detected caps 00000700 should be 00000100 type=16C950/954
0.0: ttyS2 at I/O 0x3e8 (irq = 23) is a 16C950/954

-bash-2.05b# pccardctl status 0
  5.0V 16-bit PC Card
  Subdevice 0 (function 0) bound to driver "serial_cs"

-bash-2.05b# pccardctl ident 0
  product info: "CDMA", "CARD_A", "", ""
  manfid: 0x0279, 0x950b
  function: 2 (serial)

-bash-2.05b# pccardctl info 0
PRODID_1="CDMA"
PRODID_2="CARD_A"
PRODID_3=""
PRODID_4=""
MANFID=0279,950b
FUNCID=2



From vignesh.babu at wipro.com  Mon Apr 16 02:05:47 2007
From: vignesh.babu at wipro.com (vignesh.babu at wipro.com)
Date: Mon, 16 Apr 2007 11:35:47 +0530
Subject: [KJ][PATCH]ibmtr_cs.c-kzalloc
Message-ID: <1176703547.13066.14.camel@wriver-t81fb058.linuxcoe>


Replacing kmalloc/memset combination with kzalloc.

Signed-off-by: vignesh babu <vignesh.babu at wipro.com>
---
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 1060154..fbdbd57 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -146,9 +146,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
     DEBUG(0, "ibmtr_attach()\n");
 
     /* Create new token-ring device */
-    info = kmalloc(sizeof(*info), GFP_KERNEL); 
+    info = kzalloc(sizeof(*info), GFP_KERNEL); 
     if (!info) return -ENOMEM;
-    memset(info,0,sizeof(*info));
     dev = alloc_trdev(sizeof(struct tok_info));
     if (!dev) {
 	kfree(info);
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index 7580bde..ece59ca 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -641,14 +641,14 @@ static int xl_open(struct net_device *dev)
 	 * Now to set up the Rx and Tx buffer structures
 	 */
 	/* These MUST be on 8 byte boundaries */
-	xl_priv->xl_tx_ring = kmalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL) ; 
+	xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL) ; 
 	if (xl_priv->xl_tx_ring == NULL) {
 		printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
 				     dev->name);
 		free_irq(dev->irq,dev);
 		return -ENOMEM;
 	}
-	xl_priv->xl_rx_ring = kmalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL) ; 
+	xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL) ; 
 	if (xl_priv->xl_tx_ring == NULL) {
 		printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
 				     dev->name);
@@ -656,8 +656,6 @@ static int xl_open(struct net_device *dev)
 		kfree(xl_priv->xl_tx_ring);
 		return -ENOMEM;
 	}
-	memset(xl_priv->xl_tx_ring,0,sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) ; 
-	memset(xl_priv->xl_rx_ring,0,sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) ; 
 
 	 /* Setup Rx Ring */
 	 for (i=0 ; i < XL_RX_RING_SIZE ; i++) { 

-- 
Regards,  
Vignesh Babu BM  
_____________________________________________________________  
"Why is it that every time I'm with you, makes me believe in magic?"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3173 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20070416/e40428ac/attachment.bin 

From kristen.c.accardi at intel.com  Tue Apr 17 13:29:20 2007
From: kristen.c.accardi at intel.com (Kristen Carlson Accardi)
Date: Tue, 17 Apr 2007 10:29:20 -0700
Subject: if (!pcibios_assign_all_busses()) in parent fixup
In-Reply-To: <20070413185728.fbbb50b4.zaitcev@redhat.com>
References: <20070413185728.fbbb50b4.zaitcev@redhat.com>
Message-ID: <20070417102920.5e71a3a7.kristen.c.accardi@intel.com>

On Fri, 13 Apr 2007 18:57:28 -0700
Pete Zaitcev <zaitcev at redhat.com> wrote:

> Hi, Dominik:
> 
> Hope you're the right person to ask. I am wondering if this check is
> really necessary:
> 
> static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
> {
> 	struct pci_bus *parent = child->parent;
> 
> 	/* Attempts to fix that up are really dangerous unless
> 	   we're going to re-assign all bus numbers. */
> 	if (!pcibios_assign_all_busses())
> 		return;
> ......
> 
> The problem is, Jay (on cc:) apparently has a laptop where a fixup is
> necessary, and he would like to run it without pci=assign_buses
> (have I got it right?).
> 
> This is what happens normally (actually, a current backport from
> mainline to our 2.6.9 codebase, but same logic):
> 
> [root at postoak]# lspci -v | grep sub
> 	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
> 	Bus: primary=00, secondary=0a, subordinate=0a, sec-latency=32
> 	Bus: primary=0a, secondary=0b, subordinate=0e, sec-latency=176
> 
> Obviously the second subordinate 0x0a is too small. With the check
> removed, Cardbus works:
> 
> [root at pinoak]# lspci -v |grep sub
>        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>        Bus: primary=00, secondary=0a, subordinate=0e, sec-latency=32
>        Bus: primary=0a, secondary=0b, subordinate=0e, sec-latency=176
> 
> I thought about this, and perhaps Jay is right. If we see such a blatant
> problem, there's no other way but force the subordinate number, right?
> 
> -- Pete
> 
> P.S. I'm adding Kristen because apparently she was poking at bus
> numbers last.
> 

I have to agree that it's dangerous to fixup the subordinate number
if you aren't assigning all others - otherwise the bios may have assigned
some number within the secondary->subordinate range to some other bus,
which will really foul things up.  What would really be great would be if
you could detect such a problem and then determine that you need to assign
all the bus numbers manually and redo *everything*.  Not sure if that's 
possible though.  I think the real problem is the assumption that we can
just have 4 bus numbers under a cardbus bridge without assigning all bus
numbers ourselves- maybe we should be smarter about how we figure out how 
many we can have.


From zaitcev at redhat.com  Tue Apr 17 15:01:35 2007
From: zaitcev at redhat.com (Pete Zaitcev)
Date: Tue, 17 Apr 2007 12:01:35 -0700
Subject: if (!pcibios_assign_all_busses()) in parent fixup
In-Reply-To: <20070417102920.5e71a3a7.kristen.c.accardi@intel.com>
References: <20070413185728.fbbb50b4.zaitcev@redhat.com>
	<20070417102920.5e71a3a7.kristen.c.accardi@intel.com>
Message-ID: <20070417120135.1e14a7b6.zaitcev@redhat.com>

On Tue, 17 Apr 2007 10:29:20 -0700, Kristen Carlson Accardi <kristen.c.accardi at intel.com> wrote:

> > static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
> > {
> > 	/* Attempts to fix that up are really dangerous unless
> > 	   we're going to re-assign all bus numbers. */
> > 	if (!pcibios_assign_all_busses())
> > 		return;

> > I thought about this, and perhaps Jay is right. If we see such a blatant
> > problem, there's no other way but force the subordinate number, right?

> I have to agree that it's dangerous to fixup the subordinate number
> if you aren't assigning all others - otherwise the bios may have assigned
> some number within the secondary->subordinate range to some other bus,
> which will really foul things up.

So I suppose the next step is to identify affected Sager systems with
a DMI scan and set PCI_ASSIGN_ALL_BUSSES with a quirk. If that works
for Disney, would it be acceptable for mainline (until the time when
something is done about 4-bus assumption)?

-- Pete


From ml at hboeck.de  Tue Apr 17 20:34:33 2007
From: ml at hboeck.de (Hanno =?utf-8?q?B=C3=B6ck?=)
Date: Wed, 18 Apr 2007 02:34:33 +0200
Subject: pcmciautils new version?
Message-ID: <200704180234.33325.ml@hboeck.de>

Hi,

There hasn't been a pcmciautils-version for quite a long time. There should be 
at least one minor fix for a warning with later udev versions which made it 
into git.

Can anyone bump a new release of pcmciautils?

-- 
Hanno B?ck		Blog:   http://www.hboeck.de/
GPG: 3DBD3B20		Jabber: jabber at hboeck.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20070418/01b8dbce/attachment.bin 

From stuge-linux-pcmcia at cdy.org  Tue Apr 17 21:45:45 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Wed, 18 Apr 2007 03:45:45 +0200
Subject: using PCMCIA driver for CF access
In-Reply-To: <1ea6be8e0704112346k4f34e731l50f74518b3176d29@mail.gmail.com>
References: <1ea6be8e0704111004m26f51f1dw3f72a9a1b526a7b2@mail.gmail.com>
	<20070411220445.17886.qmail@cdy.org>
	<1ea6be8e0704112346k4f34e731l50f74518b3176d29@mail.gmail.com>
Message-ID: <20070418014545.4038.qmail@cdy.org>

Hi,

On Thu, Apr 12, 2007 at 08:46:35AM +0200, Michael wrote:
> Hi.
> It's a long story:
> The reason is the HW configuration of the board I have.
> The CF is connected to the host bus in memory mode.
> In this mode, the CF does not issue interrupts, and utilizing the
> IDE code in its current state to work in polling mode is a
> significant effort.

Aha. And you have no IDE controller. How about linux-mtd then?


> We could enable the interrupts in PC Card ATA IO mode, but not in
> TRUE IDE mode. The interface in PC Card ATA mode is, well, PC Card
> ATA (PCMCIA) compatible.

Right, but there's no PCMCIA controller on your host bus, only the
PCMCIA card.


> This make PCMCIA driver a natural choice

Not really.. You would have to implement a PCMCIA controller in
software. :(

I think linux-mtd does what you want, but I haven't used it myself
OTOH.


//Peter


From stuge-linux-pcmcia at cdy.org  Tue Apr 17 22:01:22 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Wed, 18 Apr 2007 04:01:22 +0200
Subject: Looking for a driver for Compact Flash access
In-Reply-To: <1ea6be8e0704072338p7203d37ag5eab099b68faf5cf@mail.gmail.com>
References: <1ea6be8e0704050807k1c357870sf14f754a1da89c49@mail.gmail.com>
	<20070405165307.14568.qmail@cdy.org>
	<20070405165651.15107.qmail@cdy.org>
	<1ea6be8e0704072338p7203d37ag5eab099b68faf5cf@mail.gmail.com>
Message-ID: <20070418020123.6385.qmail@cdy.org>

On Sun, Apr 08, 2007 at 08:38:51AM +0200, Michael wrote:
> Is connecting a CF directly to the local bus an unusual practice?

At least if it's operating as an PCMCIA or IDE device, but probably
otherwise too. If you have a local bus just tack on the flash
directly. Also I just read that memory mode only gives you 2kb of
data since it has 11 address lines.


> Would it be significantly easier to connect the CF in IO mode, or
> in true IDE mode?

Connections don't matter, but memory mode is definately the easiest
to program.


> Also, using memory mode, what drivers should I consider for using
> with minimal adaptation - is it just ide-ata?

Check out linux-mtd, but maybe the 2kb isn't worth the effort..

If you're designing a new board just stuff a 2Gbit flash chip on that
local bus and be done with it. :)

Seriously, it's difficult to impossible to give good advice without
understanding even more about what you want to do, how the system
will be used and so on, but this is probably not the best forum for
that discussion.


//Peter


From vitb at kernel.crashing.org  Wed Apr 18 12:53:39 2007
From: vitb at kernel.crashing.org (Vitaly Bordug)
Date: Wed, 18 Apr 2007 20:53:39 +0400
Subject: [PATCH][RFC] PCMCIA support for 8xx using platform devices
Message-ID: <20070418205339.21815926@vitb.ru.mvista.com>

This utilizes PCMCIA on mpc885ads and mpc866ads from arch/powerpc. In the new approach,
direct IMMR accesses from within drivers/ were totally eliminated, that requires hardware_enable, hardware_disable, voltage_set board-specific functions to be moved over to BSP code section 
(arch/powerpc/platforms/8xx in 885 case). There is just no way to have both arch/ppc and arch/powerpc approaches to work simultaneously because of that.

Signed-off-by: Vitaly Bordug <vitb at kernel.crashing.org>
---
However, BSP ifdef hell left untouched to be used as reference.
Any input is appreciated.

TIA!

 arch/powerpc/boot/dts/mpc885ads.dts          |   12 +
 arch/powerpc/platforms/8xx/mpc885ads.h       |    5 
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |   63 +++++
 arch/powerpc/sysdev/fsl_soc.c                |   58 ++++
 drivers/pcmcia/Kconfig                       |    1 
 drivers/pcmcia/m8xx_pcmcia.c                 |  342 ++++++++++++--------------
 include/linux/fs_pcmcia_pd.h                 |   27 ++
 7 files changed, 318 insertions(+), 190 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
index 90e047a..330ac91 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -112,6 +112,18 @@
 			compatible = "CPM";
 		};
 
+               pcmcia at 0080 {
+                       linux,phandle = <0080>;
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       compatible = "8xx";
+                       device_type = "pcmcia";
+                       reg = <80 80>;
+                       clock-frequency = <2faf080>;
+                       interrupt-parent = <ff000000>;
+                       interrupts = <d 1>;
+		};
+
 		cpm at ff000000 {
 			linux,phandle = <ff000000>;
 			#address-cells = <1>;
diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/platforms/8xx/mpc885ads.h
index 7c31aec..4439346 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads.h
+++ b/arch/powerpc/platforms/8xx/mpc885ads.h
@@ -91,5 +91,10 @@ #define PC_ENET_RENA	((ushort)0x0800)
 #define SICR_ENET_MASK	((uint)0x00ff0000)
 #define SICR_ENET_CLKRT	((uint)0x002c0000)
 
+/* Some internal interrupt registers use an 8-bit mask for the interrupt
+ * level instead of a number.
+ */
+#define mk_int_int_mask(IL) (1 << (7 - (IL/2)))
+
 #endif /* __ASM_MPC885ADS_H__ */
 #endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 394f983..1ba423f 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -22,6 +22,7 @@ #include <linux/root_dev.h>
 
 #include <linux/fs_enet_pd.h>
 #include <linux/fs_uart_pd.h>
+#include <linux/fs_pcmcia_pd.h>
 #include <linux/mii.h>
 
 #include <asm/delay.h>
@@ -375,6 +376,68 @@ static void init_i2c_ioports()
         setbits16(&cp->cp_pbodr, 0x0030);
 }
 
+void pcmcia_hw_setup(int slot, int enable)
+{
+	unsigned *bcsr_io;
+
+	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
+	if (enable)
+	clrbits32(bcsr_io, BCSR1_PCCEN);
+	else
+		setbits32(bcsr_io, BCSR1_PCCEN);
+
+	iounmap(bcsr_io);
+}
+
+int pcmcia_set_voltage(int slot, int vcc, int vpp)
+{
+        u32 reg = 0;
+        unsigned *bcsr_io;
+
+        bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
+
+        switch(vcc) {
+                case 0:
+                        break;
+                case 33:
+                        reg |= BCSR1_PCCVCC0;
+                        break;
+                case 50:
+                        reg |= BCSR1_PCCVCC1;
+                        break;
+                default:
+                        return 1;
+        }
+
+        switch(vpp) {
+                case 0:
+                        break;
+                case 33:
+                case 50:
+                        if(vcc == vpp)
+                                reg |= BCSR1_PCCVPP1;
+                        else
+                                return 1;
+                        break;
+                case 120:
+                        if ((vcc == 33) || (vcc == 50))
+                                reg |= BCSR1_PCCVPP0;
+                        else
+                                return 1;
+                default:
+                        return 1;
+        }
+
+        /* first, turn off all power */
+        clrbits32(bcsr_io, 0x00610000);
+
+        /* enable new powersettings */
+        setbits32(bcsr_io, reg);
+
+        iounmap(bcsr_io);
+        return 0;
+}
+
 int platform_device_skip(char *model, int id)
 {
 #ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 355c05d..753118d 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -26,6 +26,7 @@ #include <linux/phy.h>
 #include <linux/fsl_devices.h>
 #include <linux/fs_enet_pd.h>
 #include <linux/fs_uart_pd.h>
+#include <linux/fs_pcmcia_pd.h>
 
 #include <asm/system.h>
 #include <asm/atomic.h>
@@ -862,6 +863,8 @@ #ifdef CONFIG_8xx
 
 extern void init_scc_ioports(struct fs_platform_info*);
 extern int platform_device_skip(char *model, int id);
+extern void pcmcia_hw_setup(int slot, int enable);
+extern int pcmcia_set_voltage(int slot, int vcc, int vpp);
 
 static int __init fs_enet_mdio_of_init(void)
 {
@@ -1267,5 +1270,60 @@ err:
 
 arch_initcall(fsl_i2c_cpm_of_init);
 
+static const char *pcmcia_regs = "regs";
+static const char *pcmcia_irq = "interrupt";
+
+static int __init fsl_pcmcia_of_init(void)
+{
+	struct device_node *np;
+	unsigned int i;
+	struct platform_device *pcmcia_dev;
+	int ret;
+
+	for (np = NULL, i = 0;
+	     (np = of_find_compatible_node(np, "pcmcia", "8xx")) != NULL;
+	     i++) {
+		struct resource r[2];
+		struct fs_pcmcia_platform_data pcmcia_data;
+
+		memset(&r, 0, sizeof(r));
+		memset(&pcmcia_data, 0, sizeof(pcmcia_data));
+
+		ret = of_address_to_resource(np, 0, &r[0]);
+		if (ret)
+			goto err;
+		r[0].name = pcmcia_regs;
+
+		r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
+		r[1].flags = IORESOURCE_IRQ;
+		r[1].name = pcmcia_irq;
+
+		pcmcia_data.hwirq = irq_map[r[1].start].hwirq;
+		pcmcia_data.hw_setup = pcmcia_hw_setup;
+		pcmcia_data.voltage_set = pcmcia_set_voltage;
+		pcmcia_data.bus_freq = ppc_proc_freq;
+
+		pcmcia_dev = platform_device_register_simple("m8xx-pcmcia", i, &r[0], 2);
+		if (IS_ERR(pcmcia_dev)) {
+			ret = PTR_ERR(pcmcia_dev);
+			goto err;
+		}
+		ret =
+		    platform_device_add_data(pcmcia_dev, &pcmcia_data,
+					     sizeof(struct
+						    fs_pcmcia_platform_data));
+		if (ret)
+			goto unreg;
+	}
+
+	return 0;
+
+unreg:
+	platform_device_unregister(pcmcia_dev);
+err:
+	return ret;
+}
+
+arch_initcall(fsl_pcmcia_of_init);
 
 #endif /* CONFIG_8xx */
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 35f8864..c3fd55d 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -183,6 +183,7 @@ config PCMCIA_M8XX
         tristate "MPC8xx PCMCIA support"
         depends on PCMCIA && PPC && 8xx 
         select PCCARD_IODYN
+	select PCCARD_NONSTATIC
         help
         Say Y here to include support for PowerPC 8xx series PCMCIA
         controller.
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 9721ed7..ddac883 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -40,10 +40,6 @@ #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/string.h>
 
-#include <asm/io.h>
-#include <asm/bitops.h>
-#include <asm/system.h>
-
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
@@ -52,10 +48,16 @@ #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/fs_pcmcia_pd.h>
 
+#include <asm/io.h>
+#include <asm/bitops.h>
+#include <asm/system.h>
+#include <asm/time.h>
 #include <asm/mpc8xx.h>
 #include <asm/8xx_immap.h>
 #include <asm/irq.h>
+#include <asm/fs_pd.h>
 
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
@@ -146,27 +148,18 @@ #endif
 #define PCMCIA_MEM_WIN_BASE 0xe0000000 /* base address for memory window 0   */
 #define PCMCIA_MEM_WIN_SIZE 0x04000000 /* each memory window is 64 MByte     */
 #define PCMCIA_IO_WIN_BASE  _IO_BASE   /* base address for io window 0       */
-
-#define PCMCIA_SCHLVL PCMCIA_INTERRUPT /* Status Change Interrupt Level      */
-
 /* ------------------------------------------------------------------------- */
 
-/* 2.4.x and newer has this always in HZ */
-#define M8XX_BUSFREQ ((((bd_t *)&(__res))->bi_busfreq))
-
-static int pcmcia_schlvl = PCMCIA_SCHLVL;
+static int pcmcia_schlvl;
 
-static DEFINE_SPINLOCK(events_lock);
+static spinlock_t events_lock = SPIN_LOCK_UNLOCKED;
 
 
 #define PCMCIA_SOCKET_KEY_5V 1
 #define PCMCIA_SOCKET_KEY_LV 2
 
 /* look up table for pgcrx registers */
-static u32 *m8xx_pgcrx[2] = {
-	&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pgcra,
-	&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pgcrb
-};
+static u32 *m8xx_pgcrx[2];
 
 /*
  * This structure is used to address each window in the PCMCIA controller.
@@ -228,11 +221,16 @@ struct event_table {
 	u32 eventbit;
 };
 
+static const char driver_name[] = "m8xx-pcmcia";
+
 struct socket_info {
 	void	(*handler)(void *info, u32 events);
 	void	*info;
 
 	u32 slot;
+	pcmconf8xx_t *pcmcia;
+	struct platform_device *pdev;
+	struct fs_pcmcia_platform_data *pdata;
 
 	socket_state_t state;
 	struct pccard_mem_map mem_win[PCMCIA_MEM_WIN_NO];
@@ -404,83 +402,15 @@ static void hardware_disable(int slot)
 #endif
 
 /* MPC885ADS Boards */
-
 #if defined(CONFIG_MPC885ADS)
 
 #define PCMCIA_BOARD_MSG "MPC885ADS"
-
-static int voltage_set(int slot, int vcc, int vpp)
-{
-	u32 reg = 0;
-	unsigned *bcsr_io;
-
-	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
-
-	switch(vcc) {
-		case 0:
-			break;
-		case 33:
-			reg |= BCSR1_PCCVCC0;
-			break;
-		case 50:
-			reg |= BCSR1_PCCVCC1;
-			break;
-		default:
-			goto out_unmap;
-	}
-
-	switch(vpp) {
-		case 0:
-			break;
-		case 33:
-		case 50:
-			if(vcc == vpp)
-				reg |= BCSR1_PCCVPP1;
-			else
-				goto out_unmap;
-			break;
-		case 120:
-			if ((vcc == 33) || (vcc == 50))
-				reg |= BCSR1_PCCVPP0;
-			else
-				goto out_unmap;
-		default:
-			goto out_unmap;
-	}
-
-	/* first, turn off all power */
-	out_be32(bcsr_io, in_be32(bcsr_io) & ~(BCSR1_PCCVCC_MASK | BCSR1_PCCVPP_MASK));
-
-	/* enable new powersettings */
-	out_be32(bcsr_io, in_be32(bcsr_io) | reg);
-
-	iounmap(bcsr_io);
-	return 0;
-
-out_unmap:
-	iounmap(bcsr_io);
-	return 1;
-}
-
 #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V
 
-static void hardware_enable(int slot)
-{
-	unsigned *bcsr_io;
-
-	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
-	out_be32(bcsr_io, in_be32(bcsr_io) & ~BCSR1_PCCEN);
-	iounmap(bcsr_io);
-}
-
-static void hardware_disable(int slot)
-{
-	unsigned *bcsr_io;
-
-	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
-	out_be32(bcsr_io, in_be32(bcsr_io) |  BCSR1_PCCEN);
-	iounmap(bcsr_io);
-}
+/* These functions are defined in the board-specific code */
+#define hardware_enable(_slot_)	pdata->hw_setup(_slot_, 1)
+#define hardware_disable(_slot_) pdata->hw_setup(_slot_, 0)
+#define voltage_set(slot, vcc, vpp)	pdata->voltage_set(slot, vcc, vpp)
 
 #endif
 
@@ -541,6 +471,7 @@ #define hardware_enable(_slot_)  /* No h
 #define hardware_disable(_slot_) /* No hardware to disable */
 
 #endif /* CONFIG_MBX */
+/* Motorola MBX860 */
 
 #if defined(CONFIG_PRxK)
 #include <asm/cpld.h>
@@ -604,63 +535,22 @@ #define hardware_disable(_slot_) /* No h
 
 #endif /* CONFIG_PRxK */
 
-static void m8xx_shutdown(void)
-{
-	u32 m, i;
-	struct pcmcia_win *w;
-
-	for(i = 0; i < PCMCIA_SOCKETS_NO; i++){
-		w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
-
-		out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr, M8XX_PCMCIA_MASK(i));
-		out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per, in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per) & ~M8XX_PCMCIA_MASK(i));
-
-		/* turn off interrupt and disable CxOE */
-		out_be32(M8XX_PGCRX(i), M8XX_PGCRX_CXOE);
-
-		/* turn off memory windows */
-		for(m = 0; m < PCMCIA_MEM_WIN_NO; m++) {
-			out_be32(&w->or, 0); /* set to not valid */
-			w++;
-		}
-
-		/* turn off voltage */
-		voltage_set(i, 0, 0);
-
-		/* disable external hardware */
-		hardware_disable(i);
-	}
-
-	free_irq(pcmcia_schlvl, NULL);
-}
-
-static struct device_driver m8xx_driver = {
-        .name = "m8xx-pcmcia",
-        .bus = &platform_bus_type,
-        .suspend = pcmcia_socket_dev_suspend,
-        .resume = pcmcia_socket_dev_resume,
-};
-
-static struct platform_device m8xx_device = {
-        .name = "m8xx-pcmcia",
-        .id = 0,
-};
-
 static u32 pending_events[PCMCIA_SOCKETS_NO];
-static DEFINE_SPINLOCK(pending_event_lock);
+static spinlock_t pending_event_lock = SPIN_LOCK_UNLOCKED;
 
 static irqreturn_t m8xx_interrupt(int irq, void *dev)
 {
 	struct socket_info *s;
 	struct event_table *e;
 	unsigned int i, events, pscr, pipr, per;
+	pcmconf8xx_t	*pcmcia = socket[0].pcmcia;
 
 	dprintk("Interrupt!\n");
 	/* get interrupt sources */
 
-	pscr = in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr);
-	pipr = in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pipr);
-	per = in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per);
+	pscr = in_be32(&pcmcia->pcmc_pscr);
+	pipr = in_be32(&pcmcia->pcmc_pipr);
+	per = in_be32(&pcmcia->pcmc_per);
 
 	for(i = 0; i < PCMCIA_SOCKETS_NO; i++) {
 		s = &socket[i];
@@ -724,7 +614,7 @@ #endif
 			per &= ~M8XX_PCMCIA_RDY_L(0);
 			per &= ~M8XX_PCMCIA_RDY_L(1);
 
-			out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per, per);
+			out_be32(&pcmcia->pcmc_per, per);
 
 			if (events)
 				pcmcia_parse_events(&socket[i].socket, events);
@@ -732,7 +622,7 @@ #endif
 	}
 
 	/* clear the interrupt sources */
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr, pscr);
+	out_be32(&pcmcia->pcmc_pscr, pscr);
 
 	dprintk("Interrupt done.\n");
 
@@ -753,7 +643,7 @@ static u32 m8xx_get_graycode(u32 size)
 	return k;
 }
 
-static u32 m8xx_get_speed(u32 ns, u32 is_io)
+static u32 m8xx_get_speed(u32 ns, u32 is_io, u32 bus_freq)
 {
 	u32 reg, clocks, psst, psl, psht;
 
@@ -781,7 +671,7 @@ static u32 m8xx_get_speed(u32 ns, u32 is
 
 #define ADJ 180 /* 80 % longer accesstime - to be sure */
 
-	clocks = ((M8XX_BUSFREQ / 1000) * ns) / 1000;
+	clocks = ((bus_freq / 1000) * ns) / 1000;
 	clocks = (clocks * ADJ) / (100*1000);
 	if(clocks >= PCMCIA_BMT_LIMIT) {
 		printk( "Max access time limit reached\n");
@@ -806,8 +696,9 @@ static int m8xx_get_status(struct pcmcia
 	int lsock = container_of(sock, struct socket_info, socket)->slot;
 	struct socket_info *s = &socket[lsock];
 	unsigned int pipr, reg;
+	pcmconf8xx_t *pcmcia = s->pcmcia;
 
-	pipr = in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pipr);
+	pipr = in_be32(&pcmcia->pcmc_pipr);
 
 	*value  = ((pipr & (M8XX_PCMCIA_CD1(lsock)
 			    | M8XX_PCMCIA_CD2(lsock))) == 0) ? SS_DETECT : 0;
@@ -915,9 +806,11 @@ static int m8xx_set_socket(struct pcmcia
 {
 	int lsock = container_of(sock, struct socket_info, socket)->slot;
 	struct socket_info *s = &socket[lsock];
+	struct fs_pcmcia_platform_data *pdata = s->pdata;
 	struct event_table *e;
 	unsigned int reg;
 	unsigned long flags;
+	pcmconf8xx_t *pcmcia = socket[0].pcmcia;
 
 	dprintk( "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
 	      "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags,
@@ -927,6 +820,7 @@ static int m8xx_set_socket(struct pcmcia
 	if(voltage_set(lsock, state->Vcc, state->Vpp))
 		return -EINVAL;
 
+
 	/* Take care of reset... */
 	if(state->flags & SS_RESET)
 		out_be32(M8XX_PGCRX(lsock), in_be32(M8XX_PGCRX(lsock)) |  M8XX_PGCRX_CXRESET); /* active high */
@@ -982,7 +876,8 @@ static int m8xx_set_socket(struct pcmcia
 		 * If io_irq is non-zero we should enable irq.
 		 */
 		if(state->io_irq) {
-			out_be32(M8XX_PGCRX(lsock), in_be32(M8XX_PGCRX(lsock)) | mk_int_int_mask(state->io_irq) << 24);
+			int hwirq = s->pdata->hwirq;
+			out_be32(M8XX_PGCRX(lsock), in_be32(M8XX_PGCRX(lsock)) | mk_int_int_mask(hwirq) << 24);
 			/*
 			 * Strange thing here:
 			 * The manual does not tell us which interrupt
@@ -1027,7 +922,7 @@ static int m8xx_set_socket(struct pcmcia
 	 * Writing ones will clear the bits.
 	 */
 
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr, reg);
+	out_be32(&pcmcia->pcmc_pscr, reg);
 
 	/*
 	 * Write the mask.
@@ -1036,15 +931,8 @@ static int m8xx_set_socket(struct pcmcia
 	 * Ones will enable the interrupt.
 	 */
 
-	/*
-	  reg |= ((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per
-	  & M8XX_PCMCIA_MASK(lsock);
-	*/
-
-	reg |= in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per) &
-		(M8XX_PCMCIA_MASK(0) | M8XX_PCMCIA_MASK(1));
-
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per, reg);
+	reg |= in_be32(&pcmcia->pcmc_per) & (M8XX_PCMCIA_MASK(0) | M8XX_PCMCIA_MASK(1));
+	out_be32(&pcmcia->pcmc_per, reg);
 
 	spin_unlock_irqrestore(&events_lock, flags);
 
@@ -1062,6 +950,8 @@ static int m8xx_set_io_map(struct pcmcia
 	struct socket_info *s = &socket[lsock];
 	struct pcmcia_win *w;
 	unsigned int reg, winnr;
+	pcmconf8xx_t *pcmcia = s->pcmcia;
+
 
 #define M8XX_SIZE (io->stop - io->start + 1)
 #define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start)
@@ -1086,7 +976,7 @@ #define M8XX_BASE (PCMCIA_IO_WIN_BASE + 
 
 		/* setup registers */
 
-		w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
+		w = (void *) &pcmcia->pcmc_pbr0;
 		w += winnr;
 
 		out_be32(&w->or, 0); /* turn off window first */
@@ -1095,12 +985,13 @@ #define M8XX_BASE (PCMCIA_IO_WIN_BASE + 
 		reg <<= 27;
   		reg |= M8XX_PCMCIA_POR_IO |(lsock << 2);
 
-		reg |= m8xx_get_speed(io->speed, 1);
+		reg |= m8xx_get_speed(io->speed, 1, s->pdata->bus_freq);
 
 		if(io->flags & MAP_WRPROT)
 			reg |= M8XX_PCMCIA_POR_WRPROT;
 
-		if(io->flags & (MAP_16BIT | MAP_AUTOSZ))
+		/*if(io->flags & (MAP_16BIT | MAP_AUTOSZ))*/
+		if(io->flags & MAP_16BIT)
 			reg |= M8XX_PCMCIA_POR_16BIT;
 
 		if(io->flags & MAP_ACTIVE)
@@ -1117,7 +1008,7 @@ #define M8XX_BASE (PCMCIA_IO_WIN_BASE + 
 
 		/* setup registers */
 
-		w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
+		w = (void *) &pcmcia->pcmc_pbr0;
 		w += winnr;
 
 		out_be32(&w->or, 0); /* turn off window */
@@ -1144,6 +1035,7 @@ static int m8xx_set_mem_map(struct pcmci
 	struct pcmcia_win *w;
 	struct pccard_mem_map *old;
 	unsigned int reg, winnr;
+	pcmconf8xx_t *pcmcia = s->pcmcia;
 
 	dprintk( "SetMemMap(%d, %d, %#2.2x, %d ns, "
 	      "%#5.5lx, %#5.5x)\n", lsock, mem->map, mem->flags,
@@ -1166,12 +1058,12 @@ static int m8xx_set_mem_map(struct pcmci
 
 	/* Setup the window in the pcmcia controller */
 
-	w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
+	w = (void *) &pcmcia->pcmc_pbr0;
 	w += winnr;
 
 	reg |= lsock << 2;
 
-	reg |= m8xx_get_speed(mem->speed, 0);
+	reg |= m8xx_get_speed(mem->speed, 0, s->pdata->bus_freq);
 
 	if(mem->flags & MAP_ATTRIB)
 		reg |=  M8XX_PCMCIA_POR_ATTRMEM;
@@ -1236,57 +1128,69 @@ static int m8xx_sock_init(struct pcmcia_
 
 }
 
-static int m8xx_suspend(struct pcmcia_socket *sock)
+static int m8xx_sock_suspend(struct pcmcia_socket *sock)
 {
 	return m8xx_set_socket(sock, &dead_socket);
 }
 
 static struct pccard_operations m8xx_services = {
 	.init	= m8xx_sock_init,
-	.suspend = m8xx_suspend,
+	.suspend = m8xx_sock_suspend,
 	.get_status = m8xx_get_status,
 	.set_socket = m8xx_set_socket,
 	.set_io_map = m8xx_set_io_map,
 	.set_mem_map = m8xx_set_mem_map,
 };
 
-static int __init m8xx_init(void)
+static int __init m8xx_probe(struct platform_device *pdev)
 {
 	struct pcmcia_win *w;
-	unsigned int i,m;
+	unsigned int i, m, hwirq;
+	pcmconf8xx_t *pcmcia;
+	int status;
+	struct resource *r;
+	struct fs_pcmcia_platform_data *pdata = pdev->dev.platform_data;
 
 	pcmcia_info("%s\n", version);
 
-	if (driver_register(&m8xx_driver))
-		return -1;
+	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
+
+	pcmcia = ioremap(r->start, r->end - r->start + 1);
+	if(pcmcia == NULL)
+		return -EINVAL;
+
+	pcmcia_schlvl = platform_get_irq_byname(pdev,"interrupt");
+	if (pcmcia_schlvl < 0)
+		return -EINVAL;
+	hwirq = pdata->hwirq;
+
+	m8xx_pgcrx[0] = &pcmcia->pcmc_pgcra;
+	m8xx_pgcrx[1] = &pcmcia->pcmc_pgcrb;
+
 
 	pcmcia_info(PCMCIA_BOARD_MSG " using " PCMCIA_SLOT_MSG
-		    " with IRQ %u.\n", pcmcia_schlvl);
+		    " with IRQ %u  (%d). \n", pcmcia_schlvl, hwirq);
 
 	/* Configure Status change interrupt */
 
-	if(request_irq(pcmcia_schlvl, m8xx_interrupt, 0,
-			  "m8xx_pcmcia", NULL)) {
+	if(request_irq(pcmcia_schlvl, m8xx_interrupt, IRQF_SHARED,
+			  driver_name, socket)) {
 		pcmcia_error("Cannot allocate IRQ %u for SCHLVL!\n",
 			     pcmcia_schlvl);
 		return -1;
 	}
 
-	w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
-
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr,
-		M8XX_PCMCIA_MASK(0)| M8XX_PCMCIA_MASK(1));
+	w = (void *) &pcmcia->pcmc_pbr0;
 
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per,
-		in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per) &
-		~(M8XX_PCMCIA_MASK(0)| M8XX_PCMCIA_MASK(1)));
+	out_be32(&pcmcia->pcmc_pscr, M8XX_PCMCIA_MASK(0)| M8XX_PCMCIA_MASK(1));
+	clrbits32(&pcmcia->pcmc_per, M8XX_PCMCIA_MASK(0) | M8XX_PCMCIA_MASK(1));
 
-/* connect interrupt and disable CxOE */
+	/* connect interrupt and disable CxOE */
 
-	out_be32(M8XX_PGCRX(0), M8XX_PGCRX_CXOE | (mk_int_int_mask(pcmcia_schlvl) << 16));
-	out_be32(M8XX_PGCRX(1), M8XX_PGCRX_CXOE | (mk_int_int_mask(pcmcia_schlvl) << 16));
+	out_be32(M8XX_PGCRX(0), M8XX_PGCRX_CXOE | (mk_int_int_mask(hwirq) << 16));
+	out_be32(M8XX_PGCRX(1), M8XX_PGCRX_CXOE | (mk_int_int_mask(hwirq) << 16));
 
-/* intialize the fixed memory windows */
+	/* intialize the fixed memory windows */
 
 	for(i = 0; i < PCMCIA_SOCKETS_NO; i++){
 		for(m = 0; m < PCMCIA_MEM_WIN_NO; m++) {
@@ -1300,16 +1204,14 @@ static int __init m8xx_init(void)
 		}
 	}
 
-/* turn off voltage */
+	/* turn off voltage */
 	voltage_set(0, 0, 0);
 	voltage_set(1, 0, 0);
 
-/* Enable external hardware */
+	/* Enable external hardware */
 	hardware_enable(0);
 	hardware_enable(1);
 
-	platform_device_register(&m8xx_device);
-
 	for (i = 0 ; i < PCMCIA_SOCKETS_NO; i++) {
 		socket[i].slot = i;
 		socket[i].socket.owner = THIS_MODULE;
@@ -1317,30 +1219,90 @@ static int __init m8xx_init(void)
 		socket[i].socket.irq_mask = 0x000;
 		socket[i].socket.map_size = 0x1000;
 		socket[i].socket.io_offset = 0;
-		socket[i].socket.pci_irq = i  ? 7 : 9;
+		socket[i].socket.pci_irq = pcmcia_schlvl;
 		socket[i].socket.ops = &m8xx_services;
-		socket[i].socket.resource_ops = &pccard_iodyn_ops;
+		socket[i].socket.resource_ops = &pccard_nonstatic_ops;
 		socket[i].socket.cb_dev = NULL;
-		socket[i].socket.dev.parent = &m8xx_device.dev;
+		socket[i].socket.dev.parent = &pdev->dev;
+		socket[i].pcmcia = pcmcia;
+		socket[i].pdata = pdata;
 	}
 
-	for (i = 0; i < PCMCIA_SOCKETS_NO; i++)
-		pcmcia_register_socket(&socket[i].socket);
+	for (i = 0; i < PCMCIA_SOCKETS_NO; i++) {
+		status = pcmcia_register_socket(&socket[i].socket);
+		if (status < 0)
+			pcmcia_error("Socket register failed\n");
+	}
 
 	return 0;
 }
 
-static void __exit m8xx_exit(void)
+static int __exit m8xx_shutdown(struct platform_device *pdev)
 {
-	int i;
+	u32 m, i;
+	struct pcmcia_win *w;
+	pcmconf8xx_t *pcmcia = socket[0].pcmcia;
+	struct fs_pcmcia_platform_data *pdata = socket[0].pdata;
+
+	for(i = 0; i < PCMCIA_SOCKETS_NO; i++){
+		w = (void *) &pcmcia->pcmc_pbr0;
+
+		out_be32(&pcmcia->pcmc_pscr, M8XX_PCMCIA_MASK(i));
+		out_be32(&pcmcia->pcmc_per, in_be32(&pcmcia->pcmc_per) & ~M8XX_PCMCIA_MASK(i));
+
+		/* turn off interrupt and disable CxOE */
+		out_be32(M8XX_PGCRX(i), M8XX_PGCRX_CXOE);
 
+		/* turn off memory windows */
+		for(m = 0; m < PCMCIA_MEM_WIN_NO; m++) {
+			out_be32(&w->or, 0); /* set to not valid */
+			w++;
+		}
+
+		/* turn off voltage */
+		voltage_set(i, 0, 0);
+
+		/* disable external hardware */
+		hardware_disable(i);
+	}
 	for (i = 0; i < PCMCIA_SOCKETS_NO; i++)
 		pcmcia_unregister_socket(&socket[i].socket);
 
-	m8xx_shutdown();
+	free_irq(pcmcia_schlvl, NULL);
+
+	return 0;
+}
+
+static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
+{
+        return pcmcia_socket_dev_suspend(&pdev->dev, state);
+}
+
+static int m8xx_resume(struct platform_device *pdev)
+{
+        return pcmcia_socket_dev_resume(&pdev->dev);
+}
 
-	platform_device_unregister(&m8xx_device);
-	driver_unregister(&m8xx_driver);
+static struct platform_driver m8xx_driver = {
+	.driver = {
+		.name		= (char *) driver_name,
+		.owner		= THIS_MODULE,
+	},
+	.probe		= m8xx_probe,
+	.remove		= __exit_p(m8xx_shutdown),
+	.suspend	= m8xx_suspend,
+	.resume		= m8xx_resume,
+};
+
+
+static int __init m8xx_init(void)
+{
+	return platform_driver_register(&m8xx_driver);
+}
+
+static void __exit m8xx_exit(void)
+{
+	platform_driver_unregister(&m8xx_driver);
 }
 
 module_init(m8xx_init);
diff --git a/include/linux/fs_pcmcia_pd.h b/include/linux/fs_pcmcia_pd.h
new file mode 100644
index 0000000..2769a11
--- /dev/null
+++ b/include/linux/fs_pcmcia_pd.h
@@ -0,0 +1,27 @@
+/*
+ * Platform information definitions for the CPM Uart driver.
+ *
+ * 2007 (c) MontaVista Software, Inc.
+ * Yuri Shpilevsky <yshpilevsky at ru.mvista.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef FS_PCMCIA_PD_H
+#define FS_PCMCIA_PD_H
+
+#include <linux/version.h>
+#include <asm/types.h>
+
+struct fs_pcmcia_platform_data {
+	void(*hw_setup)(int slot, int enable);
+	int(*voltage_set)(int slot, int vcc, int vpp);
+
+	/* device specific information */
+	int hwirq;
+	u32 bus_freq;
+};
+
+#endif


-- 
Sincerely, 
Vitaly


-- 
Sincerely, 
Vitaly


From batist at gmail.com  Wed Apr 18 14:50:04 2007
From: batist at gmail.com (Batist Paklons)
Date: Wed, 18 Apr 2007 20:50:04 +0200
Subject: Oops: Machine check, sig: 7 [#1]
Message-ID: <37dc30060704181150l46d1371aw9897bf5db8a4674@mail.gmail.com>

Hi

I'm running xubuntu feisty on a powerbook G3. I've been trying to get
a wireless pcmcia NIC to work - but to no avail:

[  196.111372] pccard: PCMCIA card inserted into slot 0
[  196.111407] cs: memory probe 0x80000000-0xfcffffff: excluding 0x80000000-0x81
ffffff
[  196.230699] cs: memory probe 0xfd000000-0xfdffffff:Machine check in kernel mo
de.
[  196.230784] Caused by (from SRR1=49030): Transfer error ack signal
[  196.231010] Oops: Machine check, sig: 7 [#1]

I have found a similar problem in the list in this thread:
http://lists.infradead.org/pipermail/linux-pcmcia/2006-April/003487.html

Following that post I added a kernel parameter:
[    0.000000] Kernel command line: root=/dev/hda3 ro reserve=0xfd000000,0xfffff
f
but still the same error occurs. Where did I go wrong?

I've added a bunch of useful stuff such as dmesg (the card was
inserted after starting up, the error message is right at the end).

Thanks in advance!
Batist

Linux powerbookG3 2.6.20-15-powerpc #3 Sun Apr 15 06:45:49 UTC 2007
ppc GNU/Linux

dmesg
[    0.000000] Using PowerMac machine description
[    0.000000] Total memory = 192MB; using 512kB for hash table (at cbf80000)
[    0.000000] Linux version 2.6.20-15-powerpc (root at adare) (gcc
version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)) #3 Sun Apr 15 06:45:49 UTC 2007
(Ubuntu 2.6.20-15.27-powerpc)
[    0.000000] Found initrd at 0xc1900000:0xc204b400
[    0.000000] Found a Paddington mac-io controller, rev: 0, mapped at
0xfdf80000
[    0.000000] PowerMac motherboard: PowerBook 101 (Lombard)
[    0.000000] PMU driver v2 initialized for 1999 PowerBook G3, firmware: 0b
[    0.000000] Entering add_active_range(0, 0, 49152) 0 entries of 256 used
[    0.000000] Found Grackle (MPC106) PCI host bridge at
0x0000000080000000. Firmware bus number: 0->0
[    0.000000] nvram: OF partition at 0x140
[    0.000000] nvram: XP partition at 0xffffffff
[    0.000000] nvram: NR partition at 0xffffffff
[    0.000000] Top of RAM: 0xc000000, Total RAM: 0xc000000
[    0.000000] Memory hole size: 0MB
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA             0 ->    49152
[    0.000000]   Normal      49152 ->    49152
[    0.000000]   HighMem     49152 ->    49152
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0:        0 ->    49152
[    0.000000] On node 0 totalpages: 49152
[    0.000000]   DMA zone: 384 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 48768 pages, LIFO batch:15
[    0.000000]   Normal zone: 0 pages used for memmap
[    0.000000]   HighMem zone: 0 pages used for memmap
[    0.000000] Built 1 zonelists.  Total pages: 48768
[    0.000000] Kernel command line: root=/dev/hda3 ro
reserve=0xfd000000,0xffffff
[    0.000000] irq: Found primary Apple PIC /pci at 80000000/mac-io at 10 for 64 irqs
[    0.000000] irq: System has 64 possible interrupts
[    0.000000] PID hash table entries: 1024 (order: 10, 4096 bytes)
[    0.000000] GMT Delta read from XPRAM: 0 minutes, DST: on
[    0.000000] time_init: decrementer frequency = 16.703983 MHz
[    0.000000] time_init: processor frequency   = 399.999996 MHz
[   26.038132] Console: colour dummy device 80x25
[   26.039439] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[   26.040476] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[   26.067581] High memory: 0k
[   26.067598] Memory: 182528k/196608k available (3220k kernel code,
13744k reserved, 120k data, 293k bss, 188k init)
[   26.068022] Calibrating delay loop... 33.28 BogoMIPS (lpj=66560)
[   26.149873] Security Framework v1.0.0 initialized
[   26.149926] SELinux:  Disabled at boot.
[   26.149995] Mount-cache hash table entries: 512
[   26.150644] device-tree: Duplicate name in /cpus/PowerPC,750 at 0,
renamed to "l2-cache#1"
[   26.153881] NET: Registered protocol family 16
[   26.154549] PMU i2c /pci at 80000000/mac-io at 10/via-pmu at 16000
[   26.154580]  channel 1 bus <multibus>
[   26.154598]  channel 2 bus <multibus>
[   26.154738] PCI: Probing PCI hardware
[   26.156754] PCI: Cannot allocate resource region 1 of device 0000:00:11.0
[   26.156849] Registering pmac pic with sysfs...
[   26.160793] NET: Registered protocol family 8
[   26.160822] NET: Registered protocol family 20
[   26.162213] NET: Registered protocol family 2
[   26.197932] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[   26.198294] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[   26.198541] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[   26.198687] TCP: Hash tables configured (established 8192 bind 4096)
[   26.198709] TCP reno registered
[   26.210210] checking if image is initramfs... it is
[   28.615371] Freeing initrd memory: 7469k freed
[   28.617004] Thermal assist unit using timers, shrink_timer: 500 jiffies
[   28.618494] audit: initializing netlink socket (disabled)
[   28.618585] audit(1176920167.580:1): initialized
[   28.619082] VFS: Disk quotas dquot_6.5.1
[   28.619208] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[   28.619506] io scheduler noop registered
[   28.619534] io scheduler anticipatory registered
[   28.619554] io scheduler deadline registered
[   28.619597] io scheduler cfq registered (default)
[   28.620652] PCI: Enabling device 0000:00:11.0 (0086 -> 0087)
[   28.620713] atyfb: using auxiliary register aperture
[   28.621346] atyfb: 3D RAGE LT PRO (Mach64 LI, PCI) [0x4c49 rev 0xdc]
[   28.621407] atyfb: 8M SDRAM (1:1), 29.498928 MHz XTAL, 230 MHz PLL,
100 Mhz MCLK, 100 MHz XCLK
[   28.621989] atyfb: monitor sense=62b, mode 6
[   28.685979] Console: switching to colour frame buffer device 128x48
[   28.705901] atyfb: fb0: ATY Mach64 frame buffer device on PCI
[   28.857512] Generic RTC Driver v1.07
[   28.857997] Macintosh non-volatile memory driver v1.1
[   28.858614] mice: PS/2 mouse device common for all mice
[   28.861517] RAMDISK driver initialized: 16 RAM disks of 65536K size
1024 blocksize
[   28.862592] MacIO PCI driver attached to Paddington chipset
[   28.863931] Can't request resource 0 for MacIO device 0.00000000:power-mg
[   28.867185] mediabay0: Registered Heathrow media-bay
[   28.867418] mediabay0: powering down
[   29.101680] mediabay0: switching to 3
[   29.101837] mediabay0: powering up
[   29.325678] mediabay0: enabling (kind:3)
[   29.389674] mediabay0: waiting reset (kind:3)
[   29.517671] mediabay0: waiting IDE reset (kind:3)
[   30.669655] mediabay0: waiting IDE ready (kind:3)
[   30.701654] mediabay0: up before IDE init
[   30.702187] input: Macintosh mouse button emulation as /class/input/input0
[   30.703214] pmubl: Backlight initialized (pmubl)
[   30.703626] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
[   30.703892] ide: Assuming 33MHz system bus speed for PIO modes;
override with idebus=xx
[   30.704483] adb: starting probe task...
[   31.721652] ide0: Found Apple Heathrow ATA controller, bus ID 0, irq 20
[   31.721971] Probing IDE interface ide0...
[   32.177837] hda: TOSHIBA MK6409MAV, ATA DISK drive
[   32.831125] adb devices: [2]: 2 c3 [3]: 3 1 [7]: 7 1f
[   32.856981] ADB keyboard at 2, handler 1
[   32.866098] Detected ADB keyboard, type ANSI.
[   32.875370] input: ADB keyboard as /class/input/input1
[   32.884642] input: ADB Powerbook buttons as /class/input/input2
[   32.893677] hda: Enabling MultiWord DMA 2
[   32.903665] ide0 at 0xcd012000-0xcd012007,0xcd012160 on irq 20
[   32.913237] Registered ide1 for media bay 0
[   32.913258] ide1: Found Apple Heathrow ATA controller, bus ID 1
(mediabay), irq 31
[   32.922617] Probing IDE interface ide1...
[   32.931262] ADB mouse at 3, handler set to 4 (trackpad)
[   32.994257] input: ADB mouse as /class/input/input3
[   33.003443] adb: finished probe task...
[   33.401806] hdc: MATSHITADVD-ROM SR-8171, ATAPI CD/DVD-ROM drive
[   33.745621] hdc: Enabling MultiWord DMA 2
[   33.755698] ide1 at 0xcd018000-0xcd018007,0xcd018160 on irq 31
[   33.765412] PowerMac i2c bus pmu 2 registered
[   33.774661] PowerMac i2c bus pmu 1 registered
[   33.784043] TCP cubic registered
[   33.793047] NET: Registered protocol family 1
[   33.802270] Freeing unused kernel memory: 188k init
[   34.664163] Capability LSM initialized
[   38.447109] usbcore: registered new interface driver usbfs
[   38.447589] usbcore: registered new interface driver hub
[   38.447958] usbcore: registered new device driver usb
[   38.454521] ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller
(OHCI) Driver
[   38.454718] ohci_hcd 0000:00:0e.0: OHCI Host Controller
[   38.455604] ohci_hcd 0000:00:0e.0: new USB bus registered, assigned
bus number 1
[   38.456008] ohci_hcd 0000:00:0e.0: irq 28, io mem 0x80882000
[   38.639470] usb usb1: configuration #1 chosen from 1 choice
[   38.639953] hub 1-0:1.0: USB hub found
[   38.640203] hub 1-0:1.0: 2 ports detected
[   39.237886] SCSI subsystem initialized
[   39.245662] mesh: configured for synchronous 5 MB/s
[   39.449782] mesh: performing initial bus reset...
[   39.844696] hda: max request size: 128KiB
[   40.042244] hda: 12685680 sectors (6495 MB), CHS=13424/15/63, (U)DMA
[   40.042711] hda: cache flushes not supported
[   40.043104]  hda: [mac] hda1 hda2 hda3 hda4 hda5 hda6 hda7 hda8
[   40.203217] hdc: ATAPI 20X DVD-ROM drive, 512kB Cache, DMA
[   40.203702] Uniform CD-ROM driver Revision: 3.20
[   41.374431] Attempting manual resume
[   41.548016] kjournald starting.  Commit interval 5 seconds
[   41.548450] EXT3-fs: mounted filesystem with ordered data mode.
[   43.453569] scsi0 : MESH
[   44.003875] eth0: BMAC+ at 00:50:e4:7a:47:51
[   49.460579] phy registers:
[   49.460599]  0800 7849 2000 5c10 01e1 41e1 0007 2801
[   49.470965]  0000 0000 0000 0000 0000 0000 0000 0000
[   49.481324]  2002 0000 0000 0000 0001 0000 0020 0000
[   49.491685]  0000 0000 0180 0100 0006 0f00 0000 0000
[   54.134269] NET: Registered protocol family 17
[   57.029251] PCI: Enabling device 0000:00:13.0 (0000 -> 0002)
[   57.029720] Yenta: CardBus bridge found at 0000:00:13.0 [0000:0000]
[   57.030038] PCI: Bus 1, cardbus bridge: 0000:00:13.0
[   57.030265]   IO window: 00001400-000015ff
[   57.030459]   IO window: 00001800-000019ff
[   57.030653]   PREFETCH window: 80000000-803fffff
[   57.030867]   MEM window: 80400000-807fffff
[   57.031066] Yenta: Enabling burst memory read transactions
[   57.031312] Yenta: Using CSCINT to route CSC interrupts to PCI
[   57.031567] Yenta: Routing CardBus interrupts to PCI
[   57.031791] Yenta TI: socket 0000:00:13.0, mfunc 0x00000002, devctl 0x60
[   57.133371] Yenta: ISA IRQ mask 0x0000, PCI irq 22
[   57.133697] Socket status: 30000006
[   57.133871] pcmcia: parent PCI bridge I/O window: 0x0 - 0x7fffff
[   57.134140] pcmcia: parent PCI bridge Memory window: 0x80000000 - 0xfcffffff
[   57.134443] pcmcia: parent PCI bridge Memory window: 0xfd000000 - 0xfdffffff
[   62.931940] pmac_zilog: 0.6 (Benjamin Herrenschmidt
<benh at kernel.crashing.org>)
[   62.939055] pmac_zilog: serial modem detected
[   62.939539] ttyS0 at MMIO 0x80813020 (irq = 35) is a Z85c30 ESCC -
Internal modem
[   62.948488] ttyS1 at MMIO 0x80813000 (irq = 38) is a Z85c30 ESCC -
Infrared port
[   63.519859] apm_emu: APM Emulation 0.5 initialized.
[   66.254320] input: PowerMac Beep as /class/input/input4
[   67.170934] Adding 351552k swap on
/dev/disk/by-uuid/5de2f7e0-bb6e-49cc-b4c6-6e2fc4b74459.  Priority:-1
extents:1 across:351552k
[   67.564338] EXT3 FS on hda3, internal journal
[   68.528530] kjournald starting.  Commit interval 5 seconds
[   68.529919] EXT3 FS on hda8, internal journal
[   68.529942] EXT3-fs: mounted filesystem with ordered data mode.
[   68.563591] kjournald starting.  Commit interval 5 seconds
[   68.564666] EXT3 FS on hda7, internal journal
[   68.564689] EXT3-fs: mounted filesystem with ordered data mode.
[   68.626515] kjournald starting.  Commit interval 5 seconds
[   68.627792] EXT3 FS on hda4, internal journal
[   68.627813] EXT3-fs: mounted filesystem with ordered data mode.
[   68.669914] kjournald starting.  Commit interval 5 seconds
[   68.694117] EXT3 FS on hda5, internal journal
[   68.694140] EXT3-fs: mounted filesystem with ordered data mode.
[  103.388928] lp: driver loaded but no devices found
[  106.150040] ppdev: user-space parallel port driver
[  196.111372] pccard: PCMCIA card inserted into slot 0
[  196.111407] cs: memory probe 0x80000000-0xfcffffff: excluding
0x80000000-0x81ffffff
[  196.230699] cs: memory probe 0xfd000000-0xfdffffff:Machine check in
kernel mode.
[  196.230784] Caused by (from SRR1=49030): Transfer error ack signal
[  196.231010] Oops: Machine check, sig: 7 [#1]
[  196.231316]
[  196.231408] Modules linked in: ppdev lp parport cpufreq_userspace
cpufreq_stats cpufreq_powersave cpufreq_ondemand cpufreq_conservative
snd_powermac snd_pcm_oss snd_pcm snd_mixer_oss snd_seq_dummy
snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq
snd_timer snd_seq_device snd soundcore snd_page_alloc apm_emu
pmac_zilog serial_core pcmcia yenta_socket rsrc_nonstatic pcmcia_core
af_packet tsdev evdev ext3 jbd mbcache ide_cd cdrom ide_disk bmac mesh
scsi_mod ohci_hcd usbcore capability commoncap
[  196.234132] NIP: CD8ECD18 LR: CD8ECCEC CTR: C0014B88
[  196.234360] REGS: cbe27c80 TRAP: 0200   Not tainted  (2.6.20-15-powerpc)
[  196.234646] MSR: 00049030 <EE,ME,IR,DR>  CR: 82004024  XER: 00000000
[  196.235026] TASK = c1f15870[3057] 'pccardd' THREAD: cbe26000
[  196.235248] GPR00: 000000FF CBE27D30 C1F15870 CD990000 CD8A8014
00000070 00000002 CBE27D89
[  196.235721] GPR08: CD8A8040 00001000 CD990000 CD991000 22000022
00000000 00000000 FD000000
[  196.236194] GPR16: CD880000 FD100000 FE000000 FD000000 00200000
CB8A1428 FD080000 000004FB
[  196.236668] GPR24: CBE27D89 00000000 00000002 CB8A1428 00000021
00000000 00000002 CBE27D89
[  196.237172] NIP [CD8ECD18] pcmcia_read_cis_mem+0x178/0x26c [pcmcia_core]
[  196.237540] LR [CD8ECCEC] pcmcia_read_cis_mem+0x14c/0x26c [pcmcia_core]
[  196.237854] Call Trace:
[  196.237984] [CBE27D30] [CD8ECCEC] pcmcia_read_cis_mem+0x14c/0x26c
[pcmcia_core] (unreliable)
[  196.238390] [CBE27D60] [CD8ECF74] read_cis_cache+0x168/0x16c [pcmcia_core]
[  196.238721] [CBE27D80] [CD8ED1CC] pccard_get_next_tuple+0x1b0/0x480
[pcmcia_core]
[  196.239076] [CBE27DC0] [CD8ED534] pccard_get_first_tuple+0x98/0x144
[pcmcia_core]
[  196.239431] [CBE27DF0] [CD8EDB84] pccard_validate_cis+0xa0/0x230
[pcmcia_core]
[  196.239775] [CBE27E20] [CD881EBC] readable+0x54/0xd8 [rsrc_nonstatic]
[  196.240094] [CBE27E40] [CD8821E8]
pcmcia_nonstatic_validate_mem+0x16c/0x408 [rsrc_nonstatic]
[  196.240475] [CBE27EC0] [CD8EDD3C] pcmcia_validate_mem+0x28/0x40 [pcmcia_core]
[  196.240817] [CBE27ED0] [CD9227FC] pcmcia_card_add+0x40/0xd0 [pcmcia]
[  196.241157] [CBE27F40] [CD922934] ds_event+0xa8/0xd4 [pcmcia]
[  196.241443] [CBE27F60] [CD8EA4F8] send_event+0x6c/0x94 [pcmcia_core]
[  196.241757] [CBE27F70] [CD8EAA98] socket_insert+0xbc/0x130 [pcmcia_core]
[  196.242081] [CBE27F80] [CD8EB164] pccardd+0x260/0x2b0 [pcmcia_core]
[  196.242389] [CBE27FC0] [C0046968] kthread+0xc0/0xfc
[  196.242647] [CBE27FF0] [C0014434] kernel_thread+0x44/0x60
[  196.242912] Instruction dump:
[  196.243071] 4bfffd91 2c030000 41820104 813b00ec 3809ffff 7d634a14
7c00e838 7d430214
[  196.243520] 7f8b5000 419e006c 7c0004ac 7c0300ae <0c000000> 4c00012c
3bdeffff 981f0000

lspci
00:00.0 Host bridge: Motorola MPC106 [Grackle] (rev 40)
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort+ >SERR- <PERR-
        Latency: 0, Cache Line Size: 32 bytes

00:0e.0 USB Controller: Agere Systems USB (rev 12) (prog-if 10 [OHCI])
        Subsystem: Agere Systems USB
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 32 (750ns min, 21500ns max)
        Interrupt: pin A routed to IRQ 28
        Region 0: Memory at 80882000 (32-bit, non-prefetchable) [size=4K]

00:0f.0 Multimedia controller: C-Cube Microsystems Cinemaster C 3.0
DVD Decoder (rev 02)
        Subsystem: C-Cube Microsystems Cinemaster C 3.0 DVD Decoder
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 32 (1000ns min, 32000ns max)
        Interrupt: pin A routed to IRQ 26
        Region 0: I/O ports at 0c00 [size=256]
        Capabilities: [60] Power Management version 1
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:10.0 Class ff00: Apple Computer Inc. Paddington Mac I/O
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 32, Cache Line Size: 32 bytes
        Region 0: Memory at 80800000 (32-bit, non-prefetchable) [size=512K]

00:11.0 VGA compatible controller: ATI Technologies Inc 3D Rage LT Pro
(rev dc) (prog-if 00 [VGA])
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping+ SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 32 (2000ns min), Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 24
        Region 0: Memory at 81000000 (32-bit, non-prefetchable) [size=16M]
        Region 1: I/O ports at 1000 [size=256]
        Region 2: Memory at 80881000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [5c] Power Management version 1
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:13.0 CardBus bridge: Texas Instruments PCI1211
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 168, Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 22
        Region 0: Memory at 80880000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=01, subordinate=04, sec-latency=176
        Memory window 0: 80000000-803ff000 (prefetchable)
        Memory window 1: 80400000-807ff000
        I/O window 0: 00001400-000015ff
        I/O window 1: 00001800-000019ff
        BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+
        16-bit legacy interface ports at 0001

/proc/ioports
00000000-007fffff : /pci at 80000000
  00000c00-00000cff : 0000:00:0f.0
  00001000-000010ff : 0000:00:11.0
  00001400-000015ff : PCI CardBus #01
  00001800-000019ff : PCI CardBus #01

/proc/iomem
80000000-fcffffff : /pci at 80000000
  80000000-803fffff : PCI CardBus #01
  80400000-807fffff : PCI CardBus #01
  80800000-8087ffff : 0000:00:10.0
    80800000-8087ffff : 0.80800000:mac-io
      80800010-8080002f : 0.00000010:interrup
      80800034-80800034 : 0.00000034:media-ba
        80800034-80800034 : media-bay
      80808000-808080ff : 0.00010000:scsi
        80808000-808080ff : mesh
      80808100-808081ff : 0.00015000:fdc
      80808200-808082ff : 0.00011000:ethernet
        80808200-808082ff : bmac
      80808300-808083ff : 0.00011000:ethernet
        80808300-808083ff : bmac
      80808800-808088ff : 0.00014000:davbus
        80808800-808088ff : Sound Tx DMA
      80808900-808089ff : 0.00014000:davbus
        80808900-808089ff : Sound Rx DMA
      80808b00-80808bff : 0.00020000:ata-3
        80808b00-80808bff : ide-pmac (dma)
      80808c00-80808cff : 0.00021000:ata-3
        80808c00-80808cff : ide-pmac (dma)
      80810000-80810fff : 0.00010000:scsi
        80810000-80810fff : mesh
      80811000-80811fff : 0.00011000:ethernet
        80811000-80811fff : bmac
      80813000-80813000 : 0.00013000:ch-b
        80813000-80813000 : pmac_zilog
      80813010-80813010 : 0.00013000:ch-b
        80813010-80813010 : pmac_zilog
      80813020-80813020 : 0.00013020:ch-a
        80813020-80813020 : pmac_zilog
      80813030-80813030 : 0.00013020:ch-a
        80813030-80813030 : pmac_zilog
      80813040-80813040 : 0.00013000:ch-b
        80813040-80813040 : pmac_zilog
      80813050-80813050 : 0.00013020:ch-a
        80813050-80813050 : pmac_zilog
      80814000-80814fff : 0.00014000:davbus
        80814000-80814fff : Sound Control
      80815000-80815fff : 0.00015000:fdc
      80816000-80817fff : 0.00016000:via-pmu
      80820000-80820fff : 0.00020000:ata-3
        80820000-80820fff : ide-pmac (ports)
      80821000-80821fff : 0.00021000:ata-3
        80821000-80821fff : ide-pmac (ports)
  80880000-80880fff : 0000:00:13.0
    80880000-80880fff : yenta_socket
  80881000-80881fff : 0000:00:11.0
    80881000-80881fff : atyfb
  80882000-80882fff : 0000:00:0e.0
    80882000-80882fff : ohci_hcd
  81000000-81ffffff : 0000:00:11.0
    81000000-81ffffff : atyfb
fd000000-fdffffff : /pci at 80000000
  fd000000-fd07ffff : cs memory probe
  fd080000-fd0fffff : cs memory probe
fffffffffd000000-fffffffffdfffffe : reserved

/proc/interrupts
           CPU0
 16:         19   PMAC-PIC  Edge      PMac Output
 17:          1   PMAC-PIC  Edge      PMac
 18:     107321   PMAC-PIC  Edge      VIA-PMU
 19:          0   PMAC-PIC  Edge      PMac Input
 20:      10297   PMAC-PIC  Edge      ide0
 22:          2   PMAC-PIC  Level     yenta
 23:         14   PMAC-PIC  Edge      MESH
 28:          2   PMAC-PIC  Level     ohci_hcd:usb1
 31:      16703   PMAC-PIC  Edge      ide1
 32:        927   PMAC-PIC  Edge      BMAC-txdma
 33:       1108   PMAC-PIC  Edge      BMAC-rxdma
 42:       2100   PMAC-PIC  Edge      BMAC-misc
BAD:          0

/etc/pcmcia/config.opts
#
# Local PCMCIA Configuration File
#
#----------------------------------------------------------------------
#
# System resources available for PCMCIA cards
#
# NOTE: these settings have no effect on resources assigned to a
# CardBus bridge device itself; this file only affects resources
# assigned to cards.  Also, interrupt settings here will only affect
# ISA bus interrupts assigned to 16-bit cards.  PCI interrupts
# generally can't be reconfigured.
#
# With the kernel PCMCIA subsystem, these settings also have no effect
# at all on resources used for 32-bit CardBus cards.  Those are set by
# the PCI hotplug subsystem.
#

include port 0x100-0x4ff
include port 0x1000-0x17ff
include memory 0x80000000-0x80ffffff


From Fabrice.Aeschbacher at siemens.com  Thu Apr 19 08:42:44 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Thu, 19 Apr 2007 14:42:44 +0200
Subject: PCMCIA / compact flash / au1x00
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A40129D820@stgw002a.ww002.siemens.net>

Hi,

[kernel 2.6.20.7 / mips]

I am having trouble using a compact flash connected to a PCMCIA socket
on an Alchemy au1550 board (mips).

The CF seems to be recognized:

  # insmod au1x00_ss.ko

  => dmesg output:
    pccard: PCMCIA card inserted into slot 0
    pcmcia: registering new device pcmcia0.0

  # pccardctl ls          
  Socket 0 Bridge:        [au1x00-pcmcia]         (bus ID:
au1x00-pcmcia.0)
  Socket 0 Device 0:      [-- no driver --]       (bus ID: 0.0)

  # pccardctl info
  PRODID_1="TRANSCEND"
  PRODID_2="TS2GCF120"
  PRODID_3=""
  PRODID_4=""
  MANFID=000a,0000
  FUNCID=4

  # pccardctl status
  Socket 0:
    3.3V 16-bit PC Card
    Subdevice 0 (function 0) [unbound]

Problem: I can't access the CF by its device (hda):

  # fdisk /dev/hda
  Unable to open /dev/hda



Here is the relevant part of the kernel config:
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y
CONFIG_BLK_DEV_IDECS=m
CONFIG_PCCARD=y
CONFIG_PCMCIA_DEBUG=y
CONFIG_PCMCIA=y
CONFIG_PCMCIA_IOCTL=y
CONFIG_PCMCIA_AU1X00=m

Neither hotplug nor udev is installed (I only installed
/sbin/pccardctl).

I know cardmgr is no more used in recent kernels. Anyway, if I try to
run it, I become following result:

  # cardmgr
  cardmgr[976]: watching 1 socket
  cardmgr[976]: could not adjust resource: IO ports 0xc00-0: Invalid
argument
  cardmgr[976]: could not adjust resource: IO ports 0x100-0: Invalid
argument
  cardmgr[976]: could not adjust resource: memory 0xc0000-0xfffff:
Invalid argument
  cardmgr[976]: could not adjust resource: memory 0x60000000-0x60ffffff:
Invalid   argument
  cardmgr[976]: could not adjust resource: memory 0xa0000000-0xa0ffffff:
Invalid   argument
  cardmgr[976]: could not adjust resource: IO ports 0xa00-0: Invalid
argument
  cardmgr[976]: could not adjust resource: irq 4: Invalid argument
  cardmgr[976]: could not adjust resource: irq 7: Invalid argument

and following output in dmesg:
  ds: ds_open(socket 0)
  pcmcia: Detected deprecated PCMCIA ioctl usage from process: cardmgr.
  pcmcia: This interface will soon be removed from the kernel; please
expect breakage   unless you upgrade to new tools.
  pcmcia: see
http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html for
details.
  ds: ds_open(socket 1)
  ds: ds_open(socket 1)
  ide_attach()
  ide_config(0x80788400)
  Probing IDE interface ide0...
  hda: TRANSCEND, CFA DISK drive
  ide0: Disabled unable to get IRQ 34.
  ide0: failed to initialize IDE interface
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x16400E-0x16400E not free.
  ide0: ports already in use, skipping probe
  ide-cs: ide_register() at 0x164000 & 0x16400e, irq 34 failed
  ide_release(0x80788400)

Can someone tell me what I missed?

Note: the CF used to work correctly with a kernel 2.4.26

Best regards,
Fabrice Aeschbacher


From stuge-linux-pcmcia at cdy.org  Thu Apr 19 11:15:25 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Thu, 19 Apr 2007 17:15:25 +0200
Subject: PCMCIA / compact flash / au1x00
In-Reply-To: <D7810733513F4840B4EBAAFA64D9C6A40129D820@stgw002a.ww002.siemens.net>
References: <D7810733513F4840B4EBAAFA64D9C6A40129D820@stgw002a.ww002.siemens.net>
Message-ID: <20070419151525.22691.qmail@cdy.org>

On Thu, Apr 19, 2007 at 02:42:44PM +0200, Aeschbacher, Fabrice wrote:
> CONFIG_BLK_DEV_IDECS=m

Try using the PCMCIA PATA driver instead.


> Neither hotplug nor udev is installed (I only installed
> /sbin/pccardctl).

Then you'll have to run pcmcia-socket-startup manually. This may
actually work also with ide-cs. Try this before PCMCIA PATA.


> I know cardmgr is no more used in recent kernels. Anyway, if I try
> to run it, I become following result:

It's the wrong fix, don't use it.


//Peter


From batist at gmail.com  Fri Apr 20 05:43:50 2007
From: batist at gmail.com (Batist Paklons)
Date: Fri, 20 Apr 2007 11:43:50 +0200
Subject: Oops: Machine check, sig: 7 [#1]
In-Reply-To: <37dc30060704181150l46d1371aw9897bf5db8a4674@mail.gmail.com>
References: <37dc30060704181150l46d1371aw9897bf5db8a4674@mail.gmail.com>
Message-ID: <37dc30060704200243wc421e14sa3f3583e5425fc2e@mail.gmail.com>

Hi all,

I have just installed an older kernel 2.6.17 on the machine, booting
with the same reserve kernel parameter, and the card now works
perfectly.

I would like to get it to work with the 2.6.20 kernel though, the
machine is intended for someone else, who certainly does not want an
upgrade (thus reverting to 2.6.20) to break his system.

I'm only not sure if this list is still the right place to be.

Kind regards
Batist

Linux powerbookG3 2.6.17-11-powerpc #2 Tue Mar 13 22:51:22 UTC 2007
ppc GNU/Linux

dmesg output:
[    0.000000] Using PowerMac machine description
[    0.000000] Total memory = 192MB; using 512kB for hash table (at cbf80000)
[    0.000000] Linux version 2.6.17-11-powerpc (root at royal) (gcc
version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)) #2 Tue
Mar 13 22:51:22 UTC 2007 (Ubuntu 2.6.17-11.37-powerpc)
[    0.000000] Found initrd at 0xc1900000:0xc2011400
[    0.000000] Found a Paddington mac-io controller, rev: 0, mapped at
0xfdf80000
[    0.000000] PowerMac motherboard: PowerBook 101 (Lombard)
[    0.000000] PMU driver v2 initialized for 1999 PowerBook G3, firmware: 0b
[    0.000000] Found Grackle (MPC106) PCI host bridge at 0x80000000.
Firmware bus number: 0->0
[    0.000000] nvram: OF partition at 0x140
[    0.000000] nvram: XP partition at 0xffffffff
[    0.000000] nvram: NR partition at 0xffffffff
[    0.000000] Top of RAM: 0xc000000, Total RAM: 0xc000000
[    0.000000] Memory hole size: 0MB
[    0.000000] On node 0 totalpages: 49152
[    0.000000]   DMA zone: 49152 pages, LIFO batch:15
[    0.000000] Built 1 zonelists
[    0.000000] Kernel command line: root=/dev/hda3 ro
reserve=0xfd000000,0xffffff
[    0.000000] irq: Found primary Apple PIC /pci at 80000000/mac-io at 10 for 64 irqs
[    0.000000] irq: System has 64 possible interrupts
[    0.000000] PID hash table entries: 1024 (order: 10, 4096 bytes)
[    0.000000] GMT Delta read from XPRAM: 0 minutes, DST: on
[    0.000000] time_init: decrementer frequency = 16.704016 MHz
[    0.000000] time_init: processor frequency   = 399.999996 MHz
[   25.910338] Console: colour dummy device 80x25
[   25.911623] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[   25.912659] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[   25.940018] High memory: 0k
[   25.940069] Memory: 182972k/196608k available (2748k kernel code,
13336k reserved, 432k data, 300k bss, 172k init)
[   25.940422] Calibrating delay loop... 33.28 BogoMIPS (lpj=66560)
[   26.022106] Security Framework v1.0.0 initialized
[   26.022155] SELinux:  Disabled at boot.
[   26.022219] Mount-cache hash table entries: 512
[   26.022863] device-tree: Duplicate name in /cpus/PowerPC,750 at 0,
renamed to "l2-cache#1"
[   26.025164] checking if image is initramfs... it is
[   28.381278] Freeing initrd memory: 7237k freed
[   28.384574] NET: Registered protocol family 16
[   28.385244] PMU i2c /pci at 80000000/mac-io at 10/via-pmu at 16000
[   28.385279]  channel 1 bus <multibus>
[   28.385297]  channel 2 bus <multibus>
[   28.385642] PCI: Probing PCI hardware
[   28.387524] PCI: Cannot allocate resource region 1 of device 0000:00:11.0
[   28.387629] Registering pmac pic with sysfs...
[   28.390328] NET: Registered protocol family 2
[   28.422201] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[   28.422723] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[   28.423021] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[   28.423180] TCP: Hash tables configured (established 8192 bind 4096)
[   28.423201] TCP reno registered
[   28.423311] Thermal assist unit using timers, shrink_timer: 500 jiffies
[   28.426031] audit: initializing netlink socket (disabled)
[   28.426116] audit(1177056265.515:1): initialized
[   28.426624] VFS: Disk quotas dquot_6.5.1
[   28.426731] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[   28.426985] Initializing Cryptographic API
[   28.427025] io scheduler noop registered
[   28.427056] io scheduler anticipatory registered
[   28.427085] io scheduler deadline registered
[   28.427138] io scheduler cfq registered (default)
[   28.427687] PCI: Enabling device 0000:00:11.0 (0086 -> 0087)
[   28.427738] atyfb: using auxiliary register aperture
[   28.428377] atyfb: 3D RAGE LT PRO (Mach64 LI, PCI) [0x4c49 rev 0xdc]
[   28.428437] atyfb: 8M SDRAM (1:1), 29.498928 MHz XTAL, 230 MHz PLL,
100 Mhz MCLK, 100 MHz XCLK
[   28.429016] atyfb: monitor sense=62b, mode 6
[   28.506523] Console: switching to colour frame buffer device 128x48
[   28.506751] atyfb: fb0: ATY Mach64 frame buffer device on PCI
[   28.633836] Generic RTC Driver v1.07
[   28.634254] Macintosh non-volatile memory driver v1.1
[   28.634772] mice: PS/2 mouse device common for all mice
[   28.637360] RAMDISK driver initialized: 16 RAM disks of 65536K size
1024 blocksize
[   28.638391] MacIO PCI driver attached to Paddington chipset
[   28.639570] Can't request resource 0 for MacIO device 0.00000000:power-mg
[   28.642276] mediabay0: Registered Heathrow media-bay
[   28.642472] mediabay0: powering down
[   28.877987] mediabay0: switching to 3
[   28.878126] mediabay0: powering up
[   29.101989] mediabay0: enabling (kind:3)
[   29.165986] mediabay0: waiting reset (kind:3)
[   29.293985] mediabay0: waiting IDE reset (kind:3)
[   30.445985] mediabay0: waiting IDE ready (kind:3)
[   30.477983] mediabay0: up before IDE init
[   30.478458] input: Macintosh mouse button emulation as /class/input/input0
[   30.479119] Registered "pmu" backlight controller,level: 15/15
[   30.479637] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
[   30.479870] ide: Assuming 33MHz system bus speed for PIO modes;
override with idebus=xx
[   30.480439] adb: starting probe task...
[   31.497995] ide0: Found Apple Heathrow ATA controller, bus ID 0, irq 13
[   31.498286] Probing IDE interface ide0...
[   31.954183] hda: TOSHIBA MK6409MAV, ATA DISK drive
[   32.611162] adb devices: [2]: 2 c3 [3]: 3 1 [7]: 7 1f
[   32.634017] hda: Enabling MultiWord DMA 2
[   32.643350] ide0 at 0xcd014000-0xcd014007,0xcd014160 on irq 13
[   32.651679] ADB keyboard at 2, handler 1
[   32.659820] Detected ADB keyboard, type ANSI.
[   32.668139] input: ADB keyboard as /class/input/input1
[   32.676483] input: ADB Powerbook buttons as /class/input/input2
[   32.684843] Registered ide1 for media bay 0
[   32.684864] ide1: Found Apple Heathrow ATA controller, bus ID 1
(mediabay), irq 14
[   32.693160] Probing IDE interface ide1...
[   32.706948] ADB mouse at 3, handler set to 4 (trackpad)
[   32.768386] input: ADB mouse as /class/input/input3
[   32.776545] adb: finished probe task...
[   33.202168] hdc: MATSHITADVD-ROM SR-8171, ATAPI CD/DVD-ROM drive
[   33.545990] hdc: Enabling MultiWord DMA 2
[   33.555052] ide1 at 0xcd016000-0xcd016007,0xcd016160 on irq 14
[   33.563755] PowerMac i2c bus pmu 2 registered
[   33.572078] PowerMac i2c bus pmu 1 registered
[   33.580489] TCP bic registered
[   33.588579] NET: Registered protocol family 1
[   33.596694] NET: Registered protocol family 8
[   33.604646] NET: Registered protocol family 20
[   33.612674] Freeing unused kernel memory: 172k init
[   34.456492] Capability LSM initialized
[   38.025331] usbcore: registered new driver usbfs
[   38.035926] usbcore: registered new driver hub
[   38.053558] ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller
(OHCI) Driver (PCI)
[   38.056730] ohci_hcd 0000:00:0e.0: OHCI Host Controller
[   38.065119] ohci_hcd 0000:00:0e.0: new USB bus registered, assigned
bus number 1
[   38.072482] ohci_hcd 0000:00:0e.0: irq 28, io mem 0x80882000
[   38.165694] usb usb1: configuration #1 chosen from 1 choice
[   38.173828] hub 1-0:1.0: USB hub found
[   38.181343] hub 1-0:1.0: 2 ports detected
[   38.966718] SCSI subsystem initialized
[   38.981943] mesh: configured for synchronous 5 MB/s
[   39.194114] mesh: performing initial bus reset...
[   39.226978] hda: max request size: 128KiB
[   39.430672] hda: 12685680 sectors (6495 MB), CHS=13424/15/63, (U)DMA
[   39.438360] hda: cache flushes not supported
[   39.445878]  hda: [mac] hda1 hda2 hda3 hda4 hda5 hda6 hda7 hda8
[   39.499341] hdc: ATAPI 20X DVD-ROM drive, 512kB Cache, DMA
[   39.506824] Uniform CD-ROM driver Revision: 3.20
[   40.894858] Attempting manual resume
[   41.110254] kjournald starting.  Commit interval 5 seconds
[   41.117765] EXT3-fs: mounted filesystem with ordered data mode.
[   43.202049] scsi0 : MESH
[   43.759000] eth0: BMAC+ at 00:50:e4:7a:47:51
[   50.339589] phy registers:
[   50.339611]  0800 7849 2000 5c10 01e1 41e1 0007 2801
[   50.349856]  0000 0000 0000 0000 0000 0000 0000 0000
[   50.360094]  2002 0000 0000 0000 0001 0000 0020 0000
[   50.370333]  0000 0000 0180 0100 0006 0f00 0000 0000
[   51.171071] ts: Compaq touchscreen protocol output
[   55.358816] NET: Registered protocol family 17
[   61.082760] pmac_zilog: 0.6 (Benjamin Herrenschmidt
<benh at kernel.crashing.org>)
[   61.096348] pmac_zilog: serial modem detected
[   61.103814] ttyS0 at MMIO 0x80813020 (irq = 15) is a Z85c30 ESCC -
Internal modem
[   61.114230] ttyS1 at MMIO 0x80813000 (irq = 16) is a Z85c30 ESCC -
Infrared port
[   61.863210] PCI: Enabling device 0000:00:13.0 (0000 -> 0002)
[   61.871706] Yenta: CardBus bridge found at 0000:00:13.0 [0000:0000]
[   61.879279] PCI: Bus 1, cardbus bridge: 0000:00:13.0
[   61.886811]   IO window: 00001400-000015ff
[   61.894236]   IO window: 00001800-000019ff
[   61.901611]   PREFETCH window: 80000000-803fffff
[   61.909010]   MEM window: 80400000-807fffff
[   61.916384] Yenta: Enabling burst memory read transactions
[   61.923814] Yenta: Using CSCINT to route CSC interrupts to PCI
[   61.931275] Yenta: Routing CardBus interrupts to PCI
[   61.938691] Yenta TI: socket 0000:00:13.0, mfunc 0x00000002, devctl 0x60
[   62.050028] Yenta: ISA IRQ mask 0x0000, PCI irq 22
[   62.057634] Socket status: 30000086
[   62.065033] pcmcia: parent PCI bridge I/O window: 0x0 - 0x7fffff
[   62.077403] pcmcia: parent PCI bridge Memory window: 0x80000000 - 0xfcffffff
[   62.085058] pcmcia: parent PCI bridge Memory window: 0xfd000000 - 0xfdffffff
[   63.021055] apm_emu: APM Emulation 0.5 initialized.
[   65.646801] input: PowerMac Beep as /class/input/input4
[   66.559176] Adding 351552k swap on
/dev/disk/by-uuid/5de2f7e0-bb6e-49cc-b4c6-6e2fc4b74459.  Priority:-1
extents:1 across:351552k
[   67.009724] EXT3 FS on hda3, internal journal
[   68.087955] kjournald starting.  Commit interval 5 seconds
[   68.096122] EXT3 FS on hda8, internal journal
[   68.096147] EXT3-fs: mounted filesystem with ordered data mode.
[   68.137367] kjournald starting.  Commit interval 5 seconds
[   68.143006] EXT3 FS on hda7, internal journal
[   68.143030] EXT3-fs: mounted filesystem with ordered data mode.
[   68.214561] kjournald starting.  Commit interval 5 seconds
[   68.223405] EXT3 FS on hda4, internal journal
[   68.223428] EXT3-fs: mounted filesystem with ordered data mode.
[   68.272234] kjournald starting.  Commit interval 5 seconds
[   68.319313] EXT3 FS on hda5, internal journal
[   68.319352] EXT3-fs: mounted filesystem with ordered data mode.
[  101.815690] lp: driver loaded but no devices found
[  102.366535] ppdev: user-space parallel port driver
[  497.941249] NET: Registered protocol family 10
[  497.941713] lo: Disabled Privacy Extensions
[  497.942186] IPv6 over IPv4 tunneling driver
[  508.545547] eth0: no IPv6 routers present
[  557.817502] pccard: PCMCIA card inserted into slot 0
[  557.817542] cs: memory probe 0x80000000-0xfcffffff: excluding
0x80000000-0x81ffffff
[  557.923320] cs: memory probe 0xfd000000-0xfdffffff: excluding
0xfd000000-0xfdffffff
[  557.924033] pcmcia: registering new device pcmcia0.0
[  558.398124] orinoco 0.15rc3 (David Gibson
<hermes at gibson.dropbear.id.au>, Pavel Roskin <proski at gnu.org>, et al)
[  558.468212] orinoco_cs 0.15rc3 (David Gibson
<hermes at gibson.dropbear.id.au>, Pavel Roskin <proski at gnu.org>, et al)
[  558.616419] eth1: Hardware identity 8003:0000:0001:0000
[  558.616561] eth1: Station identity  001f:0004:0001:0003
[  558.616573] eth1: Firmware determined as Intersil 1.3.4
[  558.616582] eth1: Ad-hoc demo mode supported
[  558.616590] eth1: IEEE standard IBSS ad-hoc mode supported
[  558.616599] eth1: WEP supported, 104-bit key
[  558.616691] eth1: MAC address 00:02:6F:01:12:B3
[  558.616783] eth1: Station name "Prism  I"
[  558.617277] eth1: ready
[  558.627761] eth1: index 0x01: , irq 22, io 0x0000-0x003f
[  558.772161] ieee80211_crypt: registered algorithm 'NULL'
[  558.884782] hostap_cs: 0.4.4-kernel (Jouni Malinen <jkmaline at cc.hut.fi>)
[  559.121499] ADDRCONF(NETDEV_UP): eth1: link is not ready
[  559.212347] eth1: New link status: Disconnected (0002)
[  559.721463] eth1: New link status: Association Failed (0006)
[  621.438345] eth1: New link status: Disconnected (0002)
[  623.208325] eth1: New link status: Connected (0001)
[  623.208391] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[  633.569464] eth1: no IPv6 routers present
[  646.782936] eth1: New link status: Disconnected (0002)
[  647.596634] eth1: New link status: Connected (0001)
[  647.781431] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[  664.697386] eth1: no IPv6 routers present



On 18/04/07, Batist Paklons <batist at gmail.com> wrote:
> Hi
>
> I'm running xubuntu feisty on a powerbook G3. I've been trying to get
> a wireless pcmcia NIC to work - but to no avail:
>
> [  196.111372] pccard: PCMCIA card inserted into slot 0
> [  196.111407] cs: memory probe 0x80000000-0xfcffffff: excluding 0x80000000-0x81
> ffffff
> [  196.230699] cs: memory probe 0xfd000000-0xfdffffff:Machine check in kernel mo
> de.
> [  196.230784] Caused by (from SRR1=49030): Transfer error ack signal
> [  196.231010] Oops: Machine check, sig: 7 [#1]
>
> I have found a similar problem in the list in this thread:
> http://lists.infradead.org/pipermail/linux-pcmcia/2006-April/003487.html
>
> Following that post I added a kernel parameter:
> [    0.000000] Kernel command line: root=/dev/hda3 ro reserve=0xfd000000,0xfffff
> f
> but still the same error occurs. Where did I go wrong?
>
> I've added a bunch of useful stuff such as dmesg (the card was
> inserted after starting up, the error message is right at the end).
>
> Thanks in advance!
> Batist
>
> Linux powerbookG3 2.6.20-15-powerpc #3 Sun Apr 15 06:45:49 UTC 2007
> ppc GNU/Linux
>
> dmesg
> [    0.000000] Using PowerMac machine description
> [    0.000000] Total memory = 192MB; using 512kB for hash table (at cbf80000)
> [    0.000000] Linux version 2.6.20-15-powerpc (root at adare) (gcc
> version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)) #3 Sun Apr 15 06:45:49 UTC 2007
> (Ubuntu 2.6.20-15.27-powerpc)
> [    0.000000] Found initrd at 0xc1900000:0xc204b400
> [    0.000000] Found a Paddington mac-io controller, rev: 0, mapped at
> 0xfdf80000
> [    0.000000] PowerMac motherboard: PowerBook 101 (Lombard)
> [    0.000000] PMU driver v2 initialized for 1999 PowerBook G3, firmware: 0b
> [    0.000000] Entering add_active_range(0, 0, 49152) 0 entries of 256 used
> [    0.000000] Found Grackle (MPC106) PCI host bridge at
> 0x0000000080000000. Firmware bus number: 0->0
> [    0.000000] nvram: OF partition at 0x140
> [    0.000000] nvram: XP partition at 0xffffffff
> [    0.000000] nvram: NR partition at 0xffffffff
> [    0.000000] Top of RAM: 0xc000000, Total RAM: 0xc000000
> [    0.000000] Memory hole size: 0MB
> [    0.000000] Zone PFN ranges:
> [    0.000000]   DMA             0 ->    49152
> [    0.000000]   Normal      49152 ->    49152
> [    0.000000]   HighMem     49152 ->    49152
> [    0.000000] early_node_map[1] active PFN ranges
> [    0.000000]     0:        0 ->    49152
> [    0.000000] On node 0 totalpages: 49152
> [    0.000000]   DMA zone: 384 pages used for memmap
> [    0.000000]   DMA zone: 0 pages reserved
> [    0.000000]   DMA zone: 48768 pages, LIFO batch:15
> [    0.000000]   Normal zone: 0 pages used for memmap
> [    0.000000]   HighMem zone: 0 pages used for memmap
> [    0.000000] Built 1 zonelists.  Total pages: 48768
> [    0.000000] Kernel command line: root=/dev/hda3 ro
> reserve=0xfd000000,0xffffff
> [    0.000000] irq: Found primary Apple PIC /pci at 80000000/mac-io at 10 for 64 irqs
> [    0.000000] irq: System has 64 possible interrupts
> [    0.000000] PID hash table entries: 1024 (order: 10, 4096 bytes)
> [    0.000000] GMT Delta read from XPRAM: 0 minutes, DST: on
> [    0.000000] time_init: decrementer frequency = 16.703983 MHz
> [    0.000000] time_init: processor frequency   = 399.999996 MHz
> [   26.038132] Console: colour dummy device 80x25
> [   26.039439] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
> [   26.040476] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
> [   26.067581] High memory: 0k
> [   26.067598] Memory: 182528k/196608k available (3220k kernel code,
> 13744k reserved, 120k data, 293k bss, 188k init)
> [   26.068022] Calibrating delay loop... 33.28 BogoMIPS (lpj=66560)
> [   26.149873] Security Framework v1.0.0 initialized
> [   26.149926] SELinux:  Disabled at boot.
> [   26.149995] Mount-cache hash table entries: 512
> [   26.150644] device-tree: Duplicate name in /cpus/PowerPC,750 at 0,
> renamed to "l2-cache#1"
> [   26.153881] NET: Registered protocol family 16
> [   26.154549] PMU i2c /pci at 80000000/mac-io at 10/via-pmu at 16000
> [   26.154580]  channel 1 bus <multibus>
> [   26.154598]  channel 2 bus <multibus>
> [   26.154738] PCI: Probing PCI hardware
> [   26.156754] PCI: Cannot allocate resource region 1 of device 0000:00:11.0
> [   26.156849] Registering pmac pic with sysfs...
> [   26.160793] NET: Registered protocol family 8
> [   26.160822] NET: Registered protocol family 20
> [   26.162213] NET: Registered protocol family 2
> [   26.197932] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
> [   26.198294] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
> [   26.198541] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
> [   26.198687] TCP: Hash tables configured (established 8192 bind 4096)
> [   26.198709] TCP reno registered
> [   26.210210] checking if image is initramfs... it is
> [   28.615371] Freeing initrd memory: 7469k freed
> [   28.617004] Thermal assist unit using timers, shrink_timer: 500 jiffies
> [   28.618494] audit: initializing netlink socket (disabled)
> [   28.618585] audit(1176920167.580:1): initialized
> [   28.619082] VFS: Disk quotas dquot_6.5.1
> [   28.619208] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
> [   28.619506] io scheduler noop registered
> [   28.619534] io scheduler anticipatory registered
> [   28.619554] io scheduler deadline registered
> [   28.619597] io scheduler cfq registered (default)
> [   28.620652] PCI: Enabling device 0000:00:11.0 (0086 -> 0087)
> [   28.620713] atyfb: using auxiliary register aperture
> [   28.621346] atyfb: 3D RAGE LT PRO (Mach64 LI, PCI) [0x4c49 rev 0xdc]
> [   28.621407] atyfb: 8M SDRAM (1:1), 29.498928 MHz XTAL, 230 MHz PLL,
> 100 Mhz MCLK, 100 MHz XCLK
> [   28.621989] atyfb: monitor sense=62b, mode 6
> [   28.685979] Console: switching to colour frame buffer device 128x48
> [   28.705901] atyfb: fb0: ATY Mach64 frame buffer device on PCI
> [   28.857512] Generic RTC Driver v1.07
> [   28.857997] Macintosh non-volatile memory driver v1.1
> [   28.858614] mice: PS/2 mouse device common for all mice
> [   28.861517] RAMDISK driver initialized: 16 RAM disks of 65536K size
> 1024 blocksize
> [   28.862592] MacIO PCI driver attached to Paddington chipset
> [   28.863931] Can't request resource 0 for MacIO device 0.00000000:power-mg
> [   28.867185] mediabay0: Registered Heathrow media-bay
> [   28.867418] mediabay0: powering down
> [   29.101680] mediabay0: switching to 3
> [   29.101837] mediabay0: powering up
> [   29.325678] mediabay0: enabling (kind:3)
> [   29.389674] mediabay0: waiting reset (kind:3)
> [   29.517671] mediabay0: waiting IDE reset (kind:3)
> [   30.669655] mediabay0: waiting IDE ready (kind:3)
> [   30.701654] mediabay0: up before IDE init
> [   30.702187] input: Macintosh mouse button emulation as /class/input/input0
> [   30.703214] pmubl: Backlight initialized (pmubl)
> [   30.703626] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
> [   30.703892] ide: Assuming 33MHz system bus speed for PIO modes;
> override with idebus=xx
> [   30.704483] adb: starting probe task...
> [   31.721652] ide0: Found Apple Heathrow ATA controller, bus ID 0, irq 20
> [   31.721971] Probing IDE interface ide0...
> [   32.177837] hda: TOSHIBA MK6409MAV, ATA DISK drive
> [   32.831125] adb devices: [2]: 2 c3 [3]: 3 1 [7]: 7 1f
> [   32.856981] ADB keyboard at 2, handler 1
> [   32.866098] Detected ADB keyboard, type ANSI.
> [   32.875370] input: ADB keyboard as /class/input/input1
> [   32.884642] input: ADB Powerbook buttons as /class/input/input2
> [   32.893677] hda: Enabling MultiWord DMA 2
> [   32.903665] ide0 at 0xcd012000-0xcd012007,0xcd012160 on irq 20
> [   32.913237] Registered ide1 for media bay 0
> [   32.913258] ide1: Found Apple Heathrow ATA controller, bus ID 1
> (mediabay), irq 31
> [   32.922617] Probing IDE interface ide1...
> [   32.931262] ADB mouse at 3, handler set to 4 (trackpad)
> [   32.994257] input: ADB mouse as /class/input/input3
> [   33.003443] adb: finished probe task...
> [   33.401806] hdc: MATSHITADVD-ROM SR-8171, ATAPI CD/DVD-ROM drive
> [   33.745621] hdc: Enabling MultiWord DMA 2
> [   33.755698] ide1 at 0xcd018000-0xcd018007,0xcd018160 on irq 31
> [   33.765412] PowerMac i2c bus pmu 2 registered
> [   33.774661] PowerMac i2c bus pmu 1 registered
> [   33.784043] TCP cubic registered
> [   33.793047] NET: Registered protocol family 1
> [   33.802270] Freeing unused kernel memory: 188k init
> [   34.664163] Capability LSM initialized
> [   38.447109] usbcore: registered new interface driver usbfs
> [   38.447589] usbcore: registered new interface driver hub
> [   38.447958] usbcore: registered new device driver usb
> [   38.454521] ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller
> (OHCI) Driver
> [   38.454718] ohci_hcd 0000:00:0e.0: OHCI Host Controller
> [   38.455604] ohci_hcd 0000:00:0e.0: new USB bus registered, assigned
> bus number 1
> [   38.456008] ohci_hcd 0000:00:0e.0: irq 28, io mem 0x80882000
> [   38.639470] usb usb1: configuration #1 chosen from 1 choice
> [   38.639953] hub 1-0:1.0: USB hub found
> [   38.640203] hub 1-0:1.0: 2 ports detected
> [   39.237886] SCSI subsystem initialized
> [   39.245662] mesh: configured for synchronous 5 MB/s
> [   39.449782] mesh: performing initial bus reset...
> [   39.844696] hda: max request size: 128KiB
> [   40.042244] hda: 12685680 sectors (6495 MB), CHS=13424/15/63, (U)DMA
> [   40.042711] hda: cache flushes not supported
> [   40.043104]  hda: [mac] hda1 hda2 hda3 hda4 hda5 hda6 hda7 hda8
> [   40.203217] hdc: ATAPI 20X DVD-ROM drive, 512kB Cache, DMA
> [   40.203702] Uniform CD-ROM driver Revision: 3.20
> [   41.374431] Attempting manual resume
> [   41.548016] kjournald starting.  Commit interval 5 seconds
> [   41.548450] EXT3-fs: mounted filesystem with ordered data mode.
> [   43.453569] scsi0 : MESH
> [   44.003875] eth0: BMAC+ at 00:50:e4:7a:47:51
> [   49.460579] phy registers:
> [   49.460599]  0800 7849 2000 5c10 01e1 41e1 0007 2801
> [   49.470965]  0000 0000 0000 0000 0000 0000 0000 0000
> [   49.481324]  2002 0000 0000 0000 0001 0000 0020 0000
> [   49.491685]  0000 0000 0180 0100 0006 0f00 0000 0000
> [   54.134269] NET: Registered protocol family 17
> [   57.029251] PCI: Enabling device 0000:00:13.0 (0000 -> 0002)
> [   57.029720] Yenta: CardBus bridge found at 0000:00:13.0 [0000:0000]
> [   57.030038] PCI: Bus 1, cardbus bridge: 0000:00:13.0
> [   57.030265]   IO window: 00001400-000015ff
> [   57.030459]   IO window: 00001800-000019ff
> [   57.030653]   PREFETCH window: 80000000-803fffff
> [   57.030867]   MEM window: 80400000-807fffff
> [   57.031066] Yenta: Enabling burst memory read transactions
> [   57.031312] Yenta: Using CSCINT to route CSC interrupts to PCI
> [   57.031567] Yenta: Routing CardBus interrupts to PCI
> [   57.031791] Yenta TI: socket 0000:00:13.0, mfunc 0x00000002, devctl 0x60
> [   57.133371] Yenta: ISA IRQ mask 0x0000, PCI irq 22
> [   57.133697] Socket status: 30000006
> [   57.133871] pcmcia: parent PCI bridge I/O window: 0x0 - 0x7fffff
> [   57.134140] pcmcia: parent PCI bridge Memory window: 0x80000000 - 0xfcffffff
> [   57.134443] pcmcia: parent PCI bridge Memory window: 0xfd000000 - 0xfdffffff
> [   62.931940] pmac_zilog: 0.6 (Benjamin Herrenschmidt
> <benh at kernel.crashing.org>)
> [   62.939055] pmac_zilog: serial modem detected
> [   62.939539] ttyS0 at MMIO 0x80813020 (irq = 35) is a Z85c30 ESCC -
> Internal modem
> [   62.948488] ttyS1 at MMIO 0x80813000 (irq = 38) is a Z85c30 ESCC -
> Infrared port
> [   63.519859] apm_emu: APM Emulation 0.5 initialized.
> [   66.254320] input: PowerMac Beep as /class/input/input4
> [   67.170934] Adding 351552k swap on
> /dev/disk/by-uuid/5de2f7e0-bb6e-49cc-b4c6-6e2fc4b74459.  Priority:-1
> extents:1 across:351552k
> [   67.564338] EXT3 FS on hda3, internal journal
> [   68.528530] kjournald starting.  Commit interval 5 seconds
> [   68.529919] EXT3 FS on hda8, internal journal
> [   68.529942] EXT3-fs: mounted filesystem with ordered data mode.
> [   68.563591] kjournald starting.  Commit interval 5 seconds
> [   68.564666] EXT3 FS on hda7, internal journal
> [   68.564689] EXT3-fs: mounted filesystem with ordered data mode.
> [   68.626515] kjournald starting.  Commit interval 5 seconds
> [   68.627792] EXT3 FS on hda4, internal journal
> [   68.627813] EXT3-fs: mounted filesystem with ordered data mode.
> [   68.669914] kjournald starting.  Commit interval 5 seconds
> [   68.694117] EXT3 FS on hda5, internal journal
> [   68.694140] EXT3-fs: mounted filesystem with ordered data mode.
> [  103.388928] lp: driver loaded but no devices found
> [  106.150040] ppdev: user-space parallel port driver
> [  196.111372] pccard: PCMCIA card inserted into slot 0
> [  196.111407] cs: memory probe 0x80000000-0xfcffffff: excluding
> 0x80000000-0x81ffffff
> [  196.230699] cs: memory probe 0xfd000000-0xfdffffff:Machine check in
> kernel mode.
> [  196.230784] Caused by (from SRR1=49030): Transfer error ack signal
> [  196.231010] Oops: Machine check, sig: 7 [#1]
> [  196.231316]
> [  196.231408] Modules linked in: ppdev lp parport cpufreq_userspace
> cpufreq_stats cpufreq_powersave cpufreq_ondemand cpufreq_conservative
> snd_powermac snd_pcm_oss snd_pcm snd_mixer_oss snd_seq_dummy
> snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq
> snd_timer snd_seq_device snd soundcore snd_page_alloc apm_emu
> pmac_zilog serial_core pcmcia yenta_socket rsrc_nonstatic pcmcia_core
> af_packet tsdev evdev ext3 jbd mbcache ide_cd cdrom ide_disk bmac mesh
> scsi_mod ohci_hcd usbcore capability commoncap
> [  196.234132] NIP: CD8ECD18 LR: CD8ECCEC CTR: C0014B88
> [  196.234360] REGS: cbe27c80 TRAP: 0200   Not tainted  (2.6.20-15-powerpc)
> [  196.234646] MSR: 00049030 <EE,ME,IR,DR>  CR: 82004024  XER: 00000000
> [  196.235026] TASK = c1f15870[3057] 'pccardd' THREAD: cbe26000
> [  196.235248] GPR00: 000000FF CBE27D30 C1F15870 CD990000 CD8A8014
> 00000070 00000002 CBE27D89
> [  196.235721] GPR08: CD8A8040 00001000 CD990000 CD991000 22000022
> 00000000 00000000 FD000000
> [  196.236194] GPR16: CD880000 FD100000 FE000000 FD000000 00200000
> CB8A1428 FD080000 000004FB
> [  196.236668] GPR24: CBE27D89 00000000 00000002 CB8A1428 00000021
> 00000000 00000002 CBE27D89
> [  196.237172] NIP [CD8ECD18] pcmcia_read_cis_mem+0x178/0x26c [pcmcia_core]
> [  196.237540] LR [CD8ECCEC] pcmcia_read_cis_mem+0x14c/0x26c [pcmcia_core]
> [  196.237854] Call Trace:
> [  196.237984] [CBE27D30] [CD8ECCEC] pcmcia_read_cis_mem+0x14c/0x26c
> [pcmcia_core] (unreliable)
> [  196.238390] [CBE27D60] [CD8ECF74] read_cis_cache+0x168/0x16c [pcmcia_core]
> [  196.238721] [CBE27D80] [CD8ED1CC] pccard_get_next_tuple+0x1b0/0x480
> [pcmcia_core]
> [  196.239076] [CBE27DC0] [CD8ED534] pccard_get_first_tuple+0x98/0x144
> [pcmcia_core]
> [  196.239431] [CBE27DF0] [CD8EDB84] pccard_validate_cis+0xa0/0x230
> [pcmcia_core]
> [  196.239775] [CBE27E20] [CD881EBC] readable+0x54/0xd8 [rsrc_nonstatic]
> [  196.240094] [CBE27E40] [CD8821E8]
> pcmcia_nonstatic_validate_mem+0x16c/0x408 [rsrc_nonstatic]
> [  196.240475] [CBE27EC0] [CD8EDD3C] pcmcia_validate_mem+0x28/0x40 [pcmcia_core]
> [  196.240817] [CBE27ED0] [CD9227FC] pcmcia_card_add+0x40/0xd0 [pcmcia]
> [  196.241157] [CBE27F40] [CD922934] ds_event+0xa8/0xd4 [pcmcia]
> [  196.241443] [CBE27F60] [CD8EA4F8] send_event+0x6c/0x94 [pcmcia_core]
> [  196.241757] [CBE27F70] [CD8EAA98] socket_insert+0xbc/0x130 [pcmcia_core]
> [  196.242081] [CBE27F80] [CD8EB164] pccardd+0x260/0x2b0 [pcmcia_core]
> [  196.242389] [CBE27FC0] [C0046968] kthread+0xc0/0xfc
> [  196.242647] [CBE27FF0] [C0014434] kernel_thread+0x44/0x60
> [  196.242912] Instruction dump:
> [  196.243071] 4bfffd91 2c030000 41820104 813b00ec 3809ffff 7d634a14
> 7c00e838 7d430214
> [  196.243520] 7f8b5000 419e006c 7c0004ac 7c0300ae <0c000000> 4c00012c
> 3bdeffff 981f0000
>
> lspci
> 00:00.0 Host bridge: Motorola MPC106 [Grackle] (rev 40)
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B-
>         Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort+ >SERR- <PERR-
>         Latency: 0, Cache Line Size: 32 bytes
>
> 00:0e.0 USB Controller: Agere Systems USB (rev 12) (prog-if 10 [OHCI])
>         Subsystem: Agere Systems USB
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32 (750ns min, 21500ns max)
>         Interrupt: pin A routed to IRQ 28
>         Region 0: Memory at 80882000 (32-bit, non-prefetchable) [size=4K]
>
> 00:0f.0 Multimedia controller: C-Cube Microsystems Cinemaster C 3.0
> DVD Decoder (rev 02)
>         Subsystem: C-Cube Microsystems Cinemaster C 3.0 DVD Decoder
>         Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32 (1000ns min, 32000ns max)
>         Interrupt: pin A routed to IRQ 26
>         Region 0: I/O ports at 0c00 [size=256]
>         Capabilities: [60] Power Management version 1
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:10.0 Class ff00: Apple Computer Inc. Paddington Mac I/O
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
> ParErr- Stepping- SERR- FastB2B-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32, Cache Line Size: 32 bytes
>         Region 0: Memory at 80800000 (32-bit, non-prefetchable) [size=512K]
>
> 00:11.0 VGA compatible controller: ATI Technologies Inc 3D Rage LT Pro
> (rev dc) (prog-if 00 [VGA])
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping+ SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32 (2000ns min), Cache Line Size: 32 bytes
>         Interrupt: pin A routed to IRQ 24
>         Region 0: Memory at 81000000 (32-bit, non-prefetchable) [size=16M]
>         Region 1: I/O ports at 1000 [size=256]
>         Region 2: Memory at 80881000 (32-bit, non-prefetchable) [size=4K]
>         Capabilities: [5c] Power Management version 1
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:13.0 CardBus bridge: Texas Instruments PCI1211
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 168, Cache Line Size: 32 bytes
>         Interrupt: pin A routed to IRQ 22
>         Region 0: Memory at 80880000 (32-bit, non-prefetchable) [size=4K]
>         Bus: primary=00, secondary=01, subordinate=04, sec-latency=176
>         Memory window 0: 80000000-803ff000 (prefetchable)
>         Memory window 1: 80400000-807ff000
>         I/O window 0: 00001400-000015ff
>         I/O window 1: 00001800-000019ff
>         BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+
>         16-bit legacy interface ports at 0001
>
> /proc/ioports
> 00000000-007fffff : /pci at 80000000
>   00000c00-00000cff : 0000:00:0f.0
>   00001000-000010ff : 0000:00:11.0
>   00001400-000015ff : PCI CardBus #01
>   00001800-000019ff : PCI CardBus #01
>
> /proc/iomem
> 80000000-fcffffff : /pci at 80000000
>   80000000-803fffff : PCI CardBus #01
>   80400000-807fffff : PCI CardBus #01
>   80800000-8087ffff : 0000:00:10.0
>     80800000-8087ffff : 0.80800000:mac-io
>       80800010-8080002f : 0.00000010:interrup
>       80800034-80800034 : 0.00000034:media-ba
>         80800034-80800034 : media-bay
>       80808000-808080ff : 0.00010000:scsi
>         80808000-808080ff : mesh
>       80808100-808081ff : 0.00015000:fdc
>       80808200-808082ff : 0.00011000:ethernet
>         80808200-808082ff : bmac
>       80808300-808083ff : 0.00011000:ethernet
>         80808300-808083ff : bmac
>       80808800-808088ff : 0.00014000:davbus
>         80808800-808088ff : Sound Tx DMA
>       80808900-808089ff : 0.00014000:davbus
>         80808900-808089ff : Sound Rx DMA
>       80808b00-80808bff : 0.00020000:ata-3
>         80808b00-80808bff : ide-pmac (dma)
>       80808c00-80808cff : 0.00021000:ata-3
>         80808c00-80808cff : ide-pmac (dma)
>       80810000-80810fff : 0.00010000:scsi
>         80810000-80810fff : mesh
>       80811000-80811fff : 0.00011000:ethernet
>         80811000-80811fff : bmac
>       80813000-80813000 : 0.00013000:ch-b
>         80813000-80813000 : pmac_zilog
>       80813010-80813010 : 0.00013000:ch-b
>         80813010-80813010 : pmac_zilog
>       80813020-80813020 : 0.00013020:ch-a
>         80813020-80813020 : pmac_zilog
>       80813030-80813030 : 0.00013020:ch-a
>         80813030-80813030 : pmac_zilog
>       80813040-80813040 : 0.00013000:ch-b
>         80813040-80813040 : pmac_zilog
>       80813050-80813050 : 0.00013020:ch-a
>         80813050-80813050 : pmac_zilog
>       80814000-80814fff : 0.00014000:davbus
>         80814000-80814fff : Sound Control
>       80815000-80815fff : 0.00015000:fdc
>       80816000-80817fff : 0.00016000:via-pmu
>       80820000-80820fff : 0.00020000:ata-3
>         80820000-80820fff : ide-pmac (ports)
>       80821000-80821fff : 0.00021000:ata-3
>         80821000-80821fff : ide-pmac (ports)
>   80880000-80880fff : 0000:00:13.0
>     80880000-80880fff : yenta_socket
>   80881000-80881fff : 0000:00:11.0
>     80881000-80881fff : atyfb
>   80882000-80882fff : 0000:00:0e.0
>     80882000-80882fff : ohci_hcd
>   81000000-81ffffff : 0000:00:11.0
>     81000000-81ffffff : atyfb
> fd000000-fdffffff : /pci at 80000000
>   fd000000-fd07ffff : cs memory probe
>   fd080000-fd0fffff : cs memory probe
> fffffffffd000000-fffffffffdfffffe : reserved
>
> /proc/interrupts
>            CPU0
>  16:         19   PMAC-PIC  Edge      PMac Output
>  17:          1   PMAC-PIC  Edge      PMac
>  18:     107321   PMAC-PIC  Edge      VIA-PMU
>  19:          0   PMAC-PIC  Edge      PMac Input
>  20:      10297   PMAC-PIC  Edge      ide0
>  22:          2   PMAC-PIC  Level     yenta
>  23:         14   PMAC-PIC  Edge      MESH
>  28:          2   PMAC-PIC  Level     ohci_hcd:usb1
>  31:      16703   PMAC-PIC  Edge      ide1
>  32:        927   PMAC-PIC  Edge      BMAC-txdma
>  33:       1108   PMAC-PIC  Edge      BMAC-rxdma
>  42:       2100   PMAC-PIC  Edge      BMAC-misc
> BAD:          0
>
> /etc/pcmcia/config.opts
> #
> # Local PCMCIA Configuration File
> #
> #----------------------------------------------------------------------
> #
> # System resources available for PCMCIA cards
> #
> # NOTE: these settings have no effect on resources assigned to a
> # CardBus bridge device itself; this file only affects resources
> # assigned to cards.  Also, interrupt settings here will only affect
> # ISA bus interrupts assigned to 16-bit cards.  PCI interrupts
> # generally can't be reconfigured.
> #
> # With the kernel PCMCIA subsystem, these settings also have no effect
> # at all on resources used for 32-bit CardBus cards.  Those are set by
> # the PCI hotplug subsystem.
> #
>
> include port 0x100-0x4ff
> include port 0x1000-0x17ff
> include memory 0x80000000-0x80ffffff
>


From Fabrice.Aeschbacher at siemens.com  Fri Apr 20 08:17:28 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Fri, 20 Apr 2007 14:17:28 +0200
Subject: PCMCIA / compact flash / au1x00
In-Reply-To: <20070419151525.22691.qmail@cdy.org>
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A40129DC57@stgw002a.ww002.siemens.net>

> > CONFIG_BLK_DEV_IDECS=m
> 
> Try using the PCMCIA PATA driver instead.

This does not seem to work either. In this case, which would be the
device? /dev/hda? or /dev/sda? something else?

> > Neither hotplug nor udev is installed (I only installed 
> > /sbin/pccardctl).
> 
> Then you'll have to run pcmcia-socket-startup manually. This 
> may actually work also with ide-cs. Try this before PCMCIA PATA.

I tried to run pcmcia-socket-startup, without success. It does not
display any message, neither on stdout nor in dmesg. I tried without
parameters, with 0 then with and 0.0 as parameter.

In /proc/bus/pccard, there should be a sub-directory "00", but it is not
there.
Moreover, 'pccardctl status' display the subdevice 0 as 'unbound'
(should be 'bound', I imagine):

  # pccardctl status
  Socket 0:
    3.3V 16-bit PC Card
    Subdevice 0 (function 0) [unbound]

But the kernel recognizes when I plug the CF card in and out (I can see
messages on the console).

Best regards,
Fabrice Aeschbacher



From stuge-linux-pcmcia at cdy.org  Fri Apr 20 11:17:00 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Fri, 20 Apr 2007 17:17:00 +0200
Subject: PCMCIA / compact flash / au1x00
In-Reply-To: <D7810733513F4840B4EBAAFA64D9C6A40129DC57@stgw002a.ww002.siemens.net>
References: <20070419151525.22691.qmail@cdy.org>
	<D7810733513F4840B4EBAAFA64D9C6A40129DC57@stgw002a.ww002.siemens.net>
Message-ID: <20070420151700.5862.qmail@cdy.org>

On Fri, Apr 20, 2007 at 02:17:28PM +0200, Aeschbacher, Fabrice wrote:
> > > CONFIG_BLK_DEV_IDECS=m
> > 
> > Try using the PCMCIA PATA driver instead.
> 
> This does not seem to work either. In this case, which would be the
> device? /dev/hda? or /dev/sda? something else?

The first of hda, hdc, hde, hdg, hdi etc. that is free.


> I tried to run pcmcia-socket-startup, without success. It does not
> display any message, neither on stdout nor in dmesg. I tried
> without parameters, with 0 then with and 0.0 as parameter.

Should not need parameters.


> Moreover, 'pccardctl status' display the subdevice 0 as 'unbound'
> (should be 'bound', I imagine):

Yes. Perhaps the CF device id isn't added to the pcmcia_pata and/or
ide-cs drivers. I don't know exactly how to retrieve the number, but
I think it's all covered in /usr/src/linux/Documentation/pcmcia/

If the kernel driver doesn't know about the id, userspace tools are
required for reading the card CIS and then for starting it up.


>   # pccardctl status
>   Socket 0:
>     3.3V 16-bit PC Card
>     Subdevice 0 (function 0) [unbound]
> 
> But the kernel recognizes when I plug the CF card in and out (I can
> see messages on the console).

Aye, you're good on your way but not quite there.


//Peter


From jplatte at naasa.net  Sat Apr 21 12:25:54 2007
From: jplatte at naasa.net (Joerg Platte)
Date: Sat, 21 Apr 2007 18:25:54 +0200
Subject: O2Micro: performance degradation on recent kernels
Message-ID: <200704211825.56623.jplatte@naasa.net>

Hi,

Somewhere between 2.6.11 and 2.6.21-rc7 read prefetch and write bursts have 
been disabled for O2Micro CardBus bridges (see drivers/pcmcia/o2micro.h). 
This results in a much lower network card performance (500-700 kB now and 
approximately 4 MB with 2.6.11). According to the comments in o2micro.h there 
might be problems with older chips, but my old notebook does not seem to be 
affected. After patching 2.6.21-rc7 to re-enable prefetching and bursts I'm 
able to get the expected network performance like for 2.6.11. Is there any 
chance that bursts and prefetches can be turned on using a module option? 

lspci:
00:00.0 Host bridge: ALi Corporation M1621 (rev 05)
        Flags: bus master, slow devsel, latency 0
        Memory at e0000000 (32-bit, prefetchable) [size=64M]
        Capabilities: [b0] AGP version 1.0

00:01.0 PCI bridge: ALi Corporation PCI to AGP Controller (rev 01) (prog-if 00 
[Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        Memory behind bridge: 80500000-80cfffff
        Prefetchable memory behind bridge: 80d00000-820fffff

00:06.0 Communication controller: Agere Systems WinModem 56k (rev 01)
        Subsystem: AMBIT Microsystem Corp. Lucent Win Modem
        Flags: bus master, medium devsel, latency 0, IRQ 9
        Memory at 80100000 (32-bit, non-prefetchable) [size=256]
        I/O ports at 7090 [size=8]
        I/O ports at 7400 [size=256]
        Capabilities: [f8] Power Management version 2

00:07.0 ISA bridge: ALi Corporation M1533/M1535 PCI to ISA Bridge [Aladdin 
IV/V/V+] (rev 0a)
        Subsystem: Acer Incorporated [ALI] Unknown device 1002
        Flags: bus master, medium devsel, latency 0

00:08.0 Multimedia audio controller: ESS Technology ES1969 Solo-1 Audiodrive 
(rev 02)
        Subsystem: Acer Incorporated [ALI] Unknown device 1002
        Flags: bus master, medium devsel, latency 32, IRQ 5
        I/O ports at 7800 [size=64]
        I/O ports at 7850 [size=16]
        I/O ports at 7870 [size=16]
        I/O ports at 7890 [size=4]
        I/O ports at 78a4 [size=4]
        Capabilities: [c0] Power Management version 1

00:0f.0 IDE interface: ALi Corporation M5229 IDE (rev 20) (prog-if 8a [Master 
SecP PriP])
        Flags: bus master, medium devsel, latency 32, IRQ 15
        [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [disabled] 
[size=8]
        [virtual] Memory at 000003f0 (type 3, non-prefetchable) [disabled] 
[size=1]
        [virtual] Memory at 00000170 (32-bit, non-prefetchable) [disabled] 
[size=8]
        [virtual] Memory at 00000370 (type 3, non-prefetchable) [disabled] 
[size=1]
        I/O ports at 78c0 [size=16]

00:11.0 Bridge: ALi Corporation M7101 Power Management Controller [PMU] (rev 
09)
        Subsystem: Acer Incorporated [ALI] Unknown device 1002
        Flags: medium devsel

00:13.0 CardBus bridge: O2 Micro, Inc. OZ6832/6833 CardBus Controller (rev 34)
        Subsystem: Acer Incorporated [ALI] Unknown device 1002
        Flags: bus master, stepping, slow devsel, latency 168, IRQ 9
        Memory at 30000000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=02, subordinate=05, sec-latency=176
        Memory window 0: 20000000-23fff000 (prefetchable)
        Memory window 1: 24000000-27fff000
        I/O window 0: 00001400-000014ff
        I/O window 1: 00001800-000018ff
        16-bit legacy interface ports at 0001

00:13.1 CardBus bridge: O2 Micro, Inc. OZ6832/6833 CardBus Controller (rev 34)
        Subsystem: Acer Incorporated [ALI] Unknown device 1002
        Flags: bus master, stepping, slow devsel, latency 168, IRQ 9
        Memory at 30001000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=06, subordinate=09, sec-latency=176
        Memory window 0: 28000000-2bfff000 (prefetchable)
        Memory window 1: 2c000000-2ffff000
        I/O window 0: 00001c00-00001cff
        I/O window 1: 00002000-000020ff
        16-bit legacy interface ports at 0001

00:14.0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03) (prog-if 
10 [OHCI])
        Flags: bus master, medium devsel, latency 32, IRQ 10
        Memory at 82100000 (32-bit, non-prefetchable) [size=4K]

01:00.0 VGA compatible controller: Neomagic Corporation NM2200 [MagicGraph 
256AV] (rev 20) (prog-if 00 [VGA])
        Subsystem: Acer Incorporated [ALI] Unknown device 1002
        Flags: bus master, medium devsel, latency 32, IRQ 9
        Memory at 81000000 (32-bit, prefetchable) [size=16M]
        Memory at 80800000 (32-bit, non-prefetchable) [size=4M]
        Memory at 80500000 (32-bit, non-prefetchable) [size=1M]
        Capabilities: [dc] Power Management version 1

06:00.0 Ethernet controller: 3Com Corporation 3cCFE575CT CardBus [Cyclone] 
(rev 10)
        Subsystem: 3Com Corporation FE575C-3Com 10/100 LAN CardBus-Fast 
Ethernet
        Flags: bus master, medium devsel, latency 64, IRQ 9
        I/O ports at 1c00 [size=256]
        Memory at 2c000000 (32-bit, non-prefetchable) [size=128]
        Memory at 2c000080 (32-bit, non-prefetchable) [size=128]
        [virtual] Expansion ROM at 28000000 [disabled] [size=128K]
        Capabilities: [50] Power Management version 2

regards,
J?rg

PS: Please CC, I'm not subscribed


From hch at infradead.org  Sun Apr 22 08:55:36 2007
From: hch at infradead.org (Christoph Hellwig)
Date: Sun, 22 Apr 2007 13:55:36 +0100
Subject: [PATCH] cs: kill thread_wait
Message-ID: <20070422125536.GA30808@infradead.org>

There is not reason to have a waitqueue if there it's always the same
thread that is waiting for it.  Just use wake_up_process instead.


Signed-off-by: Christoph Hellwig <hch at lst.de>

Index: linux-2.6/drivers/pcmcia/cs.c
===================================================================
--- linux-2.6.orig/drivers/pcmcia/cs.c	2007-04-22 13:19:17.000000000 +0200
+++ linux-2.6/drivers/pcmcia/cs.c	2007-04-22 13:21:05.000000000 +0200
@@ -238,7 +238,6 @@ int pcmcia_register_socket(struct pcmcia
 
 	init_completion(&socket->socket_released);
 	init_completion(&socket->thread_done);
-	init_waitqueue_head(&socket->thread_wait);
 	mutex_init(&socket->skt_mutex);
 	spin_lock_init(&socket->thread_lock);
 
@@ -277,10 +276,9 @@ void pcmcia_unregister_socket(struct pcm
 
 	cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
 
-	if (socket->thread) {
-		wake_up(&socket->thread_wait);
+	if (socket->thread)
 		kthread_stop(socket->thread);
-	}
+
 	release_cis_mem(socket);
 
 	/* remove from our own list */
@@ -649,7 +647,6 @@ static int pccardd(void *__skt)
 		return 0;
 	}
 
-	add_wait_queue(&skt->thread_wait, &wait);
 	complete(&skt->thread_done);
 
 	for (;;) {
@@ -686,8 +683,6 @@ static int pccardd(void *__skt)
 	/* make sure we are running before we exit */
 	set_current_state(TASK_RUNNING);
 
-	remove_wait_queue(&skt->thread_wait, &wait);
-
 	/* remove from the device core */
 	device_unregister(&skt->dev);
 
@@ -707,7 +702,7 @@ void pcmcia_parse_events(struct pcmcia_s
 		s->thread_events |= events;
 		spin_unlock_irqrestore(&s->thread_lock, flags);
 
-		wake_up(&s->thread_wait);
+		wake_up_process(s->thread);
 	}
 } /* pcmcia_parse_events */
 EXPORT_SYMBOL(pcmcia_parse_events);
Index: linux-2.6/include/pcmcia/ss.h
===================================================================
--- linux-2.6.orig/include/pcmcia/ss.h	2007-04-22 13:20:20.000000000 +0200
+++ linux-2.6/include/pcmcia/ss.h	2007-04-22 13:20:27.000000000 +0200
@@ -245,7 +245,6 @@ struct pcmcia_socket {
 
 	struct task_struct		*thread;
 	struct completion		thread_done;
-	wait_queue_head_t		thread_wait;
 	spinlock_t			thread_lock;	/* protects thread_events */
 	unsigned int			thread_events;
 


From vitb at kernel.crashing.org  Sun Apr 22 15:26:58 2007
From: vitb at kernel.crashing.org (Vitaly Bordug)
Date: Sun, 22 Apr 2007 23:26:58 +0400
Subject: Fw: [PATCH][RFC] PCMCIA support for 8xx using platform devices
Message-ID: <20070422232658.5f427fd3@localhost.localdomain>

This utilizes PCMCIA on mpc885ads and mpc866ads from arch/powerpc. In the new approach,
direct IMMR accesses from within drivers/ were totally eliminated, that requires hardware_enable, hardware_disable, voltage_set board-specific functions to be moved over to BSP code section 
(arch/powerpc/platforms/8xx in 885 case). There is just no way to have both arch/ppc and arch/powerpc approaches to work simultaneously because of that.

It implies a bit of work to move other target's bits over to BSP region, but no ifdef hell worths it,
in addition to the fact of being moved/merged to arch/powerpc, the code would spot this problem 
anyway.

Signed-off-by: Vitaly Bordug <vitb at kernel.crashing.org>
---
This is FW of original message sent to linux-pcmcia at lists.infradead.org to attach wider audience.
Original maillist kept in loop to prevent misunderstanding...

 arch/powerpc/boot/dts/mpc885ads.dts          |   12 +
 arch/powerpc/platforms/8xx/mpc885ads.h       |    5 
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |   63 +++++
 arch/powerpc/sysdev/fsl_soc.c                |   58 ++++
 drivers/pcmcia/Kconfig                       |    1 
 drivers/pcmcia/m8xx_pcmcia.c                 |  342 ++++++++++++--------------
 include/linux/fs_pcmcia_pd.h                 |   27 ++
 7 files changed, 318 insertions(+), 190 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
index 90e047a..330ac91 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -112,6 +112,18 @@
 			compatible = "CPM";
 		};
 
+               pcmcia at 0080 {
+                       linux,phandle = <0080>;
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       compatible = "8xx";
+                       device_type = "pcmcia";
+                       reg = <80 80>;
+                       clock-frequency = <2faf080>;
+                       interrupt-parent = <ff000000>;
+                       interrupts = <d 1>;
+		};
+
 		cpm at ff000000 {
 			linux,phandle = <ff000000>;
 			#address-cells = <1>;
diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/platforms/8xx/mpc885ads.h
index 7c31aec..4439346 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads.h
+++ b/arch/powerpc/platforms/8xx/mpc885ads.h
@@ -91,5 +91,10 @@ #define PC_ENET_RENA	((ushort)0x0800)
 #define SICR_ENET_MASK	((uint)0x00ff0000)
 #define SICR_ENET_CLKRT	((uint)0x002c0000)
 
+/* Some internal interrupt registers use an 8-bit mask for the interrupt
+ * level instead of a number.
+ */
+#define mk_int_int_mask(IL) (1 << (7 - (IL/2)))
+
 #endif /* __ASM_MPC885ADS_H__ */
 #endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 394f983..1ba423f 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -22,6 +22,7 @@ #include <linux/root_dev.h>
 
 #include <linux/fs_enet_pd.h>
 #include <linux/fs_uart_pd.h>
+#include <linux/fs_pcmcia_pd.h>
 #include <linux/mii.h>
 
 #include <asm/delay.h>
@@ -375,6 +376,68 @@ static void init_i2c_ioports()
         setbits16(&cp->cp_pbodr, 0x0030);
 }
 
+void pcmcia_hw_setup(int slot, int enable)
+{
+	unsigned *bcsr_io;
+
+	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
+	if (enable)
+	clrbits32(bcsr_io, BCSR1_PCCEN);
+	else
+		setbits32(bcsr_io, BCSR1_PCCEN);
+
+	iounmap(bcsr_io);
+}
+
+int pcmcia_set_voltage(int slot, int vcc, int vpp)
+{
+        u32 reg = 0;
+        unsigned *bcsr_io;
+
+        bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
+
+        switch(vcc) {
+                case 0:
+                        break;
+                case 33:
+                        reg |= BCSR1_PCCVCC0;
+                        break;
+                case 50:
+                        reg |= BCSR1_PCCVCC1;
+                        break;
+                default:
+                        return 1;
+        }
+
+        switch(vpp) {
+                case 0:
+                        break;
+                case 33:
+                case 50:
+                        if(vcc == vpp)
+                                reg |= BCSR1_PCCVPP1;
+                        else
+                                return 1;
+                        break;
+                case 120:
+                        if ((vcc == 33) || (vcc == 50))
+                                reg |= BCSR1_PCCVPP0;
+                        else
+                                return 1;
+                default:
+                        return 1;
+        }
+
+        /* first, turn off all power */
+        clrbits32(bcsr_io, 0x00610000);
+
+        /* enable new powersettings */
+        setbits32(bcsr_io, reg);
+
+        iounmap(bcsr_io);
+        return 0;
+}
+
 int platform_device_skip(char *model, int id)
 {
 #ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 355c05d..753118d 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -26,6 +26,7 @@ #include <linux/phy.h>
 #include <linux/fsl_devices.h>
 #include <linux/fs_enet_pd.h>
 #include <linux/fs_uart_pd.h>
+#include <linux/fs_pcmcia_pd.h>
 
 #include <asm/system.h>
 #include <asm/atomic.h>
@@ -862,6 +863,8 @@ #ifdef CONFIG_8xx
 
 extern void init_scc_ioports(struct fs_platform_info*);
 extern int platform_device_skip(char *model, int id);
+extern void pcmcia_hw_setup(int slot, int enable);
+extern int pcmcia_set_voltage(int slot, int vcc, int vpp);
 
 static int __init fs_enet_mdio_of_init(void)
 {
@@ -1267,5 +1270,60 @@ err:
 
 arch_initcall(fsl_i2c_cpm_of_init);
 
+static const char *pcmcia_regs = "regs";
+static const char *pcmcia_irq = "interrupt";
+
+static int __init fsl_pcmcia_of_init(void)
+{
+	struct device_node *np;
+	unsigned int i;
+	struct platform_device *pcmcia_dev;
+	int ret;
+
+	for (np = NULL, i = 0;
+	     (np = of_find_compatible_node(np, "pcmcia", "8xx")) != NULL;
+	     i++) {
+		struct resource r[2];
+		struct fs_pcmcia_platform_data pcmcia_data;
+
+		memset(&r, 0, sizeof(r));
+		memset(&pcmcia_data, 0, sizeof(pcmcia_data));
+
+		ret = of_address_to_resource(np, 0, &r[0]);
+		if (ret)
+			goto err;
+		r[0].name = pcmcia_regs;
+
+		r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
+		r[1].flags = IORESOURCE_IRQ;
+		r[1].name = pcmcia_irq;
+
+		pcmcia_data.hwirq = irq_map[r[1].start].hwirq;
+		pcmcia_data.hw_setup = pcmcia_hw_setup;
+		pcmcia_data.voltage_set = pcmcia_set_voltage;
+		pcmcia_data.bus_freq = ppc_proc_freq;
+
+		pcmcia_dev = platform_device_register_simple("m8xx-pcmcia", i, &r[0], 2);
+		if (IS_ERR(pcmcia_dev)) {
+			ret = PTR_ERR(pcmcia_dev);
+			goto err;
+		}
+		ret =
+		    platform_device_add_data(pcmcia_dev, &pcmcia_data,
+					     sizeof(struct
+						    fs_pcmcia_platform_data));
+		if (ret)
+			goto unreg;
+	}
+
+	return 0;
+
+unreg:
+	platform_device_unregister(pcmcia_dev);
+err:
+	return ret;
+}
+
+arch_initcall(fsl_pcmcia_of_init);
 
 #endif /* CONFIG_8xx */
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 35f8864..c3fd55d 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -183,6 +183,7 @@ config PCMCIA_M8XX
         tristate "MPC8xx PCMCIA support"
         depends on PCMCIA && PPC && 8xx 
         select PCCARD_IODYN
+	select PCCARD_NONSTATIC
         help
         Say Y here to include support for PowerPC 8xx series PCMCIA
         controller.
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 9721ed7..ddac883 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -40,10 +40,6 @@ #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/string.h>
 
-#include <asm/io.h>
-#include <asm/bitops.h>
-#include <asm/system.h>
-
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
@@ -52,10 +48,16 @@ #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/fs_pcmcia_pd.h>
 
+#include <asm/io.h>
+#include <asm/bitops.h>
+#include <asm/system.h>
+#include <asm/time.h>
 #include <asm/mpc8xx.h>
 #include <asm/8xx_immap.h>
 #include <asm/irq.h>
+#include <asm/fs_pd.h>
 
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
@@ -146,27 +148,18 @@ #endif
 #define PCMCIA_MEM_WIN_BASE 0xe0000000 /* base address for memory window 0   */
 #define PCMCIA_MEM_WIN_SIZE 0x04000000 /* each memory window is 64 MByte     */
 #define PCMCIA_IO_WIN_BASE  _IO_BASE   /* base address for io window 0       */
-
-#define PCMCIA_SCHLVL PCMCIA_INTERRUPT /* Status Change Interrupt Level      */
-
 /* ------------------------------------------------------------------------- */
 
-/* 2.4.x and newer has this always in HZ */
-#define M8XX_BUSFREQ ((((bd_t *)&(__res))->bi_busfreq))
-
-static int pcmcia_schlvl = PCMCIA_SCHLVL;
+static int pcmcia_schlvl;
 
-static DEFINE_SPINLOCK(events_lock);
+static spinlock_t events_lock = SPIN_LOCK_UNLOCKED;
 
 
 #define PCMCIA_SOCKET_KEY_5V 1
 #define PCMCIA_SOCKET_KEY_LV 2
 
 /* look up table for pgcrx registers */
-static u32 *m8xx_pgcrx[2] = {
-	&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pgcra,
-	&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pgcrb
-};
+static u32 *m8xx_pgcrx[2];
 
 /*
  * This structure is used to address each window in the PCMCIA controller.
@@ -228,11 +221,16 @@ struct event_table {
 	u32 eventbit;
 };
 
+static const char driver_name[] = "m8xx-pcmcia";
+
 struct socket_info {
 	void	(*handler)(void *info, u32 events);
 	void	*info;
 
 	u32 slot;
+	pcmconf8xx_t *pcmcia;
+	struct platform_device *pdev;
+	struct fs_pcmcia_platform_data *pdata;
 
 	socket_state_t state;
 	struct pccard_mem_map mem_win[PCMCIA_MEM_WIN_NO];
@@ -404,83 +402,15 @@ static void hardware_disable(int slot)
 #endif
 
 /* MPC885ADS Boards */
-
 #if defined(CONFIG_MPC885ADS)
 
 #define PCMCIA_BOARD_MSG "MPC885ADS"
-
-static int voltage_set(int slot, int vcc, int vpp)
-{
-	u32 reg = 0;
-	unsigned *bcsr_io;
-
-	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
-
-	switch(vcc) {
-		case 0:
-			break;
-		case 33:
-			reg |= BCSR1_PCCVCC0;
-			break;
-		case 50:
-			reg |= BCSR1_PCCVCC1;
-			break;
-		default:
-			goto out_unmap;
-	}
-
-	switch(vpp) {
-		case 0:
-			break;
-		case 33:
-		case 50:
-			if(vcc == vpp)
-				reg |= BCSR1_PCCVPP1;
-			else
-				goto out_unmap;
-			break;
-		case 120:
-			if ((vcc == 33) || (vcc == 50))
-				reg |= BCSR1_PCCVPP0;
-			else
-				goto out_unmap;
-		default:
-			goto out_unmap;
-	}
-
-	/* first, turn off all power */
-	out_be32(bcsr_io, in_be32(bcsr_io) & ~(BCSR1_PCCVCC_MASK | BCSR1_PCCVPP_MASK));
-
-	/* enable new powersettings */
-	out_be32(bcsr_io, in_be32(bcsr_io) | reg);
-
-	iounmap(bcsr_io);
-	return 0;
-
-out_unmap:
-	iounmap(bcsr_io);
-	return 1;
-}
-
 #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V
 
-static void hardware_enable(int slot)
-{
-	unsigned *bcsr_io;
-
-	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
-	out_be32(bcsr_io, in_be32(bcsr_io) & ~BCSR1_PCCEN);
-	iounmap(bcsr_io);
-}
-
-static void hardware_disable(int slot)
-{
-	unsigned *bcsr_io;
-
-	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
-	out_be32(bcsr_io, in_be32(bcsr_io) |  BCSR1_PCCEN);
-	iounmap(bcsr_io);
-}
+/* These functions are defined in the board-specific code */
+#define hardware_enable(_slot_)	pdata->hw_setup(_slot_, 1)
+#define hardware_disable(_slot_) pdata->hw_setup(_slot_, 0)
+#define voltage_set(slot, vcc, vpp)	pdata->voltage_set(slot, vcc, vpp)
 
 #endif
 
@@ -541,6 +471,7 @@ #define hardware_enable(_slot_)  /* No h
 #define hardware_disable(_slot_) /* No hardware to disable */
 
 #endif /* CONFIG_MBX */
+/* Motorola MBX860 */
 
 #if defined(CONFIG_PRxK)
 #include <asm/cpld.h>
@@ -604,63 +535,22 @@ #define hardware_disable(_slot_) /* No h
 
 #endif /* CONFIG_PRxK */
 
-static void m8xx_shutdown(void)
-{
-	u32 m, i;
-	struct pcmcia_win *w;
-
-	for(i = 0; i < PCMCIA_SOCKETS_NO; i++){
-		w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
-
-		out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr, M8XX_PCMCIA_MASK(i));
-		out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per, in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per) & ~M8XX_PCMCIA_MASK(i));
-
-		/* turn off interrupt and disable CxOE */
-		out_be32(M8XX_PGCRX(i), M8XX_PGCRX_CXOE);
-
-		/* turn off memory windows */
-		for(m = 0; m < PCMCIA_MEM_WIN_NO; m++) {
-			out_be32(&w->or, 0); /* set to not valid */
-			w++;
-		}
-
-		/* turn off voltage */
-		voltage_set(i, 0, 0);
-
-		/* disable external hardware */
-		hardware_disable(i);
-	}
-
-	free_irq(pcmcia_schlvl, NULL);
-}
-
-static struct device_driver m8xx_driver = {
-        .name = "m8xx-pcmcia",
-        .bus = &platform_bus_type,
-        .suspend = pcmcia_socket_dev_suspend,
-        .resume = pcmcia_socket_dev_resume,
-};
-
-static struct platform_device m8xx_device = {
-        .name = "m8xx-pcmcia",
-        .id = 0,
-};
-
 static u32 pending_events[PCMCIA_SOCKETS_NO];
-static DEFINE_SPINLOCK(pending_event_lock);
+static spinlock_t pending_event_lock = SPIN_LOCK_UNLOCKED;
 
 static irqreturn_t m8xx_interrupt(int irq, void *dev)
 {
 	struct socket_info *s;
 	struct event_table *e;
 	unsigned int i, events, pscr, pipr, per;
+	pcmconf8xx_t	*pcmcia = socket[0].pcmcia;
 
 	dprintk("Interrupt!\n");
 	/* get interrupt sources */
 
-	pscr = in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr);
-	pipr = in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pipr);
-	per = in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per);
+	pscr = in_be32(&pcmcia->pcmc_pscr);
+	pipr = in_be32(&pcmcia->pcmc_pipr);
+	per = in_be32(&pcmcia->pcmc_per);
 
 	for(i = 0; i < PCMCIA_SOCKETS_NO; i++) {
 		s = &socket[i];
@@ -724,7 +614,7 @@ #endif
 			per &= ~M8XX_PCMCIA_RDY_L(0);
 			per &= ~M8XX_PCMCIA_RDY_L(1);
 
-			out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per, per);
+			out_be32(&pcmcia->pcmc_per, per);
 
 			if (events)
 				pcmcia_parse_events(&socket[i].socket, events);
@@ -732,7 +622,7 @@ #endif
 	}
 
 	/* clear the interrupt sources */
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr, pscr);
+	out_be32(&pcmcia->pcmc_pscr, pscr);
 
 	dprintk("Interrupt done.\n");
 
@@ -753,7 +643,7 @@ static u32 m8xx_get_graycode(u32 size)
 	return k;
 }
 
-static u32 m8xx_get_speed(u32 ns, u32 is_io)
+static u32 m8xx_get_speed(u32 ns, u32 is_io, u32 bus_freq)
 {
 	u32 reg, clocks, psst, psl, psht;
 
@@ -781,7 +671,7 @@ static u32 m8xx_get_speed(u32 ns, u32 is
 
 #define ADJ 180 /* 80 % longer accesstime - to be sure */
 
-	clocks = ((M8XX_BUSFREQ / 1000) * ns) / 1000;
+	clocks = ((bus_freq / 1000) * ns) / 1000;
 	clocks = (clocks * ADJ) / (100*1000);
 	if(clocks >= PCMCIA_BMT_LIMIT) {
 		printk( "Max access time limit reached\n");
@@ -806,8 +696,9 @@ static int m8xx_get_status(struct pcmcia
 	int lsock = container_of(sock, struct socket_info, socket)->slot;
 	struct socket_info *s = &socket[lsock];
 	unsigned int pipr, reg;
+	pcmconf8xx_t *pcmcia = s->pcmcia;
 
-	pipr = in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pipr);
+	pipr = in_be32(&pcmcia->pcmc_pipr);
 
 	*value  = ((pipr & (M8XX_PCMCIA_CD1(lsock)
 			    | M8XX_PCMCIA_CD2(lsock))) == 0) ? SS_DETECT : 0;
@@ -915,9 +806,11 @@ static int m8xx_set_socket(struct pcmcia
 {
 	int lsock = container_of(sock, struct socket_info, socket)->slot;
 	struct socket_info *s = &socket[lsock];
+	struct fs_pcmcia_platform_data *pdata = s->pdata;
 	struct event_table *e;
 	unsigned int reg;
 	unsigned long flags;
+	pcmconf8xx_t *pcmcia = socket[0].pcmcia;
 
 	dprintk( "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
 	      "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags,
@@ -927,6 +820,7 @@ static int m8xx_set_socket(struct pcmcia
 	if(voltage_set(lsock, state->Vcc, state->Vpp))
 		return -EINVAL;
 
+
 	/* Take care of reset... */
 	if(state->flags & SS_RESET)
 		out_be32(M8XX_PGCRX(lsock), in_be32(M8XX_PGCRX(lsock)) |  M8XX_PGCRX_CXRESET); /* active high */
@@ -982,7 +876,8 @@ static int m8xx_set_socket(struct pcmcia
 		 * If io_irq is non-zero we should enable irq.
 		 */
 		if(state->io_irq) {
-			out_be32(M8XX_PGCRX(lsock), in_be32(M8XX_PGCRX(lsock)) | mk_int_int_mask(state->io_irq) << 24);
+			int hwirq = s->pdata->hwirq;
+			out_be32(M8XX_PGCRX(lsock), in_be32(M8XX_PGCRX(lsock)) | mk_int_int_mask(hwirq) << 24);
 			/*
 			 * Strange thing here:
 			 * The manual does not tell us which interrupt
@@ -1027,7 +922,7 @@ static int m8xx_set_socket(struct pcmcia
 	 * Writing ones will clear the bits.
 	 */
 
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr, reg);
+	out_be32(&pcmcia->pcmc_pscr, reg);
 
 	/*
 	 * Write the mask.
@@ -1036,15 +931,8 @@ static int m8xx_set_socket(struct pcmcia
 	 * Ones will enable the interrupt.
 	 */
 
-	/*
-	  reg |= ((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per
-	  & M8XX_PCMCIA_MASK(lsock);
-	*/
-
-	reg |= in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per) &
-		(M8XX_PCMCIA_MASK(0) | M8XX_PCMCIA_MASK(1));
-
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per, reg);
+	reg |= in_be32(&pcmcia->pcmc_per) & (M8XX_PCMCIA_MASK(0) | M8XX_PCMCIA_MASK(1));
+	out_be32(&pcmcia->pcmc_per, reg);
 
 	spin_unlock_irqrestore(&events_lock, flags);
 
@@ -1062,6 +950,8 @@ static int m8xx_set_io_map(struct pcmcia
 	struct socket_info *s = &socket[lsock];
 	struct pcmcia_win *w;
 	unsigned int reg, winnr;
+	pcmconf8xx_t *pcmcia = s->pcmcia;
+
 
 #define M8XX_SIZE (io->stop - io->start + 1)
 #define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start)
@@ -1086,7 +976,7 @@ #define M8XX_BASE (PCMCIA_IO_WIN_BASE + 
 
 		/* setup registers */
 
-		w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
+		w = (void *) &pcmcia->pcmc_pbr0;
 		w += winnr;
 
 		out_be32(&w->or, 0); /* turn off window first */
@@ -1095,12 +985,13 @@ #define M8XX_BASE (PCMCIA_IO_WIN_BASE + 
 		reg <<= 27;
   		reg |= M8XX_PCMCIA_POR_IO |(lsock << 2);
 
-		reg |= m8xx_get_speed(io->speed, 1);
+		reg |= m8xx_get_speed(io->speed, 1, s->pdata->bus_freq);
 
 		if(io->flags & MAP_WRPROT)
 			reg |= M8XX_PCMCIA_POR_WRPROT;
 
-		if(io->flags & (MAP_16BIT | MAP_AUTOSZ))
+		/*if(io->flags & (MAP_16BIT | MAP_AUTOSZ))*/
+		if(io->flags & MAP_16BIT)
 			reg |= M8XX_PCMCIA_POR_16BIT;
 
 		if(io->flags & MAP_ACTIVE)
@@ -1117,7 +1008,7 @@ #define M8XX_BASE (PCMCIA_IO_WIN_BASE + 
 
 		/* setup registers */
 
-		w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
+		w = (void *) &pcmcia->pcmc_pbr0;
 		w += winnr;
 
 		out_be32(&w->or, 0); /* turn off window */
@@ -1144,6 +1035,7 @@ static int m8xx_set_mem_map(struct pcmci
 	struct pcmcia_win *w;
 	struct pccard_mem_map *old;
 	unsigned int reg, winnr;
+	pcmconf8xx_t *pcmcia = s->pcmcia;
 
 	dprintk( "SetMemMap(%d, %d, %#2.2x, %d ns, "
 	      "%#5.5lx, %#5.5x)\n", lsock, mem->map, mem->flags,
@@ -1166,12 +1058,12 @@ static int m8xx_set_mem_map(struct pcmci
 
 	/* Setup the window in the pcmcia controller */
 
-	w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
+	w = (void *) &pcmcia->pcmc_pbr0;
 	w += winnr;
 
 	reg |= lsock << 2;
 
-	reg |= m8xx_get_speed(mem->speed, 0);
+	reg |= m8xx_get_speed(mem->speed, 0, s->pdata->bus_freq);
 
 	if(mem->flags & MAP_ATTRIB)
 		reg |=  M8XX_PCMCIA_POR_ATTRMEM;
@@ -1236,57 +1128,69 @@ static int m8xx_sock_init(struct pcmcia_
 
 }
 
-static int m8xx_suspend(struct pcmcia_socket *sock)
+static int m8xx_sock_suspend(struct pcmcia_socket *sock)
 {
 	return m8xx_set_socket(sock, &dead_socket);
 }
 
 static struct pccard_operations m8xx_services = {
 	.init	= m8xx_sock_init,
-	.suspend = m8xx_suspend,
+	.suspend = m8xx_sock_suspend,
 	.get_status = m8xx_get_status,
 	.set_socket = m8xx_set_socket,
 	.set_io_map = m8xx_set_io_map,
 	.set_mem_map = m8xx_set_mem_map,
 };
 
-static int __init m8xx_init(void)
+static int __init m8xx_probe(struct platform_device *pdev)
 {
 	struct pcmcia_win *w;
-	unsigned int i,m;
+	unsigned int i, m, hwirq;
+	pcmconf8xx_t *pcmcia;
+	int status;
+	struct resource *r;
+	struct fs_pcmcia_platform_data *pdata = pdev->dev.platform_data;
 
 	pcmcia_info("%s\n", version);
 
-	if (driver_register(&m8xx_driver))
-		return -1;
+	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
+
+	pcmcia = ioremap(r->start, r->end - r->start + 1);
+	if(pcmcia == NULL)
+		return -EINVAL;
+
+	pcmcia_schlvl = platform_get_irq_byname(pdev,"interrupt");
+	if (pcmcia_schlvl < 0)
+		return -EINVAL;
+	hwirq = pdata->hwirq;
+
+	m8xx_pgcrx[0] = &pcmcia->pcmc_pgcra;
+	m8xx_pgcrx[1] = &pcmcia->pcmc_pgcrb;
+
 
 	pcmcia_info(PCMCIA_BOARD_MSG " using " PCMCIA_SLOT_MSG
-		    " with IRQ %u.\n", pcmcia_schlvl);
+		    " with IRQ %u  (%d). \n", pcmcia_schlvl, hwirq);
 
 	/* Configure Status change interrupt */
 
-	if(request_irq(pcmcia_schlvl, m8xx_interrupt, 0,
-			  "m8xx_pcmcia", NULL)) {
+	if(request_irq(pcmcia_schlvl, m8xx_interrupt, IRQF_SHARED,
+			  driver_name, socket)) {
 		pcmcia_error("Cannot allocate IRQ %u for SCHLVL!\n",
 			     pcmcia_schlvl);
 		return -1;
 	}
 
-	w = (void *) &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0;
-
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr,
-		M8XX_PCMCIA_MASK(0)| M8XX_PCMCIA_MASK(1));
+	w = (void *) &pcmcia->pcmc_pbr0;
 
-	out_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per,
-		in_be32(&((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_per) &
-		~(M8XX_PCMCIA_MASK(0)| M8XX_PCMCIA_MASK(1)));
+	out_be32(&pcmcia->pcmc_pscr, M8XX_PCMCIA_MASK(0)| M8XX_PCMCIA_MASK(1));
+	clrbits32(&pcmcia->pcmc_per, M8XX_PCMCIA_MASK(0) | M8XX_PCMCIA_MASK(1));
 
-/* connect interrupt and disable CxOE */
+	/* connect interrupt and disable CxOE */
 
-	out_be32(M8XX_PGCRX(0), M8XX_PGCRX_CXOE | (mk_int_int_mask(pcmcia_schlvl) << 16));
-	out_be32(M8XX_PGCRX(1), M8XX_PGCRX_CXOE | (mk_int_int_mask(pcmcia_schlvl) << 16));
+	out_be32(M8XX_PGCRX(0), M8XX_PGCRX_CXOE | (mk_int_int_mask(hwirq) << 16));
+	out_be32(M8XX_PGCRX(1), M8XX_PGCRX_CXOE | (mk_int_int_mask(hwirq) << 16));
 
-/* intialize the fixed memory windows */
+	/* intialize the fixed memory windows */
 
 	for(i = 0; i < PCMCIA_SOCKETS_NO; i++){
 		for(m = 0; m < PCMCIA_MEM_WIN_NO; m++) {
@@ -1300,16 +1204,14 @@ static int __init m8xx_init(void)
 		}
 	}
 
-/* turn off voltage */
+	/* turn off voltage */
 	voltage_set(0, 0, 0);
 	voltage_set(1, 0, 0);
 
-/* Enable external hardware */
+	/* Enable external hardware */
 	hardware_enable(0);
 	hardware_enable(1);
 
-	platform_device_register(&m8xx_device);
-
 	for (i = 0 ; i < PCMCIA_SOCKETS_NO; i++) {
 		socket[i].slot = i;
 		socket[i].socket.owner = THIS_MODULE;
@@ -1317,30 +1219,90 @@ static int __init m8xx_init(void)
 		socket[i].socket.irq_mask = 0x000;
 		socket[i].socket.map_size = 0x1000;
 		socket[i].socket.io_offset = 0;
-		socket[i].socket.pci_irq = i  ? 7 : 9;
+		socket[i].socket.pci_irq = pcmcia_schlvl;
 		socket[i].socket.ops = &m8xx_services;
-		socket[i].socket.resource_ops = &pccard_iodyn_ops;
+		socket[i].socket.resource_ops = &pccard_nonstatic_ops;
 		socket[i].socket.cb_dev = NULL;
-		socket[i].socket.dev.parent = &m8xx_device.dev;
+		socket[i].socket.dev.parent = &pdev->dev;
+		socket[i].pcmcia = pcmcia;
+		socket[i].pdata = pdata;
 	}
 
-	for (i = 0; i < PCMCIA_SOCKETS_NO; i++)
-		pcmcia_register_socket(&socket[i].socket);
+	for (i = 0; i < PCMCIA_SOCKETS_NO; i++) {
+		status = pcmcia_register_socket(&socket[i].socket);
+		if (status < 0)
+			pcmcia_error("Socket register failed\n");
+	}
 
 	return 0;
 }
 
-static void __exit m8xx_exit(void)
+static int __exit m8xx_shutdown(struct platform_device *pdev)
 {
-	int i;
+	u32 m, i;
+	struct pcmcia_win *w;
+	pcmconf8xx_t *pcmcia = socket[0].pcmcia;
+	struct fs_pcmcia_platform_data *pdata = socket[0].pdata;
+
+	for(i = 0; i < PCMCIA_SOCKETS_NO; i++){
+		w = (void *) &pcmcia->pcmc_pbr0;
+
+		out_be32(&pcmcia->pcmc_pscr, M8XX_PCMCIA_MASK(i));
+		out_be32(&pcmcia->pcmc_per, in_be32(&pcmcia->pcmc_per) & ~M8XX_PCMCIA_MASK(i));
+
+		/* turn off interrupt and disable CxOE */
+		out_be32(M8XX_PGCRX(i), M8XX_PGCRX_CXOE);
 
+		/* turn off memory windows */
+		for(m = 0; m < PCMCIA_MEM_WIN_NO; m++) {
+			out_be32(&w->or, 0); /* set to not valid */
+			w++;
+		}
+
+		/* turn off voltage */
+		voltage_set(i, 0, 0);
+
+		/* disable external hardware */
+		hardware_disable(i);
+	}
 	for (i = 0; i < PCMCIA_SOCKETS_NO; i++)
 		pcmcia_unregister_socket(&socket[i].socket);
 
-	m8xx_shutdown();
+	free_irq(pcmcia_schlvl, NULL);
+
+	return 0;
+}
+
+static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
+{
+        return pcmcia_socket_dev_suspend(&pdev->dev, state);
+}
+
+static int m8xx_resume(struct platform_device *pdev)
+{
+        return pcmcia_socket_dev_resume(&pdev->dev);
+}
 
-	platform_device_unregister(&m8xx_device);
-	driver_unregister(&m8xx_driver);
+static struct platform_driver m8xx_driver = {
+	.driver = {
+		.name		= (char *) driver_name,
+		.owner		= THIS_MODULE,
+	},
+	.probe		= m8xx_probe,
+	.remove		= __exit_p(m8xx_shutdown),
+	.suspend	= m8xx_suspend,
+	.resume		= m8xx_resume,
+};
+
+
+static int __init m8xx_init(void)
+{
+	return platform_driver_register(&m8xx_driver);
+}
+
+static void __exit m8xx_exit(void)
+{
+	platform_driver_unregister(&m8xx_driver);
 }
 
 module_init(m8xx_init);
diff --git a/include/linux/fs_pcmcia_pd.h b/include/linux/fs_pcmcia_pd.h
new file mode 100644
index 0000000..2769a11
--- /dev/null
+++ b/include/linux/fs_pcmcia_pd.h
@@ -0,0 +1,27 @@
+/*
+ * Platform information definitions for the CPM Uart driver.
+ *
+ * 2007 (c) MontaVista Software, Inc.
+ * Yuri Shpilevsky <yshpilevsky at ru.mvista.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef FS_PCMCIA_PD_H
+#define FS_PCMCIA_PD_H
+
+#include <linux/version.h>
+#include <asm/types.h>
+
+struct fs_pcmcia_platform_data {
+	void(*hw_setup)(int slot, int enable);
+	int(*voltage_set)(int slot, int vcc, int vpp);
+
+	/* device specific information */
+	int hwirq;
+	u32 bus_freq;
+};
+
+#endif


-- 
Sincerely, 
Vitaly


-- 
Sincerely, 
Vitaly

_______________________________________________
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


-- 
Sincerely, Vitaly



From arnd at arndb.de  Sun Apr 22 17:49:41 2007
From: arnd at arndb.de (Arnd Bergmann)
Date: Sun, 22 Apr 2007 23:49:41 +0200
Subject: Fw: [PATCH][RFC] PCMCIA support for 8xx using platform devices
In-Reply-To: <20070422232658.5f427fd3@localhost.localdomain>
References: <20070422232658.5f427fd3@localhost.localdomain>
Message-ID: <200704222349.42368.arnd@arndb.de>

On Sunday 22 April 2007, Vitaly Bordug wrote:
> This utilizes PCMCIA on mpc885ads and mpc866ads from arch/powerpc. In the
> new approach, direct IMMR accesses from within drivers/ were totally
> eliminated, that requires hardware_enable, hardware_disable, voltage_set
> board-specific functions to be moved over to BSP code section   
> (arch/powerpc/platforms/8xx in 885 case). There is just no way to have
> both arch/ppc and arch/powerpc approaches to work simultaneously because
> of that.  

Maybe I'm missing a key issue here, but what's the point of adding
more platform_devices for stuff that is already in the device tree?
Shouldn't this be made an of_platform_driver instead so you can
use the existing of_device directly?

	Arnd <><


From vitb at kernel.crashing.org  Mon Apr 23 02:14:27 2007
From: vitb at kernel.crashing.org (Vitaly Bordug)
Date: Mon, 23 Apr 2007 10:14:27 +0400
Subject: [PATCH][RFC] PCMCIA support for 8xx using platform devices
In-Reply-To: <200704222349.42368.arnd@arndb.de>
References: <20070422232658.5f427fd3@localhost.localdomain>
	<200704222349.42368.arnd@arndb.de>
Message-ID: <20070423101427.3a1d4983@localhost.localdomain>

On Sun, 22 Apr 2007 23:49:41 +0200
Arnd Bergmann wrote:

> On Sunday 22 April 2007, Vitaly Bordug wrote:
> > This utilizes PCMCIA on mpc885ads and mpc866ads from arch/powerpc.
> > In the new approach, direct IMMR accesses from within drivers/ were
> > totally eliminated, that requires hardware_enable,
> > hardware_disable, voltage_set board-specific functions to be moved
> > over to BSP code section (arch/powerpc/platforms/8xx in 885 case).
> > There is just no way to have both arch/ppc and arch/powerpc
> > approaches to work simultaneously because of that.  
> 
> Maybe I'm missing a key issue here, but what's the point of adding
> more platform_devices for stuff that is already in the device tree?
> Shouldn't this be made an of_platform_driver instead so you can
> use the existing of_device directly?
> 
Was thinking of it but platform_device is better for migration purposes. Hence,
assuming somebody would want to have pcmcia working not bothering to add whole arch/powerpc support,
it can be accomplished quickly. OTOH, further change from pd to of_device is not hard as well. So far, most ppc stuff (if not all) still existing both in ppc/ and powerpc/ paths, and to keep consistency platform_devices are used here and there. So, with pd approach arch/ppc/ boards are encouraged to get source device/driver bus ready, hereby simplifying transition to of_device later.

With current bootwrapper activities it may happen sooner, but there are many places in kernel nobody want to move for almost zero value..



-- 
Sincerely, Vitaly



From Fabrice.Aeschbacher at siemens.com  Mon Apr 23 03:22:53 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Mon, 23 Apr 2007 09:22:53 +0200
Subject: PCMCIA / compact flash / au1x00
In-Reply-To: <20070420151700.5862.qmail@cdy.org>
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A40129DE5A@stgw002a.ww002.siemens.net>

Hi,

> > Moreover, 'pccardctl status' display the subdevice 0 as 'unbound'
> > (should be 'bound', I imagine):
> 
> Yes. Perhaps the CF device id isn't added to the pcmcia_pata 
> and/or ide-cs drivers. I don't know exactly how to retrieve 
> the number, but I think it's all covered in 
> /usr/src/linux/Documentation/pcmcia/
> 
> If the kernel driver doesn't know about the id, userspace 
> tools are required for reading the card CIS and then for 
> starting it up.

By userspace tools, do you mean 'pcmcia-socket-startup', or something
else?

Fabrice


From hch at infradead.org  Mon Apr 23 03:59:57 2007
From: hch at infradead.org (Christoph Hellwig)
Date: Mon, 23 Apr 2007 08:59:57 +0100
Subject: [PATCH][RFC] PCMCIA support for 8xx using platform devices
In-Reply-To: <20070423101427.3a1d4983@localhost.localdomain>
References: <20070422232658.5f427fd3@localhost.localdomain>
	<200704222349.42368.arnd@arndb.de>
	<20070423101427.3a1d4983@localhost.localdomain>
Message-ID: <20070423075957.GA22811@infradead.org>

On Mon, Apr 23, 2007 at 10:14:27AM +0400, Vitaly Bordug wrote:
> On Sun, 22 Apr 2007 23:49:41 +0200
> Arnd Bergmann wrote:
> 
> > On Sunday 22 April 2007, Vitaly Bordug wrote:
> > > This utilizes PCMCIA on mpc885ads and mpc866ads from arch/powerpc.
> > > In the new approach, direct IMMR accesses from within drivers/ were
> > > totally eliminated, that requires hardware_enable,
> > > hardware_disable, voltage_set board-specific functions to be moved
> > > over to BSP code section (arch/powerpc/platforms/8xx in 885 case).
> > > There is just no way to have both arch/ppc and arch/powerpc
> > > approaches to work simultaneously because of that.  
> > 
> > Maybe I'm missing a key issue here, but what's the point of adding
> > more platform_devices for stuff that is already in the device tree?
> > Shouldn't this be made an of_platform_driver instead so you can
> > use the existing of_device directly?
> > 
> Was thinking of it but platform_device is better for migration purposes. Hence,
> assuming somebody would want to have pcmcia working not bothering to add whole arch/powerpc support,
> it can be accomplished quickly.

That's a horrible argument.  Please do it properly, and let arch/ppc die
as it should.  We shouldn't be adding anything to it anymore anyway.



From Fabrice.Aeschbacher at siemens.com  Mon Apr 23 09:46:01 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Mon, 23 Apr 2007 15:46:01 +0200
Subject: PCMCIA / compact flash / au1x00
In-Reply-To: <D7810733513F4840B4EBAAFA64D9C6A40129D820@stgw002a.ww002.siemens.net>
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A4012D53B7@stgw002a.ww002.siemens.net>

I tried with another compact flash (this time, a SanDisk). Surprisingly,
I got some other results. The card still appears or disappears in
/sys/bus/pcmcia/devices as I plug or unplug it. But now I can see some
messages on the console:

o when using ide-cs:

  pccard: PCMCIA card inserted into slot 0
  pcmcia: registering new device pcmcia0.0
  hda: SanDisk SDCFB-64, CFA DISK drive
  ide0: Disabled unable to get IRQ 35.
  ide0: failed to initialize IDE interface
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide0: I/O resource 0x10200E-0x10200E not free.
  ide0: ports already in use, skipping probe
  ide-cs: ide_register() at 0x102000 & 0x10200e, irq 35 failed

o when using pata_pcmcia:

  ata1: PATA max PIO0 cmd 0x102000 ctl 0x10200E bmdma 0x0 irq 35
  pata_pcmcia 0.0: irq 35 request failed: -89
  pata_pcmcia: probe of 0.0 failed with error -12


The same console messages are generated if I run pcmcia-socket-startup
later.

Bye,
Fabrice Aeschbacher

> -----Original Message-----
> From: linux-pcmcia-bounces at lists.infradead.org 
> [mailto:linux-pcmcia-bounces at lists.infradead.org] On Behalf 
> Of Aeschbacher, Fabrice
> Sent: Donnerstag, 19. April 2007 14:43
> To: linux-pcmcia at lists.infradead.org
> Subject: PCMCIA / compact flash / au1x00
> 
> Hi,
> 
> [kernel 2.6.20.7 / mips]
> 
> I am having trouble using a compact flash connected to a 
> PCMCIA socket on an Alchemy au1550 board (mips).
> 
> The CF seems to be recognized:
> 
>   # insmod au1x00_ss.ko
> 
>   => dmesg output:
>     pccard: PCMCIA card inserted into slot 0
>     pcmcia: registering new device pcmcia0.0
> 
>   # pccardctl ls          
>   Socket 0 Bridge:        [au1x00-pcmcia]         (bus ID:
> au1x00-pcmcia.0)
>   Socket 0 Device 0:      [-- no driver --]       (bus ID: 0.0)
> 
>   # pccardctl info
>   PRODID_1="TRANSCEND"
>   PRODID_2="TS2GCF120"
>   PRODID_3=""
>   PRODID_4=""
>   MANFID=000a,0000
>   FUNCID=4
> 
>   # pccardctl status
>   Socket 0:
>     3.3V 16-bit PC Card
>     Subdevice 0 (function 0) [unbound]
> 
> Problem: I can't access the CF by its device (hda):
> 
>   # fdisk /dev/hda
>   Unable to open /dev/hda
> 
> 
> 
> Here is the relevant part of the kernel config:
> CONFIG_IDE=y
> CONFIG_BLK_DEV_IDE=y
> CONFIG_BLK_DEV_IDECS=m
> CONFIG_PCCARD=y
> CONFIG_PCMCIA_DEBUG=y
> CONFIG_PCMCIA=y
> CONFIG_PCMCIA_IOCTL=y
> CONFIG_PCMCIA_AU1X00=m
> 
> Neither hotplug nor udev is installed (I only installed 
> /sbin/pccardctl).
> 
> I know cardmgr is no more used in recent kernels. Anyway, if 
> I try to run it, I become following result:
> 
>   # cardmgr
>   cardmgr[976]: watching 1 socket
>   cardmgr[976]: could not adjust resource: IO ports 0xc00-0: 
> Invalid argument
>   cardmgr[976]: could not adjust resource: IO ports 0x100-0: 
> Invalid argument
>   cardmgr[976]: could not adjust resource: memory 0xc0000-0xfffff:
> Invalid argument
>   cardmgr[976]: could not adjust resource: memory 
> 0x60000000-0x60ffffff:
> Invalid   argument
>   cardmgr[976]: could not adjust resource: memory 
> 0xa0000000-0xa0ffffff:
> Invalid   argument
>   cardmgr[976]: could not adjust resource: IO ports 0xa00-0: 
> Invalid argument
>   cardmgr[976]: could not adjust resource: irq 4: Invalid argument
>   cardmgr[976]: could not adjust resource: irq 7: Invalid argument
> 
> and following output in dmesg:
>   ds: ds_open(socket 0)
>   pcmcia: Detected deprecated PCMCIA ioctl usage from 
> process: cardmgr.
>   pcmcia: This interface will soon be removed from the kernel; please
> expect breakage   unless you upgrade to new tools.
>   pcmcia: see
> http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.htm
> l for details.
>   ds: ds_open(socket 1)
>   ds: ds_open(socket 1)
>   ide_attach()
>   ide_config(0x80788400)
>   Probing IDE interface ide0...
>   hda: TRANSCEND, CFA DISK drive
>   ide0: Disabled unable to get IRQ 34.
>   ide0: failed to initialize IDE interface
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide0: I/O resource 0x16400E-0x16400E not free.
>   ide0: ports already in use, skipping probe
>   ide-cs: ide_register() at 0x164000 & 0x16400e, irq 34 failed
>   ide_release(0x80788400)
> 
> Can someone tell me what I missed?
> 
> Note: the CF used to work correctly with a kernel 2.4.26
> 
> Best regards,
> Fabrice Aeschbacher
> 
> _______________________________________________
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia
> 


From scottwood at freescale.com  Mon Apr 23 15:07:00 2007
From: scottwood at freescale.com (Scott Wood)
Date: Mon, 23 Apr 2007 14:07:00 -0500
Subject: Fw: [PATCH][RFC] PCMCIA support for 8xx using platform devices
In-Reply-To: <20070422232658.5f427fd3@localhost.localdomain>
References: <20070422232658.5f427fd3@localhost.localdomain>
Message-ID: <20070423190700.GA9987@ld0162-tx32.am.freescale.net>

On Sun, Apr 22, 2007 at 11:26:58PM +0400, Vitaly Bordug wrote:
> diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
> index 90e047a..330ac91 100644
> --- a/arch/powerpc/boot/dts/mpc885ads.dts
> +++ b/arch/powerpc/boot/dts/mpc885ads.dts
> @@ -112,6 +112,18 @@
>  			compatible = "CPM";
>  		};
>  
> +               pcmcia at 0080 {
> +                       linux,phandle = <0080>;
> +                       #interrupt-cells = <1>;
> +                       #size-cells = <2>;
> +                       compatible = "8xx";
> +                       device_type = "pcmcia";
> +                       reg = <80 80>;
> +                       clock-frequency = <2faf080>;
> +                       interrupt-parent = <ff000000>;
> +                       interrupts = <d 1>;
> +		};
> +

DTC supports labels now; we should be using those instead of hardcoded
phandles.  Also, please indent by tabs.

-Scott


From vitb at kernel.crashing.org  Mon Apr 23 15:55:02 2007
From: vitb at kernel.crashing.org (Vitaly Bordug)
Date: Mon, 23 Apr 2007 23:55:02 +0400
Subject: [PATCH][RFC] PCMCIA support for 8xx using platform devices
In-Reply-To: <20070423075957.GA22811@infradead.org>
References: <20070422232658.5f427fd3@localhost.localdomain>
	<200704222349.42368.arnd@arndb.de>
	<20070423101427.3a1d4983@localhost.localdomain>
	<20070423075957.GA22811@infradead.org>
Message-ID: <20070423235502.734e6e67@localhost.localdomain>

On Mon, 23 Apr 2007 08:59:57 +0100
Christoph Hellwig wrote:

> On Mon, Apr 23, 2007 at 10:14:27AM +0400, Vitaly Bordug wrote:
> > On Sun, 22 Apr 2007 23:49:41 +0200
> > Arnd Bergmann wrote:
> > 
> > > On Sunday 22 April 2007, Vitaly Bordug wrote:
> > > > This utilizes PCMCIA on mpc885ads and mpc866ads from
> > > > arch/powerpc. In the new approach, direct IMMR accesses from
> > > > within drivers/ were totally eliminated, that requires
> > > > hardware_enable, hardware_disable, voltage_set board-specific
> > > > functions to be moved over to BSP code section
> > > > (arch/powerpc/platforms/8xx in 885 case). There is just no way
> > > > to have both arch/ppc and arch/powerpc approaches to work
> > > > simultaneously because of that.  
> > > 
> > > Maybe I'm missing a key issue here, but what's the point of adding
> > > more platform_devices for stuff that is already in the device
> > > tree? Shouldn't this be made an of_platform_driver instead so you
> > > can use the existing of_device directly?
> > > 
> > Was thinking of it but platform_device is better for migration
> > purposes. Hence, assuming somebody would want to have pcmcia
> > working not bothering to add whole arch/powerpc support, it can be
> > accomplished quickly.
> 
> That's a horrible argument.  Please do it properly, and let arch/ppc
> die as it should.  We shouldn't be adding anything to it anymore
> anyway.
> 
I understand your point, but we shouldn't trash existing bits either. Things are a bit different with embedded
stuff, and especially in case of 8xx, there are targets without OF-powered uboot. Bootwrapper thing might be helpful in resolving it, but not a holy tablet after all.

The main point is: current 8xx pcmcia code is a holy mess of ifdefs, direct immr accesses (assuming it is io_block_mapped 1:1) etc. And limiting pcmcia to 885ads only (the only 8xx that supports OF so far) is not good.
We have to admit, that many 8xx boards will remain in ppc/ for a while, and instead of just dropping BSP bits
I'm going to let them be refactored via pdevs (with announcement in feature removal reference) as it would take couple of hrs only. If nobody will care, then the whole 8xx pcmcia driver will be cleaned up and switched 
to of_device.

Does that make sense?

-- 
Sincerely, Vitaly



From segher at kernel.crashing.org  Mon Apr 23 17:12:58 2007
From: segher at kernel.crashing.org (Segher Boessenkool)
Date: Mon, 23 Apr 2007 23:12:58 +0200
Subject: [PATCH][RFC] PCMCIA support for 8xx using platform devices
In-Reply-To: <20070423235502.734e6e67@localhost.localdomain>
References: <20070422232658.5f427fd3@localhost.localdomain>
	<200704222349.42368.arnd@arndb.de>
	<20070423101427.3a1d4983@localhost.localdomain>
	<20070423075957.GA22811@infradead.org>
	<20070423235502.734e6e67@localhost.localdomain>
Message-ID: <44c9a2b88950e3848d2c4e457641eb9b@kernel.crashing.org>

>> That's a horrible argument.  Please do it properly, and let arch/ppc
>> die as it should.  We shouldn't be adding anything to it anymore
>> anyway.
>>
> I understand your point, but we shouldn't trash existing bits either.

Why not?  The things that haven't been ported over yet
obviously are unmaintained.  If we can make the few
remaining board ports in there utterly broken, we
can finally remove arch/ppc/ completely :-)

Since nothing new gets added to arch/ppc/ anymore,
anyone who wants it can get it from an older kernel
tree, no?

[Yes, I'm half joking.  No, not fully.]


Segher



From Fabrice.Aeschbacher at siemens.com  Wed Apr 25 05:27:09 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Wed, 25 Apr 2007 11:27:09 +0200
Subject: [PATCH] ide-cs: recognize 2GB CompactFlash from Transcend
In-Reply-To: <44c9a2b88950e3848d2c4e457641eb9b@kernel.crashing.org>
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A4012D5C9F@stgw002a.ww002.siemens.net>

Without the following patch, the kernel does not automatically detect
2GB CompactFlash cards from Transcend.

I'm not sure which correct values must be assigned to the 3th and 4th
parameters (here: 0x709b1bf1, 0xf54a91c8). Anyway, the patch is working
with these values. Tested on arch=mips.

Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher at siemens.com>

===================================================================
--- linux-2.6.20.7-orig/drivers/ide/legacy/ide-cs.c     2007-04-15
21:08:02.000000000 +0200
+++ linux-2.6.20.7/drivers/ide/legacy/ide-cs.c  2007-04-25
10:53:53.000000000 +0200
@@ -64,6 +64,7 @@
 
 #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
 
+#define PCMCIA_DEBUG 1
 #ifdef PCMCIA_DEBUG
 INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
@@ -399,6 +400,7 @@
        PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a,
0x3489e003),
        PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1,
0x2a54d4b1),
+       PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1,
0xf54a91c8),
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1,
0xf54a91c8),
        PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
        PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c,
0x212bb918),


From stuge-linux-pcmcia at cdy.org  Wed Apr 25 16:39:37 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Wed, 25 Apr 2007 22:39:37 +0200
Subject: [PATCH] ide-cs: recognize 2GB CompactFlash from Transcend
In-Reply-To: <D7810733513F4840B4EBAAFA64D9C6A4012D5C9F@stgw002a.ww002.siemens.net>
References: <44c9a2b88950e3848d2c4e457641eb9b@kernel.crashing.org>
	<D7810733513F4840B4EBAAFA64D9C6A4012D5C9F@stgw002a.ww002.siemens.net>
Message-ID: <20070425203937.11718.qmail@cdy.org>

On Wed, Apr 25, 2007 at 11:27:09AM +0200, Aeschbacher, Fabrice wrote:
> I'm not sure which correct values must be assigned to the 3th and
> 4th parameters (here: 0x709b1bf1, 0xf54a91c8). Anyway, the patch is
> working with these values. Tested on arch=mips.
> 
> +       PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1,
> 0xf54a91c8),

According to /usr/src/linux/Documentation/pcmcia/devicetable.txt and
crc32hash.c the 4th parameter should be 0x969aa4f2.


//Peter


From akpm at linux-foundation.org  Wed Apr 25 20:15:33 2007
From: akpm at linux-foundation.org (Andrew Morton)
Date: Wed, 25 Apr 2007 17:15:33 -0700
Subject: [PATCH] ide-cs: recognize 2GB CompactFlash from Transcend
In-Reply-To: <D7810733513F4840B4EBAAFA64D9C6A4012D5C9F@stgw002a.ww002.siemens.net>
References: <44c9a2b88950e3848d2c4e457641eb9b@kernel.crashing.org>
	<D7810733513F4840B4EBAAFA64D9C6A4012D5C9F@stgw002a.ww002.siemens.net>
Message-ID: <20070425171533.22efa133.akpm@linux-foundation.org>

On Wed, 25 Apr 2007 11:27:09 +0200 "Aeschbacher, Fabrice" <Fabrice.Aeschbacher at siemens.com> wrote:

> Without the following patch, the kernel does not automatically detect
> 2GB CompactFlash cards from Transcend.
> 
> I'm not sure which correct values must be assigned to the 3th and 4th
> parameters (here: 0x709b1bf1, 0xf54a91c8). Anyway, the patch is working
> with these values. Tested on arch=mips.
> 

Thanks.  Your patch was wordwrapped and had tabs replaced by spaces, btw.

> 
> ===================================================================
> --- linux-2.6.20.7-orig/drivers/ide/legacy/ide-cs.c     2007-04-15
> 21:08:02.000000000 +0200
> +++ linux-2.6.20.7/drivers/ide/legacy/ide-cs.c  2007-04-25
> 10:53:53.000000000 +0200
> @@ -64,6 +64,7 @@
>  
>  #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
>  
> +#define PCMCIA_DEBUG 1
>  #ifdef PCMCIA_DEBUG
>  INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
>  #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)

I removed the above change

> @@ -399,6 +400,7 @@
>         PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a,
> 0x3489e003),
>         PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
>         PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1,
> 0x2a54d4b1),
> +       PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1,
> 0xf54a91c8),
>         PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1,
> 0xf54a91c8),
>         PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
>         PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c,
> 0x212bb918),

I'm never sure whether it's Bart or Dominik who handles pcmcia-cs patches.


From Fabrice.Aeschbacher at siemens.com  Thu Apr 26 05:21:01 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Thu, 26 Apr 2007 11:21:01 +0200
Subject: [PATCH] ide-cs: recognize 2GB CompactFlash from Transcend
In-Reply-To: <20070425171533.22efa133.akpm@linux-foundation.org>
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A4012D6188@stgw002a.ww002.siemens.net>

As pointed to by Peter, and also as indicated by a judicious output in
dmesg, the 4th parameter should be 0x969aa4f2. Please find below the
corrected patch:

Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher at siemens.com>

===================================================================
--- linux-2.6.20.7-orig/drivers/ide/legacy/ide-cs.c	2007-04-15
21:08:02.000000000 +0200
+++ linux-2.6.20.7/drivers/ide/legacy/ide-cs.c	2007-04-26
11:13:13.000000000 +0200
@@ -399,6 +399,7 @@
 	PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a,
0x3489e003),
 	PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1,
0x2a54d4b1),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1,
0x969aa4f2),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1,
0xf54a91c8),
 	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
 	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c,
0x212bb918),
===================================================================
 

> -----Original Message-----
> From: Andrew Morton [mailto:akpm at linux-foundation.org] 
> Sent: Donnerstag, 26. April 2007 02:16
> To: Aeschbacher, Fabrice
> Cc: linux-pcmcia at lists.infradead.org; lkml; Dominik 
> Brodowski; Bartlomiej Zolnierkiewicz
> Subject: Re: [PATCH] ide-cs: recognize 2GB CompactFlash from Transcend
> 
> On Wed, 25 Apr 2007 11:27:09 +0200 "Aeschbacher, Fabrice" 
> <Fabrice.Aeschbacher at siemens.com> wrote:
> 
> > Without the following patch, the kernel does not 
> automatically detect 
> > 2GB CompactFlash cards from Transcend.
> > 
> > I'm not sure which correct values must be assigned to the 
> 3th and 4th 
> > parameters (here: 0x709b1bf1, 0xf54a91c8). Anyway, the patch is 
> > working with these values. Tested on arch=mips.
> > 
> 
> Thanks.  Your patch was wordwrapped and had tabs replaced by 
> spaces, btw.
> 
> > 
> > ===================================================================
> > --- linux-2.6.20.7-orig/drivers/ide/legacy/ide-cs.c     2007-04-15
> > 21:08:02.000000000 +0200
> > +++ linux-2.6.20.7/drivers/ide/legacy/ide-cs.c  2007-04-25
> > 10:53:53.000000000 +0200
> > @@ -64,6 +64,7 @@
> >  
> >  #define INT_MODULE_PARM(n, v) static int n = v; 
> module_param(n, int, 
> > 0)
> >  
> > +#define PCMCIA_DEBUG 1
> >  #ifdef PCMCIA_DEBUG
> >  INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);  #define DEBUG(n, 
> args...) 
> > if (pc_debug>(n)) printk(KERN_DEBUG args)
> 
> I removed the above change
> 
> > @@ -399,6 +400,7 @@
> >         PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 
> > 0x3489e003),
> >         PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
> >         PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 
> 0x709b1bf1, 
> > 0x2a54d4b1),
> > +       PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 
> 0x709b1bf1,
> > 0xf54a91c8),
> >         PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 
> 0x709b1bf1, 
> > 0xf54a91c8),
> >         PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 
> 0x3e232852),
> >         PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 
> > 0x212bb918),
> 
> I'm never sure whether it's Bart or Dominik who handles 
> pcmcia-cs patches.
> 


From Fabrice.Aeschbacher at siemens.com  Thu Apr 26 05:49:35 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Thu, 26 Apr 2007 11:49:35 +0200
Subject: [PATCH] pata_pcmcia: recognize 2GB CompactFlash from Transcend
In-Reply-To: <D7810733513F4840B4EBAAFA64D9C6A4012D5C9F@stgw002a.ww002.siemens.net>
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A40130764F@stgw002a.ww002.siemens.net>

This patch allows the pata_pcmcia driver to automatically detect 2GB
CompactFlash cards from Transcend.

Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher at siemens.com>

=====================================================================
--- linux-2.6.20.7-orig/drivers/ata/pata_pcmcia.c	2007-04-15
21:08:02.000000000 +0200
+++ linux-2.6.20.7/drivers/ata/pata_pcmcia.c	2007-04-26
11:35:38.000000000 +0200
@@ -350,6 +350,7 @@
 	PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a,
0x3489e003),
 	PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1,
0x2a54d4b1),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1,
0x969aa4f2),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1,
0xf54a91c8),
 	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
 	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c,
0x212bb918),


From bugme-daemon at bugzilla.kernel.org  Thu Apr 26 13:47:28 2007
From: bugme-daemon at bugzilla.kernel.org (bugme-daemon at bugzilla.kernel.org)
Date: Thu, 26 Apr 2007 10:47:28 -0700
Subject: [Bug 8262] PCMCIA: socket *** DANGER *** unable to remove socket power
Message-ID: <200704261747.l3QHlSig022060@fire-2.osdl.org>

http://bugzilla.kernel.org/show_bug.cgi?id=8262

nils.neumann at rwth-aachen.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|PCMCIA: socket *** DANGER   |PCMCIA: socket *** DANGER
                   |*** unable to remove socket |*** unable to remove socket
                   |power                       |power



------- Additional Comments From nils.neumann at rwth-aachen.de  2007-04-26 10:47 -------
same problem with 2.6.21 

(only as information, because there are no patches between 2.6.20->2.6.21 
regarding this error)

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


From Fabrice.Aeschbacher at siemens.com  Fri Apr 27 04:00:06 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Fri, 27 Apr 2007 10:00:06 +0200
Subject: pcmcia - failed to initialize IDE interface
In-Reply-To: <20070425190753.fb8c272d.akpm@linux-foundation.org>
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A401307A69@stgw002a.ww002.siemens.net>

I think I isolated the problem: in ide-cs.c, ide_config() is calling
pcmcia_request_irq(), and this function happens to set irq=35. This irq
was not rejected later in ide_probe.c, hwif_init():

  ide0: Disabled unable to get IRQ 35

I noticed that the old kernel 2.4.26 used irq=40 here. So I tried to
force pcmcia_request_irq() to set irq=40, like follows:

--- linux-2.6.20.7-orig/drivers/pcmcia/pcmcia_resource.c
2007-04-15 21:08:02.000000000 +0200
+++ linux-2.6.20.7/drivers/pcmcia/pcmcia_resource.c	2007-04-27
09:20:41.000000000 +0200
@@ -867,6 +867,7 @@
 		printk(KERN_WARNING "pcmcia: request for exclusive IRQ
could not be fulfilled.\n");
 		printk(KERN_WARNING "pcmcia: the driver needs updating
to supported shared IRQ lines.\n");
 	}
+	irq = 40;
 	c->irq.Attributes = req->Attributes;
 	s->irq.AssignedIRQ = req->AssignedIRQ = irq;
 	s->irq.Config++;

and this happens to work: ide_config() succeeds, and finally I can mount
the CF and use it.

Other values for irq (i tried 39, 41) won't work either.

Which would be the correct way to make pcmcia_request_irq() use the
correct value of 40?

Fabrice


> -----Original Message-----
> From: Andrew Morton [mailto:akpm at linux-foundation.org] 
> Sent: Donnerstag, 26. April 2007 04:08
> To: Aeschbacher, Fabrice
> Cc: lkml; linux-mips at linux-mips.org
> Subject: Re: pcmcia - failed to initialize IDE interface
> 
> On Wed, 25 Apr 2007 15:27:26 +0200 "Aeschbacher, Fabrice" 
> <Fabrice.Aeschbacher at siemens.com> wrote:
> 
> > Hi,
> > 
> > [kernel 2.6.20.7, arch=mips, processor=amd au1550]
> > 
> > I'm trying to install a 2.6 kernel on an Alchemy au1550, and having 
> > problem with the pcmcia socket, where I plugged a 
> CompactFlash card. 
> > The card seems to be recognized by the kernel, appears in 
> > /sys/bus/pcmcia/devices, but not in /proc/bus/pccard, and I can't 
> > access the device (/dev/hda).
> > 
> > The relevant console messages:
> > ----------------------------------------------------------------
> > pccard: PCMCIA card inserted into slot 0
> > pcmcia: registering new device pcmcia0.0
> > hda: SanDisk SDCFB-64, CFA DISK drive
> > ide0: Disabled unable to get IRQ 35.
> > ide0: failed to initialize IDE interface
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide0: I/O resource 0x10200E-0x10200E not free.
> > ide0: ports already in use, skipping probe
> > ide-cs: ide_register() at 0x102000 & 0x10200e, irq 35 failed
> > ----------------------------------------------------------------
> > 
> > Here is the relevant part of the kernel config:
> > CONFIG_IDE=y
> > CONFIG_IDE_GENERIC=y
> > CONFIG_BLK_DEV_IDE=y
> > CONFIG_BLK_DEV_IDECS=y
> > CONFIG_PCCARD=y
> > CONFIG_PCMCIA_DEBUG=y
> > CONFIG_PCMCIA=y
> > CONFIG_PCMCIA_AU1X00=y
> > 
> 
> (cc'ed linux-mips)
> 
> Perhaps /proc/ioports will tell us where the conflict lies.
> 
> The output of `dmesg -s 1000000' might also be needed.
> 


From Fabrice.Aeschbacher at siemens.com  Fri Apr 27 04:42:31 2007
From: Fabrice.Aeschbacher at siemens.com (Aeschbacher, Fabrice)
Date: Fri, 27 Apr 2007 10:42:31 +0200
Subject: pcmcia - failed to initialize IDE interface
In-Reply-To: <D7810733513F4840B4EBAAFA64D9C6A401307A69@stgw002a.ww002.siemens.net>
Message-ID: <D7810733513F4840B4EBAAFA64D9C6A401307AC9@stgw002a.ww002.siemens.net>

> Which would be the correct way to make pcmcia_request_irq() 
> use the correct value of 40?

This is in drivers/pcmcia/au1000_db1x00.c:

db1x00_pcmcia_hw_init():

	skt->irq = AU1000_GPIO_8;  /* = 40 */

Now the CF is working fine.

Fabrice


From akpm at linux-foundation.org  Fri Apr 27 22:01:43 2007
From: akpm at linux-foundation.org (Andrew Morton)
Date: Fri, 27 Apr 2007 19:01:43 -0700
Subject: [PATCH] ide-cs: recognize 2GB CompactFlash from Transcend
In-Reply-To: <D7810733513F4840B4EBAAFA64D9C6A4012D6188@stgw002a.ww002.siemens.net>
References: <20070425171533.22efa133.akpm@linux-foundation.org>
	<D7810733513F4840B4EBAAFA64D9C6A4012D6188@stgw002a.ww002.siemens.net>
Message-ID: <20070427190143.d597dd38.akpm@linux-foundation.org>

On Thu, 26 Apr 2007 11:21:01 +0200
"Aeschbacher, Fabrice" <Fabrice.Aeschbacher at siemens.com> wrote:

> As pointed to by Peter, and also as indicated by a judicious output in
> dmesg, the 4th parameter should be 0x969aa4f2. Please find below the
> corrected patch:
> 
> Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher at siemens.com>
> 
> ===================================================================
> --- linux-2.6.20.7-orig/drivers/ide/legacy/ide-cs.c	2007-04-15
> 21:08:02.000000000 +0200
> +++ linux-2.6.20.7/drivers/ide/legacy/ide-cs.c	2007-04-26
> 11:13:13.000000000 +0200
> @@ -399,6 +399,7 @@
>  	PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a,
> 0x3489e003),
>  	PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1,
> 0x2a54d4b1),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1,
> 0x969aa4f2),
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1,
> 0xf54a91c8),
>  	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
>  	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c,
> 0x212bb918),
> ===================================================================

This one-liner is turning into a fiasco.  All the top-posting and
word-wrapped patches aren't helping :(

I presently have two patches.  Please check them.


ide-cs-recognize-2gb-compactflash-from-transcend.patch:


From: "Aeschbacher, Fabrice" <Fabrice.Aeschbacher at siemens.com>

Without the following patch, the kernel does not automatically detect
2GB CompactFlash cards from Transcend.

Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher at siemens.com>
Cc: Dominik Brodowski <linux at dominikbrodowski.net>
Cc: Bartlomiej Zolnierkiewicz <bzolnier at gmail.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---

 drivers/ide/legacy/ide-cs.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN drivers/ide/legacy/ide-cs.c~ide-cs-recognize-2gb-compactflash-from-transcend drivers/ide/legacy/ide-cs.c
--- a/drivers/ide/legacy/ide-cs.c~ide-cs-recognize-2gb-compactflash-from-transcend
+++ a/drivers/ide/legacy/ide-cs.c
@@ -401,6 +401,8 @@ static struct pcmcia_device_id ide_ids[]
 	PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003),
 	PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0xf54a91c8),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
 	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
 	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
_


Is this really supposed to add a TS2GCF120 entry with the same IDs as
TS4GCF120?





And pata_pcmcia-recognize-2gb-compactflash-from-transcend.patch:

From: "Aeschbacher, Fabrice" <Fabrice.Aeschbacher at siemens.com>

Allow the pata_pcmcia driver to automatically detect 2GB CompactFlash cards
from Transcend.

Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher at siemens.com>
Cc: "Peter Stuge" <stuge-linux-pcmcia at cdy.org>
Acked-by: Alan Cox <alan at redhat.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier at gmail.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---

 drivers/ata/pata_pcmcia.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN drivers/ata/pata_pcmcia.c~pata_pcmcia-recognize-2gb-compactflash-from-transcend drivers/ata/pata_pcmcia.c
--- a/drivers/ata/pata_pcmcia.c~pata_pcmcia-recognize-2gb-compactflash-from-transcend
+++ a/drivers/ata/pata_pcmcia.c
@@ -396,6 +396,7 @@ static struct pcmcia_device_id pcmcia_de
 	PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003),
 	PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
 	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
 	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
_



From stuge-linux-pcmcia at cdy.org  Fri Apr 27 22:09:50 2007
From: stuge-linux-pcmcia at cdy.org (Peter Stuge)
Date: Sat, 28 Apr 2007 04:09:50 +0200
Subject: [PATCH] ide-cs: recognize 2GB CompactFlash from Transcend
In-Reply-To: <20070427190143.d597dd38.akpm@linux-foundation.org>
References: <20070425171533.22efa133.akpm@linux-foundation.org>
	<D7810733513F4840B4EBAAFA64D9C6A4012D6188@stgw002a.ww002.siemens.net>
	<20070427190143.d597dd38.akpm@linux-foundation.org>
Message-ID: <20070428020950.15491.qmail@cdy.org>

On Fri, Apr 27, 2007 at 07:01:43PM -0700, Andrew Morton wrote:
> This one-liner is turning into a fiasco.
> diff -puN drivers/ide/legacy/ide-cs.c~ide-cs-recognize-2gb-compactflash-from-transcend drivers/ide/legacy/ide-cs.c
> --- a/drivers/ide/legacy/ide-cs.c~ide-cs-recognize-2gb-compactflash-from-transcend
> +++ a/drivers/ide/legacy/ide-cs.c
> @@ -401,6 +401,8 @@ static struct pcmcia_device_id ide_ids[]
>  	PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003),
>  	PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0xf54a91c8),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
>  	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
>  	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
> _
> 
> 
> Is this really supposed to add a TS2GCF120 entry with the same IDs
> as TS4GCF120?

That's probably a copy and paste error. 0x969aa4f2 is the correct ID.


> And pata_pcmcia-recognize-2gb-compactflash-from-transcend.patch:

This one is all right so for what it's worth, it gets:

Acked-by: Peter Stuge <peter at stuge.se>


//Peter


From jengelh at linux01.gwdg.de  Mon Apr 30 07:45:03 2007
From: jengelh at linux01.gwdg.de (Jan Engelhardt)
Date: Mon, 30 Apr 2007 13:45:03 +0200 (MEST)
Subject: [PATCH 22/36] Use menuconfig objects II - netdev/pcmcia
In-Reply-To: <Pine.LNX.4.61.0704301225060.29151@yvahk01.tjqt.qr>
References: <Pine.LNX.4.61.0704301225060.29151@yvahk01.tjqt.qr>
Message-ID: <Pine.LNX.4.61.0704301344100.29151@yvahk01.tjqt.qr>


Change Kconfig objects from "menu, config" into "menuconfig" so
that the user can disable the whole feature without having to
enter the menu first.

Signed-off-by: Jan Engelhardt <jengelh at gmx.de>

---
 drivers/net/pcmcia/Kconfig |   23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

--- linux-2.6.21-mm_20070428.orig/drivers/net/pcmcia/Kconfig
+++ linux-2.6.21-mm_20070428/drivers/net/pcmcia/Kconfig
@@ -2,11 +2,9 @@
 # PCMCIA Network device configuration
 #
 
-menu "PCMCIA network device support"
-	depends on NETDEVICES && PCMCIA!=n
-
-config NET_PCMCIA
+menuconfig NET_PCMCIA
 	bool "PCMCIA network device support"
+	depends on PCMCIA
 	---help---
 	  Say Y if you would like to include support for any PCMCIA or CardBus
 	  network adapters, then say Y to the driver for your particular card
@@ -21,9 +19,10 @@ config NET_PCMCIA
 
 	  If unsure, say N.
 
+if NET_PCMCIA
+
 config PCMCIA_3C589
 	tristate "3Com 3c589 PCMCIA support"
-	depends on NET_PCMCIA && PCMCIA
 	help
 	  Say Y here if you intend to attach a 3Com 3c589 or compatible PCMCIA
 	  (PC-card) Ethernet card to your computer.
@@ -33,7 +32,6 @@ config PCMCIA_3C589
 
 config PCMCIA_3C574
 	tristate "3Com 3c574 PCMCIA support"
-	depends on NET_PCMCIA && PCMCIA
 	help
 	  Say Y here if you intend to attach a 3Com 3c574 or compatible PCMCIA
 	  (PC-card) Fast Ethernet card to your computer.
@@ -43,7 +41,6 @@ config PCMCIA_3C574
 
 config PCMCIA_FMVJ18X
 	tristate "Fujitsu FMV-J18x PCMCIA support"
-	depends on NET_PCMCIA && PCMCIA
 	select CRC32
 	help
 	  Say Y here if you intend to attach a Fujitsu FMV-J18x or compatible
@@ -54,7 +51,6 @@ config PCMCIA_FMVJ18X
 
 config PCMCIA_PCNET
 	tristate "NE2000 compatible PCMCIA support"
-	depends on NET_PCMCIA && PCMCIA
 	select CRC32
 	help
 	  Say Y here if you intend to attach an NE2000 compatible PCMCIA
@@ -65,7 +61,6 @@ config PCMCIA_PCNET
 
 config PCMCIA_NMCLAN
 	tristate "New Media PCMCIA support"
-	depends on NET_PCMCIA && PCMCIA
 	help
 	  Say Y here if you intend to attach a New Media Ethernet or LiveWire
 	  PCMCIA (PC-card) Ethernet card to your computer.
@@ -75,7 +70,6 @@ config PCMCIA_NMCLAN
 
 config PCMCIA_SMC91C92
 	tristate "SMC 91Cxx PCMCIA support"
-	depends on NET_PCMCIA && PCMCIA
 	select CRC32
 	select MII
 	help
@@ -87,7 +81,6 @@ config PCMCIA_SMC91C92
 
 config PCMCIA_XIRC2PS
 	tristate "Xircom 16-bit PCMCIA support"
-	depends on NET_PCMCIA && PCMCIA
 	help
 	  Say Y here if you intend to attach a Xircom 16-bit PCMCIA (PC-card)
 	  Ethernet or Fast Ethernet card to your computer.
@@ -97,7 +90,6 @@ config PCMCIA_XIRC2PS
 
 config PCMCIA_AXNET
 	tristate "Asix AX88190 PCMCIA support"
-	depends on NET_PCMCIA && PCMCIA
 	---help---
 	  Say Y here if you intend to attach an Asix AX88190-based PCMCIA
 	  (PC-card) Fast Ethernet card to your computer.  These cards are
@@ -109,7 +101,7 @@ config PCMCIA_AXNET
 
 config ARCNET_COM20020_CS
 	tristate "COM20020 ARCnet PCMCIA support"
-	depends on NET_PCMCIA && ARCNET_COM20020 && PCMCIA
+	depends on ARCNET_COM20020
 	help
 	  Say Y here if you intend to attach this type of ARCnet PCMCIA card
 	  to your computer.
@@ -119,7 +111,7 @@ config ARCNET_COM20020_CS
 
 config PCMCIA_IBMTR
 	tristate "IBM PCMCIA tokenring adapter support"
-	depends on NET_PCMCIA && IBMTR!=y && TR && PCMCIA && !64BIT
+	depends on IBMTR!=y && TR && !64BIT
 	help
 	  Say Y here if you intend to attach this type of Token Ring PCMCIA
 	  card to your computer. You then also need to say Y to "Token Ring
@@ -128,5 +120,4 @@ config PCMCIA_IBMTR
 	  To compile this driver as a module, choose M here: the module will be
 	  called ibmtr_cs.
 
-endmenu
-
+endif # NET_PCMCIA


From buytenh at wantstofly.org  Mon Apr 30 09:25:48 2007
From: buytenh at wantstofly.org (Lennert Buytenhek)
Date: Mon, 30 Apr 2007 15:25:48 +0200
Subject: [PATCH 0/3] pcmcia support for the cirrus logic ep93xx SoC
Message-ID: <20070430132548.GD11261@xi.wantstofly.org>

(please CC, not subscribed to the list)

Hi,

This patch series adds pcmcia support for the cirrus logic ep93xx
SoC.  I've tested it on two different ep93xx boards, and it seems to
work all right.  The first patch in the series adds the generic ep93xx
bits, the second patch implements the relevant hooks for the ADS Sphere
board, and the third patch implements the relevant hooks for the Contec
Micro9 board.

The first two patches in this series were previously sent on February
4th 2007.  There was no feedback at the time.  I'm not sure whether
this means that the patches suck or that there are no objections. :-)


thanks,
Lennert


From buytenh at wantstofly.org  Mon Apr 30 09:26:30 2007
From: buytenh at wantstofly.org (Lennert Buytenhek)
Date: Mon, 30 Apr 2007 15:26:30 +0200
Subject: [PATCH 1/3] ep93xx pcmcia support
Message-ID: <20070430132630.GE11261@xi.wantstofly.org>

Signed-off-by: Lennert Buytenhek <buytenh at wantstofly.org>

Index: linux-2.6.21-rc5/drivers/pcmcia/Kconfig
===================================================================
--- linux-2.6.21-rc5.orig/drivers/pcmcia/Kconfig
+++ linux-2.6.21-rc5/drivers/pcmcia/Kconfig
@@ -197,6 +197,12 @@ config PCMCIA_AU1X00
 	tristate "Au1x00 pcmcia support"
 	depends on SOC_AU1X00 && PCMCIA
 
+config PCMCIA_EP93XX
+	tristate "EP93xx support"
+	depends on ARM && ARCH_EP93XX && PCMCIA
+	help
+	  Say Y here to include support for the EP93xx PCMCIA controller
+
 config PCMCIA_SA1100
 	tristate "SA1100 support"
 	depends on ARM && ARCH_SA1100 && PCMCIA
Index: linux-2.6.21-rc5/drivers/pcmcia/Makefile
===================================================================
--- linux-2.6.21-rc5.orig/drivers/pcmcia/Makefile
+++ linux-2.6.21-rc5/drivers/pcmcia/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_I82092)				+= i82092.o
 obj-$(CONFIG_TCIC)				+= tcic.o
 obj-$(CONFIG_PCMCIA_M8XX)			+= m8xx_pcmcia.o
 obj-$(CONFIG_HD64465_PCMCIA)			+= hd64465_ss.o
+obj-$(CONFIG_PCMCIA_EP93XX)			+= ep93xx_core.o ep93xx_cs.o
 obj-$(CONFIG_PCMCIA_SA1100)			+= sa11xx_core.o sa1100_cs.o
 obj-$(CONFIG_PCMCIA_SA1111)			+= sa11xx_core.o sa1111_cs.o
 obj-$(CONFIG_PCMCIA_PXA2XX)                     += pxa2xx_core.o pxa2xx_cs.o
@@ -38,6 +39,7 @@ obj-$(CONFIG_PCMCIA_VRC4173)			+= vrc417
 obj-$(CONFIG_OMAP_CF)				+= omap_cf.o
 obj-$(CONFIG_AT91_CF)				+= at91_cf.o
 
+ep93xx_core-y					+= soc_common.o ep93xx_base.o
 sa11xx_core-y					+= soc_common.o sa11xx_base.o
 pxa2xx_core-y					+= soc_common.o pxa2xx_base.o
 
Index: linux-2.6.21-rc5/drivers/pcmcia/ep93xx_base.c
===================================================================
--- /dev/null
+++ linux-2.6.21-rc5/drivers/pcmcia/ep93xx_base.c
@@ -0,0 +1,194 @@
+/*======================================================================
+
+  Device driver for the PCMCIA control functionality of EP93xx
+  microprocessors.  Derived from pxa2xx_base.c
+
+    The contents of this file may be used under the
+    terms of the GNU Public License version 2 (the "GPL")
+
+    (c) Ian Molton (spyro at f2s.com) 2003
+    (c) Stefan Eletzhofer (stefan.eletzhofer at inquant.de) 2003,4
+    (c) Robert Whaley (rwhaley at applieddata.net) 2005
+
+    derived from sa11xx_base.c
+
+     Portions created by John G. Dorsey are
+     Copyright (C) 1999 John G. Dorsey.
+
+  ======================================================================*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/spinlock.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+#include <pcmcia/cs_types.h>
+#include <pcmcia/ss.h>
+#include <pcmcia/bulkmem.h>
+#include <pcmcia/cistpl.h>
+#include "cs_internal.h"
+#include "soc_common.h"
+
+#define PC1ATTRIB		(EP93XX_PCMCIA_CONTROLLER_BASE + 0x20)
+#define PC1COMMON		(EP93XX_PCMCIA_CONTROLLER_BASE + 0x24)
+#define PC1IO			(EP93XX_PCMCIA_CONTROLLER_BASE + 0x28)
+#define PC16BITSWIDE		0x80000000
+
+#define MIN(a,b)		((a) > (b) ? (b) : (a))
+
+#define MCXX_SETUP_MAX		0xff
+#define MCXX_ASST_MAX		0xff
+#define MCXX_HOLD_MAX		0x0f
+
+#define MCXX_SETUP_SHIFT	0
+#define MCXX_ASST_SHIFT		16
+#define MCXX_HOLD_SHIFT		8
+
+
+static inline u_int ep93xx_mcxx_hold(u_int pcmcia_cycle_ns,
+				     u_int hclk_10khz)
+{
+	u_int code = pcmcia_cycle_ns * hclk_10khz;
+	return (code / 100000) + ((code % 100000) ? 1 : 0) - 1;
+}
+
+static inline u_int ep93xx_mcxx_asst(u_int pcmcia_cycle_ns,
+				     u_int hclk_10khz)
+{
+	u_int code = pcmcia_cycle_ns * hclk_10khz;
+	return (code / 100000) + ((code % 100000) ? 1 : 0) - 1;
+}
+
+static inline u_int ep93xx_mcxx_setup(u_int pcmcia_cycle_ns,
+				      u_int hclk_10khz)
+{
+	u_int code = pcmcia_cycle_ns * hclk_10khz;
+	return (code / 100000) + ((code % 100000) ? 1 : 0) - 1;
+}
+
+static int ep93xx_pcmcia_set_mcmem( int sock, int speed, int clock )
+{
+        writel(PC16BITSWIDE
+	     | (MIN(ep93xx_mcxx_setup(speed, clock), MCXX_SETUP_MAX) << MCXX_SETUP_SHIFT)
+	     | (MIN(ep93xx_mcxx_asst(speed, clock), MCXX_ASST_MAX) << MCXX_ASST_SHIFT)
+	     | (MIN(ep93xx_mcxx_hold(speed, clock), MCXX_HOLD_MAX) << MCXX_HOLD_SHIFT),
+	     PC1COMMON);
+
+	return 0;
+}
+
+static int ep93xx_pcmcia_set_mcio( int sock, int speed, int clock )
+{
+        writel(PC16BITSWIDE
+	     | (MIN(ep93xx_mcxx_setup(speed, clock), MCXX_SETUP_MAX) << MCXX_SETUP_SHIFT)
+	     | (MIN(ep93xx_mcxx_asst(speed, clock), MCXX_ASST_MAX) << MCXX_ASST_SHIFT)
+	     | (MIN(ep93xx_mcxx_hold(speed, clock), MCXX_HOLD_MAX) << MCXX_HOLD_SHIFT),
+	     PC1IO);
+
+	return 0;
+}
+
+static int ep93xx_pcmcia_set_mcatt( int sock, int speed, int clock )
+{
+        writel(PC16BITSWIDE
+	     | (MIN(ep93xx_mcxx_setup(speed, clock), MCXX_SETUP_MAX) << MCXX_SETUP_SHIFT)
+	     | (MIN(ep93xx_mcxx_asst(speed, clock), MCXX_ASST_MAX) << MCXX_ASST_SHIFT)
+	     | (MIN(ep93xx_mcxx_hold(speed, clock), MCXX_HOLD_MAX) << MCXX_HOLD_SHIFT),
+	     PC1ATTRIB);
+
+	return 0;
+}
+
+static int ep93xx_pcmcia_set_mcxx(struct soc_pcmcia_socket *skt, unsigned int clk)
+{
+	struct soc_pcmcia_timing timing;
+	int sock = skt->nr;
+
+	soc_common_pcmcia_get_timing(skt, &timing);
+
+	ep93xx_pcmcia_set_mcmem(sock, timing.mem, clk);
+	ep93xx_pcmcia_set_mcatt(sock, timing.attr, clk);
+	ep93xx_pcmcia_set_mcio(sock, timing.io, clk);
+
+	return 0;
+}
+
+static int ep93xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt)
+{
+	unsigned int hclk;
+
+	/* for now just hard code hclk to 100Mhz (in 10khz units)*/
+	hclk = 10000;
+
+	return ep93xx_pcmcia_set_mcxx(skt, hclk);
+}
+
+
+static int ep93xx_drv_pcmcia_probe(struct platform_device *pdev)
+{
+	int ret;
+	struct pcmcia_low_level *ops;
+	int first, nr;
+
+	if (pdev->dev.platform_data == NULL)
+		return -ENODEV;
+
+	ops = (struct pcmcia_low_level *)pdev->dev.platform_data;
+	first = ops->first;
+	nr = ops->nr;
+
+	/* Provide our EP93xx specific timing routines. */
+	ops->set_timing  = ep93xx_pcmcia_set_timing;
+
+	ret = soc_common_drv_pcmcia_probe(&pdev->dev, ops, first, nr);
+
+	return ret;
+}
+
+static int ep93xx_drv_pcmcia_remove(struct platform_device *pdev)
+{
+	return soc_common_drv_pcmcia_remove(&pdev->dev);
+}
+
+static int ep93xx_drv_pcmcia_suspend(struct platform_device *pdev, pm_message_t state)
+{
+	return pcmcia_socket_dev_suspend(&pdev->dev, state);
+}
+
+static int ep93xx_drv_pcmcia_resume(struct platform_device *pdev)
+{
+	return pcmcia_socket_dev_resume(&pdev->dev);
+}
+
+static struct platform_driver ep93xx_pcmcia_driver = {
+	.probe		= ep93xx_drv_pcmcia_probe,
+	.remove		= ep93xx_drv_pcmcia_remove,
+	.suspend 	= ep93xx_drv_pcmcia_suspend,
+	.resume 	= ep93xx_drv_pcmcia_resume,
+	.driver		= {
+		.name	= "ep93xx-pcmcia",
+	},
+};
+
+static int __init ep93xx_pcmcia_init(void)
+{
+	return platform_driver_register(&ep93xx_pcmcia_driver);
+}
+
+static void __exit ep93xx_pcmcia_exit(void)
+{
+	platform_driver_unregister(&ep93xx_pcmcia_driver);
+}
+
+fs_initcall(ep93xx_pcmcia_init);
+module_exit(ep93xx_pcmcia_exit);
+
+MODULE_AUTHOR("Robert Whaley <rwhaley at applieddata.net>");
+MODULE_DESCRIPTION("Linux PCMCIA Card Services: EP93xx core socket driver");
+MODULE_LICENSE("GPL");
Index: linux-2.6.21-rc5/drivers/pcmcia/soc_common.c
===================================================================
--- linux-2.6.21-rc5.orig/drivers/pcmcia/soc_common.c
+++ linux-2.6.21-rc5/drivers/pcmcia/soc_common.c
@@ -49,6 +49,9 @@
 #include "soc_common.h"
 
 /* FIXME: platform dependent resource declaration has to move out of this file */
+#ifdef CONFIG_ARCH_EP93XX
+#include <asm/arch/pcmcia.h>
+#endif
 #ifdef CONFIG_ARCH_PXA
 #include <asm/arch/pxa-regs.h>
 #endif
Index: linux-2.6.21-rc5/include/asm-arm/arch-ep93xx/pcmcia.h
===================================================================
--- /dev/null
+++ linux-2.6.21-rc5/include/asm-arm/arch-ep93xx/pcmcia.h
@@ -0,0 +1,19 @@
+/*
+ * linux/include/asm-arm/arch-ep93xx/pcmcia.h
+ */
+
+#ifndef __ASM_ARCH_PCMCIA_H
+#define __ASM_ARCH_PCMCIA_H
+
+#define _PCMCIA(slt)		(0x40000000 + ((slt) ? 0x10000000 : 0))
+#define _PCMCIAIO(slt)		_PCMCIA(slt)
+#define _PCMCIAAttr(slt)	(_PCMCIA(slt) + 0x08000000)
+#define _PCMCIAMem(slt)		(_PCMCIA(slt) + 0x0c000000)
+
+#define PCMCIASp		0x10000000
+#define PCMCIAIOSp		0x04000000
+#define PCMCIAAttrSp		0x04000000
+#define PCMCIAMemSp		0x04000000
+
+
+#endif


From buytenh at wantstofly.org  Mon Apr 30 09:27:00 2007
From: buytenh at wantstofly.org (Lennert Buytenhek)
Date: Mon, 30 Apr 2007 15:27:00 +0200
Subject: [PATCH 2/3] ep93xx pcmcia support for the ads sphere board
Message-ID: <20070430132700.GF11261@xi.wantstofly.org>

Signed-off-by: Lennert Buytenhek <buytenh at wantstofly.org>

Index: linux-2.6.21-rc5/drivers/pcmcia/Makefile
===================================================================
--- linux-2.6.21-rc5.orig/drivers/pcmcia/Makefile
+++ linux-2.6.21-rc5/drivers/pcmcia/Makefile
@@ -55,6 +55,8 @@ au1x00_ss-$(CONFIG_MIPS_DB1500)			+= au1
 au1x00_ss-$(CONFIG_MIPS_DB1550)			+= au1000_db1x00.o
 au1x00_ss-$(CONFIG_MIPS_XXS1500)		+= au1000_xxs1500.o
 
+ep93xx_cs-$(CONFIG_MACH_ADSSPHERE)		+= ep93xx_adssphere.o
+
 sa1111_cs-y					+= sa1111_generic.o
 sa1111_cs-$(CONFIG_ASSABET_NEPONSET)		+= sa1100_neponset.o
 sa1111_cs-$(CONFIG_SA1100_BADGE4)		+= sa1100_badge4.o
Index: linux-2.6.21-rc5/drivers/pcmcia/ep93xx_adssphere.c
===================================================================
--- /dev/null
+++ linux-2.6.21-rc5/drivers/pcmcia/ep93xx_adssphere.c
@@ -0,0 +1,167 @@
+/*
+ * linux/drivers/pcmcia/ep93xx_adssphere.c
+ * Copyright (C) 2005 Robert Whaley <rwhaley at applieddata.net>
+ *
+ * Adapted from pxa27x_mainstone.c, which is:
+ *   Copyright (C) 2004 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <pcmcia/ss.h>
+#include <asm/io.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/adssphere.h>
+#include "soc_common.h"
+
+#define EP93XX_GPIO_PFDR	EP93XX_GPIO_REG(0x30)
+
+#define PCMCIACNT		(EP93XX_PCMCIA_CONTROLLER_BASE + 0x40)
+
+
+static struct pcmcia_irqs irqs[] = {
+	{ 0, IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_MCCD1),  "PCMCIA CD1" },
+	{ 0, IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_MCCD2),  "PCMCIA CD2" },
+	{ 0, IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_MCBVD1), "PCMCIA STSCHG/BVD1" },
+	{ 0, IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_MCBVD2), "PCMCIA SPKR/BVD2" },
+};
+
+static int adssphere_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
+{
+	if (skt->nr == 0) {
+		skt->irq = IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_READY);
+		return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	}
+
+	return -ENXIO;
+}
+
+static void adssphere_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
+{
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static void adssphere_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+					  struct pcmcia_state *state)
+{
+	unsigned long status;
+
+	status = readl(EP93XX_GPIO_PFDR);
+	state->detect = (status & 0x06) ? 0 : 1;
+	state->ready  = (status & 0x40) ? 1 : 0;
+	state->wrprot = (status & 0x01) ? 0 : 1;
+	state->bvd1   = (status & 0x08) ? 1 : 0;
+	state->bvd2   = (status & 0x10) ? 1 : 0;
+	state->vs_3v  = (status & 0x20) ? 0 : 1;
+	state->vs_Xv  = (status & 0x80) ? 0 : 1;
+}
+
+static int adssphere_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
+					     const socket_state_t *state)
+{
+	unsigned long clrbits;
+	unsigned long setbits;
+
+	if (skt->nr != 0) {
+		printk(KERN_ERR "%s: socket %u invalid\n", __func__, skt->nr);
+		return -1;
+	}
+
+	clrbits = 0;
+	setbits = 0;
+
+	switch (state->Vcc) {
+	case 0:
+		clrbits = ADSSPHERE_CR0_CF_33 | ADSSPHERE_CR0_CF_50;
+		setbits = 0;
+		break;
+
+	case 33:
+		clrbits = ADSSPHERE_CR0_CF_50;
+		setbits = ADSSPHERE_CR0_CF_33;
+		break;
+
+	case 50:
+		clrbits = ADSSPHERE_CR0_CF_33;
+		setbits = ADSSPHERE_CR0_CF_50;
+		break;
+
+	default:
+		printk(KERN_ERR "%s: bad Vcc %u\n", __func__, state->Vcc);
+		return -1;
+	}
+
+	writel((readl(ADSSPHERE_CR0) & ~clrbits) | setbits, ADSSPHERE_CR0);
+
+	if (state->flags & SS_RESET)
+		/* see EP93xx User's Guide */
+		writel(0x15, PCMCIACNT);
+	else
+		/* CF mode -  BIT1 for PCMCIA mode */
+		writel(0x11, PCMCIACNT);
+
+	return 0;
+}
+
+static void adssphere_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
+{
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static void adssphere_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
+{
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static struct pcmcia_low_level adssphere_pcmcia_ops = {
+	.owner			= THIS_MODULE,
+	.hw_init		= adssphere_pcmcia_hw_init,
+	.hw_shutdown		= adssphere_pcmcia_hw_shutdown,
+	.socket_state		= adssphere_pcmcia_socket_state,
+	.configure_socket	= adssphere_pcmcia_configure_socket,
+	.socket_init		= adssphere_pcmcia_socket_init,
+	.socket_suspend		= adssphere_pcmcia_socket_suspend,
+	.nr			= 1,
+};
+
+static struct platform_device adssphere_pcmcia = {
+	.name		= "ep93xx-pcmcia",
+	.id		= -1,
+	.dev		= {
+		.platform_data	= &adssphere_pcmcia_ops,
+	},
+};
+
+static int __init adssphere_pcmcia_init(void)
+{
+	int ret;
+
+	ret = 0;
+	if (machine_is_adssphere())
+		ret = platform_device_register(&adssphere_pcmcia);
+
+	return ret;
+}
+
+static void __exit adssphere_pcmcia_exit(void)
+{
+	if (machine_is_adssphere())
+		platform_device_unregister(&adssphere_pcmcia);
+}
+
+module_init(adssphere_pcmcia_init);
+module_exit(adssphere_pcmcia_exit);
+
+MODULE_LICENSE("GPL");


From buytenh at wantstofly.org  Mon Apr 30 09:27:23 2007
From: buytenh at wantstofly.org (Lennert Buytenhek)
Date: Mon, 30 Apr 2007 15:27:23 +0200
Subject: [PATCH 3/3] ep93xx pcmcia support for the contec micro9 board
Message-ID: <20070430132723.GG11261@xi.wantstofly.org>

Signed-off-by: Lennert Buytenhek <buytenh at wantstofly.org>

Index: linux-2.6.20/arch/arm/mach-ep93xx/micro9.c
===================================================================
--- linux-2.6.20.orig/arch/arm/mach-ep93xx/micro9.c
+++ linux-2.6.20/arch/arm/mach-ep93xx/micro9.c
@@ -16,12 +16,14 @@
 #include <linux/mm.h>
 #include <linux/platform_device.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 
 #include <linux/mtd/physmap.h>
 
 #include <asm/io.h>
 #include <asm/hardware.h>
 
+#include <asm/arch/gpio.h>
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
@@ -92,11 +94,63 @@ static void __init micro9h_init(void)
        platform_device_register(&micro9h_flash);
 }
 
+void micro9_tps2206_write(int val)
+{
+	int i;
+
+	eeclk_eedat_claim();
+
+	/*
+	 * First pull EECLK low, so that transitions on EEDAT
+	 * don't cause start or stop conditions.
+	 */
+	gpio_line_config(EP93XX_GPIO_LINE_EECLK, GPIO_OUT);
+	gpio_line_set(EP93XX_GPIO_LINE_EECLK, 0);
+	udelay(1);
+
+	for (i = 8; i >= 0; i--) {
+		if (val & (1 << i))
+			gpio_line_config(EP93XX_GPIO_LINE_EEDAT, GPIO_IN);
+		else {
+			gpio_line_config(EP93XX_GPIO_LINE_EEDAT, GPIO_OUT);
+			gpio_line_set(EP93XX_GPIO_LINE_EEDAT, 0);
+		}
+		udelay(1);
+
+		gpio_line_config(EP93XX_GPIO_LINE_EECLK, GPIO_IN);
+		udelay(1);
+		gpio_line_config(EP93XX_GPIO_LINE_EECLK, GPIO_OUT);
+		gpio_line_set(EP93XX_GPIO_LINE_EECLK, 0);
+	}
+	udelay(1);
+	gpio_line_set(EP93XX_GPIO_LINE_SLA0, 1);
+	udelay(1);
+	gpio_line_set(EP93XX_GPIO_LINE_SLA0, 0);
+
+	gpio_line_config(EP93XX_GPIO_LINE_EEDAT, GPIO_IN);
+	udelay(1);
+	gpio_line_config(EP93XX_GPIO_LINE_EECLK, GPIO_IN);
+
+	eeclk_eedat_release();
+}
+
+static void micro9_tps2206_init(void)
+{
+	gpio_line_config(EP93XX_GPIO_LINE_EECLK, GPIO_IN);
+	gpio_line_config(EP93XX_GPIO_LINE_EEDAT, GPIO_IN);
+
+	gpio_line_set(EP93XX_GPIO_LINE_SLA0, 0);
+	gpio_line_config(EP93XX_GPIO_LINE_SLA0, GPIO_OUT);
+
+	micro9_tps2206_write(0);
+}
+
 static void __init micro9h_init_machine(void)
 {
        ep93xx_init_devices();
        micro9_init();
        micro9h_init();
+	micro9_tps2206_init();
 }
 
 MACHINE_START(MICRO9, "Contec Hypercontrol Micro9-H")
@@ -154,4 +208,3 @@ MACHINE_START(MICRO9L, "Contec Hypercont
        .init_machine   = micro9l_init_machine,
 MACHINE_END
 #endif
-
Index: linux-2.6.20/drivers/pcmcia/Makefile
===================================================================
--- linux-2.6.20.orig/drivers/pcmcia/Makefile
+++ linux-2.6.20/drivers/pcmcia/Makefile
@@ -56,6 +56,7 @@ au1x00_ss-$(CONFIG_MIPS_DB1550)			+= au1
 au1x00_ss-$(CONFIG_MIPS_XXS1500)		+= au1000_xxs1500.o
 
 ep93xx_cs-$(CONFIG_MACH_ADSSPHERE)		+= ep93xx_adssphere.o
+ep93xx_cs-$(CONFIG_MACH_MICRO9)			+= ep93xx_micro9.o
 
 sa1111_cs-y					+= sa1111_generic.o
 sa1111_cs-$(CONFIG_ASSABET_NEPONSET)		+= sa1100_neponset.o
Index: linux-2.6.20/drivers/pcmcia/ep93xx_micro9.c
===================================================================
--- /dev/null
+++ linux-2.6.20/drivers/pcmcia/ep93xx_micro9.c
@@ -0,0 +1,182 @@
+/*
+ * linux/drivers/pcmcia/ep93xx_micro9.c
+ * Copyright (C) 2007 Lennert Buytenhek <buytenh at wantstofly.org>
+ *
+ * Adapted from ep93xx_adssphere.c, which is:
+ *   Copyright (C) 2005 Robert Whaley <rwhaley at applieddata.net>
+ *
+ * Adapted from pxa27x_mainstone.c, which is:
+ *   Copyright (C) 2004 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <pcmcia/ss.h>
+#include <asm/io.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/arch/gpio.h>
+#include <asm/mach-types.h>
+#include "soc_common.h"
+
+#define EP93XX_GPIO_PFDR	EP93XX_GPIO_REG(0x30)
+
+#define PCMCIACNT		(EP93XX_PCMCIA_CONTROLLER_BASE + 0x40)
+
+#define TPS2206_NOT_SHUTDOWN	0x0100
+#define TPS2206_BVCC_0V		0x0000
+#define TPS2206_BVCC_5V		0x0040
+#define TPS2206_BVCC_3V3	0x0080
+#define TPS2206_BVPP_0V		0x0000
+#define TPS2206_BVPP_12V	0x0010
+#define TPS2206_BVPP_VCC	0x0020
+#define TPS2206_BVPP_HIGHZ	0x0030
+#define TPS2206_AVCC_0V		0x0000
+#define TPS2206_AVCC_3V3	0x0004
+#define TPS2206_AVCC_5V		0x0008
+#define TPS2206_AVPP_0V		0x0000
+#define TPS2206_AVPP_12V	0x0001
+#define TPS2206_AVPP_VCC	0x0002
+#define TPS2206_AVPP_HIGHZ	0x0003
+
+
+static struct pcmcia_irqs irqs[] = {
+	{ 0, IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_MCCD1),  "PCMCIA CD1" },
+	{ 0, IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_MCCD2),  "PCMCIA CD2" },
+	{ 0, IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_MCBVD1), "PCMCIA STSCHG/BVD1" },
+	{ 0, IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_MCBVD2), "PCMCIA SPKR/BVD2" },
+};
+
+static int micro9_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
+{
+	if (skt->nr == 0) {
+		skt->irq = IRQ_EP93XX_GPIO(EP93XX_GPIO_LINE_READY);
+		return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	}
+
+	return -ENXIO;
+}
+
+static void micro9_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
+{
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static void micro9_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+					  struct pcmcia_state *state)
+{
+	unsigned long status;
+
+	status = readl(EP93XX_GPIO_PFDR);
+	state->detect = (status & 0x06) ? 0 : 1;
+	state->ready  = (status & 0x40) ? 1 : 0;
+	state->wrprot = (status & 0x01) ? 0 : 1;
+	state->bvd1   = (status & 0x08) ? 1 : 0;
+	state->bvd2   = (status & 0x10) ? 1 : 0;
+	state->vs_3v  = (status & 0x20) ? 0 : 1;
+	state->vs_Xv  = (status & 0x80) ? 0 : 1;
+}
+
+static int micro9_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
+					     const socket_state_t *state)
+{
+	int val;
+
+	if (skt->nr != 0) {
+		printk(KERN_ERR "%s: socket %u invalid\n", __func__, skt->nr);
+		return -1;
+	}
+
+	val = TPS2206_NOT_SHUTDOWN;
+	if (state->Vcc == 0) {
+		val |= TPS2206_AVCC_0V;
+	} else if (state->Vcc == 33) {
+		val |= TPS2206_AVCC_3V3;
+	} else if (state->Vcc == 50) {
+		val |= TPS2206_AVCC_5V;
+	} else {
+		printk(KERN_ERR "%s: bad Vcc %u\n", __FUNCTION__, state->Vcc);
+		val &= ~TPS2206_NOT_SHUTDOWN;
+	}
+	if (state->Vpp == 0) {
+		val |= TPS2206_AVPP_0V;
+	} else if (state->Vpp == state->Vcc) {
+		val |= TPS2206_AVPP_VCC;
+	} else if (state->Vpp == 120) {
+		val |= TPS2206_AVPP_12V;
+	} else {
+		printk(KERN_ERR "%s: bad Vpp %u\n", __FUNCTION__, state->Vpp);
+		val &= ~TPS2206_NOT_SHUTDOWN;
+	}
+
+	micro9_tps2206_write(val);
+
+	if (state->flags & SS_RESET)
+		/* see EP93xx User's Guide */
+		writel(0x15, PCMCIACNT);
+	else
+		/* CF mode -  BIT1 for PCMCIA mode */
+		writel(0x11, PCMCIACNT);
+
+	return 0;
+}
+
+static void micro9_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
+{
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static void micro9_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
+{
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static struct pcmcia_low_level micro9_pcmcia_ops = {
+	.owner			= THIS_MODULE,
+	.hw_init		= micro9_pcmcia_hw_init,
+	.hw_shutdown		= micro9_pcmcia_hw_shutdown,
+	.socket_state		= micro9_pcmcia_socket_state,
+	.configure_socket	= micro9_pcmcia_configure_socket,
+	.socket_init		= micro9_pcmcia_socket_init,
+	.socket_suspend		= micro9_pcmcia_socket_suspend,
+	.nr			= 1,
+};
+
+static struct platform_device micro9_pcmcia = {
+	.name		= "ep93xx-pcmcia",
+	.id		= -1,
+	.dev		= {
+		.platform_data	= &micro9_pcmcia_ops,
+	},
+};
+
+static int __init micro9_pcmcia_init(void)
+{
+	int ret;
+
+	ret = 0;
+	if (machine_is_micro9())
+		ret = platform_device_register(&micro9_pcmcia);
+
+	return ret;
+}
+
+static void __exit micro9_pcmcia_exit(void)
+{
+	if (machine_is_micro9())
+		platform_device_unregister(&micro9_pcmcia);
+}
+
+module_init(micro9_pcmcia_init);
+module_exit(micro9_pcmcia_exit);
+
+MODULE_LICENSE("GPL");
Index: linux-2.6.20/include/asm-arm/arch-ep93xx/hardware.h
===================================================================
--- linux-2.6.20.orig/include/asm-arm/arch-ep93xx/hardware.h
+++ linux-2.6.20/include/asm-arm/arch-ep93xx/hardware.h
@@ -10,4 +10,5 @@
 
 #include "adssphere.h"
 #include "gesbc9312.h"
+#include "micro9.h"
 #include "ts72xx.h"
Index: linux-2.6.20/include/asm-arm/arch-ep93xx/micro9.h
===================================================================
--- /dev/null
+++ linux-2.6.20/include/asm-arm/arch-ep93xx/micro9.h
@@ -0,0 +1,7 @@
+/*
+ * linux/include/asm-arm/arch-ep93xx/micro9.h
+ */
+
+#ifndef __ASSEMBLY__
+void micro9_tps2206_write(int);
+#endif


