• Home
  • Raw
  • Download

Lines Matching +full:imx8qxp +full:- +full:mu

1 // SPDX-License-Identifier: GPL-2.0+
4 * Copyright 2017-2018 NXP
10 * single global power domain and implement the ->attach|detach_dev()
12 * From within the ->attach_dev(), we could get the OF node for
13 * the device that is being attached and then parse the power-domain
18 * Additionally, we need to implement the ->stop() and ->start()
20 * rather than using the above ->power_on|off() callbacks.
23 * 1. The ->attach_dev() of power domain infrastructure still does
33 * behavior changed if removing ->power_on|off() callback and use
34 * ->start() and ->stop() instead. genpd_dev_pm_attach will only power
47 #include <dt-bindings/firmware/imx/rsrc.h>
110 { "audio-pll0", IMX_SC_R_AUDIO_PLL_0, 1, false, 0 },
111 { "audio-pll1", IMX_SC_R_AUDIO_PLL_1, 1, false, 0 },
112 { "audio-clk-0", IMX_SC_R_AUDIO_CLK_0, 1, false, 0 },
113 { "audio-clk-1", IMX_SC_R_AUDIO_CLK_1, 1, false, 0 },
114 { "dma0-ch", IMX_SC_R_DMA_0_CH0, 16, true, 0 },
115 { "dma1-ch", IMX_SC_R_DMA_1_CH0, 16, true, 0 },
116 { "dma2-ch", IMX_SC_R_DMA_2_CH0, 5, true, 0 },
131 { "dsp-ram", IMX_SC_R_DSP_RAM, 1, false, 0 },
139 { "lcd0-pwm", IMX_SC_R_LCD_0_PWM_0, 1, true, 0 },
146 { "vpu-pid", IMX_SC_R_VPU_PID0, 8, true, 0 },
147 { "vpu-dec0", IMX_SC_R_VPU_DEC_0, 1, false, 0 },
148 { "vpu-enc0", IMX_SC_R_VPU_ENC_0, 1, false, 0 },
151 { "gpu0-pid", IMX_SC_R_GPU_0_PID0, 4, true, 0 },
154 { "pcie-b", IMX_SC_R_PCIE_B, 1, false, 0 },
155 { "serdes-1", IMX_SC_R_SERDES_1, 1, false, 0 },
156 { "hsio-gpio", IMX_SC_R_HSIO_GPIO, 1, false, 0 },
160 { "mipi0-pwm0", IMX_SC_R_MIPI_0_PWM_0, 1, false, 0 },
161 { "mipi0-i2c", IMX_SC_R_MIPI_0_I2C_0, 2, true, 0 },
168 { "dc0-pll", IMX_SC_R_DC_0_PLL_0, 2, true, 0 },
171 { "cm40-i2c", IMX_SC_R_M4_0_I2C, 1, false, 0 },
172 { "cm40-intmux", IMX_SC_R_M4_0_INTMUX, 1, false, 0 },
173 { "cm40-pid", IMX_SC_R_M4_0_PID0, 5, true, 0},
174 { "cm40-mu-a1", IMX_SC_R_M4_0_MU_1A, 1, false, 0},
175 { "cm40-lpuart", IMX_SC_R_M4_0_UART, 1, false, 0},
178 { "cm41-i2c", IMX_SC_R_M4_1_I2C, 1, false, 0 },
179 { "cm41-intmux", IMX_SC_R_M4_1_INTMUX, 1, false, 0 },
180 { "cm41-pid", IMX_SC_R_M4_1_PID0, 5, true, 0},
181 { "cm41-mu-a1", IMX_SC_R_M4_1_MU_1A, 1, false, 0},
182 { "cm41-lpuart", IMX_SC_R_M4_1_UART, 1, false, 0},
207 hdr->ver = IMX_SC_RPC_VERSION; in imx_sc_pd_power()
208 hdr->svc = IMX_SC_RPC_SVC_PM; in imx_sc_pd_power()
209 hdr->func = IMX_SC_PM_FUNC_SET_RESOURCE_POWER_MODE; in imx_sc_pd_power()
210 hdr->size = 2; in imx_sc_pd_power()
212 msg.resource = pd->rsrc; in imx_sc_pd_power()
217 dev_err(&domain->dev, "failed to power %s resource %d ret %d\n", in imx_sc_pd_power()
218 power_on ? "up" : "off", pd->rsrc, ret); in imx_sc_pd_power()
236 struct generic_pm_domain *domain = ERR_PTR(-ENOENT); in imx_scu_pd_xlate()
240 for (i = 0; i < pd_data->num_domains; i++) { in imx_scu_pd_xlate()
243 sc_pd = to_imx_sc_pd(pd_data->domains[i]); in imx_scu_pd_xlate()
244 if (sc_pd->rsrc == spec->args[0]) { in imx_scu_pd_xlate()
245 domain = &sc_pd->pd; in imx_scu_pd_xlate()
260 if (!imx_sc_rm_is_resource_owned(pm_ipc_handle, pd_ranges->rsrc + idx)) in imx_scu_add_pm_domain()
265 return ERR_PTR(-ENOMEM); in imx_scu_add_pm_domain()
267 sc_pd->rsrc = pd_ranges->rsrc + idx; in imx_scu_add_pm_domain()
268 sc_pd->pd.power_off = imx_sc_pd_power_off; in imx_scu_add_pm_domain()
269 sc_pd->pd.power_on = imx_sc_pd_power_on; in imx_scu_add_pm_domain()
271 if (pd_ranges->postfix) in imx_scu_add_pm_domain()
272 snprintf(sc_pd->name, sizeof(sc_pd->name), in imx_scu_add_pm_domain()
273 "%s%i", pd_ranges->name, pd_ranges->start_from + idx); in imx_scu_add_pm_domain()
275 snprintf(sc_pd->name, sizeof(sc_pd->name), in imx_scu_add_pm_domain()
276 "%s", pd_ranges->name); in imx_scu_add_pm_domain()
278 sc_pd->pd.name = sc_pd->name; in imx_scu_add_pm_domain()
280 if (sc_pd->rsrc >= IMX_SC_R_LAST) { in imx_scu_add_pm_domain()
282 sc_pd->name, sc_pd->rsrc); in imx_scu_add_pm_domain()
288 ret = pm_genpd_init(&sc_pd->pd, NULL, true); in imx_scu_add_pm_domain()
291 sc_pd->name, sc_pd->rsrc); in imx_scu_add_pm_domain()
302 const struct imx_sc_pd_range *pd_ranges = pd_soc->pd_ranges; in imx_scu_init_pm_domains()
309 for (i = 0; i < pd_soc->num_ranges; i++) in imx_scu_init_pm_domains()
314 return -ENOMEM; in imx_scu_init_pm_domains()
318 return -ENOMEM; in imx_scu_init_pm_domains()
321 for (i = 0; i < pd_soc->num_ranges; i++) { in imx_scu_init_pm_domains()
327 domains[count++] = &sc_pd->pd; in imx_scu_init_pm_domains()
328 dev_dbg(dev, "added power domain %s\n", sc_pd->pd.name); in imx_scu_init_pm_domains()
332 pd_data->domains = domains; in imx_scu_init_pm_domains()
333 pd_data->num_domains = count; in imx_scu_init_pm_domains()
334 pd_data->xlate = imx_scu_pd_xlate; in imx_scu_init_pm_domains()
336 of_genpd_add_provider_onecell(dev->of_node, pd_data); in imx_scu_init_pm_domains()
350 pd_soc = of_device_get_match_data(&pdev->dev); in imx_sc_pd_probe()
352 return -ENODEV; in imx_sc_pd_probe()
354 return imx_scu_init_pm_domains(&pdev->dev, pd_soc); in imx_sc_pd_probe()
358 { .compatible = "fsl,imx8qxp-scu-pd", &imx8qxp_scu_pd},
359 { .compatible = "fsl,scu-pd", &imx8qxp_scu_pd},
365 .name = "imx-scu-pd",