Dash:
[t2.git] / architecture / mips64 / package / linux / 5402_ip30-enable-bridge-vchan.patch
blob7cc2f5d5649bdfe29e9c50460b154788fbd3584d
1 diff --git a/arch/mips/sgi-ip30/ip30-bridge.c b/arch/mips/sgi-ip30/ip30-bridge.c
2 index a5287e59cc45..342a579be484 100644
3 --- a/arch/mips/sgi-ip30/ip30-bridge.c
4 +++ b/arch/mips/sgi-ip30/ip30-bridge.c
5 @@ -61,25 +61,38 @@ extern u32 bridge_alloc_rrbs(u8, u8, u8, u8, bool, bool, bool, bool);
6 * - Slot 5 (PROM Password Jumper?), 0 RRB
7 * - Slot 6 (Power Button IRQ), 0 RRB
8 * - Slot 7 (AC Fail IRQ), 0 RRB
9 + *
10 + * Additionally, for the two QLA channels, the virtual channel bit is also
11 + * enabled, as this is the only driver in Linux capable of using this feature
12 + * at present (that we know of).
14 static void __init
15 ip30_setup_baseio_rrbs(struct bridge_controller *bc, const bool *census)
17 - u32 rrbs;
18 + u32 rrbs, reg[2];
20 /* Even RRBs */
21 - rrbs = bridge_alloc_rrbs(4, 3, 1, 0, false, false, false, false);
22 + rrbs = bridge_alloc_rrbs(4, 3, 1, 0, true, false, false, false);
23 spin_lock(&bc->lock);
24 bridge_write_reg(rrbs, bc, b_dev_even_rrb);
25 BRIDGE_FLUSH(bc);
26 spin_unlock(&bc->lock);
28 /* Odd RRBs */
29 - rrbs = bridge_alloc_rrbs(4, 4, 0, 0, false, false, false, false);
30 + rrbs = bridge_alloc_rrbs(4, 4, 0, 0, true, false, false, false);
31 spin_lock(&bc->lock);
32 bridge_write_reg(rrbs, bc, b_dev_odd_rrb);
33 BRIDGE_FLUSH(bc);
34 spin_unlock(&bc->lock);
36 + /* qla1280 sits on slots 0 and 1, so enable the virtual channel. */
37 + spin_lock(&bc->lock);
38 + reg[0] = bridge_read_reg(bc, b_device(0));
39 + bridge_write_reg((reg[0] | BRIDGE_DEV_VIRTUAL_EN), bc, b_device(0));
40 + reg[1] = bridge_read_reg(bc, b_device(1));
41 + bridge_write_reg((reg[1] | BRIDGE_DEV_VIRTUAL_EN), bc, b_device(1));
42 + BRIDGE_FLUSH(bc);
43 + spin_unlock(&bc->lock);
46 /**
47 diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
48 index 738f2ec7e8b6..8487c1248c8e 100644
49 --- a/drivers/scsi/qla1280.c
50 +++ b/drivers/scsi/qla1280.c
51 @@ -368,7 +368,7 @@
53 #if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2)
54 #include <asm/sn/io.h>
55 -#elif defined(CONFIG_SGI_IP27)
56 +#elif defined(CONFIG_SGI_IP27) || defined(CONFIG_SGI_IP30)
57 #include <asm/pci/bridge.h>
58 #endif
60 @@ -1455,7 +1455,7 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha)
61 ha->flags.use_pci_vchannel = 1;
62 driver_setup.no_nvram = 1;
64 -#elif defined(CONFIG_SGI_IP27)
65 +#elif defined(CONFIG_SGI_IP27) || defined(CONFIG_SGI_IP30)
66 if (ha->host_no == 0) {
67 printk(KERN_INFO "scsi(%li): Enabling vchannel on BRIDGE "
68 "for SGI/MIPS\n", ha->host_no);
69 @@ -2915,7 +2915,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
70 break;
72 dma_handle = sg_dma_address(s);
73 -#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_SGI_IP27)
74 +#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_SGI_IP27) || defined(CONFIG_SGI_IP30)
75 if (ha->flags.use_pci_vchannel)
76 sn_pci_set_vchan(ha->pdev,
77 (unsigned long *)&dma_handle,
78 @@ -2977,7 +2977,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
79 if (cnt == 5)
80 break;
81 dma_handle = sg_dma_address(s);
82 -#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_SGI_IP27)
83 +#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_SGI_IP27) || defined(CONFIG_SGI_IP30)
84 if (ha->flags.use_pci_vchannel)
85 sn_pci_set_vchan(ha->pdev,
86 (unsigned long *)&dma_handle,