Lines Matching +full:sun8i +full:- +full:h3 +full:- +full:system +full:- +full:controller
2 * Allwinner SoCs SRAM Controller Driver
6 * Author: Maxime Ripard <maxime.ripard@free-electrons.com>
61 .data = SUNXI_SRAM_DATA("A3-A4", 0x4, 0x4, 2,
75 SUNXI_SRAM_MAP(1, 1, "usb-otg")),
86 .compatible = "allwinner,sun4i-a10-sram-a3-a4",
90 .compatible = "allwinner,sun4i-a10-sram-c1",
94 .compatible = "allwinner,sun4i-a10-sram-d",
98 .compatible = "allwinner,sun50i-a64-sram-c",
118 seq_puts(s, "--------------------\n\n"); in sunxi_sram_show()
120 for_each_child_of_node(sram_dev->of_node, sram_node) { in sunxi_sram_show()
121 if (!of_device_is_compatible(sram_node, "mmio-sram")) in sunxi_sram_show()
133 sram_data = match->data; in sunxi_sram_show()
140 sram_data->name); in sunxi_sram_show()
142 val = readl(base + sram_data->reg); in sunxi_sram_show()
143 val >>= sram_data->offset; in sunxi_sram_show()
144 val &= GENMASK(sram_data->width - 1, 0); in sunxi_sram_show()
146 for (func = sram_data->func; func->func; func++) { in sunxi_sram_show()
147 seq_printf(s, "\t\t%s%c\n", func->func, in sunxi_sram_show()
148 func->reg_val == val ? in sunxi_sram_show()
182 ret = -EBUSY; in sunxi_sram_of_parse()
190 ret = -EINVAL; in sunxi_sram_of_parse()
194 data = match->data; in sunxi_sram_of_parse()
196 ret = -EINVAL; in sunxi_sram_of_parse()
200 for (func = data->func; func->func; func++) { in sunxi_sram_of_parse()
201 if (val == func->val) { in sunxi_sram_of_parse()
203 *reg_value = func->reg_val; in sunxi_sram_of_parse()
209 if (!func->func) { in sunxi_sram_of_parse()
210 ret = -EINVAL; in sunxi_sram_of_parse()
215 return match->data; in sunxi_sram_of_parse()
233 return -EPROBE_DEFER; in sunxi_sram_claim()
235 if (!dev || !dev->of_node) in sunxi_sram_claim()
236 return -EINVAL; in sunxi_sram_claim()
238 sram_data = sunxi_sram_of_parse(dev->of_node, &device); in sunxi_sram_claim()
246 if (sram_desc->claimed) { in sunxi_sram_claim()
248 return -EBUSY; in sunxi_sram_claim()
251 mask = GENMASK(sram_data->offset + sram_data->width - 1, in sunxi_sram_claim()
252 sram_data->offset); in sunxi_sram_claim()
253 val = readl(base + sram_data->reg); in sunxi_sram_claim()
255 writel(val | ((device << sram_data->offset) & mask), in sunxi_sram_claim()
256 base + sram_data->reg); in sunxi_sram_claim()
258 sram_desc->claimed = true; in sunxi_sram_claim()
270 if (!dev || !dev->of_node) in sunxi_sram_release()
273 sram_data = sunxi_sram_of_parse(dev->of_node, NULL); in sunxi_sram_release()
280 sram_desc->claimed = false; in sunxi_sram_release()
322 if (reg == SUNXI_SRAM_THS_OFFSET_REG && variant->has_ths_offset) in sunxi_sram_regmap_accessible_reg()
325 reg < SUNXI_SRAM_EMAC_CLOCK_REG + variant->num_emac_clocks * 4) in sunxi_sram_regmap_accessible_reg()
327 if (reg == SUNXI_SYS_LDO_CTRL_REG && variant->has_ldo_ctrl) in sunxi_sram_regmap_accessible_reg()
364 struct device *dev = &pdev->dev; in sunxi_sram_probe()
367 sram_dev = &pdev->dev; in sunxi_sram_probe()
369 variant = of_device_get_match_data(&pdev->dev); in sunxi_sram_probe()
371 return -EINVAL; in sunxi_sram_probe()
379 if (variant->num_emac_clocks || variant->has_ldo_ctrl) { in sunxi_sram_probe()
385 of_platform_populate(dev->of_node, NULL, NULL, dev); in sunxi_sram_probe()
394 .compatible = "allwinner,sun4i-a10-sram-controller",
398 .compatible = "allwinner,sun4i-a10-system-control",
402 .compatible = "allwinner,sun5i-a13-system-control",
406 .compatible = "allwinner,sun8i-a23-system-control",
410 .compatible = "allwinner,sun8i-h3-system-control",
414 .compatible = "allwinner,sun20i-d1-system-control",
418 .compatible = "allwinner,sun50i-a64-sram-controller",
422 .compatible = "allwinner,sun50i-a64-system-control",
426 .compatible = "allwinner,sun50i-h5-system-control",
430 .compatible = "allwinner,sun50i-h616-system-control",
439 .name = "sunxi-sram",
445 MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
446 MODULE_DESCRIPTION("Allwinner sunXi SRAM Controller Driver");