Lines Matching +full:srom +full:- +full:page +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
6 // Exynos - SROM Controller support
17 #include "exynos-srom.h"
20 /* SROM side */
29 * struct exynos_srom_reg_dump: register dump of SROM Controller registers.
30 * @offset: srom register offset from the controller base address.
39 * struct exynos_srom: platform data for exynos srom controller driver.
41 * @reg_base: srom base address
67 static int exynos_srom_configure_bank(struct exynos_srom *srom, in exynos_srom_configure_bank() argument
75 return -EINVAL; in exynos_srom_configure_bank()
76 if (of_property_read_u32(np, "reg-io-width", &width)) in exynos_srom_configure_bank()
78 if (of_property_read_bool(np, "samsung,srom-page-mode")) in exynos_srom_configure_bank()
80 if (of_property_read_u32_array(np, "samsung,srom-timing", timing, in exynos_srom_configure_bank()
82 return -EINVAL; in exynos_srom_configure_bank()
90 bw = readl_relaxed(srom->reg_base + EXYNOS_SROM_BW); in exynos_srom_configure_bank()
92 writel_relaxed(bw, srom->reg_base + EXYNOS_SROM_BW); in exynos_srom_configure_bank()
100 srom->reg_base + EXYNOS_SROM_BC0 + bank); in exynos_srom_configure_bank()
108 struct exynos_srom *srom; in exynos_srom_probe() local
109 struct device *dev = &pdev->dev; in exynos_srom_probe()
112 np = dev->of_node; in exynos_srom_probe()
114 dev_err(&pdev->dev, "could not find device info\n"); in exynos_srom_probe()
115 return -EINVAL; in exynos_srom_probe()
118 srom = devm_kzalloc(&pdev->dev, in exynos_srom_probe()
120 if (!srom) in exynos_srom_probe()
121 return -ENOMEM; in exynos_srom_probe()
123 srom->dev = dev; in exynos_srom_probe()
124 srom->reg_base = of_iomap(np, 0); in exynos_srom_probe()
125 if (!srom->reg_base) { in exynos_srom_probe()
126 dev_err(&pdev->dev, "iomap of exynos srom controller failed\n"); in exynos_srom_probe()
127 return -ENOMEM; in exynos_srom_probe()
130 platform_set_drvdata(pdev, srom); in exynos_srom_probe()
132 srom->reg_offset = exynos_srom_alloc_reg_dump(exynos_srom_offsets, in exynos_srom_probe()
134 if (!srom->reg_offset) { in exynos_srom_probe()
135 iounmap(srom->reg_base); in exynos_srom_probe()
136 return -ENOMEM; in exynos_srom_probe()
140 if (exynos_srom_configure_bank(srom, child)) { in exynos_srom_probe()
163 for (; num_regs > 0; --num_regs, ++rd) in exynos_srom_save()
164 rd->value = readl(base + rd->offset); in exynos_srom_save()
171 for (; num_regs > 0; --num_regs, ++rd) in exynos_srom_restore()
172 writel(rd->value, base + rd->offset); in exynos_srom_restore()
177 struct exynos_srom *srom = dev_get_drvdata(dev); in exynos_srom_suspend() local
179 exynos_srom_save(srom->reg_base, srom->reg_offset, in exynos_srom_suspend()
186 struct exynos_srom *srom = dev_get_drvdata(dev); in exynos_srom_resume() local
188 exynos_srom_restore(srom->reg_base, srom->reg_offset, in exynos_srom_resume()
196 .compatible = "samsung,exynos4210-srom",
206 .name = "exynos-srom",