Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

reset: imx7: Add support for i.MX8MP SoC

i.MX8MP is a new SoC of i.MX8M family, it has same src IP
inside but with different module layout, add support for it.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

authored by

Anson Huang and committed by
Philipp Zabel
e08672c0 c4e181d6

+101
+101
drivers/reset/reset-imx7.c
··· 15 15 #include <linux/regmap.h> 16 16 #include <dt-bindings/reset/imx7-reset.h> 17 17 #include <dt-bindings/reset/imx8mq-reset.h> 18 + #include <dt-bindings/reset/imx8mp-reset.h> 18 19 19 20 struct imx7_src_signal { 20 21 unsigned int offset, bit; ··· 146 145 SRC_DDRC2_RCR = 0x1004, 147 146 }; 148 147 148 + enum imx8mp_src_registers { 149 + SRC_SUPERMIX_RCR = 0x0018, 150 + SRC_AUDIOMIX_RCR = 0x001c, 151 + SRC_MLMIX_RCR = 0x0028, 152 + SRC_GPU2D_RCR = 0x0038, 153 + SRC_GPU3D_RCR = 0x003c, 154 + SRC_VPU_G1_RCR = 0x0048, 155 + SRC_VPU_G2_RCR = 0x004c, 156 + SRC_VPUVC8KE_RCR = 0x0050, 157 + SRC_NOC_RCR = 0x0054, 158 + }; 159 + 149 160 static const struct imx7_src_signal imx8mq_src_signals[IMX8MQ_RESET_NUM] = { 150 161 [IMX8MQ_RESET_A53_CORE_POR_RESET0] = { SRC_A53RCR0, BIT(0) }, 151 162 [IMX8MQ_RESET_A53_CORE_POR_RESET1] = { SRC_A53RCR0, BIT(1) }, ··· 266 253 }, 267 254 }; 268 255 256 + static const struct imx7_src_signal imx8mp_src_signals[IMX8MP_RESET_NUM] = { 257 + [IMX8MP_RESET_A53_CORE_POR_RESET0] = { SRC_A53RCR0, BIT(0) }, 258 + [IMX8MP_RESET_A53_CORE_POR_RESET1] = { SRC_A53RCR0, BIT(1) }, 259 + [IMX8MP_RESET_A53_CORE_POR_RESET2] = { SRC_A53RCR0, BIT(2) }, 260 + [IMX8MP_RESET_A53_CORE_POR_RESET3] = { SRC_A53RCR0, BIT(3) }, 261 + [IMX8MP_RESET_A53_CORE_RESET0] = { SRC_A53RCR0, BIT(4) }, 262 + [IMX8MP_RESET_A53_CORE_RESET1] = { SRC_A53RCR0, BIT(5) }, 263 + [IMX8MP_RESET_A53_CORE_RESET2] = { SRC_A53RCR0, BIT(6) }, 264 + [IMX8MP_RESET_A53_CORE_RESET3] = { SRC_A53RCR0, BIT(7) }, 265 + [IMX8MP_RESET_A53_DBG_RESET0] = { SRC_A53RCR0, BIT(8) }, 266 + [IMX8MP_RESET_A53_DBG_RESET1] = { SRC_A53RCR0, BIT(9) }, 267 + [IMX8MP_RESET_A53_DBG_RESET2] = { SRC_A53RCR0, BIT(10) }, 268 + [IMX8MP_RESET_A53_DBG_RESET3] = { SRC_A53RCR0, BIT(11) }, 269 + [IMX8MP_RESET_A53_ETM_RESET0] = { SRC_A53RCR0, BIT(12) }, 270 + [IMX8MP_RESET_A53_ETM_RESET1] = { SRC_A53RCR0, BIT(13) }, 271 + [IMX8MP_RESET_A53_ETM_RESET2] = { SRC_A53RCR0, BIT(14) }, 272 + [IMX8MP_RESET_A53_ETM_RESET3] = { SRC_A53RCR0, BIT(15) }, 273 + [IMX8MP_RESET_A53_SOC_DBG_RESET] = { SRC_A53RCR0, BIT(20) }, 274 + [IMX8MP_RESET_A53_L2RESET] = { SRC_A53RCR0, BIT(21) }, 275 + [IMX8MP_RESET_SW_NON_SCLR_M7C_RST] = { SRC_M4RCR, BIT(0) }, 276 + [IMX8MP_RESET_OTG1_PHY_RESET] = { SRC_USBOPHY1_RCR, BIT(0) }, 277 + [IMX8MP_RESET_OTG2_PHY_RESET] = { SRC_USBOPHY2_RCR, BIT(0) }, 278 + [IMX8MP_RESET_SUPERMIX_RESET] = { SRC_SUPERMIX_RCR, BIT(0) }, 279 + [IMX8MP_RESET_AUDIOMIX_RESET] = { SRC_AUDIOMIX_RCR, BIT(0) }, 280 + [IMX8MP_RESET_MLMIX_RESET] = { SRC_MLMIX_RCR, BIT(0) }, 281 + [IMX8MP_RESET_PCIEPHY] = { SRC_PCIEPHY_RCR, BIT(2) }, 282 + [IMX8MP_RESET_PCIEPHY_PERST] = { SRC_PCIEPHY_RCR, BIT(3) }, 283 + [IMX8MP_RESET_PCIE_CTRL_APPS_EN] = { SRC_PCIEPHY_RCR, BIT(6) }, 284 + [IMX8MP_RESET_PCIE_CTRL_APPS_TURNOFF] = { SRC_PCIEPHY_RCR, BIT(11) }, 285 + [IMX8MP_RESET_HDMI_PHY_APB_RESET] = { SRC_HDMI_RCR, BIT(0) }, 286 + [IMX8MP_RESET_MEDIA_RESET] = { SRC_DISP_RCR, BIT(0) }, 287 + [IMX8MP_RESET_GPU2D_RESET] = { SRC_GPU2D_RCR, BIT(0) }, 288 + [IMX8MP_RESET_GPU3D_RESET] = { SRC_GPU3D_RCR, BIT(0) }, 289 + [IMX8MP_RESET_GPU_RESET] = { SRC_GPU_RCR, BIT(0) }, 290 + [IMX8MP_RESET_VPU_RESET] = { SRC_VPU_RCR, BIT(0) }, 291 + [IMX8MP_RESET_VPU_G1_RESET] = { SRC_VPU_G1_RCR, BIT(0) }, 292 + [IMX8MP_RESET_VPU_G2_RESET] = { SRC_VPU_G2_RCR, BIT(0) }, 293 + [IMX8MP_RESET_VPUVC8KE_RESET] = { SRC_VPUVC8KE_RCR, BIT(0) }, 294 + [IMX8MP_RESET_NOC_RESET] = { SRC_NOC_RCR, BIT(0) }, 295 + }; 296 + 297 + static int imx8mp_reset_set(struct reset_controller_dev *rcdev, 298 + unsigned long id, bool assert) 299 + { 300 + struct imx7_src *imx7src = to_imx7_src(rcdev); 301 + const unsigned int bit = imx7src->signals[id].bit; 302 + unsigned int value = assert ? bit : 0; 303 + 304 + switch (id) { 305 + case IMX8MP_RESET_PCIEPHY: 306 + /* 307 + * wait for more than 10us to release phy g_rst and 308 + * btnrst 309 + */ 310 + if (!assert) 311 + udelay(10); 312 + break; 313 + 314 + case IMX8MP_RESET_PCIE_CTRL_APPS_EN: 315 + value = assert ? 0 : bit; 316 + break; 317 + } 318 + 319 + return imx7_reset_update(imx7src, id, value); 320 + } 321 + 322 + static int imx8mp_reset_assert(struct reset_controller_dev *rcdev, 323 + unsigned long id) 324 + { 325 + return imx8mp_reset_set(rcdev, id, true); 326 + } 327 + 328 + static int imx8mp_reset_deassert(struct reset_controller_dev *rcdev, 329 + unsigned long id) 330 + { 331 + return imx8mp_reset_set(rcdev, id, false); 332 + } 333 + 334 + static const struct imx7_src_variant variant_imx8mp = { 335 + .signals = imx8mp_src_signals, 336 + .signals_num = ARRAY_SIZE(imx8mp_src_signals), 337 + .ops = { 338 + .assert = imx8mp_reset_assert, 339 + .deassert = imx8mp_reset_deassert, 340 + }, 341 + }; 342 + 269 343 static int imx7_reset_probe(struct platform_device *pdev) 270 344 { 271 345 struct imx7_src *imx7src; ··· 383 283 static const struct of_device_id imx7_reset_dt_ids[] = { 384 284 { .compatible = "fsl,imx7d-src", .data = &variant_imx7 }, 385 285 { .compatible = "fsl,imx8mq-src", .data = &variant_imx8mq }, 286 + { .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp }, 386 287 { /* sentinel */ }, 387 288 }; 388 289