Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 1 | #ifndef LINUX_SSB_MIPSCORE_H_ |
| 2 | #define LINUX_SSB_MIPSCORE_H_ |
| 3 | |
| 4 | #ifdef CONFIG_SSB_DRIVER_MIPS |
| 5 | |
| 6 | struct ssb_device; |
| 7 | |
| 8 | struct ssb_serial_port { |
| 9 | void *regs; |
| 10 | unsigned long clockspeed; |
| 11 | unsigned int irq; |
| 12 | unsigned int baud_base; |
| 13 | unsigned int reg_shift; |
| 14 | }; |
| 15 | |
Hauke Mehrtens | 54c9749 | 2012-09-29 20:36:17 +0200 | [diff] [blame] | 16 | struct ssb_pflash { |
Hauke Mehrtens | d954162 | 2012-09-29 20:36:18 +0200 | [diff] [blame] | 17 | bool present; |
Hauke Mehrtens | 54c9749 | 2012-09-29 20:36:17 +0200 | [diff] [blame] | 18 | u8 buswidth; |
| 19 | u32 window; |
| 20 | u32 window_size; |
| 21 | }; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 22 | |
Rafał Miłecki | e570bd0 | 2013-06-17 19:56:20 +0200 | [diff] [blame] | 23 | #ifdef CONFIG_SSB_SFLASH |
| 24 | struct ssb_sflash { |
| 25 | bool present; |
| 26 | u32 window; |
| 27 | u32 blocksize; |
| 28 | u16 numblocks; |
| 29 | u32 size; |
| 30 | |
| 31 | void *priv; |
| 32 | }; |
| 33 | #endif |
| 34 | |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 35 | struct ssb_mipscore { |
| 36 | struct ssb_device *dev; |
| 37 | |
| 38 | int nr_serial_ports; |
| 39 | struct ssb_serial_port serial_ports[4]; |
| 40 | |
Hauke Mehrtens | 54c9749 | 2012-09-29 20:36:17 +0200 | [diff] [blame] | 41 | struct ssb_pflash pflash; |
Rafał Miłecki | e570bd0 | 2013-06-17 19:56:20 +0200 | [diff] [blame] | 42 | #ifdef CONFIG_SSB_SFLASH |
| 43 | struct ssb_sflash sflash; |
| 44 | #endif |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); |
| 48 | extern u32 ssb_cpu_clock(struct ssb_mipscore *mcore); |
| 49 | |
| 50 | extern unsigned int ssb_mips_irq(struct ssb_device *dev); |
| 51 | |
| 52 | |
| 53 | #else /* CONFIG_SSB_DRIVER_MIPS */ |
| 54 | |
| 55 | struct ssb_mipscore { |
| 56 | }; |
| 57 | |
| 58 | static inline |
| 59 | void ssb_mipscore_init(struct ssb_mipscore *mcore) |
| 60 | { |
| 61 | } |
| 62 | |
Hauke Mehrtens | a6ca2e1 | 2013-01-26 21:38:35 +0100 | [diff] [blame] | 63 | static inline unsigned int ssb_mips_irq(struct ssb_device *dev) |
| 64 | { |
| 65 | return 0; |
| 66 | } |
| 67 | |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 68 | #endif /* CONFIG_SSB_DRIVER_MIPS */ |
| 69 | |
| 70 | #endif /* LINUX_SSB_MIPSCORE_H_ */ |