diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2011-07-22 19:20:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-08 14:29:26 -0400 |
commit | 21e0534ad7415559bb8dee0dc00e39646fed83c9 (patch) | |
tree | e9e082dfdf6ce9798d6201f1ae4109b68b11920a /include/linux/bcma | |
parent | ecd177c21640e92b059a71139f5850243a8f0942 (diff) |
bcma: add mips driver
This adds a mips driver to bcma. This is only found on embedded
devices. For now the driver just initializes the irqs used on this
system.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/bcma')
-rw-r--r-- | include/linux/bcma/bcma.h | 3 | ||||
-rw-r--r-- | include/linux/bcma/bcma_driver_chipcommon.h | 13 | ||||
-rw-r--r-- | include/linux/bcma/bcma_driver_mips.h | 49 |
3 files changed, 65 insertions, 0 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index c70cec59d80e..5dbd7055cb86 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/bcma/bcma_driver_chipcommon.h> | 7 | #include <linux/bcma/bcma_driver_chipcommon.h> |
8 | #include <linux/bcma/bcma_driver_pci.h> | 8 | #include <linux/bcma/bcma_driver_pci.h> |
9 | #include <linux/bcma/bcma_driver_mips.h> | ||
9 | #include <linux/ssb/ssb.h> /* SPROM sharing */ | 10 | #include <linux/ssb/ssb.h> /* SPROM sharing */ |
10 | 11 | ||
11 | #include "bcma_regs.h" | 12 | #include "bcma_regs.h" |
@@ -130,6 +131,7 @@ struct bcma_device { | |||
130 | 131 | ||
131 | struct device dev; | 132 | struct device dev; |
132 | struct device *dma_dev; | 133 | struct device *dma_dev; |
134 | |||
133 | unsigned int irq; | 135 | unsigned int irq; |
134 | bool dev_registered; | 136 | bool dev_registered; |
135 | 137 | ||
@@ -197,6 +199,7 @@ struct bcma_bus { | |||
197 | 199 | ||
198 | struct bcma_drv_cc drv_cc; | 200 | struct bcma_drv_cc drv_cc; |
199 | struct bcma_drv_pci drv_pci; | 201 | struct bcma_drv_pci drv_pci; |
202 | struct bcma_drv_mips drv_mips; | ||
200 | 203 | ||
201 | /* We decided to share SPROM struct with SSB as long as we do not need | 204 | /* We decided to share SPROM struct with SSB as long as we do not need |
202 | * any hacks for BCMA. This simplifies drivers code. */ | 205 | * any hacks for BCMA. This simplifies drivers code. */ |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index c8b4cf7f9fae..03cde8d22e5f 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ | 24 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ |
25 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ | 25 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ |
26 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ | 26 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ |
27 | #define BCMA_CC_FLASHT_NFLASH 0x00000200 | ||
27 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ | 28 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ |
28 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ | 29 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ |
29 | #define BCMA_PLLTYPE_NONE 0x00000000 | 30 | #define BCMA_PLLTYPE_NONE 0x00000000 |
@@ -178,6 +179,7 @@ | |||
178 | #define BCMA_CC_PROG_CFG 0x0120 | 179 | #define BCMA_CC_PROG_CFG 0x0120 |
179 | #define BCMA_CC_PROG_WAITCNT 0x0124 | 180 | #define BCMA_CC_PROG_WAITCNT 0x0124 |
180 | #define BCMA_CC_FLASH_CFG 0x0128 | 181 | #define BCMA_CC_FLASH_CFG 0x0128 |
182 | #define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */ | ||
181 | #define BCMA_CC_FLASH_WAITCNT 0x012C | 183 | #define BCMA_CC_FLASH_WAITCNT 0x012C |
182 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ | 184 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ |
183 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ | 185 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ |
@@ -247,6 +249,14 @@ struct bcma_chipcommon_pmu { | |||
247 | u32 crystalfreq; /* The active crystal frequency (in kHz) */ | 249 | u32 crystalfreq; /* The active crystal frequency (in kHz) */ |
248 | }; | 250 | }; |
249 | 251 | ||
252 | #ifdef CONFIG_BCMA_DRIVER_MIPS | ||
253 | struct bcma_pflash { | ||
254 | u8 buswidth; | ||
255 | u32 window; | ||
256 | u32 window_size; | ||
257 | }; | ||
258 | #endif /* CONFIG_BCMA_DRIVER_MIPS */ | ||
259 | |||
250 | struct bcma_drv_cc { | 260 | struct bcma_drv_cc { |
251 | struct bcma_device *core; | 261 | struct bcma_device *core; |
252 | u32 status; | 262 | u32 status; |
@@ -256,6 +266,9 @@ struct bcma_drv_cc { | |||
256 | /* Fast Powerup Delay constant */ | 266 | /* Fast Powerup Delay constant */ |
257 | u16 fast_pwrup_delay; | 267 | u16 fast_pwrup_delay; |
258 | struct bcma_chipcommon_pmu pmu; | 268 | struct bcma_chipcommon_pmu pmu; |
269 | #ifdef CONFIG_BCMA_DRIVER_MIPS | ||
270 | struct bcma_pflash pflash; | ||
271 | #endif /* CONFIG_BCMA_DRIVER_MIPS */ | ||
259 | }; | 272 | }; |
260 | 273 | ||
261 | /* Register access */ | 274 | /* Register access */ |
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h new file mode 100644 index 000000000000..82b3bfd32c76 --- /dev/null +++ b/include/linux/bcma/bcma_driver_mips.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef LINUX_BCMA_DRIVER_MIPS_H_ | ||
2 | #define LINUX_BCMA_DRIVER_MIPS_H_ | ||
3 | |||
4 | #define BCMA_MIPS_IPSFLAG 0x0F08 | ||
5 | /* which sbflags get routed to mips interrupt 1 */ | ||
6 | #define BCMA_MIPS_IPSFLAG_IRQ1 0x0000003F | ||
7 | #define BCMA_MIPS_IPSFLAG_IRQ1_SHIFT 0 | ||
8 | /* which sbflags get routed to mips interrupt 2 */ | ||
9 | #define BCMA_MIPS_IPSFLAG_IRQ2 0x00003F00 | ||
10 | #define BCMA_MIPS_IPSFLAG_IRQ2_SHIFT 8 | ||
11 | /* which sbflags get routed to mips interrupt 3 */ | ||
12 | #define BCMA_MIPS_IPSFLAG_IRQ3 0x003F0000 | ||
13 | #define BCMA_MIPS_IPSFLAG_IRQ3_SHIFT 16 | ||
14 | /* which sbflags get routed to mips interrupt 4 */ | ||
15 | #define BCMA_MIPS_IPSFLAG_IRQ4 0x3F000000 | ||
16 | #define BCMA_MIPS_IPSFLAG_IRQ4_SHIFT 24 | ||
17 | |||
18 | /* MIPS 74K core registers */ | ||
19 | #define BCMA_MIPS_MIPS74K_CORECTL 0x0000 | ||
20 | #define BCMA_MIPS_MIPS74K_EXCEPTBASE 0x0004 | ||
21 | #define BCMA_MIPS_MIPS74K_BIST 0x000C | ||
22 | #define BCMA_MIPS_MIPS74K_INTMASK_INT0 0x0014 | ||
23 | #define BCMA_MIPS_MIPS74K_INTMASK(int) \ | ||
24 | ((int) * 4 + BCMA_MIPS_MIPS74K_INTMASK_INT0) | ||
25 | #define BCMA_MIPS_MIPS74K_NMIMASK 0x002C | ||
26 | #define BCMA_MIPS_MIPS74K_GPIOSEL 0x0040 | ||
27 | #define BCMA_MIPS_MIPS74K_GPIOOUT 0x0044 | ||
28 | #define BCMA_MIPS_MIPS74K_GPIOEN 0x0048 | ||
29 | #define BCMA_MIPS_MIPS74K_CLKCTLST 0x01E0 | ||
30 | |||
31 | #define BCMA_MIPS_OOBSELOUTA30 0x100 | ||
32 | |||
33 | struct bcma_device; | ||
34 | |||
35 | struct bcma_drv_mips { | ||
36 | struct bcma_device *core; | ||
37 | u8 setup_done:1; | ||
38 | unsigned int assigned_irqs; | ||
39 | }; | ||
40 | |||
41 | #ifdef CONFIG_BCMA_DRIVER_MIPS | ||
42 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); | ||
43 | #else | ||
44 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } | ||
45 | #endif | ||
46 | |||
47 | extern unsigned int bcma_core_mips_irq(struct bcma_device *dev); | ||
48 | |||
49 | #endif /* LINUX_BCMA_DRIVER_MIPS_H_ */ | ||