Subject: sl82c105.c weirdness

From: Benjamin Herrenschmidt <[email-masked]>
Date: Fri, 23 Jul 1999 15:38:18 +0200

Hi !

On a board we are developping we use a Winbond "553" chip for the IDE
controller. Originally, I compiled the kernel with support for only our
board (another board I added in the list of "footbridge" archs). Things
worked fine except the IDE controller gave me lots of "lost interrupts".

I finally found that the code in sl82c105c was used with this chip and
that part of this code is under compile option "CONFIG_ARCH_NETWINDER".
This WEIRD, since this option only means that netwinder support is
enabled, not that we are running on a netwinder. If I add support for
both our board _and_ netwinder in the kernel compile options, then
magically, my IDE began to work. I beleive this options should be changed
to something like:

-#ifdef CONFIG_ARCH_NETWINDER
+#ifdef CONFIG_HOST_FOOTBRIDGE
+if (machine_is_netwinder() || machine_is_my_board()) {
 [.../...]
+}

If this is ok, then I'll post a patch, along with fixes to the pcnet32
driver for the strongarm (appropriate cache flush/inval.)

I've not yet figured out what this added IDE code does (and why it's only
defined for the netwinder), but I'm still having a problem with the
second IDE controller of the winbond, which is still giving me
lost_interrupts.

Any clue ?

-- 
           E-Mail: <mailto:[email-masked]>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Alex Holden <[email-masked]>
Date: Fri, 23 Jul 1999 15:05:14 +0100 (GMT)

> If this is ok, then I'll post a patch, along with fixes to the pcnet32

Patches should be sent to Russell's patch system rather than the list- see:
http://www.arm.linux.org.uk/patches/info.html

--------------- Linux- the choice of a GNU generation. --------------
: Alex Holden (M1CJD)- Caver, Programmer, Land Rover nut, Radio Ham :

---

From: Philip Blundell <[email-masked]>
Date: Fri, 23 Jul 1999 14:48:29 +0100

>+if (machine_is_netwinder() || machine_is_my_board()) {

That looks OK to me.  If CONFIG_ARCH_NETWINDER is not set then 
machine_is_netwinder() will expand to a constant 0 and gcc will probably leave 
out the code inside the if in any case.

>second IDE controller of the winbond, which is still giving me

The NetWinder doesn't use the secondary IDE so this has probably not been 
tested.  What interrupt do you think the secondary controller should be using?

I'm also not sure why there are basically two different versions of 
the code for this chip.  I think the original version was written by the 
PowerPC guys so you should probably talk to them and find out whether the two 
can be somehow combined.

p.

---

From: Russell King <[email-masked]>
Date: Fri, 23 Jul 1999 16:01:28 +0100 (BST)

---

From: Russell King <[email-masked]>
Date: Fri, 23 Jul 1999 16:06:03 +0100 (BST)

> magically, my IDE began to work.

The problem is that sl82c105 has never been properly ported to Linux,
until I added the support.  Unfortunately, the original file was for
another architecture, and so I wasn't going to put the support in
for every architecture.

> second IDE controller of the winbond, which is still giving me

The second channel has never been tested, so it's quite possible that there's
some bugs there.  It may even be that channel 1 is updated with the channel
2 info, so I think this is the place to look.

---

From: Benjamin Herrenschmidt <[email-masked]>
Date: Fri, 23 Jul 1999 17:28:40 +0200

>PowerPC guys so you should probably talk to them and find out whether
the two 

second IDE is IRQ 15 (first IDE is IRQ 14).

I'll have a closer look at the code and I know the PPC port quite well (I
wrote the PowerMac booter) so I should have no problems figuring this
out. Thanks.

---

From: Benjamin Herrenschmidt <[email-masked]>
Date: Fri, 23 Jul 1999 19:50:05 +0200

>wrote the PowerMac booter) so I should have no problems figuring this

Your were right, the parameters for the second controller did indeed
override the first controller's. I fixed this along with the irq, but I'm
still having some trouble of some disks not beeing detected, or the
kernel trying to use disks on empty bus. Looks like I may still have a HW
problem there...

Once I'm sure it works perfectly, I'll send patches.