Lines Matching +full:ixp4xx +full:- +full:flash

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Intel IXP4xx Expansion Bus Controller
93 .prop = "intel,ixp4xx-eb-t1",
99 .prop = "intel,ixp4xx-eb-t2",
105 .prop = "intel,ixp4xx-eb-t3",
111 .prop = "intel,ixp4xx-eb-t4",
117 .prop = "intel,ixp4xx-eb-t5",
123 .prop = "intel,ixp4xx-eb-byte-access-on-halfword",
128 .prop = "intel,ixp4xx-eb-hpi-hrdy-pol-high",
133 .prop = "intel,ixp4xx-eb-mux-address-and-data",
138 .prop = "intel,ixp4xx-eb-ahb-split-transfers",
143 .prop = "intel,ixp4xx-eb-write-enable",
148 .prop = "intel,ixp4xx-eb-byte-access",
166 if (eb->is_42x && (cs_index > 7)) { in ixp4xx_exp_setup_chipselect()
167 dev_err(eb->dev, in ixp4xx_exp_setup_chipselect()
168 "invalid chipselect %u, we only support 0-7\n", in ixp4xx_exp_setup_chipselect()
172 if (eb->is_43x && (cs_index > 3)) { in ixp4xx_exp_setup_chipselect()
173 dev_err(eb->dev, in ixp4xx_exp_setup_chipselect()
174 "invalid chipselect %u, we only support 0-3\n", in ixp4xx_exp_setup_chipselect()
191 regmap_read(eb->rmap, IXP4XX_EXP_TIMING_CS0 + in ixp4xx_exp_setup_chipselect()
193 dev_info(eb->dev, "CS%d at %#08x, size %#08x, config before: %#08x\n", in ixp4xx_exp_setup_chipselect()
194 cs_index, eb->bus_base + IXP4XX_EXP_STRIDE * cs_index, in ixp4xx_exp_setup_chipselect()
197 /* Size set-up first align to 2^9 .. 2^24 */ in ixp4xx_exp_setup_chipselect()
203 dev_err(eb->dev, "illegal size order %d\n", cs_order); in ixp4xx_exp_setup_chipselect()
206 dev_dbg(eb->dev, "CS%d size order: %d\n", cs_index, cs_order); in ixp4xx_exp_setup_chipselect()
208 cs_cfg |= ((cs_order - 9) << IXP4XX_EXP_SIZE_SHIFT); in ixp4xx_exp_setup_chipselect()
214 ret = of_property_read_u32(np, ip->prop, &val); in ixp4xx_exp_setup_chipselect()
219 if (ip->max == 1) { in ixp4xx_exp_setup_chipselect()
221 cs_cfg |= ip->mask; in ixp4xx_exp_setup_chipselect()
223 cs_cfg &= ~ip->mask; in ixp4xx_exp_setup_chipselect()
224 dev_info(eb->dev, "CS%d %s %s\n", cs_index, in ixp4xx_exp_setup_chipselect()
226 ip->prop); in ixp4xx_exp_setup_chipselect()
230 if (val > ip->max) { in ixp4xx_exp_setup_chipselect()
231 dev_err(eb->dev, in ixp4xx_exp_setup_chipselect()
233 cs_index, ip->prop, val, ip->max); in ixp4xx_exp_setup_chipselect()
234 val = ip->max; in ixp4xx_exp_setup_chipselect()
237 cs_cfg &= ~ip->mask; in ixp4xx_exp_setup_chipselect()
238 cs_cfg |= (val << ip->shift); in ixp4xx_exp_setup_chipselect()
239 dev_info(eb->dev, "CS%d set %s to %u\n", cs_index, ip->prop, val); in ixp4xx_exp_setup_chipselect()
242 ret = of_property_read_u32(np, "intel,ixp4xx-eb-cycle-type", &val); in ixp4xx_exp_setup_chipselect()
245 dev_err(eb->dev, "illegal cycle type %d\n", val); in ixp4xx_exp_setup_chipselect()
248 dev_info(eb->dev, "CS%d set cycle type %d\n", cs_index, val); in ixp4xx_exp_setup_chipselect()
253 if (eb->is_43x) { in ixp4xx_exp_setup_chipselect()
257 * This bit for Intel strata flash is currently unused, but let's in ixp4xx_exp_setup_chipselect()
261 dev_info(eb->dev, "claims to be Intel strata flash\n"); in ixp4xx_exp_setup_chipselect()
265 regmap_write(eb->rmap, in ixp4xx_exp_setup_chipselect()
268 dev_info(eb->dev, "CS%d wrote %#08x into CS config\n", cs_index, cs_cfg); in ixp4xx_exp_setup_chipselect()
273 * chip select. For a 32MB flash chip this results in two calls in ixp4xx_exp_setup_chipselect()
279 cs_size - IXP4XX_EXP_STRIDE); in ixp4xx_exp_setup_chipselect()
295 dev_dbg(eb->dev, "child %s has %d register sets\n", in ixp4xx_exp_setup_child()
318 dev_err(eb->dev, "illegal CS %d\n", csindex); in ixp4xx_exp_setup_child()
330 dev_dbg(eb->dev, "CS%d size %#08x\n", csindex, cssize); in ixp4xx_exp_setup_child()
346 struct device *dev = &pdev->dev; in ixp4xx_exp_probe()
347 struct device_node *np = dev->of_node; in ixp4xx_exp_probe()
356 return -ENOMEM; in ixp4xx_exp_probe()
358 eb->dev = dev; in ixp4xx_exp_probe()
359 eb->is_42x = of_device_is_compatible(np, "intel,ixp42x-expansion-bus-controller"); in ixp4xx_exp_probe()
360 eb->is_43x = of_device_is_compatible(np, "intel,ixp43x-expansion-bus-controller"); in ixp4xx_exp_probe()
362 eb->rmap = syscon_node_to_regmap(np); in ixp4xx_exp_probe()
363 if (IS_ERR(eb->rmap)) in ixp4xx_exp_probe()
364 return dev_err_probe(dev, PTR_ERR(eb->rmap), "no regmap\n"); in ixp4xx_exp_probe()
367 ret = regmap_read(eb->rmap, IXP4XX_EXP_CNFG0, &val); in ixp4xx_exp_probe()
371 eb->bus_base = IXP4XX_EXP_BOOT_BASE; in ixp4xx_exp_probe()
373 eb->bus_base = IXP4XX_EXP_NORMAL_BASE; in ixp4xx_exp_probe()
374 dev_info(dev, "expansion bus at %08x\n", eb->bus_base); in ixp4xx_exp_probe()
376 if (eb->is_43x) { in ixp4xx_exp_probe()
378 regmap_read(eb->rmap, IXP43X_EXP_UNIT_FUSE_RESET, &val); in ixp4xx_exp_probe()
409 { .compatible = "intel,ixp42x-expansion-bus-controller", },
410 { .compatible = "intel,ixp43x-expansion-bus-controller", },
411 { .compatible = "intel,ixp45x-expansion-bus-controller", },
412 { .compatible = "intel,ixp46x-expansion-bus-controller", },
419 .name = "intel-extbus",
425 MODULE_DESCRIPTION("Intel IXP4xx external bus driver");