Lines Matching +full:exynos5250 +full:- +full:pmu
1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright (c) 2011-2014 Samsung Electronics Co., Ltd.
6 // Exynos - CPU PMU(Power Management Unit) support
8 #include <linux/arm-smccc.h>
18 #include <linux/soc/samsung/exynos-regs-pmu.h>
19 #include <linux/soc/samsung/exynos-pmu.h>
21 #include "exynos-pmu.h"
52 /* Write to a protected PMU register. */
62 /* returns -EINVAL if access isn't allowed or 0 */ in tensor_sec_reg_write()
69 /* Read/Modify/Write a protected PMU register. */
79 /* returns -EINVAL if access isn't allowed or 0 */ in tensor_sec_reg_rmw()
87 * Read a protected PMU register. All PMU registers can be read by Linux.
100 * the PMU register will be accessed by multiple masters.
102 * For example, to set bits 13:8 in PMU reg offset 0x3e80
105 * Set bit 8, and clear bits 13:9 PMU reg offset 0x3e80
176 if (!pmu_context || !pmu_context->pmu_data) in exynos_sys_powerdown_conf()
179 pmu_data = pmu_context->pmu_data; in exynos_sys_powerdown_conf()
181 if (pmu_data->powerdown_conf) in exynos_sys_powerdown_conf()
182 pmu_data->powerdown_conf(mode); in exynos_sys_powerdown_conf()
184 if (pmu_data->pmu_config) { in exynos_sys_powerdown_conf()
185 for (i = 0; (pmu_data->pmu_config[i].offset != PMU_TABLE_END); i++) in exynos_sys_powerdown_conf()
186 pmu_raw_writel(pmu_data->pmu_config[i].val[mode], in exynos_sys_powerdown_conf()
187 pmu_data->pmu_config[i].offset); in exynos_sys_powerdown_conf()
190 if (pmu_data->powerdown_conf_extra) in exynos_sys_powerdown_conf()
191 pmu_data->powerdown_conf_extra(mode); in exynos_sys_powerdown_conf()
193 if (pmu_data->pmu_config_extra) { in exynos_sys_powerdown_conf()
194 for (i = 0; pmu_data->pmu_config_extra[i].offset != PMU_TABLE_END; i++) in exynos_sys_powerdown_conf()
195 pmu_raw_writel(pmu_data->pmu_config_extra[i].val[mode], in exynos_sys_powerdown_conf()
196 pmu_data->pmu_config_extra[i].offset); in exynos_sys_powerdown_conf()
228 * PMU platform driver and devicetree bindings.
232 .compatible = "google,gs101-pmu",
235 .compatible = "samsung,exynos3250-pmu",
238 .compatible = "samsung,exynos4210-pmu",
241 .compatible = "samsung,exynos4212-pmu",
244 .compatible = "samsung,exynos4412-pmu",
247 .compatible = "samsung,exynos5250-pmu",
250 .compatible = "samsung,exynos5410-pmu",
252 .compatible = "samsung,exynos5420-pmu",
255 .compatible = "samsung,exynos5433-pmu",
257 .compatible = "samsung,exynos7-pmu",
259 .compatible = "samsung,exynos850-pmu",
265 { .name = "exynos-clkout", },
269 * exynos_get_pmu_regmap() - Obtain pmureg regmap
282 return ERR_PTR(-ENODEV); in exynos_get_pmu_regmap()
287 * exynos_get_pmu_regmap_by_phandle() - Obtain pmureg regmap via phandle
288 * @np: Device node holding PMU phandle property
308 return ERR_PTR(-ENODEV); in exynos_get_pmu_regmap_by_phandle()
311 * Determine if exynos-pmu device has probed and therefore regmap in exynos_get_pmu_regmap_by_phandle()
313 * return -EPROBE_DEFER. in exynos_get_pmu_regmap_by_phandle()
322 return ERR_PTR(-EPROBE_DEFER); in exynos_get_pmu_regmap_by_phandle()
330 struct device *dev = &pdev->dev; in exynos_pmu_probe()
340 pmu_context = devm_kzalloc(&pdev->dev, in exynos_pmu_probe()
344 return -ENOMEM; in exynos_pmu_probe()
348 return -ENODEV; in exynos_pmu_probe()
350 pmu_context->pmu_data = of_device_get_match_data(dev); in exynos_pmu_probe()
352 /* For SoCs that secure PMU register writes use custom regmap */ in exynos_pmu_probe()
353 if (pmu_context->pmu_data && pmu_context->pmu_data->pmu_secure) { in exynos_pmu_probe()
355 pmu_regmcfg.max_register = resource_size(res) - in exynos_pmu_probe()
359 (void *)(uintptr_t)res->start, in exynos_pmu_probe()
363 return dev_err_probe(&pdev->dev, PTR_ERR(regmap), in exynos_pmu_probe()
366 ret = of_syscon_register_regmap(dev->of_node, regmap); in exynos_pmu_probe()
371 regmap = syscon_node_to_regmap(dev->of_node); in exynos_pmu_probe()
373 return dev_err_probe(&pdev->dev, PTR_ERR(regmap), in exynos_pmu_probe()
377 pmu_context->pmureg = regmap; in exynos_pmu_probe()
378 pmu_context->dev = dev; in exynos_pmu_probe()
380 if (pmu_context->pmu_data && pmu_context->pmu_data->pmu_init) in exynos_pmu_probe()
381 pmu_context->pmu_data->pmu_init(); in exynos_pmu_probe()
393 dev_dbg(dev, "Exynos PMU Driver probe done\n"); in exynos_pmu_probe()
399 .name = "exynos-pmu",