diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-12-01 19:36:17 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:24:49 -0500 |
commit | 352c417ddb593de757f0ee1fa490cb5444778c41 (patch) | |
tree | dd1047e7611f09511c3ad1432a3f49b553b0e91e /drivers/net/chelsio/tp.c | |
parent | f1d3d38af75789f1b82969b83b69cab540609789 (diff) |
[PATCH] chelsio: add 1G swcixw aupport
Add support for 1G versions of Chelsio devices.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/chelsio/tp.c')
-rw-r--r-- | drivers/net/chelsio/tp.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/chelsio/tp.c b/drivers/net/chelsio/tp.c index 04a7073e9d15..0ca0b6e19e43 100644 --- a/drivers/net/chelsio/tp.c +++ b/drivers/net/chelsio/tp.c | |||
@@ -2,6 +2,9 @@ | |||
2 | #include "common.h" | 2 | #include "common.h" |
3 | #include "regs.h" | 3 | #include "regs.h" |
4 | #include "tp.h" | 4 | #include "tp.h" |
5 | #ifdef CONFIG_CHELSIO_T1_1G | ||
6 | #include "fpga_defs.h" | ||
7 | #endif | ||
5 | 8 | ||
6 | struct petp { | 9 | struct petp { |
7 | adapter_t *adapter; | 10 | adapter_t *adapter; |
@@ -70,6 +73,15 @@ void t1_tp_intr_enable(struct petp *tp) | |||
70 | { | 73 | { |
71 | u32 tp_intr = readl(tp->adapter->regs + A_PL_ENABLE); | 74 | u32 tp_intr = readl(tp->adapter->regs + A_PL_ENABLE); |
72 | 75 | ||
76 | #ifdef CONFIG_CHELSIO_T1_1G | ||
77 | if (!t1_is_asic(tp->adapter)) { | ||
78 | /* FPGA */ | ||
79 | writel(0xffffffff, | ||
80 | tp->adapter->regs + FPGA_TP_ADDR_INTERRUPT_ENABLE); | ||
81 | writel(tp_intr | FPGA_PCIX_INTERRUPT_TP, | ||
82 | tp->adapter->regs + A_PL_ENABLE); | ||
83 | } else | ||
84 | #endif | ||
73 | { | 85 | { |
74 | /* We don't use any TP interrupts */ | 86 | /* We don't use any TP interrupts */ |
75 | writel(0, tp->adapter->regs + A_TP_INT_ENABLE); | 87 | writel(0, tp->adapter->regs + A_TP_INT_ENABLE); |
@@ -82,6 +94,14 @@ void t1_tp_intr_disable(struct petp *tp) | |||
82 | { | 94 | { |
83 | u32 tp_intr = readl(tp->adapter->regs + A_PL_ENABLE); | 95 | u32 tp_intr = readl(tp->adapter->regs + A_PL_ENABLE); |
84 | 96 | ||
97 | #ifdef CONFIG_CHELSIO_T1_1G | ||
98 | if (!t1_is_asic(tp->adapter)) { | ||
99 | /* FPGA */ | ||
100 | writel(0, tp->adapter->regs + FPGA_TP_ADDR_INTERRUPT_ENABLE); | ||
101 | writel(tp_intr & ~FPGA_PCIX_INTERRUPT_TP, | ||
102 | tp->adapter->regs + A_PL_ENABLE); | ||
103 | } else | ||
104 | #endif | ||
85 | { | 105 | { |
86 | writel(0, tp->adapter->regs + A_TP_INT_ENABLE); | 106 | writel(0, tp->adapter->regs + A_TP_INT_ENABLE); |
87 | writel(tp_intr & ~F_PL_INTR_TP, | 107 | writel(tp_intr & ~F_PL_INTR_TP, |
@@ -91,6 +111,14 @@ void t1_tp_intr_disable(struct petp *tp) | |||
91 | 111 | ||
92 | void t1_tp_intr_clear(struct petp *tp) | 112 | void t1_tp_intr_clear(struct petp *tp) |
93 | { | 113 | { |
114 | #ifdef CONFIG_CHELSIO_T1_1G | ||
115 | if (!t1_is_asic(tp->adapter)) { | ||
116 | writel(0xffffffff, | ||
117 | tp->adapter->regs + FPGA_TP_ADDR_INTERRUPT_CAUSE); | ||
118 | writel(FPGA_PCIX_INTERRUPT_TP, tp->adapter->regs + A_PL_CAUSE); | ||
119 | return; | ||
120 | } | ||
121 | #endif | ||
94 | writel(0xffffffff, tp->adapter->regs + A_TP_INT_CAUSE); | 122 | writel(0xffffffff, tp->adapter->regs + A_TP_INT_CAUSE); |
95 | writel(F_PL_INTR_TP, tp->adapter->regs + A_PL_CAUSE); | 123 | writel(F_PL_INTR_TP, tp->adapter->regs + A_PL_CAUSE); |
96 | } | 124 | } |
@@ -99,6 +127,11 @@ int t1_tp_intr_handler(struct petp *tp) | |||
99 | { | 127 | { |
100 | u32 cause; | 128 | u32 cause; |
101 | 129 | ||
130 | #ifdef CONFIG_CHELSIO_T1_1G | ||
131 | /* FPGA doesn't support TP interrupts. */ | ||
132 | if (!t1_is_asic(tp->adapter)) | ||
133 | return 1; | ||
134 | #endif | ||
102 | 135 | ||
103 | cause = readl(tp->adapter->regs + A_TP_INT_CAUSE); | 136 | cause = readl(tp->adapter->regs + A_TP_INT_CAUSE); |
104 | writel(cause, tp->adapter->regs + A_TP_INT_CAUSE); | 137 | writel(cause, tp->adapter->regs + A_TP_INT_CAUSE); |