From patchwork Thu Mar 21 14:54:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781549 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872174wrj; Thu, 21 Mar 2024 07:55:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVYcVzmwXx0IiovQ9hOLoqfgalWPgbCu1Xbc+/9we4PY3fCvLcC22H2ICKsrnecItWdX1YZ6zORLIvDN5xCvu/m X-Google-Smtp-Source: AGHT+IEa4VDZJtBpX7NWH0Ht8vgIw5XLWky3KUtmgvtwB5AbXdhsMDHSG2Vago5B3SYrV5pznFiH X-Received: by 2002:a05:6000:1809:b0:341:a640:b516 with SMTP id m9-20020a056000180900b00341a640b516mr1637379wrh.70.1711032939622; Thu, 21 Mar 2024 07:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711032939; cv=none; d=google.com; s=arc-20160816; b=tFjhnZUU+AaJBICvehMUYGwSGVZ1lChN2ltw//pXhNgayFO4iuOtqVfGU/kwi4kyUp iDgwu2/oHVvJp3cShWGmC6illMYJ4l7FZ5+DGAIWXpwiFnl2fFhiS6VHnr2s3R/GJI+J ETOCLEeRHCvmOcgxsA9fWdUXMuhC9hrp+LJhdR0iXAyz2bZnC9kruTP86dGg3gjAMgXH X9Y/K2SMR5deccxAj43z0KViay+iJxm+SOHu4bIcTmXkM7w+HVcpyU7EReNXcrJ8jkLO J6yRMIfYWzTZrRh6rS+8GXSQ1fjYLopK6Ka4BSUreGxEoHtSTcdfiPKLj6rrFpiu/KUv IXEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ad3uCstV6107Ex9Z//2I9L6055a6XtiiyrmcQSBfESM=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=FVx+HpjECQyw/sasihXH4d71JlzRdPlhg8repMoogtqEsFChU1EKb4tJ6Lzoh7Hkq/ l4wFaoikpmTr1JYOp1S70oK0N2GuldJUD+c4LTHjSTxMD57GF3XNma8JS5nmZcEheRE4 IYjXtL481qrvEy8+Ha131D9U68YVPvBC7gt2ZBIgIRYh8w8GFap6Q7plen24ygt9mWAS 9ekfSw1DzvGUoj5BkSPxQwpbZy8EM8TP5mq7BEUbiCDovaeQWFuQEL52OClsnzTrZYfp g8l4BYXJ2fkEzw2IzrKSaMG6dGtdC5trrRHQzUwNBMoqKmXfX3Irspvrtmj77SdRfmug gJ8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y8bNuzhX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id f12-20020adffccc000000b0033ed8940dfasi6763257wrs.762.2024.03.21.07.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:55:39 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y8bNuzhX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 55BA2880D2; Thu, 21 Mar 2024 15:55:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="y8bNuzhX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0A327880D2; Thu, 21 Mar 2024 15:55:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B2102880AD for ; Thu, 21 Mar 2024 15:55:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1dfff641d10so6829945ad.2 for ; Thu, 21 Mar 2024 07:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032927; x=1711637727; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ad3uCstV6107Ex9Z//2I9L6055a6XtiiyrmcQSBfESM=; b=y8bNuzhX0xA5blDyoCtpRBa/oSanhSGRUG3qw31tmTDLV6bGJiGyt4DXDwzBWpvlFE mgZ2wZT0pHtE3/FDWBhQ5GT0RVrZgmHExX8yyGTqmCkv/x8gt3t4q8UsPxx3aRsjxUb6 zjvjuLwnCTVXqRYfMvCQkXuqipf2jgFXcpBcnkVFXDHjTDNLaolRYLredIq24OdOqcfO RdC7VUOXrCKNkD/1wq8OPFW752l7TVoIuNEh8I/mV/19icYuf/WWSzOhXbrqJ0mLAySN gmOWVrKwRg4H1JWHcEB1IMv/dV057jF86/O8my1G3xwKoRtFdL3P8owB/++nD0jxB0PH 1R7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032927; x=1711637727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ad3uCstV6107Ex9Z//2I9L6055a6XtiiyrmcQSBfESM=; b=wLyy9lwtus7ZAGCAILUOQ2vkApP9JTUIXOI945P3MYm+7QB5+GH1uLNKzhSheL7LD6 QGzbejyv14wjjZ6HbHA19rQLwnTr9DzXtoHGwM8/e6MdkePvHAHnLImbQ8+WY3N6PkOC IP+99RkWGFRosPLuvABTnxrtAQr5RfiHAvmtebYZF2rOrMRZnJ9QKJi9PqmKHsUw7Ee3 Ftr38aCXEmPyXz2cSIPWEUbSMbqdsVfYC5L9lBpNgSLejZvE+9tz31xm3k3UjgLUedFC hg1QQjnxkE8FH3xjCanzAh492poY6T6SwsJp7aLtqFAWhUBT52DCgLDf1Tu30I4Nbz4Q UW9w== X-Gm-Message-State: AOJu0YzX/Q6Gcq9KLXtIzrpCedzPs3wUCyMTJdNlmEzcWLsusNFMDZBm vJMUIftPYEKs9i1SZ49U9Aqy9k6FPDFtUhdyTw/p9ae8txOQtXOpx3BIRdknF8EdrfQbuywPYB1 N X-Received: by 2002:a17:902:eb92:b0:1df:f73e:f8a3 with SMTP id q18-20020a170902eb9200b001dff73ef8a3mr16836498plg.30.1711032926835; Thu, 21 Mar 2024 07:55:26 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:55:26 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 01/11] clk: imx8mp: Add support for PCIe clocks Date: Thu, 21 Mar 2024 20:24:57 +0530 Message-Id: <20240321145507.619448-2-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add support for PCIe clocks required to enable PCIe support on iMX8MP SoC. Tested-by: Tim Harvey #imx8mp-venice* Tested-by: Adam Ford #imx8mp-beacon-kit Reviewed-by: Marek Vasut Signed-off-by: Sumit Garg --- drivers/clk/imx/clk-imx8mp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c index a21a3ce34bb..7dfc829df2c 100644 --- a/drivers/clk/imx/clk-imx8mp.c +++ b/drivers/clk/imx/clk-imx8mp.c @@ -62,6 +62,10 @@ static const char *imx8mp_dram_apb_sels[] = {"clock-osc-24m", "sys_pll2_200m", " "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", }; +static const char * const imx8mp_pcie_aux_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll2_50m", + "sys_pll3_out", "sys_pll2_100m", "sys_pll1_80m", + "sys_pll1_160m", "sys_pll1_200m", }; + static const char *imx8mp_i2c5_sels[] = {"clock-osc-24m", "sys_pll1_160m", "sys_pll2_50m", "sys_pll3_out", "audio_pll1_out", "video_pll1_out", "audio_pll2_out", "sys_pll1_133m", }; @@ -272,6 +276,7 @@ static int imx8mp_clk_probe(struct udevice *dev) clk_dm(IMX8MP_CLK_DRAM_ALT, imx8m_clk_composite("dram_alt", imx8mp_dram_alt_sels, base + 0xa000)); clk_dm(IMX8MP_CLK_DRAM_APB, imx8m_clk_composite_critical("dram_apb", imx8mp_dram_apb_sels, base + 0xa080)); + clk_dm(IMX8MP_CLK_PCIE_AUX, imx8m_clk_composite("pcie_aux", imx8mp_pcie_aux_sels, base + 0xa400)); clk_dm(IMX8MP_CLK_I2C5, imx8m_clk_composite("i2c5", imx8mp_i2c5_sels, base + 0xa480)); clk_dm(IMX8MP_CLK_I2C6, imx8m_clk_composite("i2c6", imx8mp_i2c6_sels, base + 0xa500)); clk_dm(IMX8MP_CLK_ENET_QOS, imx8m_clk_composite("enet_qos", imx8mp_enet_qos_sels, base + 0xa880)); @@ -322,6 +327,7 @@ static int imx8mp_clk_probe(struct udevice *dev) clk_dm(IMX8MP_CLK_I2C2_ROOT, imx_clk_gate4("i2c2_root_clk", "i2c2", base + 0x4180, 0)); clk_dm(IMX8MP_CLK_I2C3_ROOT, imx_clk_gate4("i2c3_root_clk", "i2c3", base + 0x4190, 0)); clk_dm(IMX8MP_CLK_I2C4_ROOT, imx_clk_gate4("i2c4_root_clk", "i2c4", base + 0x41a0, 0)); + clk_dm(IMX8MP_CLK_PCIE_ROOT, imx_clk_gate4("pcie_root_clk", "pcie_aux", base + 0x4250, 0)); clk_dm(IMX8MP_CLK_PWM1_ROOT, imx_clk_gate4("pwm1_root_clk", "pwm1", base + 0x4280, 0)); clk_dm(IMX8MP_CLK_PWM2_ROOT, imx_clk_gate4("pwm2_root_clk", "pwm2", base + 0x4290, 0)); clk_dm(IMX8MP_CLK_PWM3_ROOT, imx_clk_gate4("pwm3_root_clk", "pwm3", base + 0x42a0, 0)); From patchwork Thu Mar 21 14:54:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781550 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872239wrj; Thu, 21 Mar 2024 07:55:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVLb9XxffAVmY2mJn4YA1yHyALci1/SJIlVV0l053UpXG557ae85mMDkoDxnFUtgz+sgyjGgJyEvLBJeka4EzAE X-Google-Smtp-Source: AGHT+IFCTWrdgRdZv9oT8wxwCrdoMFbqraMAoo9dFbkISqduc3KdgoUtXOBz+l8SErrj2wB/67CZ X-Received: by 2002:a5d:69d0:0:b0:341:9129:3bb4 with SMTP id s16-20020a5d69d0000000b0034191293bb4mr1633446wrw.69.1711032950248; Thu, 21 Mar 2024 07:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711032950; cv=none; d=google.com; s=arc-20160816; b=Q29qzSDSugj+CIYwfxfMrP4HW9+ypPv3YcF817OgMsxp0SLeM5kCcOBkgvHxEDTSHJ BABT3U8zDzXuszysn7WHuCgx8Ibk8qEVXh5NBaXfQxRIsSAb8bYhlddFkYN2DYkUgQ0q AYBPSJjehRuxlqAZvqp8QfD+peACaeJ9F++aKKSbOyKmrljvHapV6Z/Vvdew3ud06ILS kdvhqekHMOg7YabBtSuYrknSf4EW95roEViPZMb3QnPGHadNc1ApG3djaBooP3E8suZr hENH8iL8oDej1De6vMUSFWu/A451dvhkGKdeXTrw6cxw4A6SjzJOvA61LFngD5AS+kgW 6Uog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pZszhapRfBhAfiLoppFEm0qvoUGpo25SESb5dIarLvs=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=pUHKfKkjh62i8vOd5ZFXJhLZ7OatMGeu3Vx9tU2z+CCVstXOgk4a/1E+NBfVLXKPsU WBwE1JVp6pG21MdFEE/mPJ1IKYh5Kqg3ALE7BCCkT8RfYa/RyPUw/irfwbBSYn0yhK9n 1+QHy9UTdBccHLLfECVKe3JELSd1NywaLSYj/ZqyIjsYgGgAk1xaS96fdTrAbkAdEYjd fc/wxYdH83tbgb/aLNpvCc8MX5GjlW9m+ROFiy9Jv7EFzT/GHIpwutc6TAouVaCTrIRL lll1GXf79AqKsrv8K+ahqgRjNUoaPPHe7YJjOKzb8W6rR9Whg9PrKgXqSxhgN3n2Nzkp Q51A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dwSSoI58; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id r17-20020a056000015100b0033e78c45012si8715475wrx.429.2024.03.21.07.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:55:50 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dwSSoI58; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8466387F4A; Thu, 21 Mar 2024 15:55:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="dwSSoI58"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C214787F4A; Thu, 21 Mar 2024 15:55:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 73B50880E4 for ; Thu, 21 Mar 2024 15:55:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1def89f0cfdso16758785ad.0 for ; Thu, 21 Mar 2024 07:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032933; x=1711637733; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pZszhapRfBhAfiLoppFEm0qvoUGpo25SESb5dIarLvs=; b=dwSSoI584FFQt/+Y0SKof0CGiz920RK+Pil51DbZA1fU1W9hqNLSOvYs/dzNl9ovID CnMJwcYSQ5whG6oRISHa2zFZBhrBzhldwA/Trhvfd3MnzZI6+gKmqVxBHhr9qAl8qifK 4brXjnLa/ug77llbBjmVMRDEpOoA+NfUJpNk0DaiD6cjz7NTSy3+mY8ERCfm3e9zqnPG lyq3mwOU8//6oZa3sRB/XSBECCZ3NkI71H5T21mf8ksfXKFQiGF/fZxMsPAIBIyeFcwV 1sN7KoNlVhD0ixxGCNWEzB7igQvan1zgf5Ti2qydn7gf8VbRt39e4mVzLberYAq03bjF s45Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032933; x=1711637733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pZszhapRfBhAfiLoppFEm0qvoUGpo25SESb5dIarLvs=; b=pm34qQ1xAetjAwxHfTL8eHMd99MB9S//cSVX6kWnTOkZnhDF7/kbn1Avli/dMpWt/4 h4fjDmjBpeYkdfxtDdFlkhITCE3clPOLa6qh5SpNQQcgmvnjlm0jek7JBH+5cjWBbryT 0A/tV3ha3fCfMM87GhzIJAyxoYVR131fRUD4FE+uPxQIF3t3c9cZWzjyRCp+2P6luriP 60c9d6R2ge5f6zl3tfDPXTXaF/+kaKxM6eUMEZ4M3P2bRPUXohin4n2JxLRJF6GGOIi1 e1+aanCamy46ZJCXfpmemUXNAwatw/kHezGEbhRcTwGHzugSnjYsyx3SJjOKPJoDwDTQ tn2w== X-Gm-Message-State: AOJu0YwkmilquOwZmfmWeBUSQz0hkv/XCCtRjndosh9Oibl3VesNbMtl itD39pjCeP4iyc09TlJO0q1oerbx3Rdm8zMlUUJzrPl3pKMoQcBmoD0A6waVY13s2kUjz53Myn9 w X-Received: by 2002:a17:902:e750:b0:1dd:8daf:99d7 with SMTP id p16-20020a170902e75000b001dd8daf99d7mr4488079plf.32.1711032933574; Thu, 21 Mar 2024 07:55:33 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:55:33 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 02/11] reset: imx: Refactor driver to simplify function names Date: Thu, 21 Mar 2024 20:24:58 +0530 Message-Id: <20240321145507.619448-3-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean imx7_reset_{deassert/assert}_imx* are a bit more confusing when compared with imx*_reset_{deassert/assert}. So refactor driver to use function names easier to understand. This shouldn't affect the functionality though. Suggested-by: Marek Vasut Reviewed-by: Marek Vasut Signed-off-by: Sumit Garg --- drivers/reset/reset-imx7.c | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c index eaef2cc2cdf..ca703466605 100644 --- a/drivers/reset/reset-imx7.c +++ b/drivers/reset/reset-imx7.c @@ -14,7 +14,7 @@ #include #include -struct imx7_reset_priv { +struct imx_reset_priv { void __iomem *base; struct reset_ops ops; }; @@ -64,9 +64,9 @@ static const struct imx7_src_signal imx7_src_signals[IMX7_RESET_NUM] = { [IMX7_RESET_DDRC_CORE_RST] = { SRC_DDRC_RCR, BIT(1) }, }; -static int imx7_reset_deassert_imx7(struct reset_ctl *rst) +static int imx7_reset_deassert(struct reset_ctl *rst) { - struct imx7_reset_priv *priv = dev_get_priv(rst->dev); + struct imx_reset_priv *priv = dev_get_priv(rst->dev); const struct imx7_src_signal *sig = imx7_src_signals; u32 val; @@ -95,9 +95,9 @@ static int imx7_reset_deassert_imx7(struct reset_ctl *rst) return 0; } -static int imx7_reset_assert_imx7(struct reset_ctl *rst) +static int imx7_reset_assert(struct reset_ctl *rst) { - struct imx7_reset_priv *priv = dev_get_priv(rst->dev); + struct imx_reset_priv *priv = dev_get_priv(rst->dev); const struct imx7_src_signal *sig = imx7_src_signals; u32 val; @@ -185,9 +185,9 @@ static const struct imx7_src_signal imx8mq_src_signals[IMX8MQ_RESET_NUM] = { [IMX8MQ_RESET_DDRC2_PRST] = { SRC_DDRC2_RCR, BIT(2) }, }; -static int imx7_reset_deassert_imx8mq(struct reset_ctl *rst) +static int imx8mq_reset_deassert(struct reset_ctl *rst) { - struct imx7_reset_priv *priv = dev_get_priv(rst->dev); + struct imx_reset_priv *priv = dev_get_priv(rst->dev); const struct imx7_src_signal *sig = imx8mq_src_signals; u32 val; @@ -223,9 +223,9 @@ static int imx7_reset_deassert_imx8mq(struct reset_ctl *rst) return 0; } -static int imx7_reset_assert_imx8mq(struct reset_ctl *rst) +static int imx8mq_reset_assert(struct reset_ctl *rst) { - struct imx7_reset_priv *priv = dev_get_priv(rst->dev); + struct imx_reset_priv *priv = dev_get_priv(rst->dev); const struct imx7_src_signal *sig = imx8mq_src_signals; u32 val; @@ -252,21 +252,21 @@ static int imx7_reset_assert_imx8mq(struct reset_ctl *rst) return 0; } -static int imx7_reset_assert(struct reset_ctl *rst) +static int imx_reset_assert(struct reset_ctl *rst) { - struct imx7_reset_priv *priv = dev_get_priv(rst->dev); + struct imx_reset_priv *priv = dev_get_priv(rst->dev); return priv->ops.rst_assert(rst); } -static int imx7_reset_deassert(struct reset_ctl *rst) +static int imx_reset_deassert(struct reset_ctl *rst) { - struct imx7_reset_priv *priv = dev_get_priv(rst->dev); + struct imx_reset_priv *priv = dev_get_priv(rst->dev); return priv->ops.rst_deassert(rst); } static const struct reset_ops imx7_reset_reset_ops = { - .rst_assert = imx7_reset_assert, - .rst_deassert = imx7_reset_deassert, + .rst_assert = imx_reset_assert, + .rst_deassert = imx_reset_deassert, }; static const struct udevice_id imx7_reset_ids[] = { @@ -277,18 +277,18 @@ static const struct udevice_id imx7_reset_ids[] = { static int imx7_reset_probe(struct udevice *dev) { - struct imx7_reset_priv *priv = dev_get_priv(dev); + struct imx_reset_priv *priv = dev_get_priv(dev); priv->base = dev_remap_addr(dev); if (!priv->base) return -ENOMEM; if (device_is_compatible(dev, "fsl,imx8mq-src")) { - priv->ops.rst_assert = imx7_reset_assert_imx8mq; - priv->ops.rst_deassert = imx7_reset_deassert_imx8mq; + priv->ops.rst_assert = imx8mq_reset_assert; + priv->ops.rst_deassert = imx8mq_reset_deassert; } else if (device_is_compatible(dev, "fsl,imx7d-src")) { - priv->ops.rst_assert = imx7_reset_assert_imx7; - priv->ops.rst_deassert = imx7_reset_deassert_imx7; + priv->ops.rst_assert = imx7_reset_assert; + priv->ops.rst_deassert = imx7_reset_deassert; } return 0; @@ -300,5 +300,5 @@ U_BOOT_DRIVER(imx7_reset) = { .of_match = imx7_reset_ids, .ops = &imx7_reset_reset_ops, .probe = imx7_reset_probe, - .priv_auto = sizeof(struct imx7_reset_priv), + .priv_auto = sizeof(struct imx_reset_priv), }; From patchwork Thu Mar 21 14:54:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781551 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872324wrj; Thu, 21 Mar 2024 07:56:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU2xQg/B6Vm6M4LX7Ga+OjDKh8G0mpvVWPgBpZov8CJdLa33VzjZMgZ8yO4kZaRIHiRhvgF0M/NZQcyrWUWYRQm X-Google-Smtp-Source: AGHT+IE7kHM7sxymjS+2kiu1nJu5V1XOz24B54XrcxxqpJsNcp1KkEadgekBqZFFxnp1WmZ6GLHF X-Received: by 2002:a5d:684a:0:b0:33e:7991:6105 with SMTP id o10-20020a5d684a000000b0033e79916105mr2538061wrw.16.1711032960868; Thu, 21 Mar 2024 07:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711032960; cv=none; d=google.com; s=arc-20160816; b=s1TDi2gttTaGUNaS9Ox4fM/M03y71fdLPeAJxYaRS7650C8xq7ljgotNHEFjgJjXsh qA06hN9gAMLJu1XFGpgNw34zZbbdpXxCGtO9rhkhx6Auf3daDRqDSwjTAhC4vLOQTWlP BgIgiQTgnHyP75RoiHAQd3h6v9g0k+OeOn10brdjKcdd+/Da3ElL7kCqS7WN9qbNr49c 2fMBhWLLaoefVvmJTp9qoFelBobTKOHAdGM9MFDhU59QqfsKSsrg0qpMGDweoENQnja5 GeVeVLSH1nsT0gKUCYpN7baVJONMKYCw4Y4oLdAKQvwKnJh7Syfjup7o1c1DfS9h9HCk F0SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YXfJ+ze3P2WZwnms0irP1lniROry+6vdxNOaK57iBvo=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=ekboIsZIHEXXwNps4ZDyJuHe8WQ+wSWP8lnSuP3W1OhkmU9Hlnq50wGUZeVqDQpoqk HA6kgQY0eWvsUORnGLKU/YA45snDZRGH1yu4MKnzk6bBClJVbMZvrc8IWA8IQC/cU85V 7wMg8rZoKamLOZ2bqslPsbtEY/DxH/MBQFf+ZXFWZQrIFICw7zjBnb2W58O2j+xrds8U n/IsIi0HbVtMuuV+BFotlH0bNQ1fgKIdAFJKkbLPAkkMkMdYqFfrDsa5sZmP4opGA8yu tkzkNjlBzx9LR/FVS64OoU+c4TcRJTSpC8DT+q7JBuMhLMYqU35kVFaMa8EBh3BuOi91 r1tQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OiKHHoqC; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id l6-20020a5d4106000000b0033e67db2008si8375223wrp.854.2024.03.21.07.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:00 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OiKHHoqC; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F27E0880C0; Thu, 21 Mar 2024 15:55:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="OiKHHoqC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 20187880DB; Thu, 21 Mar 2024 15:55:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1907487F1E for ; Thu, 21 Mar 2024 15:55:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1e08512cd86so1109125ad.1 for ; Thu, 21 Mar 2024 07:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032940; x=1711637740; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YXfJ+ze3P2WZwnms0irP1lniROry+6vdxNOaK57iBvo=; b=OiKHHoqCOrn9zQpgld0Oi3gfVcfDacbqRZaso/jERjVrE3mb5LYYR+g/f+xU9s1NAE 9kb2m23mxZg/HDu09YTD2smlB1HYTTFqMmF+tJplxgLcVo1xJpBoXVTJ4sHET/dbVIYL 4VsXFOh5R6ANoN4yMfBCiOG9eQ0DkpDw8aqnWDJc1qzJSxrrviVKrsTUnqF6xd8WmB6s tV2HqL5yUBzDZfcrdpNiwWFRm74yXHVAMYi0l8M9C+C3sIDfUPqBnSdL/euKrnpcDdO/ u9yh30FePAX9b5vb4+onWi7OcWU8tsbLbXbqOC3F8xjwFTcRWcJWT74miwfywamanPRV Zc1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032940; x=1711637740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YXfJ+ze3P2WZwnms0irP1lniROry+6vdxNOaK57iBvo=; b=XhQFfJCx2PoK5Eorn4wenXnArDuvQRglwEREAJhQm2fScSaDZB+BFjKrLhKsw23xwD mOWmNDLrnK0LoMx+YZmSjQpuCnBkQ1GVR0IkiHSzS3/zCCUXUamV9Rg8iBTRAf7nLLDn DXQAyou3m3bREzL8kVQ/q+lJvbkYxuxGoV7khPqtYa3DlyUF6qGm4rNvPHT7rLgO9TAd sLHDY5aeUINldtVjfbyWvqv3PhP++VQ6W6AX9iHqWLH47DY+gH7nmzR/pnobqrxFKGfv CkcyRqy2tg+bYKSg8xBRxejJ1CBfywV2ce3hF+uc56l1pf5mytKYJXaDQHG6APzhoW7v 0SeA== X-Gm-Message-State: AOJu0Yxhe5n5jeXMo8Z6zwNI6u4SKW7v3cTcZGGwTSy8LGn0+uvGeR67 EW9byHu5adDIhZ0qLhwHrgfqvV+JpPzTh3oV41siv5sdl9Ebr4QrU9604DefhIUNmnEdsLI9Oht 2 X-Received: by 2002:a17:902:8c93:b0:1dd:e159:3e32 with SMTP id t19-20020a1709028c9300b001dde1593e32mr1971492plo.57.1711032940248; Thu, 21 Mar 2024 07:55:40 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:55:39 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 03/11] reset: imx: Add support for i.MX8MP reset controller Date: Thu, 21 Mar 2024 20:24:59 +0530 Message-Id: <20240321145507.619448-4-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add support for i.MX8MP reset controller, it has same reset IP inside as the other iMX7 and iMX8M variants but with different module layout. Inspired from counterpart Linux kernel v6.8-rc3 driver: drivers/reset/reset-imx7.c. Use last Linux kernel driver reference commit bad8a8afe19f ("reset: Explicitly include correct DT includes"). Tested-by: Tim Harvey #imx8mp-venice* Tested-by: Adam Ford #imx8mp-beacon-kit Reviewed-by: Marek Vasut Signed-off-by: Sumit Garg --- drivers/reset/reset-imx7.c | 101 +++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c index ca703466605..a3b3132f2fa 100644 --- a/drivers/reset/reset-imx7.c +++ b/drivers/reset/reset-imx7.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -252,6 +253,102 @@ static int imx8mq_reset_assert(struct reset_ctl *rst) return 0; } +enum imx8mp_src_registers { + SRC_SUPERMIX_RCR = 0x0018, + SRC_AUDIOMIX_RCR = 0x001c, + SRC_MLMIX_RCR = 0x0028, + SRC_GPU2D_RCR = 0x0038, + SRC_GPU3D_RCR = 0x003c, + SRC_VPU_G1_RCR = 0x0048, + SRC_VPU_G2_RCR = 0x004c, + SRC_VPUVC8KE_RCR = 0x0050, + SRC_NOC_RCR = 0x0054, +}; + +static const struct imx7_src_signal imx8mp_src_signals[IMX8MP_RESET_NUM] = { + [IMX8MP_RESET_A53_CORE_POR_RESET0] = { SRC_A53RCR0, BIT(0) }, + [IMX8MP_RESET_A53_CORE_POR_RESET1] = { SRC_A53RCR0, BIT(1) }, + [IMX8MP_RESET_A53_CORE_POR_RESET2] = { SRC_A53RCR0, BIT(2) }, + [IMX8MP_RESET_A53_CORE_POR_RESET3] = { SRC_A53RCR0, BIT(3) }, + [IMX8MP_RESET_A53_CORE_RESET0] = { SRC_A53RCR0, BIT(4) }, + [IMX8MP_RESET_A53_CORE_RESET1] = { SRC_A53RCR0, BIT(5) }, + [IMX8MP_RESET_A53_CORE_RESET2] = { SRC_A53RCR0, BIT(6) }, + [IMX8MP_RESET_A53_CORE_RESET3] = { SRC_A53RCR0, BIT(7) }, + [IMX8MP_RESET_A53_DBG_RESET0] = { SRC_A53RCR0, BIT(8) }, + [IMX8MP_RESET_A53_DBG_RESET1] = { SRC_A53RCR0, BIT(9) }, + [IMX8MP_RESET_A53_DBG_RESET2] = { SRC_A53RCR0, BIT(10) }, + [IMX8MP_RESET_A53_DBG_RESET3] = { SRC_A53RCR0, BIT(11) }, + [IMX8MP_RESET_A53_ETM_RESET0] = { SRC_A53RCR0, BIT(12) }, + [IMX8MP_RESET_A53_ETM_RESET1] = { SRC_A53RCR0, BIT(13) }, + [IMX8MP_RESET_A53_ETM_RESET2] = { SRC_A53RCR0, BIT(14) }, + [IMX8MP_RESET_A53_ETM_RESET3] = { SRC_A53RCR0, BIT(15) }, + [IMX8MP_RESET_A53_SOC_DBG_RESET] = { SRC_A53RCR0, BIT(20) }, + [IMX8MP_RESET_A53_L2RESET] = { SRC_A53RCR0, BIT(21) }, + [IMX8MP_RESET_SW_NON_SCLR_M7C_RST] = { SRC_M4RCR, BIT(0) }, + [IMX8MP_RESET_OTG1_PHY_RESET] = { SRC_USBOPHY1_RCR, BIT(0) }, + [IMX8MP_RESET_OTG2_PHY_RESET] = { SRC_USBOPHY2_RCR, BIT(0) }, + [IMX8MP_RESET_SUPERMIX_RESET] = { SRC_SUPERMIX_RCR, BIT(0) }, + [IMX8MP_RESET_AUDIOMIX_RESET] = { SRC_AUDIOMIX_RCR, BIT(0) }, + [IMX8MP_RESET_MLMIX_RESET] = { SRC_MLMIX_RCR, BIT(0) }, + [IMX8MP_RESET_PCIEPHY] = { SRC_PCIEPHY_RCR, BIT(2) }, + [IMX8MP_RESET_PCIEPHY_PERST] = { SRC_PCIEPHY_RCR, BIT(3) }, + [IMX8MP_RESET_PCIE_CTRL_APPS_EN] = { SRC_PCIEPHY_RCR, BIT(6) }, + [IMX8MP_RESET_PCIE_CTRL_APPS_TURNOFF] = { SRC_PCIEPHY_RCR, BIT(11) }, + [IMX8MP_RESET_HDMI_PHY_APB_RESET] = { SRC_HDMI_RCR, BIT(0) }, + [IMX8MP_RESET_MEDIA_RESET] = { SRC_DISP_RCR, BIT(0) }, + [IMX8MP_RESET_GPU2D_RESET] = { SRC_GPU2D_RCR, BIT(0) }, + [IMX8MP_RESET_GPU3D_RESET] = { SRC_GPU3D_RCR, BIT(0) }, + [IMX8MP_RESET_GPU_RESET] = { SRC_GPU_RCR, BIT(0) }, + [IMX8MP_RESET_VPU_RESET] = { SRC_VPU_RCR, BIT(0) }, + [IMX8MP_RESET_VPU_G1_RESET] = { SRC_VPU_G1_RCR, BIT(0) }, + [IMX8MP_RESET_VPU_G2_RESET] = { SRC_VPU_G2_RCR, BIT(0) }, + [IMX8MP_RESET_VPUVC8KE_RESET] = { SRC_VPUVC8KE_RCR, BIT(0) }, + [IMX8MP_RESET_NOC_RESET] = { SRC_NOC_RCR, BIT(0) }, +}; + +static int imx8mp_reset_set(struct reset_ctl *rst, bool assert) +{ + struct imx_reset_priv *priv = dev_get_priv(rst->dev); + unsigned int bit, value; + + if (rst->id >= IMX8MP_RESET_NUM) + return -EINVAL; + + bit = imx8mp_src_signals[rst->id].bit; + value = assert ? bit : 0; + + switch (rst->id) { + case IMX8MP_RESET_PCIEPHY: + /* + * wait for more than 10us to release phy g_rst and + * btnrst + */ + if (!assert) + udelay(10); + break; + + case IMX8MP_RESET_PCIE_CTRL_APPS_EN: + case IMX8MP_RESET_PCIEPHY_PERST: + value = assert ? 0 : bit; + break; + } + + clrsetbits_le32(priv->base + imx8mp_src_signals[rst->id].offset, bit, + value); + + return 0; +} + +static int imx8mp_reset_assert(struct reset_ctl *rst) +{ + return imx8mp_reset_set(rst, true); +} + +static int imx8mp_reset_deassert(struct reset_ctl *rst) +{ + return imx8mp_reset_set(rst, false); +} + static int imx_reset_assert(struct reset_ctl *rst) { struct imx_reset_priv *priv = dev_get_priv(rst->dev); @@ -272,6 +369,7 @@ static const struct reset_ops imx7_reset_reset_ops = { static const struct udevice_id imx7_reset_ids[] = { { .compatible = "fsl,imx7d-src" }, { .compatible = "fsl,imx8mq-src" }, + { .compatible = "fsl,imx8mp-src" }, { } }; @@ -289,6 +387,9 @@ static int imx7_reset_probe(struct udevice *dev) } else if (device_is_compatible(dev, "fsl,imx7d-src")) { priv->ops.rst_assert = imx7_reset_assert; priv->ops.rst_deassert = imx7_reset_deassert; + } else if (device_is_compatible(dev, "fsl,imx8mp-src")) { + priv->ops.rst_assert = imx8mp_reset_assert; + priv->ops.rst_deassert = imx8mp_reset_deassert; } return 0; From patchwork Thu Mar 21 14:55:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781559 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp875901wrj; Thu, 21 Mar 2024 08:02:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXUlyfYpGGI1359tnzz6FHAlsn7USHWMfmxA4dFsXE//qGkKmMJeFCOQaKqWLRnsZ8mUmL/cMuJfApme2nYWbuY X-Google-Smtp-Source: AGHT+IFuqqUlP3+HF6zd+DiaxtdQBWywzZUfSj6X4whKAntudmieqnJCPmzyRB3nmD3omj5qFQr3 X-Received: by 2002:ac2:4acf:0:b0:515:90e8:f873 with SMTP id m15-20020ac24acf000000b0051590e8f873mr1434105lfp.35.1711033350159; Thu, 21 Mar 2024 08:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711033350; cv=none; d=google.com; s=arc-20160816; b=lac9TmhHdzSUo9YxMubfFxbI0VxxlKmfKrAPJPMvTrvIwmx5DGCd0iUjoU1li7UPuR MbSpsYn18Se3bFrCWimQawiNyZ3If1Nglu/4SZoSCbVQjbVjxUxbMxI0CBqvJcUyh4eC D1mnfLcgCOWtfFQNQZO40rtNno0CZ0IEyuiqqXW7o0eBeR8YRPFh2zpDLLxhgPgvGeT8 86q2HUsqZKcBC6kLNInGGxT7Ko50fGgAeVbWY+GxdUcIejmmxaTug6ZUSPkKObvIBQmN LpqtvfV51Eyk57+m1qN4/JZWz0eEad33nCp7XWwyd5fYD5p1ZO2Jg4O9jtesWC0B3K83 omlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pW6qYNm21G5ooadcXHxvbFWY7L8jFYvMsUqA95CayFw=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=midcUGdqRIcWNFgzC8AvwNsa9zN1/rbdUoHFzi5JuyFm0ZexpoIWkn+DhGQPtApUzT Lr3XAQsxrPRHQfGuTjBr922IL2G5s4eRdGepK6dwtv7ws6+dqmHe/bbSWuVrFQUHndhf TeqYTvBRTCsZeis+ZYEhx+ptnwXn/Rl3PI88fZUO8sHzf7rXbkHdpVzy0KGkl6ZtDcGv wb8jc44IROPulowo7YgRxJxvOjxpKf1beywirXmkFj52lKGyg4pSfpPTxJUv6f9WGzmy 7L3o5X67u9shSGjSYOgU17njWOciNkABlaXxuSux8RFUYBPG8M12AaEa78a8l+i/RmWt bKqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=luLjp1Nw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id e10-20020a5d6d0a000000b0033e7b343e10si2089103wrq.269.2024.03.21.08.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 08:02:30 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=luLjp1Nw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B46487C7F; Thu, 21 Mar 2024 16:02:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="luLjp1Nw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF7F287D4F; Thu, 21 Mar 2024 16:02:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 90DBB866E8 for ; Thu, 21 Mar 2024 16:02:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-609ed7ca444so10808847b3.1 for ; Thu, 21 Mar 2024 08:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711033344; x=1711638144; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pW6qYNm21G5ooadcXHxvbFWY7L8jFYvMsUqA95CayFw=; b=luLjp1NwzO7IZu4DzkbggJkUoWSvdQGdB+fE95QL2IrtB5lvEvXbz56ZyjpxnqMGGy X4CUBdSaO+JhOUoy9+/mJ1tCPFaZKJ7ktUFD40NRXIJUFfNn27hxP/g23r+x20aIgkq9 8Ay7T+qvRFA5d/Orma/u0geITZxTyYRnrqycRyxc9o1+7JE00fHO/DEdYxUdI1q5gnms 3qC9ayWN4eJbRLUYMKO6VYdKDLMsSivtUM6AjF22C2XaoTLx+tvZ0zBi0wimeZZq3MmS CC23HwPSBC5PiCWUR+bwFICoEz5MEbiSRLwMhkLgKOoTy0jlYS9vBFCml5z/o6oAaJzP iX2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711033344; x=1711638144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pW6qYNm21G5ooadcXHxvbFWY7L8jFYvMsUqA95CayFw=; b=ersg+gS4q6Jon3NRWwet5Ec1LgnQoo+na06YZ+ypHWSUtPWm/g4lzBYbO4QJXhIcgM BZefeJBD3eKh6w8V5hHtzyjrRba2vc9O//p1usl5COvuM2BH4iuZY9/tBaQLGIdZ7U/h 3eJ4scFdSXqN/UwBXJskLvD99r92aDh07OD9sJY922c9doC3psCgz1qL0A7TRUH4w75d VjrwsNdx9e69MDTXtIjHxSJGk3df6moKSLC+2Ycrlz/lgkk0CRPgQvaAdVV8mg16P7d7 lu0xDUlFhyqIikH+6HIKfN6bOsTtQS+TWpW5Js/viKuKDexY7eMY8ywyl6iF3Vi7wd0J M/Yw== X-Gm-Message-State: AOJu0Yyj8Aa8ZttvHlS3k83WLQHMgzU6gq1191Yfk/Tbd++koO0AqPNJ yG9u3aZulgeXXzuPDJ/eLHboZR0On659HhztWud2zXU5Oc0gtX06+zBqyLTbSEzbbUZ1trL9k4G S X-Received: by 2002:a05:6a21:788d:b0:1a3:6c9e:1e2b with SMTP id bf13-20020a056a21788d00b001a36c9e1e2bmr2451731pzc.14.1711032946734; Thu, 21 Mar 2024 07:55:46 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:55:46 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 04/11] imx8mp: power-domain: Add PCIe support Date: Thu, 21 Mar 2024 20:25:00 +0530 Message-Id: <20240321145507.619448-5-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add support for GPCv2 power domains and clock handling for PCIe and PCIe PHY. Tested-by: Tim Harvey #imx8mp-venice* Tested-by: Adam Ford #imx8mp-beacon-kit Reviewed-by: Marek Vasut Signed-off-by: Sumit Garg --- drivers/power/domain/imx8mp-hsiomix.c | 117 +++++++++++++++++--------- 1 file changed, 79 insertions(+), 38 deletions(-) diff --git a/drivers/power/domain/imx8mp-hsiomix.c b/drivers/power/domain/imx8mp-hsiomix.c index e2d772c5ec7..d3b0c1146ce 100644 --- a/drivers/power/domain/imx8mp-hsiomix.c +++ b/drivers/power/domain/imx8mp-hsiomix.c @@ -16,48 +16,85 @@ #define GPR_REG0 0x0 #define PCIE_CLOCK_MODULE_EN BIT(0) #define USB_CLOCK_MODULE_EN BIT(1) +#define PCIE_PHY_APB_RST BIT(4) +#define PCIE_PHY_INIT_RST BIT(5) struct imx8mp_hsiomix_priv { void __iomem *base; struct clk clk_usb; + struct clk clk_pcie; struct power_domain pd_bus; struct power_domain pd_usb; + struct power_domain pd_pcie; struct power_domain pd_usb_phy1; struct power_domain pd_usb_phy2; + struct power_domain pd_pcie_phy; }; -static int imx8mp_hsiomix_on(struct power_domain *power_domain) +static int imx8mp_hsiomix_set(struct power_domain *power_domain, bool power_on) { struct udevice *dev = power_domain->dev; struct imx8mp_hsiomix_priv *priv = dev_get_priv(dev); - struct power_domain *domain; + struct power_domain *domain = NULL; + struct clk *clk = NULL; + u32 gpr_reg0_bits = 0; int ret; - ret = power_domain_on(&priv->pd_bus); - if (ret) - return ret; - - if (power_domain->id == IMX8MP_HSIOBLK_PD_USB) { + switch (power_domain->id) { + case IMX8MP_HSIOBLK_PD_USB: domain = &priv->pd_usb; - } else if (power_domain->id == IMX8MP_HSIOBLK_PD_USB_PHY1) { + clk = &priv->clk_usb; + gpr_reg0_bits |= USB_CLOCK_MODULE_EN; + break; + case IMX8MP_HSIOBLK_PD_USB_PHY1: domain = &priv->pd_usb_phy1; - } else if (power_domain->id == IMX8MP_HSIOBLK_PD_USB_PHY2) { + break; + case IMX8MP_HSIOBLK_PD_USB_PHY2: domain = &priv->pd_usb_phy2; - } else { - ret = -EINVAL; - goto err_pd; + break; + case IMX8MP_HSIOBLK_PD_PCIE: + domain = &priv->pd_pcie; + clk = &priv->clk_pcie; + gpr_reg0_bits |= PCIE_CLOCK_MODULE_EN; + break; + case IMX8MP_HSIOBLK_PD_PCIE_PHY: + domain = &priv->pd_pcie_phy; + /* Bits to deassert PCIe PHY reset */ + gpr_reg0_bits |= PCIE_PHY_APB_RST | PCIE_PHY_INIT_RST; + break; + default: + dev_err(dev, "unknown power domain id: %ld\n", + power_domain->id); + return -EINVAL; } - ret = power_domain_on(domain); - if (ret) - goto err_pd; + if (power_on) { + ret = power_domain_on(&priv->pd_bus); + if (ret) + return ret; - ret = clk_enable(&priv->clk_usb); - if (ret) - goto err_clk; + ret = power_domain_on(domain); + if (ret) + goto err_pd; - if (power_domain->id == IMX8MP_HSIOBLK_PD_USB) - setbits_le32(priv->base + GPR_REG0, USB_CLOCK_MODULE_EN); + if (clk) { + ret = clk_enable(clk); + if (ret) + goto err_clk; + } + + if (gpr_reg0_bits) + setbits_le32(priv->base + GPR_REG0, gpr_reg0_bits); + } else { + if (gpr_reg0_bits) + clrbits_le32(priv->base + GPR_REG0, gpr_reg0_bits); + + if (clk) + clk_disable(clk); + + power_domain_off(domain); + power_domain_off(&priv->pd_bus); + } return 0; @@ -68,26 +105,14 @@ err_pd: return ret; } -static int imx8mp_hsiomix_off(struct power_domain *power_domain) +static int imx8mp_hsiomix_on(struct power_domain *power_domain) { - struct udevice *dev = power_domain->dev; - struct imx8mp_hsiomix_priv *priv = dev_get_priv(dev); - - if (power_domain->id == IMX8MP_HSIOBLK_PD_USB) - clrbits_le32(priv->base + GPR_REG0, USB_CLOCK_MODULE_EN); - - clk_disable(&priv->clk_usb); - - if (power_domain->id == IMX8MP_HSIOBLK_PD_USB) - power_domain_off(&priv->pd_usb); - else if (power_domain->id == IMX8MP_HSIOBLK_PD_USB_PHY1) - power_domain_off(&priv->pd_usb_phy1); - else if (power_domain->id == IMX8MP_HSIOBLK_PD_USB_PHY2) - power_domain_off(&priv->pd_usb_phy2); - - power_domain_off(&priv->pd_bus); + return imx8mp_hsiomix_set(power_domain, true); +} - return 0; +static int imx8mp_hsiomix_off(struct power_domain *power_domain) +{ + return imx8mp_hsiomix_set(power_domain, false); } static int imx8mp_hsiomix_of_xlate(struct power_domain *power_domain, @@ -109,6 +134,10 @@ static int imx8mp_hsiomix_probe(struct udevice *dev) if (ret < 0) return ret; + ret = clk_get_by_name(dev, "pcie", &priv->clk_pcie); + if (ret < 0) + return ret; + ret = power_domain_get_by_name(dev, &priv->pd_bus, "bus"); if (ret < 0) return ret; @@ -125,8 +154,20 @@ static int imx8mp_hsiomix_probe(struct udevice *dev) if (ret < 0) goto err_pd_usb_phy2; + ret = power_domain_get_by_name(dev, &priv->pd_pcie, "pcie"); + if (ret < 0) + goto err_pd_pcie; + + ret = power_domain_get_by_name(dev, &priv->pd_pcie_phy, "pcie-phy"); + if (ret < 0) + goto err_pd_pcie_phy; + return 0; +err_pd_pcie_phy: + power_domain_free(&priv->pd_pcie); +err_pd_pcie: + power_domain_free(&priv->pd_usb_phy2); err_pd_usb_phy2: power_domain_free(&priv->pd_usb_phy1); err_pd_usb_phy1: From patchwork Thu Mar 21 14:55:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781552 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872383wrj; Thu, 21 Mar 2024 07:56:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVS0TstC4bjRZuCASf+ClJPvxlypwozSm1Q/pOQmz2tLzbuGQh0GUI2t4Pog9spwMXOmcepXy6yzXwBobtlfDt8 X-Google-Smtp-Source: AGHT+IGCfuNpBoVl07iYR3tm6XwZr2hpmj4qcHc6KkXT+SrCkI88U7MWQTGyJDwWmwlZcIuLWrnY X-Received: by 2002:a05:600c:3b25:b0:414:f50:3588 with SMTP id m37-20020a05600c3b2500b004140f503588mr6938757wms.27.1711032972688; Thu, 21 Mar 2024 07:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711032972; cv=none; d=google.com; s=arc-20160816; b=fCP2NMLTZnnzMaSamqgOK+q0SVT7mNerVpu5fRx9iMZtYgmKcR0ObnEUsmWc1e5cjV i1IVOocWGmZsa9gKypZgKlSJY6SBULmmeMkZryz9VG9PPA9aM3YhLUIVLmrVDZVIri/E GLZrH//ZgqZyoxqKX+xn6x+JOvPQxS+BeaCqYmSOD6Qq1CciUABjHkzmzrpyV8zKwfBC H86gAx05/6iikKeXNsjsFYXn9lX0Ad1KvI/wXvZflCmbpL5cBDF81OODaYGpWQ6Dm1Z+ LPwZ+GWLM6/WB/omJzQ0owr/h9vEeTXsLhJTNG8ihsmP2zwBgazpwQmi2agdS64GyRWN InEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KiyJd8hHzXtAy6Yk64/YBU58F0rsx8zUmD1cw3UaGCE=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=0r1RLtZBubii/u6OzOwS0wtbihZSir8ZSDti+YDXQzFvNEmbjeFdNiHNVWCUiXzbOS vKFuikHlsutx1BJ1Y5x6pr1ryUguVRF4/oBE1cfRvUnVNpA3emVobpK7oENU5prImn5h JFB537fvH9JfHzGF1yfaBVJNpSW8H9OX2tUwIPVyahrEH8HrbzgAoFL0OR8U0h7LVaxq oYrPZUns0FFE7/JITgS2uzIvWxU4WuRzIcCtYdt4I/H559kX3hka1NvX2JxmE3sZJ9Jx Fi4AsaGV1UdanoAl8BHD0cQc3iOy005Ta1UZfqkC8EyLr6Nm9lDcqwv/YTkfNQRW+BJV 9PfQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QAHTrPxb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id k8-20020a05600c1c8800b004140d1d8b33si2369514wms.197.2024.03.21.07.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:12 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QAHTrPxb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 877B1880C5; Thu, 21 Mar 2024 15:56:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="QAHTrPxb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0AA96880C5; Thu, 21 Mar 2024 15:55:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F3257880F8 for ; Thu, 21 Mar 2024 15:55:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1e0000cdf99so7633575ad.0 for ; Thu, 21 Mar 2024 07:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032953; x=1711637753; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KiyJd8hHzXtAy6Yk64/YBU58F0rsx8zUmD1cw3UaGCE=; b=QAHTrPxbm0tDDkDxNaAnn6lkNtDMTZtacUjCBI0/Kz4yuy0+rFy+9+/qYGzXEBBcze 5uQsAmQJwc6gc++1Mt7AFZ1TnWDeyGav6+Z4tmj7RHHIFz73psG2nnLyYbCwV2z9NYre +oCeJzell+tSdAuATTtlkA7U2jX3+Zb6mf9TFwiScyJ1+RIbKJQHpW7OLi8a+ErvL/hR r0xiZ3WHxZ4Ku9dtvxSClv3ZshM/m2MbApDYcy9VVYAgaxOkdao0T6pmSPS27XJrU0MF xJHB2GihTMLx8ERREFMS0Gcc6aTgihKkOuV1at7Jz5EbReeE1Yte6pgrEfRdTW5Yscn8 2rmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032953; x=1711637753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KiyJd8hHzXtAy6Yk64/YBU58F0rsx8zUmD1cw3UaGCE=; b=F9rjdf7J1EdXsvJ6Hx2qMvTwHmouaTWkE3Ee03IT0SrvuBByeYYxAASEBDlnZqks+O tx+LZffB5TbATZ+euTM4wGxeDVTkSIOPFW94polhZOPtvdN7aW1XmFFZzFpcZdCE1anO dlgsPEmDRB9cIYJX1D/GlWDNpcjQ2bZTOOLjI2uiE6Ca2hrFX7nRasrvOUAaOQWhGa0f ehCDhzsBbrzBqOv7mgdPEFyK6bebEIvqpVAXbDLM6v2OYYFHWK5bZLI1Mqg9XlREOsYx nux5+DlD3Vr43z2QWRqDGz8T+XN3i6es2aCqmOAnXn6Lp7aIhBvlN5PJBpfBcWn5QF4U zPfw== X-Gm-Message-State: AOJu0YwydU8sM1ajswU+6WbO87GmfsXMPdgGx1gPJSOVocs4EzUQ5Yfe SFUvejLzhOWmQ+F4ELZScnRfXcKfPkLBS/PeEY9zDI3kTEF0pP12eNL3E354mBUyKfND3B/Jwjp C X-Received: by 2002:a17:903:2385:b0:1e0:26c0:6c1b with SMTP id v5-20020a170903238500b001e026c06c1bmr2705922plh.0.1711032953339; Thu, 21 Mar 2024 07:55:53 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:55:53 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 05/11] imx8mp: power-domain: Expose high performance PLL clock Date: Thu, 21 Mar 2024 20:25:01 +0530 Message-Id: <20240321145507.619448-6-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Expose the high performance PLL as clock framework clock, so the PCIe PHY can use it when there is no external refclock provided. Inspired from counterpart Linux kernel v6.8-rc3 driver: drivers/pmdomain/imx/imx8mp-blk-ctrl.c. Use last Linux kernel driver reference commit 7476ddfd36ac ("pmdomain: imx8mp-blk-ctrl: Convert to platform remove callback returning void"). Tested-by: Tim Harvey #imx8mp-venice* Tested-by: Adam Ford #imx8mp-beacon-kit Reviewed-by: Marek Vasut Signed-off-by: Sumit Garg --- drivers/power/domain/imx8mp-hsiomix.c | 77 +++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/drivers/power/domain/imx8mp-hsiomix.c b/drivers/power/domain/imx8mp-hsiomix.c index d3b0c1146ce..6188a04c45e 100644 --- a/drivers/power/domain/imx8mp-hsiomix.c +++ b/drivers/power/domain/imx8mp-hsiomix.c @@ -6,9 +6,15 @@ #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include #include #include @@ -18,6 +24,15 @@ #define USB_CLOCK_MODULE_EN BIT(1) #define PCIE_PHY_APB_RST BIT(4) #define PCIE_PHY_INIT_RST BIT(5) +#define GPR_REG1 0x4 +#define PLL_LOCK BIT(13) +#define GPR_REG2 0x8 +#define P_PLL_MASK GENMASK(5, 0) +#define M_PLL_MASK GENMASK(15, 6) +#define S_PLL_MASK GENMASK(18, 16) +#define GPR_REG3 0xc +#define PLL_CKE BIT(17) +#define PLL_RST BIT(31) struct imx8mp_hsiomix_priv { void __iomem *base; @@ -123,6 +138,67 @@ static int imx8mp_hsiomix_of_xlate(struct power_domain *power_domain, return 0; } +static int hsio_pll_clk_enable(struct clk *clk) +{ + void *base = (void *)dev_get_driver_data(clk->dev); + u32 val; + int ret; + + /* Setup HSIO PLL as 100 MHz output clock */ + clrsetbits_le32(base + GPR_REG2, + P_PLL_MASK | M_PLL_MASK | S_PLL_MASK, + FIELD_PREP(P_PLL_MASK, 12) | + FIELD_PREP(M_PLL_MASK, 800) | + FIELD_PREP(S_PLL_MASK, 4)); + + /* de-assert PLL reset */ + setbits_le32(base + GPR_REG3, PLL_RST); + + /* enable PLL */ + setbits_le32(base + GPR_REG3, PLL_CKE); + + /* Check if PLL is locked */ + ret = readl_poll_sleep_timeout(base + GPR_REG1, val, + val & PLL_LOCK, 10, 100000); + if (ret) + dev_err(clk->dev, "failed to lock HSIO PLL\n"); + + return ret; +} + +static int hsio_pll_clk_disable(struct clk *clk) +{ + void *base = (void *)dev_get_driver_data(clk->dev); + + clrbits_le32(base + GPR_REG3, PLL_CKE | PLL_RST); + + return 0; +} + +static const struct clk_ops hsio_pll_clk_ops = { + .enable = hsio_pll_clk_enable, + .disable = hsio_pll_clk_disable, +}; + +U_BOOT_DRIVER(hsio_pll) = { + .name = "hsio-pll", + .id = UCLASS_CLK, + .ops = &hsio_pll_clk_ops, +}; + +int imx8mp_hsiomix_bind(struct udevice *dev) +{ + struct driver *drv; + + drv = lists_driver_lookup_name("hsio-pll"); + if (!drv) + return -ENOENT; + + return device_bind_with_driver_data(dev, drv, "hsio-pll", + (ulong)dev_read_addr_ptr(dev), + dev_ofnode(dev), NULL); +} + static int imx8mp_hsiomix_probe(struct udevice *dev) { struct imx8mp_hsiomix_priv *priv = dev_get_priv(dev); @@ -193,6 +269,7 @@ U_BOOT_DRIVER(imx8mp_hsiomix) = { .id = UCLASS_POWER_DOMAIN, .of_match = imx8mp_hsiomix_ids, .probe = imx8mp_hsiomix_probe, + .bind = imx8mp_hsiomix_bind, .priv_auto = sizeof(struct imx8mp_hsiomix_priv), .ops = &imx8mp_hsiomix_ops, }; From patchwork Thu Mar 21 14:55:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781553 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872470wrj; Thu, 21 Mar 2024 07:56:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWuoG4tDdOru9TKgAdb2f6gBm91reqXTwMPBXIkizqLNOJ4N69fetiRzHRIwGk9KS5Yx5+/2Lkeros/8bwkyBNR X-Google-Smtp-Source: AGHT+IHHtpDhmSfN2BvejP90ebCWWatVufFEfscBpNxp7I3hA3RqybXqkv99ZdVqixfs5/8qF1IN X-Received: by 2002:adf:ecd1:0:b0:341:b188:409a with SMTP id s17-20020adfecd1000000b00341b188409amr179679wro.18.1711032984030; Thu, 21 Mar 2024 07:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711032984; cv=none; d=google.com; s=arc-20160816; b=pm44t7XywQYGOUNSMWBm1zC8qytcKCKt8OVmD0L1dj6enr1OpnA4OODxTC/ousnKA7 eLzUdd1NSLCuVowiKZMGCZDFvnCDeDwYYk4h1BesxLNReauGFmou5qJiRuQEGeTgStad PUPIHWGxpiA0fCMzGRngVxq9RBFinwfOZDAURM7o3gi5ue0fsVbbwhWDSQ7Yi1vHEs8h RgISqxuMWDY3wdoBq78zCkOAAgJkM5h1unpAQ8T6nRgWmJWspZZH9SIOAodwqdhtgy28 iZyIH4UFBK2I1S5VFrVJxa1eHF2WC07KGzQTgbm7ATH4ltc31elwt5+6SPF7zTBfumcY AMNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WrebIvOxfl9a8Z8IF9PdqYJmbXt8AdPcs56yhJPGkts=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=bn6BG+DQA0bvWx1KRCKHuCoKTxjSJnKktn8Bvfevdr0ERTRi94UIlJLJYfPb9iWjc3 q/f05CX/kAyjIbQBzWiGAyOV9MmM88sDBfhSAGazNz42JxOWewo2T7oLrvEtvxUToW9u auuadTDTpR/0SnV4ipM8Lh2Mn/NMUTvyvV7s4I4NJtd3fAbnZUXwF30Z6/EDpNx7vswa /Njn3+3Omyh8u/aOvW0TNzZ0cobvnSmpNiTY/z1l+Py9Gres5br+OA1yjOTVq6GntDIa dOrw7XRLdW9p2eqU3plsI8dC5vk0QbqMsiUI7yWBRFM4gBqJJVFbKpSnzLJDEcXgx67b RG6A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bzCBLv1U; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id s3-20020a5d4ec3000000b0033ec234d4a3si8380068wrv.694.2024.03.21.07.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bzCBLv1U; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 90C76880E9; Thu, 21 Mar 2024 15:56:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bzCBLv1U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3F88E880EA; Thu, 21 Mar 2024 15:56:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AF81E880F4 for ; Thu, 21 Mar 2024 15:56:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1e034607879so7971705ad.0 for ; Thu, 21 Mar 2024 07:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032960; x=1711637760; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WrebIvOxfl9a8Z8IF9PdqYJmbXt8AdPcs56yhJPGkts=; b=bzCBLv1UXQ3KmGm+v6LDJLdOwIsIigtrGFpDiLqXd6+lk9XSiPBV7OTU5WUvf02JpV qhJsIqneS4DBgddLRnyY9Z+tjlkph1zGsXAeBVURafZAtVDKTqMYztsLq/mpvkEZODUF o4SPmTXx3UFrBDvzTV2yZdHGVi5lD1r8hv5UpV9pBoXga78DfCRKYhBgFfafmWNMwM8w KsdJH8I4nPYZLWsej8TGSxQAQP76ob3ppJSAZv72XY9fcHa2xY9259kh3n+EFdGawv2O /Tubo19+ccfeeX7+ENb6UiupzUWd4M91mXYpXPcMAvMEAkB380ZESBiZ7TVlhBHvunCu CJxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032960; x=1711637760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WrebIvOxfl9a8Z8IF9PdqYJmbXt8AdPcs56yhJPGkts=; b=N6Mifzj8rAmdFKLLI4rgcHq8PceGfoWMYzHymQ3q42mevS62scMIPHAIE8cQk+hDh7 3s3yJ0DrKflLSs88xdLuK4rs4L/uXrJCsTOU9N0df09GszWO9Qz1kVPLp7JsFaIPRNOa VQ0KynQyBIELTAGz8+b/nHKktLW2OscG7hfc7rg6jnIA13BpU1zB+Jf7/E8gP1NnEx/c tMTZTcdu/IWDXgONj+x851FCk4vzK9O2lID2bTXMErjdaGG+0ox1MTHVxK7YN7DXvZY3 2xj5O6nwD8Q0lfGP8Q/R/TZhQMj+vpmZHu3r0dHrVAVjSqL8jQc16oG65icdwhni7e2s yZIA== X-Gm-Message-State: AOJu0YzkcD+6EF1ydC6/bj52RIzMCksuiUZv5xA7wH0dKOdZWe+At03/ 9WzvGxSY1D3//WN2nT9mC9v/XALRlSK+yAfiZIRHKf+bO3UnAC+DlZsgFXj+fFutf+j/qT4iy3Q y X-Received: by 2002:a17:903:22ca:b0:1dd:c0bc:5933 with SMTP id y10-20020a17090322ca00b001ddc0bc5933mr11449764plg.2.1711032959869; Thu, 21 Mar 2024 07:55:59 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:55:59 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 06/11] phy: phy-imx8m-pcie: Add support for i.MX8M{M/P} PCIe PHY Date: Thu, 21 Mar 2024 20:25:02 +0530 Message-Id: <20240321145507.619448-7-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add initial support for i.MX8M{M/P} PCIe PHY. On i.MX8M{M/P} SoCs PCIe PHY initialization moved to this standalone PHY driver. Inspired from counterpart Linux kernel v6.8-rc3 driver: drivers/phy/freescale/phy-fsl-imx8m-pcie.c. Use last Linux kernel driver reference commit 7559e7572c03 ("phy: Explicitly include correct DT includes"). Tested-by: Tim Harvey #imx8mp-venice* Tested-by: Adam Ford #imx8mp-beacon-kit Reviewed-by: Marek Vasut Signed-off-by: Sumit Garg --- drivers/phy/Kconfig | 11 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-imx8m-pcie.c | 283 +++++++++++++++++++++++++++++++++++ 3 files changed, 295 insertions(+) create mode 100644 drivers/phy/phy-imx8m-pcie.c diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 60138beca49..8f767877e73 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -284,6 +284,17 @@ config PHY_IMX8MQ_USB help Support the USB3.0 PHY in NXP i.MX8MQ or i.MX8MP SoC +config PHY_IMX8M_PCIE + bool "NXP i.MX8MM/i.MX8MP PCIe PHY Driver" + depends on PHY + depends on IMX8MM || IMX8MP + select REGMAP + select SYSCON + help + Support the PCIe PHY in NXP i.MX8MM or i.MX8MP SoC + + This PHY is found on i.MX8M devices supporting PCIe. + config PHY_XILINX_ZYNQMP tristate "Xilinx ZynqMP PHY driver" depends on PHY && ARCH_ZYNQMP diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index 2e8723186c0..7a2b764492b 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_PHY_DA8XX_USB) += phy-da8xx-usb.o obj-$(CONFIG_PHY_MTK_TPHY) += phy-mtk-tphy.o obj-$(CONFIG_PHY_NPCM_USB) += phy-npcm-usb.o obj-$(CONFIG_PHY_IMX8MQ_USB) += phy-imx8mq-usb.o +obj-$(CONFIG_PHY_IMX8M_PCIE) += phy-imx8m-pcie.o obj-$(CONFIG_PHY_XILINX_ZYNQMP) += phy-zynqmp.o obj-y += cadence/ obj-y += ti/ diff --git a/drivers/phy/phy-imx8m-pcie.c b/drivers/phy/phy-imx8m-pcie.c new file mode 100644 index 00000000000..2418388cb3c --- /dev/null +++ b/drivers/phy/phy-imx8m-pcie.c @@ -0,0 +1,283 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 Linaro Ltd. + * + * Derived from Linux counterpart driver + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define IMX8MM_PCIE_PHY_CMN_REG061 0x184 +#define ANA_PLL_CLK_OUT_TO_EXT_IO_EN BIT(0) +#define IMX8MM_PCIE_PHY_CMN_REG062 0x188 +#define ANA_PLL_CLK_OUT_TO_EXT_IO_SEL BIT(3) +#define IMX8MM_PCIE_PHY_CMN_REG063 0x18C +#define AUX_PLL_REFCLK_SEL_SYS_PLL GENMASK(7, 6) +#define IMX8MM_PCIE_PHY_CMN_REG064 0x190 +#define ANA_AUX_RX_TX_SEL_TX BIT(7) +#define ANA_AUX_RX_TERM_GND_EN BIT(3) +#define ANA_AUX_TX_TERM BIT(2) +#define IMX8MM_PCIE_PHY_CMN_REG065 0x194 +#define ANA_AUX_RX_TERM (BIT(7) | BIT(4)) +#define ANA_AUX_TX_LVL GENMASK(3, 0) +#define IMX8MM_PCIE_PHY_CMN_REG075 0x1D4 +#define ANA_PLL_DONE 0x3 +#define PCIE_PHY_TRSV_REG5 0x414 +#define PCIE_PHY_TRSV_REG6 0x418 + +#define IMX8MM_GPR_PCIE_REF_CLK_SEL GENMASK(25, 24) +#define IMX8MM_GPR_PCIE_REF_CLK_PLL FIELD_PREP(IMX8MM_GPR_PCIE_REF_CLK_SEL, 0x3) +#define IMX8MM_GPR_PCIE_REF_CLK_EXT FIELD_PREP(IMX8MM_GPR_PCIE_REF_CLK_SEL, 0x2) +#define IMX8MM_GPR_PCIE_AUX_EN BIT(19) +#define IMX8MM_GPR_PCIE_CMN_RST BIT(18) +#define IMX8MM_GPR_PCIE_POWER_OFF BIT(17) +#define IMX8MM_GPR_PCIE_SSC_EN BIT(16) +#define IMX8MM_GPR_PCIE_AUX_EN_OVERRIDE BIT(9) + +#define IOMUXC_GPR14_OFFSET 0x38 + +enum imx8_pcie_phy_type { + IMX8MM, + IMX8MP, +}; + +struct imx8_pcie_phy_drvdata { + const char *gpr; + enum imx8_pcie_phy_type variant; +}; + +struct imx8_pcie_phy { + ulong base; + struct clk hsio_clk; + struct regmap *iomuxc_gpr; + struct reset_ctl perst; + struct reset_ctl reset; + u32 refclk_pad_mode; + u32 tx_deemph_gen1; + u32 tx_deemph_gen2; + bool clkreq_unused; + const struct imx8_pcie_phy_drvdata *drvdata; +}; + +static int imx8_pcie_phy_power_on(struct phy *phy) +{ + int ret; + u32 val, pad_mode; + struct imx8_pcie_phy *imx8_phy = dev_get_priv(phy->dev); + + pad_mode = imx8_phy->refclk_pad_mode; + switch (imx8_phy->drvdata->variant) { + case IMX8MM: + reset_assert(&imx8_phy->reset); + + /* Tune PHY de-emphasis setting to pass PCIe compliance. */ + if (imx8_phy->tx_deemph_gen1) + writel(imx8_phy->tx_deemph_gen1, + imx8_phy->base + PCIE_PHY_TRSV_REG5); + if (imx8_phy->tx_deemph_gen2) + writel(imx8_phy->tx_deemph_gen2, + imx8_phy->base + PCIE_PHY_TRSV_REG6); + break; + case IMX8MP: /* Do nothing. */ + break; + } + + if (pad_mode == IMX8_PCIE_REFCLK_PAD_INPUT || + pad_mode == IMX8_PCIE_REFCLK_PAD_UNUSED) { + /* Configure the pad as input */ + val = readl(imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG061); + writel(val & ~ANA_PLL_CLK_OUT_TO_EXT_IO_EN, + imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG061); + } else { + /* Configure the PHY to output the refclock via pad */ + writel(ANA_PLL_CLK_OUT_TO_EXT_IO_EN, + imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG061); + } + + if (pad_mode == IMX8_PCIE_REFCLK_PAD_OUTPUT || + pad_mode == IMX8_PCIE_REFCLK_PAD_UNUSED) { + /* Source clock from SoC internal PLL */ + writel(ANA_PLL_CLK_OUT_TO_EXT_IO_SEL, + imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG062); + writel(AUX_PLL_REFCLK_SEL_SYS_PLL, + imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG063); + val = ANA_AUX_RX_TX_SEL_TX | ANA_AUX_TX_TERM; + writel(val | ANA_AUX_RX_TERM_GND_EN, + imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG064); + writel(ANA_AUX_RX_TERM | ANA_AUX_TX_LVL, + imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG065); + } + + /* Set AUX_EN_OVERRIDE 1'b0, when the CLKREQ# isn't hooked */ + regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14_OFFSET, + IMX8MM_GPR_PCIE_AUX_EN_OVERRIDE, + imx8_phy->clkreq_unused ? + 0 : IMX8MM_GPR_PCIE_AUX_EN_OVERRIDE); + regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14_OFFSET, + IMX8MM_GPR_PCIE_AUX_EN, + IMX8MM_GPR_PCIE_AUX_EN); + regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14_OFFSET, + IMX8MM_GPR_PCIE_POWER_OFF, 0); + regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14_OFFSET, + IMX8MM_GPR_PCIE_SSC_EN, 0); + + regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14_OFFSET, + IMX8MM_GPR_PCIE_REF_CLK_SEL, + pad_mode == IMX8_PCIE_REFCLK_PAD_INPUT ? + IMX8MM_GPR_PCIE_REF_CLK_EXT : + IMX8MM_GPR_PCIE_REF_CLK_PLL); + udelay(200); + + /* Do the PHY common block reset */ + regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14_OFFSET, + IMX8MM_GPR_PCIE_CMN_RST, + IMX8MM_GPR_PCIE_CMN_RST); + + switch (imx8_phy->drvdata->variant) { + case IMX8MP: + reset_deassert(&imx8_phy->perst); + fallthrough; + case IMX8MM: + reset_deassert(&imx8_phy->reset); + udelay(500); + break; + } + + /* Polling to check the phy is ready or not. */ + ret = readl_poll_timeout(imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG075, + val, val == ANA_PLL_DONE, 20000); + return ret; +} + +static int imx8_pcie_phy_init(struct phy *phy) +{ + struct imx8_pcie_phy *imx8_phy = dev_get_priv(phy->dev); + + return clk_enable(&imx8_phy->hsio_clk); +} + +static int imx8_pcie_phy_exit(struct phy *phy) +{ + struct imx8_pcie_phy *imx8_phy = dev_get_priv(phy->dev); + + return clk_disable(&imx8_phy->hsio_clk); +} + +static const struct phy_ops imx8_pcie_phy_ops = { + .init = imx8_pcie_phy_init, + .exit = imx8_pcie_phy_exit, + .power_on = imx8_pcie_phy_power_on, +}; + +static const struct imx8_pcie_phy_drvdata imx8mm_drvdata = { + .gpr = "fsl,imx8mm-iomuxc-gpr", + .variant = IMX8MM, +}; + +static const struct imx8_pcie_phy_drvdata imx8mp_drvdata = { + .gpr = "fsl,imx8mp-iomuxc-gpr", + .variant = IMX8MP, +}; + +static const struct udevice_id imx8_pcie_phy_of_match[] = { + {.compatible = "fsl,imx8mm-pcie-phy", .data = (ulong)&imx8mm_drvdata, }, + {.compatible = "fsl,imx8mp-pcie-phy", .data = (ulong)&imx8mp_drvdata, }, + { }, +}; + +static int imx8_pcie_phy_probe(struct udevice *dev) +{ + struct imx8_pcie_phy *imx8_phy = dev_get_priv(dev); + ofnode gpr; + int ret = 0; + + imx8_phy->drvdata = (void *)dev_get_driver_data(dev); + imx8_phy->base = dev_read_addr(dev); + if (!imx8_phy->base) + return -EINVAL; + + /* get PHY refclk pad mode */ + dev_read_u32(dev, "fsl,refclk-pad-mode", &imx8_phy->refclk_pad_mode); + + imx8_phy->tx_deemph_gen1 = dev_read_u32_default(dev, + "fsl,tx-deemph-gen1", + 0); + imx8_phy->tx_deemph_gen2 = dev_read_u32_default(dev, + "fsl,tx-deemph-gen2", + 0); + imx8_phy->clkreq_unused = dev_read_bool(dev, "fsl,clkreq-unsupported"); + + /* Grab GPR config register range */ + gpr = ofnode_by_compatible(ofnode_null(), imx8_phy->drvdata->gpr); + if (ofnode_equal(gpr, ofnode_null())) { + dev_err(dev, "unable to find GPR node\n"); + return -ENODEV; + } + + imx8_phy->iomuxc_gpr = syscon_node_to_regmap(gpr); + if (IS_ERR(imx8_phy->iomuxc_gpr)) { + dev_err(dev, "unable to find iomuxc registers\n"); + return PTR_ERR(imx8_phy->iomuxc_gpr); + } + + ret = clk_get_by_name(dev, "ref", &imx8_phy->hsio_clk); + if (ret) { + dev_err(dev, "Failed to get PCIEPHY ref clock\n"); + return ret; + } + + ret = reset_get_by_name(dev, "pciephy", &imx8_phy->reset); + if (ret) { + dev_err(dev, "Failed to get PCIEPHY reset control\n"); + return ret; + } + + if (imx8_phy->drvdata->variant == IMX8MP) { + ret = reset_get_by_name(dev, "perst", &imx8_phy->perst); + if (ret) { + dev_err(dev, + "Failed to get PCIEPHY PHY PERST control\n"); + goto err_perst; + } + } + + return 0; + +err_perst: + reset_free(&imx8_phy->reset); + return ret; +} + +static int imx8_pcie_phy_remove(struct udevice *dev) +{ + struct imx8_pcie_phy *imx8_phy = dev_get_priv(dev); + + if (imx8_phy->drvdata->variant == IMX8MP) + reset_free(&imx8_phy->perst); + + reset_free(&imx8_phy->reset); + + return 0; +} + +U_BOOT_DRIVER(nxp_imx8_pcie_phy) = { + .name = "nxp_imx8_pcie_phy", + .id = UCLASS_PHY, + .of_match = imx8_pcie_phy_of_match, + .probe = imx8_pcie_phy_probe, + .remove = imx8_pcie_phy_remove, + .ops = &imx8_pcie_phy_ops, + .priv_auto = sizeof(struct imx8_pcie_phy), +}; From patchwork Thu Mar 21 14:55:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781554 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872544wrj; Thu, 21 Mar 2024 07:56:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVdpMat6qrS5CVQ3kTsg7cRyufepMPutmMNVVcQiTgGWIMGFnBT0JTBnWZNJuXWOLzS3h5UDnEd1COlmGdRRY8h X-Google-Smtp-Source: AGHT+IFOowvpPtrcgDCyKP9mt7DEJizuIkmTER/8T7YaD6Cn15ImO6CB1OPYjn/XKK273VXQPpUJ X-Received: by 2002:adf:b19d:0:b0:33e:c4c3:6f with SMTP id q29-20020adfb19d000000b0033ec4c3006fmr3846746wra.64.1711032994476; Thu, 21 Mar 2024 07:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711032994; cv=none; d=google.com; s=arc-20160816; b=uzqIFBT9S7aSFe5s4XVf2vzOzNOxfrDoYYw6Ig7JjWELjXxybh2pQDDea0yhwTL2j2 TmTwvqVglJEGzZwZ0Uve/0wV/0nQk5VucyVVXH2mqui87fAO2823dC/Drwyo0KIE34Wt sn2/M1a0BAgUwahpIthfEYv9MCMJtkpAL7eTjC/31IF27O8LKyGDWBk5Mphjz2lOGIxd ll8axnj4PUwlP6RyHHSoJIAIceOoWOWTeVGiC7tulw61mNLhJ0QaAN0dmvgG0u2scet/ HitjEUPuo8xb67w9/4VHEPHMy+n3nI9NRUcLapbBjlpKnWeBHA8hyPD+Ig44SpNnP8R0 HkaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bJuH6fJ8KHGcTOwKyh27qN/clO/qxiO/vrnQ1AaNV+0=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=HUjiaHaFtgiUVV+EOTrXG71H7u53yZJqroivAaQeWl1mBtbE67l/ef9+7U+JwwMaNh 7eDL0NTN+IHGSnyAJ6vzSPMbZXZ21R3TAnhGEKFlX8bKlzvqRj6ZPY07zaOsbJRN8uJc WYkdrO2w+x0XoIGUOebLYQFjLIB7jKWFzOZkqaaMjBDjZWMZ5cg0ctqpIv+vYSN21kxE sw/qYatfR+4oZzVAoIHZLbNQjJw1xX011pao2TxeTXTPpI+xKCV9Tef7scIZpS7YLc85 GVU7SQbTzmfvARuJZw/noeTY9tgfcMtVUea0I4ixg5DpPIHXNGFK44uhxFE26MaKBk4A Yy+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HipeyikU; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id l4-20020adfe584000000b0033ec067693asi8529501wrm.535.2024.03.21.07.56.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HipeyikU; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9401F880E5; Thu, 21 Mar 2024 15:56:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HipeyikU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D605687F1E; Thu, 21 Mar 2024 15:56:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 48183880F8 for ; Thu, 21 Mar 2024 15:56:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1def3340682so7989055ad.1 for ; Thu, 21 Mar 2024 07:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032966; x=1711637766; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bJuH6fJ8KHGcTOwKyh27qN/clO/qxiO/vrnQ1AaNV+0=; b=HipeyikUlsALWyiwv5sAicz+p5kuGPIePHSQgYXV89jnSSKzJJfgAzzPUk+Cb7nxOF 82DtfgUcq8mLIq313OXN1f2HdHVN2QnBqoRnrPG5uXfyqqNAVNHsDhgQhy5efK/ZqyLh DDgH/wZFLjb1dqBPheJAqDZSY5T93Bfh6cXsSD4rMVlNK6J/4XSVXT9+VS3FVH0HwhMx vsjJwS5tQTAg54dqK5VNpDbjMF71cqzvTjyznpvtABARrP8XiEmXoNbxDWSnhpLnpCTC UxjolDo7tkbUU8Rvq4GNz4fpDRuZLio8U397OBPHZg534eu5/5ddjB8YSZ/SiB2Z4G4G noyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032966; x=1711637766; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bJuH6fJ8KHGcTOwKyh27qN/clO/qxiO/vrnQ1AaNV+0=; b=nk7QxHDqAkELbqNoMGlmamjDZUeK3hIcKaZNdtI+i4wBN1VFFA83/JVLQWaKKxYwN+ Bwd+2Uge8OwrahLOlJK6KCtc2MQQo3qOZq/MgZgelkHALh3kV365KOk/Sz+wKLFUEvpy 0j8H8QSsXfLDfVPhcNE3MRwrs79mZAwwmRr12YblNo69akCE92lUUDncY66YiTEnt33S yEBaIoJke37Qnbn/g9HzVKIL9Yh2qElzHcHHspIRcN2ZuM2r3lxEFoi0lt4gS9uXFGqQ Kmoxaww7rrxZ+oYla8qijyetkownWrlvym2MrcuFyfWdMhKvbITW3UHkItOWqo4j66K8 Xhhw== X-Gm-Message-State: AOJu0YzMIeu2nAACbFw1hQjB8wJsi3JGzqGrsJxSd3guj05/Dh00Ozpi w/yKZchHnZ2rp18pUEn/y0BdJfR8SspCVBTM9gfbi2kqipVldtzgFGo8RqGteVXr/4SyTwGs+/+ u X-Received: by 2002:a17:902:e544:b0:1e0:185d:16c3 with SMTP id n4-20020a170902e54400b001e0185d16c3mr12404314plf.12.1711032966401; Thu, 21 Mar 2024 07:56:06 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:06 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 07/11] pci: Add DW PCIe controller support for iMX8MP SoC Date: Thu, 21 Mar 2024 20:25:03 +0530 Message-Id: <20240321145507.619448-8-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean pcie_imx doesn't seem to share any useful code for iMX8 SoC and it is tied to quite old port of pcie_designware driver from Linux which suffices only iMX6 specific needs. But currently we have the common DWC specific bits which alligns pretty well with DW PCIe controller on iMX8MP SoC. So lets reuse those common bits instead as a new driver for iMX8 SoCs. It should be fairly easy to add support for other iMX8 variants to this driver. iMX8MP SoC also comes up with standalone PCIe PHY support, so hence we can reuse the generic PHY infrastructure to power on PCIe PHY. Tested-by: Tim Harvey #imx8mp-venice* Tested-by: Adam Ford #imx8mp-beacon-kit Reviewed-by: Marek Vasut Signed-off-by: Sumit Garg --- drivers/pci/Kconfig | 11 ++ drivers/pci/Makefile | 1 + drivers/pci/pcie_dw_imx.c | 338 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 350 insertions(+) create mode 100644 drivers/pci/pcie_dw_imx.c diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 463ec47eb92..8d02ab82ad9 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -413,4 +413,15 @@ config PCIE_STARFIVE_JH7110 Say Y here if you want to enable PLDA XpressRich PCIe controller support on StarFive JH7110 SoC. +config PCIE_DW_IMX + bool "i.MX DW PCIe controller support" + depends on ARCH_IMX8M + select PCIE_DW_COMMON + select DM_REGULATOR + select REGMAP + select SYSCON + help + Say Y here if you want to enable DW PCIe controller support on + iMX SoCs. + endif diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index 72ef8b4bc77..2927c519129 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -53,3 +53,4 @@ obj-$(CONFIG_PCIE_UNIPHIER) += pcie_uniphier.o obj-$(CONFIG_PCIE_XILINX_NWL) += pcie-xilinx-nwl.o obj-$(CONFIG_PCIE_PLDA_COMMON) += pcie_plda_common.o obj-$(CONFIG_PCIE_STARFIVE_JH7110) += pcie_starfive_jh7110.o +obj-$(CONFIG_PCIE_DW_IMX) += pcie_dw_imx.o diff --git a/drivers/pci/pcie_dw_imx.c b/drivers/pci/pcie_dw_imx.c new file mode 100644 index 00000000000..a2ee228224b --- /dev/null +++ b/drivers/pci/pcie_dw_imx.c @@ -0,0 +1,338 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2024 Linaro Ltd. + * + * Author: Sumit Garg + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pcie_dw_common.h" + +#define PCIE_LINK_CAPABILITY 0x7c +#define TARGET_LINK_SPEED_MASK 0xf +#define LINK_SPEED_GEN_1 0x1 +#define LINK_SPEED_GEN_2 0x2 +#define LINK_SPEED_GEN_3 0x3 + +#define PCIE_MISC_CONTROL_1_OFF 0x8bc +#define PCIE_DBI_RO_WR_EN BIT(0) + +#define PCIE_PORT_DEBUG0 0x728 +#define PCIE_PORT_DEBUG1 0x72c +#define PCIE_PORT_DEBUG1_LINK_UP BIT(4) +#define PCIE_PORT_DEBUG1_LINK_IN_TRAINING BIT(29) + +#define PCIE_LINK_UP_TIMEOUT_MS 100 + +#define IOMUXC_GPR14_OFFSET 0x38 +#define IMX8M_GPR_PCIE_CLK_REQ_OVERRIDE_EN BIT(10) +#define IMX8M_GPR_PCIE_CLK_REQ_OVERRIDE BIT(11) + +struct pcie_dw_imx { + /* Must be first member of the struct */ + struct pcie_dw dw; + struct regmap *iomuxc_gpr; + struct clk_bulk clks; + struct gpio_desc reset_gpio; + struct reset_ctl apps_reset; + struct phy phy; + struct udevice *vpcie; +}; + +static void pcie_dw_configure(struct pcie_dw_imx *priv, u32 cap_speed) +{ + dw_pcie_dbi_write_enable(&priv->dw, true); + + clrsetbits_le32(priv->dw.dbi_base + PCIE_LINK_CAPABILITY, + TARGET_LINK_SPEED_MASK, cap_speed); + + dw_pcie_dbi_write_enable(&priv->dw, false); +} + +static void imx_pcie_ltssm_enable(struct pcie_dw_imx *priv) +{ + reset_deassert(&priv->apps_reset); +} + +static void imx_pcie_ltssm_disable(struct pcie_dw_imx *priv) +{ + reset_assert(&priv->apps_reset); +} + +static bool is_link_up(u32 val) +{ + return ((val & PCIE_PORT_DEBUG1_LINK_UP) && + (!(val & PCIE_PORT_DEBUG1_LINK_IN_TRAINING))); +} + +static int wait_link_up(struct pcie_dw_imx *priv) +{ + u32 val; + + return readl_poll_sleep_timeout(priv->dw.dbi_base + PCIE_PORT_DEBUG1, + val, is_link_up(val), 10000, 100000); +} + +static int pcie_link_up(struct pcie_dw_imx *priv, u32 cap_speed) +{ + int ret; + + /* DW pre link configurations */ + pcie_dw_configure(priv, cap_speed); + + /* Initiate link training */ + imx_pcie_ltssm_enable(priv); + + /* Check that link was established */ + ret = wait_link_up(priv); + if (ret) + imx_pcie_ltssm_disable(priv); + + return ret; +} + +static int imx_pcie_assert_core_reset(struct pcie_dw_imx *priv) +{ + if (dm_gpio_is_valid(&priv->reset_gpio)) { + dm_gpio_set_value(&priv->reset_gpio, 1); + mdelay(20); + } + + return reset_assert(&priv->apps_reset); +} + +static int imx_pcie_clk_enable(struct pcie_dw_imx *priv) +{ + int ret; + + ret = clk_enable_bulk(&priv->clks); + if (ret) + return ret; + + /* + * Set the over ride low and enabled make sure that + * REF_CLK is turned on. + */ + regmap_update_bits(priv->iomuxc_gpr, IOMUXC_GPR14_OFFSET, + IMX8M_GPR_PCIE_CLK_REQ_OVERRIDE, 0); + regmap_update_bits(priv->iomuxc_gpr, IOMUXC_GPR14_OFFSET, + IMX8M_GPR_PCIE_CLK_REQ_OVERRIDE_EN, + IMX8M_GPR_PCIE_CLK_REQ_OVERRIDE_EN); + + /* allow the clocks to stabilize */ + udelay(500); + + return 0; +} + +static void imx_pcie_deassert_core_reset(struct pcie_dw_imx *priv) +{ + if (!dm_gpio_is_valid(&priv->reset_gpio)) + return; + + mdelay(100); + dm_gpio_set_value(&priv->reset_gpio, 0); + /* Wait for 100ms after PERST# deassertion (PCIe r5.0, 6.6.1) */ + mdelay(100); +} + +static int pcie_dw_imx_probe(struct udevice *dev) +{ + struct pcie_dw_imx *priv = dev_get_priv(dev); + struct udevice *ctlr = pci_get_controller(dev); + struct pci_controller *hose = dev_get_uclass_priv(ctlr); + int ret; + + if (priv->vpcie) { + ret = regulator_set_enable(priv->vpcie, true); + if (ret) { + dev_err(dev, "failed to enable vpcie regulator\n"); + return ret; + } + } + + ret = imx_pcie_assert_core_reset(priv); + if (ret) { + dev_err(dev, "failed to assert core reset\n"); + return ret; + } + + ret = imx_pcie_clk_enable(priv); + if (ret) { + dev_err(dev, "failed to enable clocks\n"); + goto err_clk; + } + + ret = generic_phy_init(&priv->phy); + if (ret) { + dev_err(dev, "failed to initialize PHY\n"); + goto err_phy_init; + } + + ret = generic_phy_power_on(&priv->phy); + if (ret) { + dev_err(dev, "failed to power on PHY\n"); + goto err_phy_power; + } + + imx_pcie_deassert_core_reset(priv); + + priv->dw.first_busno = dev_seq(dev); + priv->dw.dev = dev; + pcie_dw_setup_host(&priv->dw); + + if (pcie_link_up(priv, LINK_SPEED_GEN_1)) { + printf("PCIE-%d: Link down\n", dev_seq(dev)); + ret = -ENODEV; + goto err_link; + } + + printf("PCIE-%d: Link up (Gen%d-x%d, Bus%d)\n", dev_seq(dev), + pcie_dw_get_link_speed(&priv->dw), + pcie_dw_get_link_width(&priv->dw), + hose->first_busno); + + pcie_dw_prog_outbound_atu_unroll(&priv->dw, PCIE_ATU_REGION_INDEX0, + PCIE_ATU_TYPE_MEM, + priv->dw.mem.phys_start, + priv->dw.mem.bus_start, priv->dw.mem.size); + + return 0; + +err_link: + generic_shutdown_phy(&priv->phy); +err_phy_power: + generic_phy_exit(&priv->phy); +err_phy_init: + clk_disable_bulk(&priv->clks); +err_clk: + imx_pcie_deassert_core_reset(priv); + + return ret; +} + +static int pcie_dw_imx_remove(struct udevice *dev) +{ + struct pcie_dw_imx *priv = dev_get_priv(dev); + + generic_shutdown_phy(&priv->phy); + dm_gpio_free(dev, &priv->reset_gpio); + reset_free(&priv->apps_reset); + clk_release_bulk(&priv->clks); + + return 0; +} + +static int pcie_dw_imx_of_to_plat(struct udevice *dev) +{ + struct pcie_dw_imx *priv = dev_get_priv(dev); + ofnode gpr; + int ret; + + /* Get the controller base address */ + priv->dw.dbi_base = (void *)dev_read_addr_name(dev, "dbi"); + if ((fdt_addr_t)priv->dw.dbi_base == FDT_ADDR_T_NONE) { + dev_err(dev, "failed to get dbi_base address\n"); + return -EINVAL; + } + + /* Get the config space base address and size */ + priv->dw.cfg_base = (void *)dev_read_addr_size_name(dev, "config", + &priv->dw.cfg_size); + if ((fdt_addr_t)priv->dw.cfg_base == FDT_ADDR_T_NONE) { + dev_err(dev, "failed to get cfg_base address\n"); + return -EINVAL; + } + + ret = clk_get_bulk(dev, &priv->clks); + if (ret) { + dev_err(dev, "failed to get PCIe clks\n"); + return ret; + } + + ret = reset_get_by_name(dev, "apps", &priv->apps_reset); + if (ret) { + dev_err(dev, + "Failed to get PCIe apps reset control\n"); + goto err_reset; + } + + ret = gpio_request_by_name(dev, "reset-gpio", 0, &priv->reset_gpio, + GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); + if (ret) { + dev_err(dev, "unable to get reset-gpio\n"); + goto err_gpio; + } + + ret = generic_phy_get_by_name(dev, "pcie-phy", &priv->phy); + if (ret) { + dev_err(dev, "failed to get pcie phy\n"); + goto err_phy; + } + + gpr = ofnode_by_compatible(ofnode_null(), "fsl,imx8mp-iomuxc-gpr"); + if (ofnode_equal(gpr, ofnode_null())) { + dev_err(dev, "unable to find GPR node\n"); + ret = -ENODEV; + goto err_phy; + } + + priv->iomuxc_gpr = syscon_node_to_regmap(gpr); + if (IS_ERR(priv->iomuxc_gpr)) { + dev_err(dev, "unable to find iomuxc registers\n"); + ret = PTR_ERR(priv->iomuxc_gpr); + goto err_phy; + } + + /* vpcie-supply regulator is optional */ + device_get_supply_regulator(dev, "vpcie-supply", &priv->vpcie); + + return 0; + +err_phy: + dm_gpio_free(dev, &priv->reset_gpio); +err_gpio: + reset_free(&priv->apps_reset); +err_reset: + clk_release_bulk(&priv->clks); + + return ret; +} + +static const struct dm_pci_ops pcie_dw_imx_ops = { + .read_config = pcie_dw_read_config, + .write_config = pcie_dw_write_config, +}; + +static const struct udevice_id pcie_dw_imx_ids[] = { + { .compatible = "fsl,imx8mp-pcie" }, + { } +}; + +U_BOOT_DRIVER(pcie_dw_imx) = { + .name = "pcie_dw_imx", + .id = UCLASS_PCI, + .of_match = pcie_dw_imx_ids, + .ops = &pcie_dw_imx_ops, + .of_to_plat = pcie_dw_imx_of_to_plat, + .probe = pcie_dw_imx_probe, + .remove = pcie_dw_imx_remove, + .priv_auto = sizeof(struct pcie_dw_imx), +}; From patchwork Thu Mar 21 14:55:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781555 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872619wrj; Thu, 21 Mar 2024 07:56:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXaMGXzpMfnO97bJR9VANjBl1ZRdj+VCN51HJ4o5vtLLEbwLNreWpyP+cP3GdQ1YO889VyPa7142HszEcFc3VKA X-Google-Smtp-Source: AGHT+IGoCgyXbBVLldsREZdYue2VuOhARnv8hTrU+D4LT5APhLnzm1zcnL9QVjXR8Pi81MCWZE0h X-Received: by 2002:adf:e383:0:b0:33d:a2f7:ab33 with SMTP id e3-20020adfe383000000b0033da2f7ab33mr13832878wrm.55.1711033006519; Thu, 21 Mar 2024 07:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711033006; cv=none; d=google.com; s=arc-20160816; b=FuSB03qJU86XizqO5PvmjoJFBfq+GnCG8CiE/19o2ZOqaDGFgXa2dW2hQdJz+7pe99 zF2md6jChNqwixQg09ujC+7jwMhGQMhsfvHgsFtEprrE7yXubVcpv6AfiI9yGI21j728 8+Jz5t7bKpIhsP7tEI8lKdpaTMby2YIvLpf4+d6QC7sVg0OUrimSRHwptTWvSb2mFg3f rVSM9pB9zpm9ztbCdSme04dJ2slIOMEv1V0/qUUS8z6ZKGwPX1gFqH90R2n0+qL7v9GH dzMWC9Oe72CGKISJe1pvPZYGka4mjurhyPdqSCebxVPkKO1pLs0w5RMpyb4NQfdpf0kd plLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8wps8uv/k5UQVBa/I0VqzJT2tx2q5k9BLdfIs1HgCOM=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=U7NyYYlM9cQZ+4TQEXd0DZSCHVj2ld6yHJEJhQ4Mc5GxtS9RWZlNOn7KzvAXBitiek SOcRoX8XBfCTW/oSAot+3EZx2KA7dCtjLGvkpoI1qa5TXIsZ4sHwGsBJm+CP4pPm9kz/ ktRtjVb2vs+a7wk1GRfVqUhR4XT8t9+luroeY1QTiM/l2VfhR0mWBrvVPUzm55vn8c5/ dvkFCKrb6w8283akuRQPqBEQp5WYhm6BFq7ce48cTg6coYlILkhzHjF0ucbwOxuwVqFf zjU3t/Ag6S2nVy7w6K7yP4XJTykKBmOr6GzvAuTQJaplEJgdaqwOYzPE1/Ffjs95tIt3 HIWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XaS1nX8Z; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id i16-20020adffdd0000000b0033e7a7db4d7si8471899wrs.1047.2024.03.21.07.56.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:46 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XaS1nX8Z; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 00315880F8; Thu, 21 Mar 2024 15:56:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="XaS1nX8Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A9DB9880FC; Thu, 21 Mar 2024 15:56:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A6D7F880FE for ; Thu, 21 Mar 2024 15:56:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1e00b1c2684so8280855ad.0 for ; Thu, 21 Mar 2024 07:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032973; x=1711637773; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8wps8uv/k5UQVBa/I0VqzJT2tx2q5k9BLdfIs1HgCOM=; b=XaS1nX8Zp4bHnKIx6V9c6Y6/2S4rspC4ePp4eGeuvxHOc/BPJe6EqylHtDsS1CSUXJ IzSB+whIGdK0FNUUCGnsHcUne9BF52QXCI6cKRgt4Rf6aQXUtbAlAgLu5LtekuzsTkrg kfzqInLIXHO7UUJh+IWb2UbAUdIPvW29zLVeOZ/F5MQb5Ay1MpRZCvWsgynmJE2JwthR wrVgRL9lgzGIEDb8cOmzBPxrC+y1kGIAM/sFBaZpA0D1eAKiKlAOgHRVlMx1aRlnEN1F fOVj4m0oYmxpByaeazEOoDSC6yFte47Dw8jYsraA8RRONdRG2wNDr06RVWMNVIlJ6IMp AisA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032973; x=1711637773; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8wps8uv/k5UQVBa/I0VqzJT2tx2q5k9BLdfIs1HgCOM=; b=s3CybFHywxLbpmXcNp5RaXrfrRs1SYGleD0EmL6qST9UKnEluiB7TdMyI0ff+qpsqf zUyn2+6rIIhPVYSSdr3ItZWaVBonOouHQT1T10UGcR/N453Hlz8/cTxsanqGn6sPEvIq cFcd0l6AxZqzSUN23BQuWVTHcwFeRXHVtPWJoXD/5l0szz1XvciSTJC2Cn0/PsZseiLb r+esxfiE96Hebc0Lnj3Iq42FuUyRiaSe3NwghRoJpwjiTHcO8VSOTvy58y86BX0mc5rV 4jtbX8lhYsvqSEapOXL6J8vH7kWy29qNyvjD2GnivM+zJ93Yq+nxo0BdNecyvbmzYt67 43jg== X-Gm-Message-State: AOJu0YxDcb5Oyrusn5SJvxg/oOhM8lUcKsBuwSSzi1y1ENGjnSJ6RlF7 u5m5kWIeGF2YYve5mtarpOj0CrbH89ETAd5PAMog3lOuVaGZI5jvKV6c4Z1v2fohyIYDdOAmjLR F X-Received: by 2002:a17:902:a385:b0:1db:f910:98a9 with SMTP id x5-20020a170902a38500b001dbf91098a9mr21679003pla.56.1711032972974; Thu, 21 Mar 2024 07:56:12 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:12 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 08/11] pcie_imx: Update header to describe it as a legacy driver Date: Thu, 21 Mar 2024 20:25:04 +0530 Message-Id: <20240321145507.619448-9-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Since now we have the modern pcie_dw_imx.c driver for iMX SoCs, encourage people to switch to that for any further new iMX SoC support or even for the older iMX6 SoCs too. Suggested-by: Peter Robinson Signed-off-by: Sumit Garg Reviewed-by: Marek Vasut --- drivers/pci/pcie_imx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c index 4a18b0e0910..78f2c7d6bcd 100644 --- a/drivers/pci/pcie_imx.c +++ b/drivers/pci/pcie_imx.c @@ -7,6 +7,14 @@ * Based on upstream Linux kernel driver: * pci-imx6.c: Sean Cross * pcie-designware.c: Jingoo Han + * + * This is a legacy PCIe iMX driver kept to support older iMX6 SoCs. It is + * rather tied to quite old port of pcie-designware driver from Linux which + * suffices only iMX6 specific needs. But now we have modern PCIe iMX driver + * (drivers/pci/pcie_dw_imx.c) utilizing all the common DWC specific bits from + * (drivers/pci/pcie_dw_common.*). So you are encouraged to add any further iMX + * SoC support there or even better if you posses older iMX6 SoCs then switch + * those too in order to have a single modern PCIe iMX driver. */ #include From patchwork Thu Mar 21 14:55:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781556 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872698wrj; Thu, 21 Mar 2024 07:56:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXju1b70iI37O6/kJlpJ5cyuR6MBc2KQxwi4cUUe6VZtDBit6e5GNhLBJPfH52Y4IFyBxvCjHbNzEQANchTsD5y X-Google-Smtp-Source: AGHT+IFX/KhDdXuSrDPhVTgOOIlQ911Y5E7/TEFz1A70Ew3UxQYsHRxib60dUGiHNhi6qcr+NFek X-Received: by 2002:a05:600c:1395:b0:413:271d:8889 with SMTP id u21-20020a05600c139500b00413271d8889mr2126508wmf.11.1711033018172; Thu, 21 Mar 2024 07:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711033018; cv=none; d=google.com; s=arc-20160816; b=DwDRwOBuHKAZzYG62/S8RnEb773qg3kcCOmAZ/Ss3jYxd+5x0z/vxANr0eEZCs18uA jZFvBqn5isER1ZGmK82D9a1gjJGBQioiwURl2McQ8exRiyC8rgatVLzS65sojiTDSv43 qkBA6DgXaPiWcIZVZClAn9ZTbQWZ2NoZmMR/lBR7iT4dFq0shO7vSHs4JBFclbyzwwdc vUyjlIQU40l1xUsgAI/zIM4oBjY4wq9d5QlQapILN0U5DVM3BlMbOVrtoqpfWFEB2Zp8 4+HjO5ePlBcTGIG7ev+TbCBhA+eOWY1/uxfDIZnPUVUn1HlVsGCZvYLm45uwyPn61x7r Tq8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FQSdlyuHyjO3evVA1Zxr8iEviGz+bLT9UGQ9oBc3nSw=; fh=VdJh2CIruktabdbGEB/DD0cYU5gcKvSFlbIGzVRuS8s=; b=Jj0psRFE3qM/cGe7cOk7xrsEbrQjRHlnc2SsZml7gz86V2xiMRqe38sUAJknozhq10 kkyiXDK61ZaDS3QSzHp936Z4iHlnN+cvbqod0xmNH8XvuSP0qkZoRfMzBU5EhUUpFjoI UmZ9NdSDUmliqodGYnYlwstacbXeECrk34Rr4CLDfta/atrM/K6OcjYu77EUOdT5Q1AM FBfBTWz9ZHBgcddchjIVaEU1Ryha8oMmDcBqt6/YKxcVpkQQCuH6PdAYM6aNuwFco2sK 2UlhlMbO7RM18zG3E5/xqPJfhsAyU61tsQImMMhGQVhvK47BRw98GsZOtK7Zynyi4Hq2 sRKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FkZCMC63; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id l34-20020a05600c1d2200b0041403f51f35si2387273wms.194.2024.03.21.07.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FkZCMC63; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7818D8810D; Thu, 21 Mar 2024 15:56:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="FkZCMC63"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8FAD887F1E; Thu, 21 Mar 2024 15:56:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DD9528810D for ; Thu, 21 Mar 2024 15:56:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1dff837d674so8482595ad.3 for ; Thu, 21 Mar 2024 07:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032979; x=1711637779; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FQSdlyuHyjO3evVA1Zxr8iEviGz+bLT9UGQ9oBc3nSw=; b=FkZCMC63AB1Jm4NAvFFAuOWTbBAiI+OloTr0lPAKyrjSgSAW4GmHffHtQs0ESWskn0 PWx+GdXsfB70wmiOT9ziY3SRZGzARgkgy1Axqk24rVRpvpCslwtiaUfCOrSYO442Xhh/ oBFjFU95rlp+SxB7e33IDGL964yrNSqcEE6eoKl3E5gDZYFzkqvoTznYfVsgiRxBvAFi JMCZ7a7PFPiIICQeLIxLWWNoPUFpgonMAFo+IY+I4uCUvxziaFiouY44hHRBWFYNDvmS X7IsgH30OQVvrfbTECWD5ytF94Tp+7qEitOpzRc0tYoJQLq4Cfe3Fjh0omE5NcxzIh1c IAmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032979; x=1711637779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FQSdlyuHyjO3evVA1Zxr8iEviGz+bLT9UGQ9oBc3nSw=; b=HIVqAH521BbfoX7opsJgFmplmoH0vXygwNwvm1YHjGuDfPw6DkWUEpYEXYt96hqb2W qvRSJGdGzqidj9x1sU5XvVR9oXBDPUjjvL39CGgDiNleWcpKDzYBEKGoOk0OZFhc/xHW ShYH3ZPi6bcUbPTulVlLqPxICjQ1LrKl+IyiV/bJjWVeGh/KyQjD8Ii7812ouZtwGzJl yo6Max8rMj+77DlwQPUjbzsvhqMSWb2Hzo12xSECUwqhldAMGFX0ytR9UdOmy3e45mxV qqzfNY5CoqZytwJ9iIZ+KmuD7RzKRUJMDqvBWYf6/K1cqUVAEQLpjtVzDXHFj/83D/Hu ewGg== X-Gm-Message-State: AOJu0YwXdjG27U68tabzGLto4+KwGjEU5WdbpWjbntCiqdeYBhiwDNiS EG/UQoFyJz/rCgNuprwlWZwV/IlvcK5x5coxhKBJ0US+R26Zr0ZiH6lP/SHLcbaqjHMwsD8Xi1E n X-Received: by 2002:a17:902:7847:b0:1e0:2335:8f68 with SMTP id e7-20020a170902784700b001e023358f68mr4636036pln.26.1711032979710; Thu, 21 Mar 2024 07:56:19 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:19 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg , Francesco Dolcini Subject: [PATCH v4 09/11] verdin-imx8mp_defconfig: Enable PCIe/NVMe support Date: Thu, 21 Mar 2024 20:25:05 +0530 Message-Id: <20240321145507.619448-10-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Enable PCIe/NVMe support. Also, enable the reset driver which is a prerequisite for PCIe support. Acked-by: Francesco Dolcini Tested-by: Marcel Ziswiler Signed-off-by: Sumit Garg --- configs/verdin-imx8mp_defconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configs/verdin-imx8mp_defconfig b/configs/verdin-imx8mp_defconfig index 7ac5e65642c..b6194404baa 100644 --- a/configs/verdin-imx8mp_defconfig +++ b/configs/verdin-imx8mp_defconfig @@ -16,6 +16,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx8mp-verdin-wifi-dev" CONFIG_SPL_TEXT_BASE=0x920000 CONFIG_TARGET_VERDIN_IMX8MP=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_DM_RESET=y CONFIG_SYS_MONITOR_LEN=524288 CONFIG_SPL_MMC=y CONFIG_SPL_SERIAL=y @@ -26,6 +27,7 @@ CONFIG_SPL=y CONFIG_IMX_BOOTAUX=y CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000 CONFIG_SYS_LOAD_ADDR=0x48200000 +CONFIG_PCI=y CONFIG_SYS_MEMTEST_START=0x40000000 CONFIG_SYS_MEMTEST_END=0x80000000 CONFIG_REMAKE_ELF=y @@ -76,6 +78,7 @@ CONFIG_CMD_FUSE=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y +CONFIG_CMD_PCI=y CONFIG_CMD_READ=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y @@ -145,8 +148,11 @@ CONFIG_DWC_ETH_QOS_IMX=y CONFIG_FEC_MXC=y CONFIG_RGMII=y CONFIG_MII=y +CONFIG_NVME_PCI=y +CONFIG_PCIE_DW_IMX=y CONFIG_PHY=y CONFIG_PHY_IMX8MQ_USB=y +CONFIG_PHY_IMX8M_PCIE=y CONFIG_PINCTRL=y CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_IMX8M=y From patchwork Thu Mar 21 14:55:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781557 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872765wrj; Thu, 21 Mar 2024 07:57:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX59fdCxARxitQ1couOUy5F7/LkW5mWDH3WBt87gSHFkHddBCK3K2lmi5wFjpEHtmxk2MwEPhmRRruSwg8JQr1p X-Google-Smtp-Source: AGHT+IGs98w7yl1tBq06frtbwGmFKFWsTR2xH2gJz7ntzPSiYbE1UHwoG4/GlpAJXB6nEmUfbLYk X-Received: by 2002:a5d:470e:0:b0:33d:c2cb:c18d with SMTP id y14-20020a5d470e000000b0033dc2cbc18dmr2076720wrq.32.1711033028360; Thu, 21 Mar 2024 07:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711033028; cv=none; d=google.com; s=arc-20160816; b=ogATLjjFi55SA2AagzLw5FsrbFm/DMMxgmKvaO58xgomRw7eGRBGpb26IGgh0LjxF7 3uESZh+0EoA0l9Zybi31ndEszB3vY2oA0nMTCC6UXZ1UwcMSvg0WSq5x9eEdCZ8QpLHA szSPONsLBKjoU7KVKrqNNuHh9YO+hVGkUXVBiNTuoak2dfq4PZPhOY5dS5x0Lj6VcfkM Pfqw9ndzXVIIfhdqaKwStM/26M5u8k5qVVajlGCWugLc2+9tqJaLNniZjjl+47KRG7qx 2RMAGHVLYOtk6LRVHHa6tzOt1K09F+5gOgQTECdh0nrRVh9QDOkUognWggMRTafZUcAr WUIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DPOk29tp9hSaHHd7ex7d+x3CJBUfHDyKeW57FXsBWGs=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=eiSwIUNmuUst0p5PUSu251f+ceUKxny/UD1Ov7MWbT7Ud7U9aBR3fyLzEAZIZ+HTo0 DlGOLxV30TrNFus5QvICGvkyG46HTGjBZVvoFaBVIICgp18CWv/VNe3CkQEJyt4Xqw1y kCM/WQxRLcp88/zwL3AtTUEh98piGTP3c8yRBjZVSYod2Hl5ny/+ZzLdMCJ8DmW0XTYW UkmHrjtLI7fWOMc2Yw6L206WnBlF7zrOuLqh0YgXzNWIIJLBxPpeXJWwma880dNp3f1o xmcUOmx8kb15VKd/w+lyMbQWjf5w+oPQ2WhsCpg9fCPeiyZ4U+NXuPP3sA6QFaj2fW/e YXQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KnqJKuGG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id x11-20020a5d650b000000b0033d39186eabsi8318243wru.680.2024.03.21.07.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:57:08 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KnqJKuGG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC16C880FA; Thu, 21 Mar 2024 15:56:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="KnqJKuGG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B384F880FE; Thu, 21 Mar 2024 15:56:31 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F2A3C880FA for ; Thu, 21 Mar 2024 15:56:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1deefb08b9eso6706885ad.3 for ; Thu, 21 Mar 2024 07:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032986; x=1711637786; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DPOk29tp9hSaHHd7ex7d+x3CJBUfHDyKeW57FXsBWGs=; b=KnqJKuGGSjbFAZ9B4S0C2able35B2HzPEaXUJLMuU0IYJ6qvdH1IcOqOX7Nrd2H9P/ DBvVTEU/sJDLGoU30PdF+80H1h4U7AVQjSjetlRex8I47ishpks6suXNtbMKgsq97OW5 PdymfvforKaUIIwESAxDmtrfPlJwRPezYxeP+UpuJNBYt2A8aQQUjXBfDxMq++1gvztQ HmcFas1/vYRQ+cPX0JocCGiyE76YF59mLVJj8PTteRP/7+qYI0NDfwsBk8SgdGWsipWr VUq4fNx/1tuvcwpoJFpr/cBuYl45i+eF9ndbXn0d2Zhc2YYu5cNzCLfWFC547nOvJeSC jLjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032986; x=1711637786; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DPOk29tp9hSaHHd7ex7d+x3CJBUfHDyKeW57FXsBWGs=; b=At5Jpuep5y4u6L6mYIvc2Kv9qjOzBZOmSzBEhqWEMCV3nSIk1O02URw0ZS0JZ+x8/q Esj5ORQHgaP7w3mP47HEdG3dOuTl24IGGDED+g44IwSKX0QyT+S24aMxiqbuspSL7Tp+ m722OnMMAzYYKQVQMor5e4SN4+eGdKAF3ZDnv3pqq12YMlTrTNLsz2yJ1HnZ9fwrlSYa NyKe7ECdEVLdXZ9b5FTsAyroZrxvZvRu8i/xW73oIISpt0ZI1aGgMhODNk1DwjGLAHjM IL+l8JFYTzfsZC7e05HIe6kH+WgVWlhWSnnkJnylIWqr2C0BA02ofjq7kF0X+dzNn5Tk u9wA== X-Gm-Message-State: AOJu0YzexyDAd6I1F/wKiwYL9GknnXGxGPg4ijVYJpHIfRdudcmjYMr/ xMwHS410uIDQ5QPcjKv3N9MNbS+P/As+/kQ8zhyW2xy++/IHemi/hmCFl3XHqcejYuffsWinwGS W X-Received: by 2002:a17:902:c949:b0:1dd:819f:9503 with SMTP id i9-20020a170902c94900b001dd819f9503mr10750524pla.12.1711032986220; Thu, 21 Mar 2024 07:56:26 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:25 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 10/11] imx8mp_venice_defconfig: Enable PCIe/NVMe support Date: Thu, 21 Mar 2024 20:25:06 +0530 Message-Id: <20240321145507.619448-11-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Tim Harvey Enable PCIe/NVMe support. Also, enable the reset, regmap and syscon drivers which are a prerequisite for PCIe support. Signed-off-by: Tim Harvey [SG: rebased to next branch tip] Signed-off-by: Sumit Garg --- configs/imx8mp_venice_defconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configs/imx8mp_venice_defconfig b/configs/imx8mp_venice_defconfig index 501ccb0ba8f..6e4addc7728 100644 --- a/configs/imx8mp_venice_defconfig +++ b/configs/imx8mp_venice_defconfig @@ -12,6 +12,7 @@ CONFIG_DEFAULT_DEVICE_TREE="freescale/imx8mp-venice-gw71xx-2x" CONFIG_SPL_TEXT_BASE=0x920000 CONFIG_TARGET_IMX8MP_VENICE=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_DM_RESET=y CONFIG_SYS_MONITOR_LEN=524288 CONFIG_SPL_MMC=y CONFIG_SPL_SERIAL=y @@ -21,6 +22,7 @@ CONFIG_SPL=y CONFIG_ENV_OFFSET_REDUND=0x3f8000 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000 CONFIG_SYS_LOAD_ADDR=0x40480000 +CONFIG_PCI=y CONFIG_SYS_MEMTEST_START=0x40000000 CONFIG_SYS_MEMTEST_END=0x80000000 CONFIG_FIT=y @@ -63,6 +65,7 @@ CONFIG_CMD_FUSE=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y +CONFIG_CMD_PCI=y CONFIG_CMD_USB=y CONFIG_SYS_DISABLE_AUTOLOAD=y CONFIG_CMD_CACHE=y @@ -84,6 +87,8 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_IP_DEFRAG=y CONFIG_TFTP_BLOCKSIZE=4096 CONFIG_SPL_DM=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y CONFIG_CLK_COMPOSITE_CCF=y CONFIG_CLK_IMX8MP=y CONFIG_GPIO_HOG=y @@ -112,7 +117,10 @@ CONFIG_FEC_MXC=y CONFIG_KSZ9477=y CONFIG_RGMII=y CONFIG_MII=y +CONFIG_NVME_PCI=y +CONFIG_PCIE_DW_IMX=y CONFIG_PHY_IMX8MQ_USB=y +CONFIG_PHY_IMX8M_PCIE=y CONFIG_PINCTRL=y CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_IMX8M=y From patchwork Thu Mar 21 14:55:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 781558 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp872841wrj; Thu, 21 Mar 2024 07:57:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV24xQcMT1rKyzzL1Rk1br5ROZrwhF2/QfvMJ0u4lY4/WSXY9I2ueWswEpns+GKK6GiAdP6PGsqAYeQuxJw4RDl X-Google-Smtp-Source: AGHT+IEFy/eGEufRTJzXApacyBVhfSdP8owaQEfuMeDY88n6+ttHmWjlv1rdlaBwSCr/FSLOKVx9 X-Received: by 2002:a2e:9810:0:b0:2d4:5d44:fe1d with SMTP id a16-20020a2e9810000000b002d45d44fe1dmr1621756ljj.52.1711033039107; Thu, 21 Mar 2024 07:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711033039; cv=none; d=google.com; s=arc-20160816; b=x6pDBB3/uwRhSIVNpoNF3KwoFMW9CeiFGW6e3FuWgZuu1Zi+EhEZjNF/TMNsxYqGym 9u9Z5Zaeb/9i/bKOs/gnhkWAbeIIe/sa0sxzwwwySOI6BhuU++zqTJ4ER2bQF4+owwPt j8/cxCWlK45J36ox/ivnIK14TBqwLl6pTXx60WezDtLhBKF8fvHFvNt+Bp/3gkQ0A5h7 /tbvNpHhNyWA7/CaHOPiFvCCcpP2CYtxDAeXInUa0SIGjb+1KDPfXPFA+wLNWLEvZJ/w Zmz7I1TDsG6umTZilJMUQ6t7I1SotC/Fy5zJk2ZpHBIMNEeuG855x1xg7gtOt0WG0Rbu Sf6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DE3g6t51eUKFdWjCnl+qh3aKrNAc8k4gkwbwvC1c8Gs=; fh=WJZelecVwJYi3XoomUSIfm84sWVa8M+dwDiKdtbDIHo=; b=AmTC62bmRrjfDbp2/s7yUZVsrYKH1eyseE0RgcVAERsZSC9bvT8ymAa95M6a1MkSzN 9I843xse1f6VzGkf+cpJotORUjGmwpqWFo5Harzm172JbjqIdTh083OellUEo/t9doYF 4GOsw+2S6AwYe9aRXD+MblpvG2rtHkJ/G5+7pIN9mLZX1YnZI613ZzfQkO6lqlqbDNEZ kzjkgzhG259/CztMJDtmfKFQlqZkSu22AgAq/76klLtElyFUi5rsqa/OqSJ3VHJsPKms 5qz5tTrtD1hAi9xWry3X99Ed1XHbYaCa150PUqvs5kGlCQOPCAS992lGos2zsOFh1M/Y wvwQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MsQAqG4H; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id m5-20020a05600c3b0500b00413f7c8f195si2369488wms.196.2024.03.21.07.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:57:19 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MsQAqG4H; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58A2B8811E; Thu, 21 Mar 2024 15:56:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="MsQAqG4H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B3407880F9; Thu, 21 Mar 2024 15:56:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 81CFC8811D for ; Thu, 21 Mar 2024 15:56:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1e0000cdf99so7638025ad.0 for ; Thu, 21 Mar 2024 07:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711032993; x=1711637793; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DE3g6t51eUKFdWjCnl+qh3aKrNAc8k4gkwbwvC1c8Gs=; b=MsQAqG4HyqA7zW4dRFoWdO3S4QzLcTA7NK4irhvDwp+/uMnetRldGYYQO8xzDvvYpR qjH7I4vN09AdxhFa860JlZK5zGm3pOHZIkCUtQkd2/6gFFrXzocFw2aow9o3VoVgOooP Yl3Bh9P7BGNDANZVrK4EWhahqQNjqcUmR5ZZtR4dJu/CC9I/UHvJkG1Nv+El/8dA0Tiu GaIJ0vUQ5MtGLgRuiHsyxQcTF9Ii94QxS9kO0zFF2I3MD8/39J3/jY4FQPzar++mLQep v66nTiTzvd09QnfWP0Zf89E6pLeAdXt3HFd/9k7B8SxAL28EplT9j7/NMcQXEYT5BMC4 SbIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711032993; x=1711637793; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DE3g6t51eUKFdWjCnl+qh3aKrNAc8k4gkwbwvC1c8Gs=; b=p7ZAaSZ3lVEqiRkADgny/ulS80vXjIhv02JqfGjKC4mqWor/oSKtEDKANKooYcXX1L 67tgiG/zQkN7gGp4AA9cS5PHdz3PKNraQdXScvQgwTBQL+c2tzJjWmR8KTNtozojszAj hxb1sNWDdDQiNpEGv1M8RcLsm679CPDaHSQDjwk0NA19nBXL2qd0ew4jUpM7yMZCASo5 xrPg86kGQ9rVKMl+CzBy+X8NrOPSBydVkWqPpzpGLrXdUy+qeTsezex90tneQy6sSZ8r O50f6U5Ej/Ld8RbIMgegeW78K/cegUyX1CGmMJ2R1O5TUV+wU8C6auxEXCHnHgZ7E3rZ MhsA== X-Gm-Message-State: AOJu0YwTLZehYDWmYyMJ3sTeH2ys2EGMEDtPJRKvBPWMscxZ18s5jEfL VSZKjRyNfecQYPANrmw8rutHEL7Y9y/LDZwc2holiG8HXZcF0btiCyVOMJwF0cLFnFy+F37ysKw 1 X-Received: by 2002:a17:902:ea0b:b0:1df:fbc3:d131 with SMTP id s11-20020a170902ea0b00b001dffbc3d131mr2721436plg.27.1711032992704; Thu, 21 Mar 2024 07:56:32 -0700 (PDT) Received: from sumit-X1.. ([223.178.211.159]) by smtp.gmail.com with ESMTPSA id j9-20020a170902da8900b001dddb014624sm11751668plx.54.2024.03.21.07.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:56:32 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: trini@konsulko.com, tharvey@gateworks.com, marcel.ziswiler@toradex.com, francesco@dolcini.it, lukma@denx.de, seanga2@gmail.com, jh80.chung@samsung.com, sjg@chromium.org, festevam@denx.de, andrejs.cainikovs@toradex.com, peng.fan@nxp.com, aford173@gmail.com, marex@denx.de, ilias.apalodimas@linaro.org, sahaj.sarup@linaro.org, fathi.boudra@linaro.org, remi.duraffort@linaro.org, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v4 11/11] MAINTAINERS: Add entry for PCIe DWC IMX driver Date: Thu, 21 Mar 2024 20:25:07 +0530 Message-Id: <20240321145507.619448-12-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321145507.619448-1-sumit.garg@linaro.org> References: <20240321145507.619448-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add myself as maintainer for PCIe DWC IMX driver support. Acked-by: Marek Vasut Signed-off-by: Sumit Garg --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8b316c8550e..83fd68e3f39 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1371,6 +1371,12 @@ M: Simon Glass S: Maintained F: tools/patman/ +PCIe DWC IMX +M: Sumit Garg +S: Maintained +F: drivers/pci/pcie_dw_imx.c +F: drivers/phy/phy-imx8m-pcie.c + PCI Endpoint M: Ramon Fried S: Maintained