linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* PPC405EP Custom Board. Question for PCI init.
@ 2007-03-08 16:08 powerpc440
  2007-03-09  8:49 ` Stefan Roese
  0 siblings, 1 reply; 2+ messages in thread
From: powerpc440 @ 2007-03-08 16:08 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

I have a custom board, based on Taihu with ppc405ep CPU. On the board
are 3 PCI devices: SATA, USB and graphic on PCI Slot. I made custom
board definition in Linux kernel, based on Taihu. The boot process is
OK, the command prompt is appears (over ttyS0), but seems that the PCI
units are not really initialized yet. This is part from dmesg:

................
libata version 1.20 loaded.
sata_sil 0000:00:02.0: version 0.9
sata_sil 0000:00:02.0: Applying R_ERR on DMA activate FIS errata fix
ata1: SATA max UDMA/100 cmd 0xD1050C80 ctl 0xD1050C8A bmdma 0xD1050C00
irq 29
ata2: SATA max UDMA/100 cmd 0xD1050CC0 ctl 0xD1050CCA bmdma 0xD1050C08
irq 29
ata3: SATA max UDMA/100 cmd 0xD1050E80 ctl 0xD1050E8A bmdma 0xD1050E00
irq 29
ata4: SATA max UDMA/100 cmd 0xD1050EC0 ctl 0xD1050ECA bmdma 0xD1050E08
irq 29
ata1: SATA link down (SStatus 0)
scsi0 : sata_sil
ata2: SATA link up 1.5 Gbps (SStatus 113)
ata2: dev 0 cfg 49:2f00 82:7c6b 83:5b09 84:4673 85:7c69 86:1a21 87:4663
88:007f
ata2: dev 0 ATA-7, max UDMA/133, 160086528 sectors: LBA
ata2: qc timeout (cmd 0xef)
ata2: failed to set xfermode, disabled
ata2: dev 0 configured for UDMA/100
scsi1 : sata_sil
ata3: SATA link down (SStatus 0)
scsi2 : sata_sil
ata4: SATA link down (SStatus 0)
scsi3 : sata_sil
usbmon: debugfs is not available
ehci_hcd 0000:00:03.2: EHCI Host Controller
ehci_hcd 0000:00:03.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:03.2: irq 30, io mem 0xbfffcf00
ehci_hcd 0000:00:03.2: USB 2.0 started, EHCI 0.95, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 4 ports detected
116x: driver isp116x-hcd, 03 Nov 2005
ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci_hcd 0000:00:03.0: OHCI Host Controller
ohci_hcd 0000:00:03.0: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:03.0: irq 30, io mem 0xbfffe000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
ohci_hcd 0000:00:03.1: OHCI Host Controller
ohci_hcd 0000:00:03.1: new USB bus registered, assigned bus number 3
ohci_hcd 0000:00:03.1: irq 30, io mem 0xbfffd000
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
i2c /dev entries driver
....................

USBs and SATA ports are visible from system, but seems that the IRQs are
not corect.


There is part of taihu.c bord configuration:

/* Some IRQs unique to the board
 * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
 */
int __init
ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
    static char pci_irq_table[][4] =
        /*
         *      PCI IDSEL/INTPIN->INTLINE
         *      A       B       C       D
         */
    {
        /*{25, 26, 27, 28},    *//* IDSEL 1 - PCI slot 1 */
        /*{26, 27, 28, 25},    *//* IDSEL 2 - PCI slot 2 */
    };

    const long min_idsel = 6, max_idsel = 7, irqs_per_slot = 4;
    return PCI_IRQ_TABLE_LOOKUP;
};

My question is what exactly means these values {25, 26, 27, 28}, and how
I can determinate and complete the correct config for my board.
The PCI slot IDSEL pin is connected to PCI_AD11 (CPU);
SATA IDSEL - to PCI_AD12;
USB IDSEL - to PCI_AD13

Best regards,
Zhivko Yordanov

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

* Re: PPC405EP Custom Board. Question for PCI init.
  2007-03-08 16:08 PPC405EP Custom Board. Question for PCI init powerpc440
@ 2007-03-09  8:49 ` Stefan Roese
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2007-03-09  8:49 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: powerpc440

On Thursday 08 March 2007 17:08, powerpc440 wrote:
> /* Some IRQs unique to the board
>  * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
>  */
> int __init
> ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
> {
>     static char pci_irq_table[][4] =
>         /*
>          *      PCI IDSEL/INTPIN->INTLINE
>          *      A       B       C       D
>          */
>     {
>         /*{25, 26, 27, 28},    *//* IDSEL 1 - PCI slot 1 */
>         /*{26, 27, 28, 25},    *//* IDSEL 2 - PCI slot 2 */
>     };
>
>     const long min_idsel = 6, max_idsel = 7, irqs_per_slot = 4;
>     return PCI_IRQ_TABLE_LOOKUP;
> };
>
> My question is what exactly means these values {25, 26, 27, 28},

Those are the interrupt numbers. Please take a look at the 405EP users manual 
and read the description of the UIC and it's external interrupts. In your 
board design you most likely have connected the PCI interrupts to some 
external PPC interrupts, right? This configuration is totally board 
dependant. And please don't forget to configure the external interrupts 
correctly (level, edge...).

> and how 
> I can determinate and complete the correct config for my board.
> The PCI slot IDSEL pin is connected to PCI_AD11 (CPU);
> SATA IDSEL - to PCI_AD12;
> USB IDSEL - to PCI_AD13

Since I can't remember how to "calculate" the idsel number from the connected 
AD signal, I'm just adding a printk() in this function to point the idsel 
number here.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
=====================================================================

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

end of thread, other threads:[~2007-03-09  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-08 16:08 PPC405EP Custom Board. Question for PCI init powerpc440
2007-03-09  8:49 ` Stefan Roese

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).