Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-kirkwood/common.h |
| 3 | * |
| 4 | * Core functions for Marvell Kirkwood SoCs |
| 5 | * |
| 6 | * This file is licensed under the terms of the GNU General Public |
| 7 | * License version 2. This program is licensed "as is" without any |
| 8 | * warranty of any kind, whether express or implied. |
| 9 | */ |
| 10 | |
| 11 | #ifndef __ARCH_KIRKWOOD_COMMON_H |
| 12 | #define __ARCH_KIRKWOOD_COMMON_H |
| 13 | |
Lennert Buytenhek | dcf1cec | 2008-09-25 16:23:48 +0200 | [diff] [blame] | 14 | struct dsa_platform_data; |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 15 | struct mv643xx_eth_platform_data; |
| 16 | struct mv_sata_platform_data; |
Nicolas Pitre | 8235ee0 | 2009-02-14 03:15:55 -0500 | [diff] [blame] | 17 | struct mvsdio_platform_data; |
Nicolas Pitre | fb7b2d3 | 2009-06-01 15:36:36 -0400 | [diff] [blame] | 18 | struct mtd_partition; |
Ben Dooks | 010937e | 2010-04-20 10:26:19 +0100 | [diff] [blame] | 19 | struct mtd_info; |
apatard@mandriva.com | 49106c7 | 2010-05-31 13:49:12 +0200 | [diff] [blame] | 20 | struct kirkwood_asoc_platform_data; |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 21 | |
Saeed Bishara | ffd58bd | 2010-06-08 14:21:34 +0300 | [diff] [blame] | 22 | #define KW_PCIE0 (1 << 0) |
| 23 | #define KW_PCIE1 (1 << 1) |
| 24 | |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 25 | /* |
| 26 | * Basic Kirkwood init functions used early by machine-setup. |
| 27 | */ |
| 28 | void kirkwood_map_io(void); |
| 29 | void kirkwood_init(void); |
Lennert Buytenhek | 4ee1f6b | 2010-10-15 16:50:26 +0200 | [diff] [blame] | 30 | void kirkwood_init_early(void); |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 31 | void kirkwood_init_irq(void); |
| 32 | |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 33 | void kirkwood_setup_cpu_mbus(void); |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 34 | |
Eric Cooper | 0e0cdd3 | 2011-02-02 17:16:10 -0500 | [diff] [blame] | 35 | void kirkwood_enable_pcie(void); |
Ronen Shitrit | b2b3dc2f | 2008-09-15 10:40:35 +0300 | [diff] [blame] | 36 | void kirkwood_pcie_id(u32 *dev, u32 *rev); |
| 37 | |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 38 | void kirkwood_ehci_init(void); |
| 39 | void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data); |
Ronen Shitrit | d15fb9e | 2008-10-19 23:10:14 +0200 | [diff] [blame] | 40 | void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data); |
Lennert Buytenhek | dcf1cec | 2008-09-25 16:23:48 +0200 | [diff] [blame] | 41 | void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq); |
Saeed Bishara | ffd58bd | 2010-06-08 14:21:34 +0300 | [diff] [blame] | 42 | void kirkwood_pcie_init(unsigned int portmask); |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 43 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); |
Nicolas Pitre | 8235ee0 | 2009-02-14 03:15:55 -0500 | [diff] [blame] | 44 | void kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data); |
Lennert Buytenhek | 18365d1 | 2008-08-09 15:38:18 +0200 | [diff] [blame] | 45 | void kirkwood_spi_init(void); |
Martin Michlmayr | 6574e00 | 2009-03-23 19:13:21 +0100 | [diff] [blame] | 46 | void kirkwood_i2c_init(void); |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 47 | void kirkwood_uart0_init(void); |
| 48 | void kirkwood_uart1_init(void); |
Nicolas Pitre | fb7b2d3 | 2009-06-01 15:36:36 -0400 | [diff] [blame] | 49 | void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay); |
Andrew Lunn | 98adf932 | 2012-10-20 13:23:16 +0200 | [diff] [blame] | 50 | void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, |
| 51 | int (*dev_ready)(struct mtd_info *)); |
apatard@mandriva.com | 49106c7 | 2010-05-31 13:49:12 +0200 | [diff] [blame] | 52 | void kirkwood_audio_init(void); |
Russell King | cb15dff | 2011-11-05 10:03:47 +0000 | [diff] [blame] | 53 | void kirkwood_restart(char, const char *); |
Andrew Lunn | 2f129bf | 2011-12-15 08:15:07 +0100 | [diff] [blame] | 54 | void kirkwood_clk_init(void); |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 55 | |
Jason Cooper | 6fa6b87 | 2012-03-15 00:52:31 +0000 | [diff] [blame] | 56 | /* board init functions for boards not fully converted to fdt */ |
| 57 | #ifdef CONFIG_MACH_DREAMPLUG_DT |
| 58 | void dreamplug_init(void); |
| 59 | #else |
| 60 | static inline void dreamplug_init(void) {}; |
| 61 | #endif |
Andrew Lunn | 9eb61f4 | 2012-05-12 14:57:59 +0200 | [diff] [blame] | 62 | #ifdef CONFIG_MACH_TS219_DT |
| 63 | void qnap_dt_ts219_init(void); |
| 64 | #else |
| 65 | static inline void qnap_dt_ts219_init(void) {}; |
| 66 | #endif |
Jason Cooper | 6fa6b87 | 2012-03-15 00:52:31 +0000 | [diff] [blame] | 67 | |
Jamie Lentin | 9007d10 | 2012-04-18 11:06:40 +0100 | [diff] [blame] | 68 | #ifdef CONFIG_MACH_DLINK_KIRKWOOD_DT |
| 69 | void dnskw_init(void); |
| 70 | #else |
| 71 | static inline void dnskw_init(void) {}; |
| 72 | #endif |
| 73 | |
Arnaud Patard (Rtp) | c06cd9b | 2012-04-18 23:16:41 +0200 | [diff] [blame] | 74 | #ifdef CONFIG_MACH_ICONNECT_DT |
| 75 | void iconnect_init(void); |
| 76 | #else |
| 77 | static inline void iconnect_init(void) {}; |
| 78 | #endif |
| 79 | |
Simon Baatz | f552036 | 2012-04-30 23:55:17 +0200 | [diff] [blame] | 80 | #ifdef CONFIG_MACH_IB62X0_DT |
| 81 | void ib62x0_init(void); |
| 82 | #else |
| 83 | static inline void ib62x0_init(void) {}; |
| 84 | #endif |
| 85 | |
Sebastian Hesselbarth | dd88db7 | 2012-08-14 22:43:41 +0200 | [diff] [blame] | 86 | #ifdef CONFIG_MACH_DOCKSTAR_DT |
| 87 | void dockstar_dt_init(void); |
| 88 | #else |
| 89 | static inline void dockstar_dt_init(void) {}; |
| 90 | #endif |
| 91 | |
Josh Coombs | 5136b2a | 2012-07-16 11:52:50 +0200 | [diff] [blame] | 92 | #ifdef CONFIG_MACH_GOFLEXNET_DT |
| 93 | void goflexnet_init(void); |
| 94 | #else |
| 95 | static inline void goflexnet_init(void) {}; |
| 96 | #endif |
| 97 | |
Michael Walle | 4aff38a | 2012-07-17 07:25:55 +0200 | [diff] [blame] | 98 | #ifdef CONFIG_MACH_LSXL_DT |
| 99 | void lsxl_init(void); |
| 100 | #else |
| 101 | static inline void lsxl_init(void) {}; |
| 102 | #endif |
| 103 | |
Alan M Butler | 4f48b7f | 2012-08-20 15:29:07 +0100 | [diff] [blame] | 104 | #ifdef CONFIG_MACH_IOMEGA_IX2_200_DT |
| 105 | void iomega_ix2_200_init(void); |
| 106 | #else |
| 107 | static inline void iomega_ix2_200_init(void) {}; |
| 108 | #endif |
| 109 | |
Valentin Longchamp | 0510c8a | 2012-09-04 11:55:02 +0200 | [diff] [blame] | 110 | #ifdef CONFIG_MACH_KM_KIRKWOOD_DT |
| 111 | void km_kirkwood_init(void); |
| 112 | #else |
| 113 | static inline void km_kirkwood_init(void) {}; |
| 114 | #endif |
| 115 | |
Stefan Peter | 5492a11 | 2012-11-18 16:46:16 +0100 | [diff] [blame] | 116 | #ifdef CONFIG_MACH_MPLCEC4_DT |
| 117 | void mplcec4_init(void); |
| 118 | #else |
| 119 | static inline void mplcec4_init(void) {}; |
| 120 | #endif |
| 121 | |
Simon Guinot | ecee1e4 | 2012-10-17 12:09:04 +0200 | [diff] [blame] | 122 | #if defined(CONFIG_MACH_INETSPACE_V2_DT) || \ |
| 123 | defined(CONFIG_MACH_NETSPACE_V2_DT) || \ |
Simon Guinot | ca7d945 | 2012-10-17 12:09:05 +0200 | [diff] [blame] | 124 | defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \ |
Simon Guinot | 7f9871d | 2012-10-17 12:09:06 +0200 | [diff] [blame] | 125 | defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \ |
| 126 | defined(CONFIG_MACH_NETSPACE_MINI_V2_DT) |
Simon Guinot | ecee1e4 | 2012-10-17 12:09:04 +0200 | [diff] [blame] | 127 | void ns2_init(void); |
| 128 | #else |
| 129 | static inline void ns2_init(void) {}; |
| 130 | #endif |
| 131 | |
Tero Jaasko | afcad88 | 2012-10-26 18:56:16 +0300 | [diff] [blame] | 132 | #ifdef CONFIG_MACH_NSA310_DT |
| 133 | void nsa310_init(void); |
| 134 | #else |
| 135 | static inline void nsa310_init(void) {}; |
| 136 | #endif |
| 137 | |
Nobuhiro Iwamatsu | f17073a | 2012-11-13 16:43:09 +0900 | [diff] [blame] | 138 | #ifdef CONFIG_MACH_OPENBLOCKS_A6_DT |
| 139 | void openblocks_a6_init(void); |
| 140 | #else |
| 141 | static inline void openblocks_a6_init(void) {}; |
| 142 | #endif |
| 143 | |
Jason Cooper | 767fc1e | 2012-10-22 02:15:35 +0000 | [diff] [blame] | 144 | #ifdef CONFIG_MACH_TOPKICK_DT |
| 145 | void usi_topkick_init(void); |
| 146 | #else |
| 147 | static inline void usi_topkick_init(void) {}; |
| 148 | #endif |
| 149 | |
Jason Cooper | 6fa6b87 | 2012-03-15 00:52:31 +0000 | [diff] [blame] | 150 | /* early init functions not converted to fdt yet */ |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 151 | char *kirkwood_id(void); |
| 152 | void kirkwood_l2_init(void); |
Jason Cooper | 2b45e05 | 2012-02-29 17:39:08 +0000 | [diff] [blame] | 153 | void kirkwood_wdt_init(void); |
| 154 | void kirkwood_xor0_init(void); |
| 155 | void kirkwood_xor1_init(void); |
| 156 | void kirkwood_crypto_init(void); |
| 157 | |
Martin Michlmayr | 586dcf2 | 2009-03-22 15:22:11 +0100 | [diff] [blame] | 158 | extern int kirkwood_tclk; |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 159 | extern void kirkwood_timer_init(void); |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 160 | |
Nicolas Pitre | fb7b2d3 | 2009-06-01 15:36:36 -0400 | [diff] [blame] | 161 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 162 | |
| 163 | #endif |