Thomas Gleixner | 2b72c9e | 2019-05-29 16:57:54 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 2 | /* |
| 3 | * Marvell EBU SoC Device Bus Controller |
| 4 | * (memory controller for NOR/NAND/SRAM/FPGA devices) |
| 5 | * |
Thomas Petazzoni | c4ec743 | 2014-04-22 23:26:12 +0200 | [diff] [blame] | 6 | * Copyright (C) 2013-2014 Marvell |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <linux/kernel.h> |
| 10 | #include <linux/module.h> |
| 11 | #include <linux/slab.h> |
| 12 | #include <linux/err.h> |
| 13 | #include <linux/io.h> |
| 14 | #include <linux/clk.h> |
| 15 | #include <linux/mbus.h> |
| 16 | #include <linux/of_platform.h> |
| 17 | #include <linux/of_address.h> |
| 18 | #include <linux/platform_device.h> |
| 19 | |
| 20 | /* Register definitions */ |
Thomas Petazzoni | 8a33692 | 2014-04-22 23:26:10 +0200 | [diff] [blame] | 21 | #define ARMADA_DEV_WIDTH_SHIFT 30 |
| 22 | #define ARMADA_BADR_SKEW_SHIFT 28 |
| 23 | #define ARMADA_RD_HOLD_SHIFT 23 |
| 24 | #define ARMADA_ACC_NEXT_SHIFT 17 |
| 25 | #define ARMADA_RD_SETUP_SHIFT 12 |
| 26 | #define ARMADA_ACC_FIRST_SHIFT 6 |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 27 | |
Thomas Petazzoni | 8a33692 | 2014-04-22 23:26:10 +0200 | [diff] [blame] | 28 | #define ARMADA_SYNC_ENABLE_SHIFT 24 |
| 29 | #define ARMADA_WR_HIGH_SHIFT 16 |
| 30 | #define ARMADA_WR_LOW_SHIFT 8 |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 31 | |
Thomas Petazzoni | 71e2e5d | 2014-04-22 23:26:09 +0200 | [diff] [blame] | 32 | #define ARMADA_READ_PARAM_OFFSET 0x0 |
| 33 | #define ARMADA_WRITE_PARAM_OFFSET 0x4 |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 34 | |
Thomas Petazzoni | c4ec743 | 2014-04-22 23:26:12 +0200 | [diff] [blame] | 35 | #define ORION_RESERVED (0x2 << 30) |
| 36 | #define ORION_BADR_SKEW_SHIFT 28 |
| 37 | #define ORION_WR_HIGH_EXT_BIT BIT(27) |
| 38 | #define ORION_WR_HIGH_EXT_MASK 0x8 |
| 39 | #define ORION_WR_LOW_EXT_BIT BIT(26) |
| 40 | #define ORION_WR_LOW_EXT_MASK 0x8 |
| 41 | #define ORION_ALE_WR_EXT_BIT BIT(25) |
| 42 | #define ORION_ALE_WR_EXT_MASK 0x8 |
| 43 | #define ORION_ACC_NEXT_EXT_BIT BIT(24) |
| 44 | #define ORION_ACC_NEXT_EXT_MASK 0x10 |
| 45 | #define ORION_ACC_FIRST_EXT_BIT BIT(23) |
| 46 | #define ORION_ACC_FIRST_EXT_MASK 0x10 |
| 47 | #define ORION_TURN_OFF_EXT_BIT BIT(22) |
| 48 | #define ORION_TURN_OFF_EXT_MASK 0x8 |
| 49 | #define ORION_DEV_WIDTH_SHIFT 20 |
| 50 | #define ORION_WR_HIGH_SHIFT 17 |
| 51 | #define ORION_WR_HIGH_MASK 0x7 |
| 52 | #define ORION_WR_LOW_SHIFT 14 |
| 53 | #define ORION_WR_LOW_MASK 0x7 |
| 54 | #define ORION_ALE_WR_SHIFT 11 |
| 55 | #define ORION_ALE_WR_MASK 0x7 |
| 56 | #define ORION_ACC_NEXT_SHIFT 7 |
| 57 | #define ORION_ACC_NEXT_MASK 0xF |
| 58 | #define ORION_ACC_FIRST_SHIFT 3 |
| 59 | #define ORION_ACC_FIRST_MASK 0xF |
| 60 | #define ORION_TURN_OFF_SHIFT 0 |
| 61 | #define ORION_TURN_OFF_MASK 0x7 |
| 62 | |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 63 | struct devbus_read_params { |
| 64 | u32 bus_width; |
| 65 | u32 badr_skew; |
| 66 | u32 turn_off; |
| 67 | u32 acc_first; |
| 68 | u32 acc_next; |
| 69 | u32 rd_setup; |
| 70 | u32 rd_hold; |
| 71 | }; |
| 72 | |
| 73 | struct devbus_write_params { |
| 74 | u32 sync_enable; |
| 75 | u32 wr_high; |
| 76 | u32 wr_low; |
| 77 | u32 ale_wr; |
| 78 | }; |
| 79 | |
| 80 | struct devbus { |
| 81 | struct device *dev; |
| 82 | void __iomem *base; |
| 83 | unsigned long tick_ps; |
| 84 | }; |
| 85 | |
| 86 | static int get_timing_param_ps(struct devbus *devbus, |
| 87 | struct device_node *node, |
| 88 | const char *name, |
| 89 | u32 *ticks) |
| 90 | { |
| 91 | u32 time_ps; |
| 92 | int err; |
| 93 | |
| 94 | err = of_property_read_u32(node, name, &time_ps); |
| 95 | if (err < 0) { |
Rob Herring | db749d1 | 2017-07-18 16:43:14 -0500 | [diff] [blame] | 96 | dev_err(devbus->dev, "%pOF has no '%s' property\n", |
| 97 | node, name); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 98 | return err; |
| 99 | } |
| 100 | |
| 101 | *ticks = (time_ps + devbus->tick_ps - 1) / devbus->tick_ps; |
| 102 | |
| 103 | dev_dbg(devbus->dev, "%s: %u ps -> 0x%x\n", |
| 104 | name, time_ps, *ticks); |
| 105 | return 0; |
| 106 | } |
| 107 | |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 108 | static int devbus_get_timing_params(struct devbus *devbus, |
| 109 | struct device_node *node, |
| 110 | struct devbus_read_params *r, |
| 111 | struct devbus_write_params *w) |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 112 | { |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 113 | int err; |
| 114 | |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 115 | err = of_property_read_u32(node, "devbus,bus-width", &r->bus_width); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 116 | if (err < 0) { |
| 117 | dev_err(devbus->dev, |
Rob Herring | db749d1 | 2017-07-18 16:43:14 -0500 | [diff] [blame] | 118 | "%pOF has no 'devbus,bus-width' property\n", |
| 119 | node); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 120 | return err; |
| 121 | } |
Thomas Petazzoni | ce965c3 | 2014-04-14 17:29:18 +0200 | [diff] [blame] | 122 | |
| 123 | /* |
| 124 | * The bus width is encoded into the register as 0 for 8 bits, |
| 125 | * and 1 for 16 bits, so we do the necessary conversion here. |
| 126 | */ |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 127 | if (r->bus_width == 8) |
| 128 | r->bus_width = 0; |
| 129 | else if (r->bus_width == 16) |
| 130 | r->bus_width = 1; |
Thomas Petazzoni | ce965c3 | 2014-04-14 17:29:18 +0200 | [diff] [blame] | 131 | else { |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 132 | dev_err(devbus->dev, "invalid bus width %d\n", r->bus_width); |
Thomas Petazzoni | ce965c3 | 2014-04-14 17:29:18 +0200 | [diff] [blame] | 133 | return -EINVAL; |
| 134 | } |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 135 | |
| 136 | err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps", |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 137 | &r->badr_skew); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 138 | if (err < 0) |
| 139 | return err; |
| 140 | |
| 141 | err = get_timing_param_ps(devbus, node, "devbus,turn-off-ps", |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 142 | &r->turn_off); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 143 | if (err < 0) |
| 144 | return err; |
| 145 | |
| 146 | err = get_timing_param_ps(devbus, node, "devbus,acc-first-ps", |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 147 | &r->acc_first); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 148 | if (err < 0) |
| 149 | return err; |
| 150 | |
| 151 | err = get_timing_param_ps(devbus, node, "devbus,acc-next-ps", |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 152 | &r->acc_next); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 153 | if (err < 0) |
| 154 | return err; |
| 155 | |
Thomas Petazzoni | c4ec743 | 2014-04-22 23:26:12 +0200 | [diff] [blame] | 156 | if (of_device_is_compatible(devbus->dev->of_node, "marvell,mvebu-devbus")) { |
| 157 | err = get_timing_param_ps(devbus, node, "devbus,rd-setup-ps", |
| 158 | &r->rd_setup); |
| 159 | if (err < 0) |
| 160 | return err; |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 161 | |
Thomas Petazzoni | c4ec743 | 2014-04-22 23:26:12 +0200 | [diff] [blame] | 162 | err = get_timing_param_ps(devbus, node, "devbus,rd-hold-ps", |
| 163 | &r->rd_hold); |
| 164 | if (err < 0) |
| 165 | return err; |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 166 | |
Thomas Petazzoni | c4ec743 | 2014-04-22 23:26:12 +0200 | [diff] [blame] | 167 | err = of_property_read_u32(node, "devbus,sync-enable", |
| 168 | &w->sync_enable); |
| 169 | if (err < 0) { |
| 170 | dev_err(devbus->dev, |
Rob Herring | db749d1 | 2017-07-18 16:43:14 -0500 | [diff] [blame] | 171 | "%pOF has no 'devbus,sync-enable' property\n", |
| 172 | node); |
Thomas Petazzoni | c4ec743 | 2014-04-22 23:26:12 +0200 | [diff] [blame] | 173 | return err; |
| 174 | } |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | err = get_timing_param_ps(devbus, node, "devbus,ale-wr-ps", |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 178 | &w->ale_wr); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 179 | if (err < 0) |
| 180 | return err; |
| 181 | |
| 182 | err = get_timing_param_ps(devbus, node, "devbus,wr-low-ps", |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 183 | &w->wr_low); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 184 | if (err < 0) |
| 185 | return err; |
| 186 | |
| 187 | err = get_timing_param_ps(devbus, node, "devbus,wr-high-ps", |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 188 | &w->wr_high); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 189 | if (err < 0) |
| 190 | return err; |
| 191 | |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 192 | return 0; |
| 193 | } |
| 194 | |
Thomas Petazzoni | c4ec743 | 2014-04-22 23:26:12 +0200 | [diff] [blame] | 195 | static void devbus_orion_set_timing_params(struct devbus *devbus, |
| 196 | struct device_node *node, |
| 197 | struct devbus_read_params *r, |
| 198 | struct devbus_write_params *w) |
| 199 | { |
| 200 | u32 value; |
| 201 | |
| 202 | /* |
| 203 | * The hardware designers found it would be a good idea to |
| 204 | * split most of the values in the register into two fields: |
| 205 | * one containing all the low-order bits, and another one |
| 206 | * containing just the high-order bit. For all of those |
| 207 | * fields, we have to split the value into these two parts. |
| 208 | */ |
| 209 | value = (r->turn_off & ORION_TURN_OFF_MASK) << ORION_TURN_OFF_SHIFT | |
| 210 | (r->acc_first & ORION_ACC_FIRST_MASK) << ORION_ACC_FIRST_SHIFT | |
| 211 | (r->acc_next & ORION_ACC_NEXT_MASK) << ORION_ACC_NEXT_SHIFT | |
| 212 | (w->ale_wr & ORION_ALE_WR_MASK) << ORION_ALE_WR_SHIFT | |
| 213 | (w->wr_low & ORION_WR_LOW_MASK) << ORION_WR_LOW_SHIFT | |
| 214 | (w->wr_high & ORION_WR_HIGH_MASK) << ORION_WR_HIGH_SHIFT | |
| 215 | r->bus_width << ORION_DEV_WIDTH_SHIFT | |
| 216 | ((r->turn_off & ORION_TURN_OFF_EXT_MASK) ? ORION_TURN_OFF_EXT_BIT : 0) | |
| 217 | ((r->acc_first & ORION_ACC_FIRST_EXT_MASK) ? ORION_ACC_FIRST_EXT_BIT : 0) | |
| 218 | ((r->acc_next & ORION_ACC_NEXT_EXT_MASK) ? ORION_ACC_NEXT_EXT_BIT : 0) | |
| 219 | ((w->ale_wr & ORION_ALE_WR_EXT_MASK) ? ORION_ALE_WR_EXT_BIT : 0) | |
| 220 | ((w->wr_low & ORION_WR_LOW_EXT_MASK) ? ORION_WR_LOW_EXT_BIT : 0) | |
| 221 | ((w->wr_high & ORION_WR_HIGH_EXT_MASK) ? ORION_WR_HIGH_EXT_BIT : 0) | |
| 222 | (r->badr_skew << ORION_BADR_SKEW_SHIFT) | |
| 223 | ORION_RESERVED; |
| 224 | |
| 225 | writel(value, devbus->base); |
| 226 | } |
| 227 | |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 228 | static void devbus_armada_set_timing_params(struct devbus *devbus, |
| 229 | struct device_node *node, |
| 230 | struct devbus_read_params *r, |
| 231 | struct devbus_write_params *w) |
| 232 | { |
| 233 | u32 value; |
| 234 | |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 235 | /* Set read timings */ |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 236 | value = r->bus_width << ARMADA_DEV_WIDTH_SHIFT | |
| 237 | r->badr_skew << ARMADA_BADR_SKEW_SHIFT | |
| 238 | r->rd_hold << ARMADA_RD_HOLD_SHIFT | |
| 239 | r->acc_next << ARMADA_ACC_NEXT_SHIFT | |
| 240 | r->rd_setup << ARMADA_RD_SETUP_SHIFT | |
| 241 | r->acc_first << ARMADA_ACC_FIRST_SHIFT | |
| 242 | r->turn_off; |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 243 | |
| 244 | dev_dbg(devbus->dev, "read parameters register 0x%p = 0x%x\n", |
Thomas Petazzoni | 71e2e5d | 2014-04-22 23:26:09 +0200 | [diff] [blame] | 245 | devbus->base + ARMADA_READ_PARAM_OFFSET, |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 246 | value); |
| 247 | |
Thomas Petazzoni | 71e2e5d | 2014-04-22 23:26:09 +0200 | [diff] [blame] | 248 | writel(value, devbus->base + ARMADA_READ_PARAM_OFFSET); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 249 | |
| 250 | /* Set write timings */ |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 251 | value = w->sync_enable << ARMADA_SYNC_ENABLE_SHIFT | |
| 252 | w->wr_low << ARMADA_WR_LOW_SHIFT | |
| 253 | w->wr_high << ARMADA_WR_HIGH_SHIFT | |
| 254 | w->ale_wr; |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 255 | |
| 256 | dev_dbg(devbus->dev, "write parameters register: 0x%p = 0x%x\n", |
Thomas Petazzoni | 71e2e5d | 2014-04-22 23:26:09 +0200 | [diff] [blame] | 257 | devbus->base + ARMADA_WRITE_PARAM_OFFSET, |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 258 | value); |
| 259 | |
Thomas Petazzoni | 71e2e5d | 2014-04-22 23:26:09 +0200 | [diff] [blame] | 260 | writel(value, devbus->base + ARMADA_WRITE_PARAM_OFFSET); |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | static int mvebu_devbus_probe(struct platform_device *pdev) |
| 264 | { |
| 265 | struct device *dev = &pdev->dev; |
| 266 | struct device_node *node = pdev->dev.of_node; |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 267 | struct devbus_read_params r; |
| 268 | struct devbus_write_params w; |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 269 | struct devbus *devbus; |
| 270 | struct resource *res; |
| 271 | struct clk *clk; |
| 272 | unsigned long rate; |
Ezequiel Garcia | 9b6e4c0 | 2013-07-26 10:17:38 -0300 | [diff] [blame] | 273 | int err; |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 274 | |
| 275 | devbus = devm_kzalloc(&pdev->dev, sizeof(struct devbus), GFP_KERNEL); |
| 276 | if (!devbus) |
| 277 | return -ENOMEM; |
| 278 | |
| 279 | devbus->dev = dev; |
| 280 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 281 | devbus->base = devm_ioremap_resource(&pdev->dev, res); |
| 282 | if (IS_ERR(devbus->base)) |
| 283 | return PTR_ERR(devbus->base); |
| 284 | |
| 285 | clk = devm_clk_get(&pdev->dev, NULL); |
| 286 | if (IS_ERR(clk)) |
| 287 | return PTR_ERR(clk); |
| 288 | clk_prepare_enable(clk); |
| 289 | |
| 290 | /* |
| 291 | * Obtain clock period in picoseconds, |
| 292 | * we need this in order to convert timing |
| 293 | * parameters from cycles to picoseconds. |
| 294 | */ |
| 295 | rate = clk_get_rate(clk) / 1000; |
| 296 | devbus->tick_ps = 1000000000 / rate; |
| 297 | |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 298 | dev_dbg(devbus->dev, "Setting timing parameter, tick is %lu ps\n", |
| 299 | devbus->tick_ps); |
| 300 | |
Thomas Petazzoni | 0456d330 | 2014-04-22 23:26:13 +0200 | [diff] [blame] | 301 | if (!of_property_read_bool(node, "devbus,keep-config")) { |
| 302 | /* Read the Device Tree node */ |
| 303 | err = devbus_get_timing_params(devbus, node, &r, &w); |
| 304 | if (err < 0) |
| 305 | return err; |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 306 | |
Thomas Petazzoni | 0456d330 | 2014-04-22 23:26:13 +0200 | [diff] [blame] | 307 | /* Set the new timing parameters */ |
| 308 | if (of_device_is_compatible(node, "marvell,orion-devbus")) |
| 309 | devbus_orion_set_timing_params(devbus, node, &r, &w); |
| 310 | else |
| 311 | devbus_armada_set_timing_params(devbus, node, &r, &w); |
| 312 | } |
Thomas Petazzoni | 30bd30b | 2014-04-22 23:26:11 +0200 | [diff] [blame] | 313 | |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 314 | /* |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 315 | * We need to create a child device explicitly from here to |
| 316 | * guarantee that the child will be probed after the timing |
| 317 | * parameters for the bus are written. |
| 318 | */ |
| 319 | err = of_platform_populate(node, NULL, NULL, dev); |
Ezequiel Garcia | 9b6e4c0 | 2013-07-26 10:17:38 -0300 | [diff] [blame] | 320 | if (err < 0) |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 321 | return err; |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 322 | |
| 323 | return 0; |
| 324 | } |
| 325 | |
| 326 | static const struct of_device_id mvebu_devbus_of_match[] = { |
| 327 | { .compatible = "marvell,mvebu-devbus" }, |
Thomas Petazzoni | c4ec743 | 2014-04-22 23:26:12 +0200 | [diff] [blame] | 328 | { .compatible = "marvell,orion-devbus" }, |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 329 | {}, |
| 330 | }; |
| 331 | MODULE_DEVICE_TABLE(of, mvebu_devbus_of_match); |
| 332 | |
| 333 | static struct platform_driver mvebu_devbus_driver = { |
| 334 | .probe = mvebu_devbus_probe, |
| 335 | .driver = { |
| 336 | .name = "mvebu-devbus", |
Ezequiel Garcia | 3edad32 | 2013-04-23 16:21:26 -0300 | [diff] [blame] | 337 | .of_match_table = mvebu_devbus_of_match, |
| 338 | }, |
| 339 | }; |
| 340 | |
| 341 | static int __init mvebu_devbus_init(void) |
| 342 | { |
| 343 | return platform_driver_register(&mvebu_devbus_driver); |
| 344 | } |
| 345 | module_init(mvebu_devbus_init); |
| 346 | |
| 347 | MODULE_LICENSE("GPL v2"); |
| 348 | MODULE_AUTHOR("Ezequiel Garcia <ezequiel.garcia@free-electrons.com>"); |
| 349 | MODULE_DESCRIPTION("Marvell EBU SoC Device Bus controller"); |