SGI IOC4: Detect IO card variant
PATCH 1/1 SGI IOC4: Detect IO card variant
There are three different IO cards which an SGI IOC4 controller may find itself on. One of these variants does not bring out the IDE and serial signals, so we need to disable attaching the corresponding IOC4 subdrivers to such cards.
---
drivers/ide/pci/sgiioc4.c | 10 +++++++ drivers/serial/ioc4_serial.c | 13 +++++++++ drivers/sn/ioc4.c | 61 +++++++++++++++++++++++++++++++++++++++++++ include/linux/ioc4.h | 5 +++ 4 files changed, 89 insertions(+)
---
drivers/ide/pci/sgiioc4.c +10 -0
@@ -717,6 +717,16 @@ static ide_pci_device_t sgiioc4_chipsetsint ioc4_ide_attach_one (struct ioc4_driver_data *idd) { +/* IO9-RT does not bring out IDE connection. +* Do not attach to this particular IOC4. +*/ +if (idd->idd_variant ==IOC4_VARIANT_IO9_RT ) { +printk (KERN_INFO +"sgiioc4: Not needed for IO9-RT card at %s.\n" , +pci_name (idd->idd_pdev)); +return 0 ; + } +return pci_init_sgiioc4 (idd->idd_pdev, &sgiioc4_chipsets[idd->idd_pci_id->driver_data]); }
drivers/serial/ioc4_serial.c +13 -0
@@ -2646,7 +2646,10 @@ static int ioc4_serial_remove_one(structstruct ioc4_port *port;struct ioc4_soft *soft; +/* If serial driver did not attach, don't try to detach */ control = idd->idd_serial_data; +if (!control) +return 0 ;for (port_num =0 ; port_num <IOC4_NUM_SERIAL_PORTS ; port_num++) { for (port_type = UART_PORT_MIN;
@@ -2778,6 +2781,16 @@ ioc4_serial_attach_one(struct ioc4_driveDPRINT_CONFIG (("%s (0x%p, 0x%p)\n" , __FUNCTION__, idd->idd_pdev, idd->idd_pci_id)); +/* IO9-RT does not bring out serial connections. +* Do not attach to this particular IOC4. +*/ +if (idd->idd_variant ==IOC4_VARIANT_IO9_RT ) { +printk (KERN_INFO +"ioc4_serial: Not needed for IO9-RT card at %s.\n" , +pci_name (idd->idd_pdev)); +return 0 ; + } +/* request serial registers */ tmp_addr1 = idd->idd_bar0 +IOC4_SERIAL_OFFSET ;
drivers/sn/ioc4.c +61 -0
73 lines not on this page · raw message
include/linux/ioc4.h +5 -0
@@ -147,6 +147,10 @@ struct ioc4_misc_regs {#define IOC4_GPCR_EDGE_6 0x40#define IOC4_GPCR_EDGE_7 0x80 +#define IOC4_VARIANT_IO9 0x0900 +#define IOC4_VARIANT_IO9_RT 0x0901 +#define IOC4_VARIANT_IO10 0x1000 +/* One of these per IOC4 */ struct ioc4_driver_data {struct list_head idd_list;
@@ -156,6 +160,7 @@ struct ioc4_driver_data {struct __iomem ioc4_misc_regs *idd_misc_regs;unsigned long count_period;void *idd_serial_data; +unsigned int idd_variant; };/* One per submodule */
Signature · 3 lines
Brent Casavant All music is folk music. I ain't [email protected] never heard a horse sing a song. Silicon Graphics, Inc. -- Louis Armstrong
drivers/sn/ioc4.c ioc4_clock_calibrate(struct ioc4_driver_ · line 241
Quoted 9 lines · On Wed, 3 May 2006 17:21:23 -0500 (CDT) Brent Casavant <[email protected]> wrote:
drivers/sn/ioc4.c +9
-0+#ifndef PCI_DEVICE_ID_QLOGIC_ISP12160 +#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216 +#endif +#ifndef PCI_VENDOR_ID_VITESSE +#define PCI_VENDOR_ID_VITESSE 0x1725 +#endif +#ifndef PCI_DEVICE_ID_VITESSE_7174 +#define PCI_DEVICE_ID_VITESSE_7174 0x7174 +#endif
We shouldn't need the ifdefs here. Let's just get the right defines in the right place and use them.
I'm unable to work out whether this problem which this patch fixes warrants a 2.6.17 merge.
Quoted 15 lines · Andrew Morton
drivers/sn/ioc4.c ioc4_clock_calibrate(struct ioc4_driver_ · line 241
Quoted 9 lines · On Wed, 3 May 2006 17:21:23 -0500 (CDT) Brent Casavant <[email protected]> wrote:
drivers/sn/ioc4.c +9
-0+#ifndef PCI_DEVICE_ID_QLOGIC_ISP12160 +#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216 +#endif +#ifndef PCI_VENDOR_ID_VITESSE +#define PCI_VENDOR_ID_VITESSE 0x1725 +#endif +#ifndef PCI_DEVICE_ID_VITESSE_7174 +#define PCI_DEVICE_ID_VITESSE_7174 0x7174 +#endif We shouldn't need the ifdefs here. Let's just get the right defines in the right place and use them.
I'll submit a patch for this today.
Quoted 2 lines
I'm unable to work out whether this problem which this patch fixes warrants a 2.6.17 merge.
Not really, as the new IO9-RT card which what the patch is primarily for isn't shipping yet. If it's in -mm, then I think SGI will be able to get our distribution partner to pick it up, which is honestly 90% of my concern at this point.
Brent
Signature · 3 lines
Brent Casavant All music is folk music. I ain't [email protected] never heard a horse sing a song. Silicon Graphics, Inc. -- Louis Armstrong
There are three different IO cards which an SGI IOC4 controller may find itself on. One of these variants does not bring out the IDE and serial signals, so we need to disable attaching the corresponding IOC4 subdrivers to such cards.
Cleans up message clutter emitted during device probing.
---
If my prior patch to move PCI IDs from the qla1280 and sata_vsc drivers to pci_ids.h is taken (2006-05-04, "Move various PCI IDs to header file"), this should replace sgi-ioc4-detect-variant.patch in the -mm tree.
drivers/ide/pci/sgiioc4.c | 6 ++++ drivers/serial/ioc4_serial.c | 9 ++++++ drivers/sn/ioc4.c | 64 +++++++++++++++++++++++++++++++++++++++---- include/linux/ioc4.h | 5 +++ 4 files changed, 79 insertions(+), 5 deletions(-)
---
drivers/ide/pci/sgiioc4.c +6 -0
@@ -717,6 +717,12 @@ static ide_pci_device_t sgiioc4_chipsetsint ioc4_ide_attach_one (struct ioc4_driver_data *idd) { +/* PCI-RT does not bring out IDE connection. +* Do not attach to this particular IOC4. +*/ +if (idd->idd_variant ==IOC4_VARIANT_PCI_RT ) +return 0 ; +return pci_init_sgiioc4 (idd->idd_pdev, &sgiioc4_chipsets[idd->idd_pci_id->driver_data]); }
drivers/serial/ioc4_serial.c +9 -0
@@ -2646,7 +2646,10 @@ static int ioc4_serial_remove_one(structstruct ioc4_port *port;struct ioc4_soft *soft; +/* If serial driver did not attach, don't try to detach */ control = idd->idd_serial_data; +if (!control) +return 0 ;for (port_num =0 ; port_num <IOC4_NUM_SERIAL_PORTS ; port_num++) { for (port_type = UART_PORT_MIN;
@@ -2778,6 +2781,12 @@ ioc4_serial_attach_one(struct ioc4_driveDPRINT_CONFIG (("%s (0x%p, 0x%p)\n" , __FUNCTION__, idd->idd_pdev, idd->idd_pci_id)); +/* PCI-RT does not bring out serial connections. +* Do not attach to this particular IOC4. +*/ +if (idd->idd_variant ==IOC4_VARIANT_PCI_RT ) +return 0 ; +/* request serial registers */ tmp_addr1 = idd->idd_bar0 +IOC4_SERIAL_OFFSET ;
drivers/sn/ioc4.c +59 -5
91 lines not on this page · raw message
include/linux/ioc4.h +5 -0
@@ -147,6 +147,10 @@ struct ioc4_misc_regs {#define IOC4_GPCR_EDGE_6 0x40#define IOC4_GPCR_EDGE_7 0x80 +#define IOC4_VARIANT_IO9 0x0900 +#define IOC4_VARIANT_PCI_RT 0x0901 +#define IOC4_VARIANT_IO10 0x1000 +/* One of these per IOC4 */ struct ioc4_driver_data {struct list_head idd_list;
@@ -156,6 +160,7 @@ struct ioc4_driver_data {struct __iomem ioc4_misc_regs *idd_misc_regs;unsigned long count_period;void *idd_serial_data; +unsigned int idd_variant; };/* One per submodule */