linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: PCMCIA support for 860 -- lost interrupt
@ 2000-05-24  5:09 Shuangjun Zhu
  2000-05-24 20:59 ` Dan Malek
  0 siblings, 1 reply; 5+ messages in thread
From: Shuangjun Zhu @ 2000-05-24  5:09 UTC (permalink / raw)
  To: linuxppc-embedded


1. why "lost interrupt"? irq for IDE is 9, PCMCIA_INTERRUPT=13,
   so, which hardware trigger IRQ 9?
2. why vpp=0.0, where can I change it, in ide_cs.c or m8xx_pcmcia.c?

Note:

I have changed arch/ppc/kernel/ppc8xx_pic.c, so that request_irq() looks
like this:
int request_irq(unsigned int irq, void (*handler)(int, void *, struct
pt_regs *),
 unsigned long irqflags, const char * devname, void *dev_id)
{
#ifdef CONFIG_MBX
        irq += i8259_pic.irq_offset;
#endif
 return (request_8xxirq(irq, handler, irqflags, devname, dev_id));
}
but the error information like following:
-------------------------------------------------------------
<30>Feb 16 20:38:12 cardmgr[128]: executing: 'insmod
/lib/modules/2.2.13/pcmci'
hda: , ATA DISK drive
hdb: probing with STATUS(0x00) instead of ALTSTATUS(0xb0)
hdb: no response (status = 0xa1), resetting drive
hdb: no response (status = 0xa1)
ide0 at 0x108-0x10f,0x10e on irq 9
hda: , 23MB w/0kB Cache, CHS=375/8/16
Partition check:
 hda:hda: lost interrupt
hda: lost interrupt
hda: lost interrupt
hda: lost interrupt
 unknown partition table
ide_cs: hda: Vcc = 5.0, Vpp = 0.0
I<30>Feb 16 20:39:09 cardmgr[128]: executing: './ide start hda'
 hda:hda: lost interrupt
hda: lost interrupt
 unknown partition table
hda: lost interrupt
hda: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
hda: drive_cmd: error=0x04 { DriveStatusError }

bash#


>
>In arch/ppc/kernel/m8xx_setup.c:m8xx_ide_init_hwif_ports()
>==============================================================
> base = (unsigned long) ioremap(PCMCIA_MEM_ADDR, 0x200);
>
> /* For the M-Systems ATA card, the first 8 registers map 1:1.
>  * The following register, control/Altstatus, is located at 0x0e.
>  * Following that, the irq offset, is not used, so we place it in
>  * an unused location, 0x0a.
>  */
> *p++ = base + 8;
>=================================================================
>This code means that ide_ioreg_t save the value as VMA, such 0xCxxxxxxx,
>but in include/asm/io.h, it defined
>
>#define outb(val, port)  out_8((unsigned char *)((port)+_IO_BASE), (val))
>
>it uses the port as register offset, such as 0x10.
>
>So, code access illegal address in macro
> SELECT_DRIVE in drivers/block/ide-probe.c: do_probe()
>
>
>
>>
>>In arch/ppc/mm/init.c, I have iorempa(_IO_BASE,_IO_BASE_SIZE),
>>which _IO_BASE = 0x80000000,
>>
>>in macro SELECT_DRIVE in drivers/block/ide-probe.c: do_probe()
>>OUT_BYTE((drive)->select.all, hwif->io_ports[IDE_SELECT_OFFSET])
>>equal to OUT_BYTE((drive)->select.all, 0x80000000),
>>then system illegal access, so what's wrong?
>>
>>Thanks in advanced!
>>
>>>
>>>Hi,
>>>
>>>
>>>
>>>I recompiled the kernel (2.2.13, including fpu, damm, bossek patches) and
>>>restarted it.
>>>Then I used the rc.pcmcia to set the modules up. It fails because of...
>>>
>>>I found that system acess the illegal address 0x80000000,
>>>in macro SELECT_DRIVE in drivers/block/ide-probe.c: do_probe()
>>>
>>>-------------------------------------------------------------------------
-
>>>bash# ./rc.pcmcia start
>>>Starting PCMCIA services: modulesLinux PCMCIA Card Services 3.1.10
>>>  kernel build: 2.2.13 #496 Fri May 19 11:14:29 CST 2000
>>>  options:  none
>>>m8xx_pcmcia: Version 0.03, 14-Feb-2000, Magnus Damm
>>>m8xx_pcmcia: FADS using SLOT_B with IRQ 13.
>>> cardmgr.
>>>H<30>Jan  1 00:35:21 cardmgr[131]: starting, version is 3.1.10
>>>bash# A<30>Jan  1 00:35:22 cardmgr[131]: watching 1 sockets
>>>A<30>Jan  1 00:35:22 cardmgr[131]: initializing socket 0
>>>I<30>Jan  1 00:35:22 cardmgr[131]: socket 0: ATA/IDE Fixed Disk
>>>a<30>Jan  1 00:35:22 cardmgr[131]: executing: 'insmod
>>>/lib/modules/2.2.13/pcmci'
>>>probing for hda: present=0, media=32, probetype=ATA
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: PCMCIA support for 860 -- lost interrupt
@ 2000-05-25  0:59 Shuangjun Zhu
  0 siblings, 0 replies; 5+ messages in thread
From: Shuangjun Zhu @ 2000-05-25  0:59 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Dan Malek, linuxppc-embedded


Damm wrote:
>
>
>Shuangjun Zhu wrote:
>>
>1. what board are you trying to use pcmcia with?


I'm using a MPC823 FADS board and PCMCIA for ATA/IDE,

>2. check and see that m8xx_pcmcia gets your MHz or Hz value correct.
>   The MHz/Hz value is used by my driver to calculate the number of
>   waitstates necessary for all pcmcia accesses. So, if that is bad
>   much stuff will get wierd.


I have set the M8XX_BUSFREQ as following in m8xx_pcmcia.c,
BTW, my MPC823 runs' frequency is 48MHZ, which pcmcia uses the SLOT_B.

#ifdef CONFIG_BD_IS_MHZ
#define M8XX_BUSFREQ (48 * 1000000)
#else
#define M8XX_BUSFREQ (48)
#endif


>> 1. why "lost interrupt"? irq for IDE is 9, PCMCIA_INTERRUPT=13,
>>    so, which hardware trigger IRQ 9?
>
>Well, you have to figure out that one for yourself.
>I have no idea. Maybe the MHz/Hz stuff above could help you.
>Check proc/interrupts...
>
>The m8xx_pcmcia driver handles 1 (one) interrupt.
>That interrupt is the status changed interrupt and it tells
>us if someone has inserted/removed a card and some other stuff.
>
>Then - the pcmcia package will figure out what other interrupt
>the device driver for the card you've inserted (ide, serial, etc)
>will use. And then that (ide) code will request that irq and use
>is as if it was any other interrupt. That is the second interrupt.


>From the code ide_cs.c in pcmcia package, the m8xx_pcmcia interrupt
handler will call the ide_event() in ide_cs.c, this function does
nothing with ide interrupt handler in the kernel.

Here is Dan's ideas
>See, this is why I changed the function name in the first place.
>request_irq() assumes a PC-like interrupt structure, which doesn't work
>on the MPC8xx internal interrupt controller.  You need to add an
>indirect function call to the 'md' structure that will install the
>IDE interrupt handler.  When you use the PCMCIA for ATA/IDE, you should
>call a function that installs the PCMCIA interrupt vector.

In drivers/block/ide-probe.c,
init_irq() function has installed the IDE interrupt handler of IRQ 9 as
ide_intr()
In m8xx_pcmcia.c from the pcmcia package, Damm has installed the PCMCIA
interrupt
IRQ 13 as m8xx_interrupt(), so problem is:
without 8259 controller in FADS board, how the m8xx_interrupt() route the
interrupt
event to the ide_intr(). No hardware triger the IRQ 9, no call ide_intr(),
so the
kernel think "lost interrupt", I guess.


BRs,
Shuangjun


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: PCMCIA support for 860 -- lost interrupt
@ 2000-05-25  2:58 Shuangjun Zhu
  0 siblings, 0 replies; 5+ messages in thread
From: Shuangjun Zhu @ 2000-05-25  2:58 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Dan Malek, linuxppc-embedded


>
>Damm wrote:
>>
>>
>>Shuangjun Zhu wrote:
>>>
>>1. what board are you trying to use pcmcia with?
>
>
>I'm using a MPC823 FADS board and PCMCIA for ATA/IDE,
>
>>2. check and see that m8xx_pcmcia gets your MHz or Hz value correct.
>>   The MHz/Hz value is used by my driver to calculate the number of
>>   waitstates necessary for all pcmcia accesses. So, if that is bad
>>   much stuff will get wierd.
>
>
>I have set the M8XX_BUSFREQ as following in m8xx_pcmcia.c,
>BTW, my MPC823 runs' frequency is 48MHZ, which pcmcia uses the SLOT_B.
>
>#ifdef CONFIG_BD_IS_MHZ
>#define M8XX_BUSFREQ (48 * 1000000)
>#else
>#define M8XX_BUSFREQ (48)
>#endif
>
>
>>> 1. why "lost interrupt"? irq for IDE is 9, PCMCIA_INTERRUPT=13,
>>>    so, which hardware trigger IRQ 9?
>>
>>Well, you have to figure out that one for yourself.
>>I have no idea. Maybe the MHz/Hz stuff above could help you.
>>Check proc/interrupts...
>>
>>The m8xx_pcmcia driver handles 1 (one) interrupt.
>>That interrupt is the status changed interrupt and it tells
>>us if someone has inserted/removed a card and some other stuff.
>>
>>Then - the pcmcia package will figure out what other interrupt
>>the device driver for the card you've inserted (ide, serial, etc)
>>will use. And then that (ide) code will request that irq and use
>>is as if it was any other interrupt. That is the second interrupt.
>
>
>From the code ide_cs.c in pcmcia package, the m8xx_pcmcia interrupt
>handler will call the ide_event() in ide_cs.c, this function does
>nothing with ide interrupt handler in the kernel.
>
>Here is Dan's ideas
>>See, this is why I changed the function name in the first place.
>>request_irq() assumes a PC-like interrupt structure, which doesn't work
>>on the MPC8xx internal interrupt controller.  You need to add an
>>indirect function call to the 'md' structure that will install the
>>IDE interrupt handler.  When you use the PCMCIA for ATA/IDE, you should
>>call a function that installs the PCMCIA interrupt vector.
>
>In drivers/block/ide-probe.c,
>init_irq() function has installed the IDE interrupt handler of IRQ 9 as
>ide_intr()
>In m8xx_pcmcia.c from the pcmcia package, Damm has installed the PCMCIA
>interrupt
>IRQ 13 as m8xx_interrupt(), so problem is:
>without 8259 controller in FADS board, how the m8xx_interrupt() route the
>interrupt
>event to the ide_intr(). No hardware triger the IRQ 9, no call ide_intr(),
>so the
>kernel think "lost interrupt", I guess.


Here is the result:
bash# cat /proc/inter*
           CPU0
  5:       2394   8xx SIU       cpm
  9:          0   8xx SIU       ide0
 13:          9   8xx SIU       m8xx_pcmcia
 15:          0   8xx SIU       tbint
BAD:          0


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: PCMCIA support for 860 -- lost interrupt
@ 2000-05-26  3:01 Shuangjun Zhu
  0 siblings, 0 replies; 5+ messages in thread
From: Shuangjun Zhu @ 2000-05-26  3:01 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Dan Malek, linuxppc-embedded


Hello, Magnus

I found a temp hacker to fix it.
Socket Driver and ATA/IDE driver share the same IRQ 13.
So I must modify the arch/ppc/kernel/irq.c: request_8xxirq(),
it only allow pci-ide share the irq.
It will not complain "lost interrupt".

BRs,
Shuangjun



>>From the code ide_cs.c in pcmcia package, the m8xx_pcmcia interrupt
>>handler will call the ide_event() in ide_cs.c, this function does
>>nothing with ide interrupt handler in the kernel.
>>
>>Here is Dan's ideas
>>>See, this is why I changed the function name in the first place.
>>>request_irq() assumes a PC-like interrupt structure, which doesn't work
>>>on the MPC8xx internal interrupt controller.  You need to add an
>>>indirect function call to the 'md' structure that will install the
>>>IDE interrupt handler.  When you use the PCMCIA for ATA/IDE, you should
>>>call a function that installs the PCMCIA interrupt vector.
>>
>>In drivers/block/ide-probe.c,
>>init_irq() function has installed the IDE interrupt handler of IRQ 9 as
>>ide_intr()
>>In m8xx_pcmcia.c from the pcmcia package, Damm has installed the PCMCIA
>>interrupt
>>IRQ 13 as m8xx_interrupt(), so problem is:
>>without 8259 controller in FADS board, how the m8xx_interrupt() route the
>>interrupt
>>event to the ide_intr(). No hardware triger the IRQ 9, no call ide_intr(),
>>so the
>>kernel think "lost interrupt", I guess.
>
>
>Here is the result:
>bash# cat /proc/inter*
>           CPU0
>  5:       2394   8xx SIU       cpm
>  9:          0   8xx SIU       ide0
> 13:          9   8xx SIU       m8xx_pcmcia
> 15:          0   8xx SIU       tbint
>BAD:          0


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2000-05-26  3:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-24  5:09 PCMCIA support for 860 -- lost interrupt Shuangjun Zhu
2000-05-24 20:59 ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2000-05-25  0:59 Shuangjun Zhu
2000-05-25  2:58 Shuangjun Zhu
2000-05-26  3:01 Shuangjun Zhu

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