From patchwork Fri Mar 24 08:04:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 666550 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp448983wrt; Fri, 24 Mar 2023 05:55:23 -0700 (PDT) Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mCu1e3dX X-Google-Smtp-Source: AKy350YMixs/3DwUSpM+aDQUaXlU7hEvUGg4FQG+knZ7YIVDiXPiSkViJ5LLAfehLfxEvlUIGj1v X-Received: by 2002:a17:90b:4f48:b0:22c:59c3:8694 with SMTP id pj8-20020a17090b4f4800b0022c59c38694mr2778580pjb.44.1679662522946; Fri, 24 Mar 2023 05:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679662522; cv=none; d=google.com; s=arc-20160816; b=I2EXiBkfLIN8uZjGJGUOy0ax/RvtJnWEemhAWp9tSClRdxyH1BF6jQzFnlFZUaqeno ZHAOH3VufZtnLVQTRXg5o5lQemoyD6g7U58MEKh+9cNwdLKnSUpVb7sUsROg9vChqhdq HHCpSyMJp8X23iUIu95IqGJw20G2jKgCYAQZ7Veg2Xhq9rR0rV101LGrV10g0wwyFTAB O3OqQxLYzPIQbfw4HJASJCXMEyGYe89Mfsc0c++X/mDAZ3dH1nub6PDslPlV0z5O7HAb pIJHl90Jg4gilRLMx17nD3k/6AYxUwoIvJRETG6BtTnghwgAoHT+QAyCVKoM5G7wxoz8 3lGw== 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=CQQdA9Om6YD/3xAO6TZHnFWc5oopFpeCfxoHtNPhIhQ=; b=MxR4LQhkdk+XiYTwDihxRxBuER/gQspI7cH2rhHV3/GuPsFVgcGGUVd34n3tTDJZVq cdMxW/gvoYmA9L1Pt4Fq8NdWR+7Rg++WFvPo0kaEBQ5tAhcifY71tmsZDdsP+9Op9Q6o gmc572Ndo2tZ0o01f9xkMLtWC6M3VSIXkjdhyc2q915yrjeBPqdZOjms2/JCm4Jz+yLs KDjte2eNriekE3MKtHI4E6URYFySqgYDw7//CkD2agLJSN/iGwVQv0BysDMZYXfJ0VxN g2vwAe8VycCMs06+andc1AVR5HFIX49FhYBd8jaidY8e3kUzhGDRgDBn8R3wFi9p2PbN vRUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mCu1e3dX; 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 b18-20020a17090ae39200b0023d2b3ac7a2si4134413pjz.60.2023.03.24.05.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 05:55:22 -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=mCu1e3dX; 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 CC48885D6B; Fri, 24 Mar 2023 13:54:56 +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="mCu1e3dX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DDDFC859E5; Fri, 24 Mar 2023 09:05:20 +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, UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (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 3E3F4859B4 for ; Fri, 24 Mar 2023 09:05: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=bhupesh.sharma@linaro.org Received: by mail-pj1-x1029.google.com with SMTP id q102so869352pjq.3 for ; Fri, 24 Mar 2023 01:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679645116; 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=CQQdA9Om6YD/3xAO6TZHnFWc5oopFpeCfxoHtNPhIhQ=; b=mCu1e3dXlSmo1xdjWB06Z4qTUAK3+b6lGbAlldnam8zTZvPh6pJOolV//6I6dbywY7 By4YOzBLZ1YDJOUKZq98RwU2kzu7ypE9LmfJcikxxHcmhH33TLcPLeQit1/kbfbiqQhl qKSOGG/xChYrIIskvlfyrqgB+4zREFjs/BglH46uKhJcKH6PUzSmYNUKn6s4UEkea/F0 eejw9teLaRt+sYMWPFR3wKOJMCtPEfv4fOVcIz0/FbbhG28zvF1j6lDI4eje0VG6lrpG gVrBF+qrY+GzJCaVznPa+HMduiS3oadQqU/HKhVAveFIi97l0u6CBeSJ/asYfCAjrZ3U H+Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679645116; 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=CQQdA9Om6YD/3xAO6TZHnFWc5oopFpeCfxoHtNPhIhQ=; b=kw3Dbdw5V+ripDWb+MpLOaiAcBPIJJxmqx2O9QTbgafddRH1vhVnOGQV7Q5CkkIwl4 u3Us/BQIAL+VpK/D0plQzAzUG6EKFip3TPiLSb52hau+kk/4XVpCJDFVOOifGyZ04z+U Wt36AH2tCvoPtIalR4U+DH18ry+7B2Tv5pYmWnq0m5y6r3INskDRzwIUziFfideDk5ha x1AIU4vI78HGEM9AmWXk36Xl9pzH5ioMYiW50joOy8PbwF8kCU1NeHgkNH3Fbo+aa/1e H+MBoU0MR/nfJbABt0dc0J282FOXY5QP1D+U+v7Sqemi66e6l6G1alJIyj6vaa6hWEoT gAgw== X-Gm-Message-State: AAQBX9dLZM7aYCO6OgqM9lDwP9fzJXvpfBSJJPClakyBb/3caG0DK1cw uI651aYljYi3Swlx6v94OrwZKrUsJV86MLl2CVk= X-Received: by 2002:a17:903:3013:b0:1a0:437c:4e82 with SMTP id o19-20020a170903301300b001a0437c4e82mr1550261pla.13.1679645116232; Fri, 24 Mar 2023 01:05:16 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:1c60:d4c3:8671:83c0:33ae:5a96]) by smtp.gmail.com with ESMTPSA id s22-20020a170902989600b001a04a372fa0sm12205293plp.251.2023.03.24.01.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 01:05:15 -0700 (PDT) From: Bhupesh Sharma To: u-boot@lists.denx.de Cc: jh80.chung@samsung.com, peng.fan@nxp.com, rfried.dev@gmail.com, sjg@chromium.org, trini@konsulko.com, dsankouski@gmail.com, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org Subject: [PATCH 1/5] dt-bindings: clock: Import qcom,gcc-sm6115.h Date: Fri, 24 Mar 2023 13:34:14 +0530 Message-Id: <20230324080418.3856409-2-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> References: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 24 Mar 2023 13:54:51 +0100 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 Import qcom,gcc-sm6115.h from Linux to allow standard macros to be used as clock ids. Signed-off-by: Bhupesh Sharma --- include/dt-bindings/clock/qcom,gcc-sm6115.h | 201 ++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h diff --git a/include/dt-bindings/clock/qcom,gcc-sm6115.h b/include/dt-bindings/clock/qcom,gcc-sm6115.h new file mode 100644 index 0000000000..b91a7b4604 --- /dev/null +++ b/include/dt-bindings/clock/qcom,gcc-sm6115.h @@ -0,0 +1,201 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. + */ + +#ifndef _DT_BINDINGS_CLK_QCOM_GCC_SM6115_H +#define _DT_BINDINGS_CLK_QCOM_GCC_SM6115_H + +/* GCC clocks */ +#define GPLL0 0 +#define GPLL0_OUT_AUX2 1 +#define GPLL0_OUT_MAIN 2 +#define GPLL10 3 +#define GPLL10_OUT_MAIN 4 +#define GPLL11 5 +#define GPLL11_OUT_MAIN 6 +#define GPLL3 7 +#define GPLL4 8 +#define GPLL4_OUT_MAIN 9 +#define GPLL6 10 +#define GPLL6_OUT_MAIN 11 +#define GPLL7 12 +#define GPLL7_OUT_MAIN 13 +#define GPLL8 14 +#define GPLL8_OUT_MAIN 15 +#define GPLL9 16 +#define GPLL9_OUT_MAIN 17 +#define GCC_CAMSS_CSI0PHYTIMER_CLK 18 +#define GCC_CAMSS_CSI0PHYTIMER_CLK_SRC 19 +#define GCC_CAMSS_CSI1PHYTIMER_CLK 20 +#define GCC_CAMSS_CSI1PHYTIMER_CLK_SRC 21 +#define GCC_CAMSS_CSI2PHYTIMER_CLK 22 +#define GCC_CAMSS_CSI2PHYTIMER_CLK_SRC 23 +#define GCC_CAMSS_MCLK0_CLK 24 +#define GCC_CAMSS_MCLK0_CLK_SRC 25 +#define GCC_CAMSS_MCLK1_CLK 26 +#define GCC_CAMSS_MCLK1_CLK_SRC 27 +#define GCC_CAMSS_MCLK2_CLK 28 +#define GCC_CAMSS_MCLK2_CLK_SRC 29 +#define GCC_CAMSS_MCLK3_CLK 30 +#define GCC_CAMSS_MCLK3_CLK_SRC 31 +#define GCC_CAMSS_NRT_AXI_CLK 32 +#define GCC_CAMSS_OPE_AHB_CLK 33 +#define GCC_CAMSS_OPE_AHB_CLK_SRC 34 +#define GCC_CAMSS_OPE_CLK 35 +#define GCC_CAMSS_OPE_CLK_SRC 36 +#define GCC_CAMSS_RT_AXI_CLK 37 +#define GCC_CAMSS_TFE_0_CLK 38 +#define GCC_CAMSS_TFE_0_CLK_SRC 39 +#define GCC_CAMSS_TFE_0_CPHY_RX_CLK 40 +#define GCC_CAMSS_TFE_0_CSID_CLK 41 +#define GCC_CAMSS_TFE_0_CSID_CLK_SRC 42 +#define GCC_CAMSS_TFE_1_CLK 43 +#define GCC_CAMSS_TFE_1_CLK_SRC 44 +#define GCC_CAMSS_TFE_1_CPHY_RX_CLK 45 +#define GCC_CAMSS_TFE_1_CSID_CLK 46 +#define GCC_CAMSS_TFE_1_CSID_CLK_SRC 47 +#define GCC_CAMSS_TFE_2_CLK 48 +#define GCC_CAMSS_TFE_2_CLK_SRC 49 +#define GCC_CAMSS_TFE_2_CPHY_RX_CLK 50 +#define GCC_CAMSS_TFE_2_CSID_CLK 51 +#define GCC_CAMSS_TFE_2_CSID_CLK_SRC 52 +#define GCC_CAMSS_TFE_CPHY_RX_CLK_SRC 53 +#define GCC_CAMSS_TOP_AHB_CLK 54 +#define GCC_CAMSS_TOP_AHB_CLK_SRC 55 +#define GCC_CFG_NOC_USB3_PRIM_AXI_CLK 56 +#define GCC_CPUSS_AHB_CLK 57 +#define GCC_CPUSS_GNOC_CLK 60 +#define GCC_DISP_AHB_CLK 61 +#define GCC_DISP_GPLL0_DIV_CLK_SRC 62 +#define GCC_DISP_HF_AXI_CLK 63 +#define GCC_DISP_THROTTLE_CORE_CLK 64 +#define GCC_DISP_XO_CLK 65 +#define GCC_GP1_CLK 66 +#define GCC_GP1_CLK_SRC 67 +#define GCC_GP2_CLK 68 +#define GCC_GP2_CLK_SRC 69 +#define GCC_GP3_CLK 70 +#define GCC_GP3_CLK_SRC 71 +#define GCC_GPU_CFG_AHB_CLK 72 +#define GCC_GPU_GPLL0_CLK_SRC 73 +#define GCC_GPU_GPLL0_DIV_CLK_SRC 74 +#define GCC_GPU_IREF_CLK 75 +#define GCC_GPU_MEMNOC_GFX_CLK 76 +#define GCC_GPU_SNOC_DVM_GFX_CLK 77 +#define GCC_GPU_THROTTLE_CORE_CLK 78 +#define GCC_GPU_THROTTLE_XO_CLK 79 +#define GCC_PDM2_CLK 80 +#define GCC_PDM2_CLK_SRC 81 +#define GCC_PDM_AHB_CLK 82 +#define GCC_PDM_XO4_CLK 83 +#define GCC_PRNG_AHB_CLK 84 +#define GCC_QMIP_CAMERA_NRT_AHB_CLK 85 +#define GCC_QMIP_CAMERA_RT_AHB_CLK 86 +#define GCC_QMIP_DISP_AHB_CLK 87 +#define GCC_QMIP_GPU_CFG_AHB_CLK 88 +#define GCC_QMIP_VIDEO_VCODEC_AHB_CLK 89 +#define GCC_QUPV3_WRAP0_CORE_2X_CLK 90 +#define GCC_QUPV3_WRAP0_CORE_CLK 91 +#define GCC_QUPV3_WRAP0_S0_CLK 92 +#define GCC_QUPV3_WRAP0_S0_CLK_SRC 93 +#define GCC_QUPV3_WRAP0_S1_CLK 94 +#define GCC_QUPV3_WRAP0_S1_CLK_SRC 95 +#define GCC_QUPV3_WRAP0_S2_CLK 96 +#define GCC_QUPV3_WRAP0_S2_CLK_SRC 97 +#define GCC_QUPV3_WRAP0_S3_CLK 98 +#define GCC_QUPV3_WRAP0_S3_CLK_SRC 99 +#define GCC_QUPV3_WRAP0_S4_CLK 100 +#define GCC_QUPV3_WRAP0_S4_CLK_SRC 101 +#define GCC_QUPV3_WRAP0_S5_CLK 102 +#define GCC_QUPV3_WRAP0_S5_CLK_SRC 103 +#define GCC_QUPV3_WRAP_0_M_AHB_CLK 104 +#define GCC_QUPV3_WRAP_0_S_AHB_CLK 105 +#define GCC_SDCC1_AHB_CLK 106 +#define GCC_SDCC1_APPS_CLK 107 +#define GCC_SDCC1_APPS_CLK_SRC 108 +#define GCC_SDCC1_ICE_CORE_CLK 109 +#define GCC_SDCC1_ICE_CORE_CLK_SRC 110 +#define GCC_SDCC2_AHB_CLK 111 +#define GCC_SDCC2_APPS_CLK 112 +#define GCC_SDCC2_APPS_CLK_SRC 113 +#define GCC_SYS_NOC_CPUSS_AHB_CLK 114 +#define GCC_SYS_NOC_UFS_PHY_AXI_CLK 115 +#define GCC_SYS_NOC_USB3_PRIM_AXI_CLK 116 +#define GCC_UFS_PHY_AHB_CLK 117 +#define GCC_UFS_PHY_AXI_CLK 118 +#define GCC_UFS_PHY_AXI_CLK_SRC 119 +#define GCC_UFS_PHY_ICE_CORE_CLK 120 +#define GCC_UFS_PHY_ICE_CORE_CLK_SRC 121 +#define GCC_UFS_PHY_PHY_AUX_CLK 122 +#define GCC_UFS_PHY_PHY_AUX_CLK_SRC 123 +#define GCC_UFS_PHY_RX_SYMBOL_0_CLK 124 +#define GCC_UFS_PHY_TX_SYMBOL_0_CLK 125 +#define GCC_UFS_PHY_UNIPRO_CORE_CLK 126 +#define GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC 127 +#define GCC_USB30_PRIM_MASTER_CLK 128 +#define GCC_USB30_PRIM_MASTER_CLK_SRC 129 +#define GCC_USB30_PRIM_MOCK_UTMI_CLK 130 +#define GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC 131 +#define GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC 132 +#define GCC_USB30_PRIM_SLEEP_CLK 133 +#define GCC_USB3_PRIM_CLKREF_CLK 134 +#define GCC_USB3_PRIM_PHY_AUX_CLK_SRC 135 +#define GCC_USB3_PRIM_PHY_COM_AUX_CLK 136 +#define GCC_USB3_PRIM_PHY_PIPE_CLK 137 +#define GCC_VCODEC0_AXI_CLK 138 +#define GCC_VENUS_AHB_CLK 139 +#define GCC_VENUS_CTL_AXI_CLK 140 +#define GCC_VIDEO_AHB_CLK 141 +#define GCC_VIDEO_AXI0_CLK 142 +#define GCC_VIDEO_THROTTLE_CORE_CLK 143 +#define GCC_VIDEO_VCODEC0_SYS_CLK 144 +#define GCC_VIDEO_VENUS_CLK_SRC 145 +#define GCC_VIDEO_VENUS_CTL_CLK 146 +#define GCC_VIDEO_XO_CLK 147 +#define GCC_AHB2PHY_CSI_CLK 148 +#define GCC_AHB2PHY_USB_CLK 149 +#define GCC_BIMC_GPU_AXI_CLK 150 +#define GCC_BOOT_ROM_AHB_CLK 151 +#define GCC_CAM_THROTTLE_NRT_CLK 152 +#define GCC_CAM_THROTTLE_RT_CLK 153 +#define GCC_CAMERA_AHB_CLK 154 +#define GCC_CAMERA_XO_CLK 155 +#define GCC_CAMSS_AXI_CLK 156 +#define GCC_CAMSS_AXI_CLK_SRC 157 +#define GCC_CAMSS_CAMNOC_ATB_CLK 158 +#define GCC_CAMSS_CAMNOC_NTS_XO_CLK 159 +#define GCC_CAMSS_CCI_0_CLK 160 +#define GCC_CAMSS_CCI_CLK_SRC 161 +#define GCC_CAMSS_CPHY_0_CLK 162 +#define GCC_CAMSS_CPHY_1_CLK 163 +#define GCC_CAMSS_CPHY_2_CLK 164 +#define GCC_UFS_CLKREF_CLK 165 +#define GCC_DISP_GPLL0_CLK_SRC 166 + +/* GCC resets */ +#define GCC_QUSB2PHY_PRIM_BCR 0 +#define GCC_QUSB2PHY_SEC_BCR 1 +#define GCC_SDCC1_BCR 2 +#define GCC_UFS_PHY_BCR 3 +#define GCC_USB30_PRIM_BCR 4 +#define GCC_USB_PHY_CFG_AHB2PHY_BCR 5 +#define GCC_VCODEC0_BCR 6 +#define GCC_VENUS_BCR 7 +#define GCC_VIDEO_INTERFACE_BCR 8 +#define GCC_USB3PHY_PHY_PRIM_SP0_BCR 9 +#define GCC_USB3_PHY_PRIM_SP0_BCR 10 +#define GCC_SDCC2_BCR 11 + +/* Indexes for GDSCs */ +#define GCC_CAMSS_TOP_GDSC 0 +#define GCC_UFS_PHY_GDSC 1 +#define GCC_USB30_PRIM_GDSC 2 +#define GCC_VCODEC0_GDSC 3 +#define GCC_VENUS_GDSC 4 +#define HLOS1_VOTE_TURING_MMU_TBU1_GDSC 5 +#define HLOS1_VOTE_TURING_MMU_TBU0_GDSC 6 +#define HLOS1_VOTE_MM_SNOC_MMU_TBU_RT_GDSC 7 +#define HLOS1_VOTE_MM_SNOC_MMU_TBU_NRT_GDSC 8 + +#endif From patchwork Fri Mar 24 08:04:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 666551 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp449064wrt; Fri, 24 Mar 2023 05:55:36 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2j2nlBwZFZzeDY9chrOvU1mr/dj2kum1YQoewraSx9PJmUcKL08HnExLx6zEjASo+Xs8C X-Received: by 2002:a17:902:e5c8:b0:19e:6eb0:a746 with SMTP id u8-20020a170902e5c800b0019e6eb0a746mr3370861plf.26.1679662536017; Fri, 24 Mar 2023 05:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679662536; cv=none; d=google.com; s=arc-20160816; b=0tgMUVwUR/jFsBN1JpySUyh3odC4nJvgoNA2sAPnmQQe+kBvVaS2D+l6kFA4w42s93 hUgESJ1h4J0EQ/XbsrOnKEsh/E42W/k+3dM5B1CuoHjb8OYlS4IfBq5N6SEFmSXAdFEX Sk8gB286oGAATwBeGvGBVCTGzJSNn9AFJkyQVcd2my5uZrr9mKpPgPkyOzazpg3FUgwF QGE3I+LGybGPFSeiOT1NOJoGL7kulVIT++qEaqVRueH4WDR1S2wp7HJzDcMEFKsZKzxS r0mSDl4v3CG3oAN4qhaixusptE7GMhV8gRl1kdJ0nMue2im6hsYOdCkjb0s4svIk2WPv 9ICg== 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=ioVYMBh4j7uqvv+MuFxSY2BovmrwF/L2CJ1l1ip2cIE=; b=ukZzPz1PAiUrSJp0q4+fcBBgG7Sl+9YPkplVtgWJnq7JC7ndKwbc4TA05Z87W42t/N nG5UfgT6W3/kn7DRCn7LItWXJ8brytMC6/du7mrhXlGfKuR9nFS75eVPKtS4noYKS4vo +GoA9FIiPnbZt9KFiSO6mdz27Bl1IoYgJaOQT1Z/o+MG0qz12cj0LvvfdXR+Ym/qp9F7 EXO5K9LpdFxVNWLJuhDMjeQxIZ/QhRs9MM4X+hxxBX4hlOh7Ii8wo51xAIN2b1HcT724 Lx9EoxWIhLC05QA+DrJNcXXJ5T8zoYr1edOIZQ9Ygeg9gcnWUCaw+oQqsAmI6zIjTD4F mCaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nVPDkQBr; 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 d10-20020a170902aa8a00b00194dd9cb062si20444115plr.396.2023.03.24.05.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 05:55:35 -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=nVPDkQBr; 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 622AB85D94; Fri, 24 Mar 2023 13:54:58 +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="nVPDkQBr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFBB185D38; Fri, 24 Mar 2023 09:05:24 +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 autolearn=ham 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 DC772859E5 for ; Fri, 24 Mar 2023 09:05: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=bhupesh.sharma@linaro.org Received: by mail-pl1-x635.google.com with SMTP id iw3so1150936plb.6 for ; Fri, 24 Mar 2023 01:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679645120; 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=ioVYMBh4j7uqvv+MuFxSY2BovmrwF/L2CJ1l1ip2cIE=; b=nVPDkQBrmzRhVsHWxNJ4ivRIeQvmyeQmD0BIpgd38aPdC/6yWJkQQnV914kDG1Pt+B PqqvfU/62STBuNi6L1dNLcECz6Hg1tCBeNs6EZ8cd5SL7rP7LIt6FKt1lqEe7WsgMEyG KJayMyB5K9zmje6rVfKPuj+a3f1xUmudEZtXvIoIn49PwqBtIuWJkjFggSdMiEnBsQwX PsD6KuuUBFiWxy9wSUoHlgpvNcsAH580Pg9yb7C+C2ozX/SNIENtEH6jWA4jE3b1rhB8 1/632L9VhCGwUQyyrHNTc00ni1HM6OhbzFUiKxDlZg1wKiJJvRLQIROMD9gLmtZEsGzG VXrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679645120; 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=ioVYMBh4j7uqvv+MuFxSY2BovmrwF/L2CJ1l1ip2cIE=; b=a/dafbNlwRdNUSqQpYFzB5hfJjb1/P3m2OFFqIYtsNqKcm7giEwXsObqc2pXuGqVmc h4Tmllje/78E3sPNfENb2aUVj3eysFRXLsoYb2doUTsJUUzgW5FMfB8Slk0hp3voyXsF mZSR+cPK5Mweeol/KtcsNYW/ZxQzE6ipYtKvsMsfvBBT7Ut6zSbQzwaW8nXF2MFGsylY RQ7kIn/m6Ivg6qfX4uiQzpysNFigamSS/WynVI7fcN2tZ1ymdZQtOKqKtpAWrDIx2quN a0RPrAuO1tEqwnnIwxhsgiGgAUAsMKOLZKS6McRuu4Js+hfOvwRVOayXuv6nTkfsWxDQ XJzA== X-Gm-Message-State: AAQBX9dHWnOlCcKxibnu2pbpE73q7G9qhqeiyBNy7apHpHj1ppWzU3fK BsSjtLyrn12KuSsx8Csm/B4Aqm6pMZmC7lU6F1k= X-Received: by 2002:a17:902:ea06:b0:1a2:7d:17ea with SMTP id s6-20020a170902ea0600b001a2007d17eamr2306340plg.56.1679645119892; Fri, 24 Mar 2023 01:05:19 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:1c60:d4c3:8671:83c0:33ae:5a96]) by smtp.gmail.com with ESMTPSA id s22-20020a170902989600b001a04a372fa0sm12205293plp.251.2023.03.24.01.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 01:05:19 -0700 (PDT) From: Bhupesh Sharma To: u-boot@lists.denx.de Cc: jh80.chung@samsung.com, peng.fan@nxp.com, rfried.dev@gmail.com, sjg@chromium.org, trini@konsulko.com, dsankouski@gmail.com, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org Subject: [PATCH 2/5] clocks: qcom: Add clock driver for SM6115 SoC Date: Fri, 24 Mar 2023 13:34:15 +0530 Message-Id: <20230324080418.3856409-3-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> References: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 24 Mar 2023 13:54:51 +0100 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 Currently the SM6115 clock driver initializes clocks for debug UART only. Along with this import "qcom,gcc-sm6115.h" header from Linux mainline to support DT bindings. Signed-off-by: Bhupesh Sharma --- arch/arm/mach-snapdragon/Makefile | 1 + arch/arm/mach-snapdragon/clock-qrb4210-rb2.c | 110 +++++++++++++++++++ arch/arm/mach-snapdragon/clock-snapdragon.c | 1 + arch/arm/mach-snapdragon/clock-snapdragon.h | 2 + 4 files changed, 114 insertions(+) create mode 100644 arch/arm/mach-snapdragon/clock-qrb4210-rb2.c diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile index cbaaf23f6b..23aa1a974c 100644 --- a/arch/arm/mach-snapdragon/Makefile +++ b/arch/arm/mach-snapdragon/Makefile @@ -19,3 +19,4 @@ obj-y += pinctrl-qcs404.o obj-y += pinctrl-sdm845.o obj-$(CONFIG_TARGET_QCS404EVB) += clock-qcs404.o obj-$(CONFIG_TARGET_QCS404EVB) += sysmap-qcs404.o +obj-$(CONFIG_TARGET_QRB4210RB2) += clock-qrb4210-rb2.o diff --git a/arch/arm/mach-snapdragon/clock-qrb4210-rb2.c b/arch/arm/mach-snapdragon/clock-qrb4210-rb2.c new file mode 100644 index 0000000000..d67c69b320 --- /dev/null +++ b/arch/arm/mach-snapdragon/clock-qrb4210-rb2.c @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Clock drivers for Qualcomm SM6115 + * + * (C) Copyright 2023 Bhupesh Sharma + * + * Based on Kernel driver, simplified + */ + +#include +#include +#include +#include +#include +#include +#include +#include "clock-snapdragon.h" + +#include + +/* GPLL clock control registers */ +#define GPLL0_STATUS_ACTIVE BIT(31) + +#define GCC_GLOBAL_EN_BASE (0x84000) +#define GCC_CLOBAL_PERIPHERALS_EN BIT(5) + +#define GCC_APCS_CLOCK_BRANCH_ENA_VOTE_1 (0x7900C) + +#define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) } + +struct freq_tbl { + uint freq; + uint src; + u8 pre_div; + u16 m; + u16 n; +}; + +static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = { + F(7372800, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 384, 15625), + F(14745600, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 768, 15625), + F(19200000, CFG_CLK_SRC_CXO, 1, 0, 0), + F(29491200, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 1536, 15625), + F(32000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 8, 75), + F(48000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 4, 25), + F(64000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 16, 75), + F(75000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 4, 0, 0), + F(80000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 4, 15), + F(96000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 8, 25), + F(100000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 3, 0, 0), + F(102400000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 128, 375), + F(112000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 28, 75), + F(117964800, CFG_CLK_SRC_GPLL0_OUT_AUX2, 1, 6144, 15625), + F(120000000, CFG_CLK_SRC_GPLL0_OUT_AUX2, 2.5, 0, 0), + F(128000000, CFG_CLK_SRC_GPLL6_OUT_MAIN, 3, 0, 0), + { } +}; + +static const struct bcr_regs uart4_regs = { + .cfg_rcgr = UART4_APPS_CFG_RCGR, + .cmd_rcgr = UART4_APPS_CMD_RCGR, + .M = UART4_APPS_M, + .N = UART4_APPS_N, + .D = UART4_APPS_D, +}; + +const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f, uint rate) +{ + if (!f) + return NULL; + + if (!f->freq) + return f; + + for (; f->freq; f++) + if (rate <= f->freq) + return f; + + /* Default to our fastest rate */ + return f - 1; +} + +static int clk_init_uart(struct msm_clk_priv *priv, uint rate) +{ + const struct freq_tbl *freq = qcom_find_freq(ftbl_gcc_qupv3_wrap0_s0_clk_src, rate); + + clk_rcg_set_rate_mnd(priv->base, &uart4_regs, + freq->pre_div, freq->m, freq->n, freq->src); + + return 0; +} + +ulong msm_set_rate(struct clk *clk, ulong rate) +{ + struct msm_clk_priv *priv = dev_get_priv(clk->dev); + + switch (clk->id) { + case GCC_QUPV3_WRAP0_S4_CLK: /* UART4 */ + return clk_init_uart(priv, rate); + default: + return 0; + } + + return 0; +} + +int msm_enable(struct clk *clk) +{ + return 0; +} diff --git a/arch/arm/mach-snapdragon/clock-snapdragon.c b/arch/arm/mach-snapdragon/clock-snapdragon.c index 0ac45dce9a..f306fd5b20 100644 --- a/arch/arm/mach-snapdragon/clock-snapdragon.c +++ b/arch/arm/mach-snapdragon/clock-snapdragon.c @@ -167,6 +167,7 @@ static const struct udevice_id msm_clk_ids[] = { { .compatible = "qcom,gcc-msm8996" }, { .compatible = "qcom,gcc-apq8096" }, { .compatible = "qcom,gcc-sdm845" }, + { .compatible = "qcom,gcc-sm6115" }, { .compatible = "qcom,gcc-qcs404" }, { } }; diff --git a/arch/arm/mach-snapdragon/clock-snapdragon.h b/arch/arm/mach-snapdragon/clock-snapdragon.h index c90bbefa58..9e520dbbce 100644 --- a/arch/arm/mach-snapdragon/clock-snapdragon.h +++ b/arch/arm/mach-snapdragon/clock-snapdragon.h @@ -10,6 +10,8 @@ #define CFG_CLK_SRC_CXO (0 << 8) #define CFG_CLK_SRC_GPLL0 (1 << 8) #define CFG_CLK_SRC_GPLL0_EVEN (6 << 8) +#define CFG_CLK_SRC_GPLL0_OUT_AUX2 (2 << 8) +#define CFG_CLK_SRC_GPLL6_OUT_MAIN (4 << 8) #define CFG_CLK_SRC_MASK (7 << 8) struct pll_vote_clk { From patchwork Fri Mar 24 08:04:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 666552 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp449141wrt; Fri, 24 Mar 2023 05:55:49 -0700 (PDT) X-Google-Smtp-Source: AKy350aPkGO9EGkhbcoqgcIOOyba1Pzlxa1WR6QfMaoD9HNRBowe60vIP+cZaX4VBvg3eHX3JYkw X-Received: by 2002:a17:90b:1e49:b0:233:76bd:9faa with SMTP id pi9-20020a17090b1e4900b0023376bd9faamr2781727pjb.47.1679662549232; Fri, 24 Mar 2023 05:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679662549; cv=none; d=google.com; s=arc-20160816; b=mO8fdseuCR1Y3QZnyik/+suhhO1Ybo8kuh8om5i7pZxKltFG8fkTUA0FzE13LQTfTA 3cZZCx1gmjREZdQyDbaMK3mBmutSJILZgq+iKVF8V0KJcCinx7CM1XmHvPFkIKxAfWRG daDJ3QmtMa/AT3PHeyN8+yrweww+Dm8ufs26u/CbtQ5EAMtaqV83vLgh0re+vQOpX4dZ gwI8PMuc5eHHkxmLoWmkKpSmFZg7XdiYKssJLn5Q5PcWBII0Ek6/uHTsljqM5c3SWDte gkVnw55tglqBy9D6thsoIlEmPbR9T7/GZQ7uh41xcMk+HCHAf2zLGH7w06I1XKZqmAY3 63zg== 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=348CRDZrzAjDt5mi2CPA2bsJ5TsDLp9Xz9q6y4mKS4M=; b=HrjUeqSF4LZuccZNndKEEdDjU409XZiwfW1JevrYFe33hJCZYf0zgLYze1FhD/j2tB kJuEVs4pPACaQfcdV9TKK3dvIplWloD27llnVAq4tqW1wx7N1y1vstluLqm/Mj7Q+XRa e0CF4gbfLuB8H8XkTQzKeBI+DGgYpVBGE3hlWT75d8CQOOyhz5OEw4Jv3B8ZtoQlGaSC mxLEvGAHdzvoOMAIHCTd4h5SGhcNjS0qIviO2+2TTRyhZgyx1kxBg3jTpI3Z+7j79bzy W+mu8ODEoIb3t9kjPr7gSWEyTy6zvqopqKunmeuTihGeWzklZXMtmVx3GPXYoBaBlulp rkjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ff1TAbwy; 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 a18-20020a17090a8c1200b00230da5c13e3si4287436pjo.43.2023.03.24.05.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 05:55:49 -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=Ff1TAbwy; 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 63BBF85DAA; Fri, 24 Mar 2023 13:55: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="Ff1TAbwy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D350859B4; Fri, 24 Mar 2023 09:05:28 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (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 C24AB859B4 for ; Fri, 24 Mar 2023 09:05: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=bhupesh.sharma@linaro.org Received: by mail-pj1-x1034.google.com with SMTP id p13-20020a17090a284d00b0023d2e945aebso5288235pjf.0 for ; Fri, 24 Mar 2023 01:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679645124; 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=348CRDZrzAjDt5mi2CPA2bsJ5TsDLp9Xz9q6y4mKS4M=; b=Ff1TAbwynnYjqsydZacmmbTFduXsRqLJj5aJXpMwiUrRdU9qDo0HISij8jPXjqB8JU w6zqDUT8pQyNeXUGoGXfA2l9deREyc/70CFtKFrqD40Y4GKUkExCMbHS3WpxEWvjgtYL 0IquuyZpniGivev+YtJg23BRObBpuU/gVKDHdiZqbwdrW6W6PSPXtp5EBIvopT2jPbu4 jbsUdUCAi7oLvdGNkg03KlMfgppkR442NtVsUyD13m2XypQuUmgJyUsDDTYHku54dRgN /wuS4lQ9ElT0+CObcXGLYDQ1ram0SoCot1MkM5f0XDSmwKxOotT6WoNHSZld8KI9KVTD hGdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679645124; 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=348CRDZrzAjDt5mi2CPA2bsJ5TsDLp9Xz9q6y4mKS4M=; b=W2BlQ78NCMNy78gIaacpynMRokv/DGoki9DD9pYv5N3f/340MvG4rJgDUEkwhyZpgD fdAd9UEiizMqwyeU++UpT/UBPZZro87u0bt8jRR7VJOANyUyp1I3Evb5ro8NAZosi9D3 EqNyRtG2qKYbv3iOvqpQK7olQAJ96IHFFvDbb3/q4RJupNhyLnwHxEKy+4f/9faZEdLl 5B/Rx8Pr13XNY4keX1EtmaPFDuDesu6Ch4SNDFS/lxk21E+LDc5wdbgU4EAIisJU3cEX Er2BT6ZYgYCVdeJJIFzCVlzWT44MTh6mdyoJegpPdgzyGHXFB49ncBx4DyrCX2He6Z8G w9/w== X-Gm-Message-State: AAQBX9feCOJoPFErJffCbd4uJA8wSQSxCISV7DsiPGCxqAVYeIMVTVNC pc5Q5J2Usqrtyr+2u6BAL5hORhiGydrOlRcri/g= X-Received: by 2002:a17:903:11c8:b0:1a1:a790:c1e6 with SMTP id q8-20020a17090311c800b001a1a790c1e6mr2154203plh.46.1679645123765; Fri, 24 Mar 2023 01:05:23 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:1c60:d4c3:8671:83c0:33ae:5a96]) by smtp.gmail.com with ESMTPSA id s22-20020a170902989600b001a04a372fa0sm12205293plp.251.2023.03.24.01.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 01:05:23 -0700 (PDT) From: Bhupesh Sharma To: u-boot@lists.denx.de Cc: jh80.chung@samsung.com, peng.fan@nxp.com, rfried.dev@gmail.com, sjg@chromium.org, trini@konsulko.com, dsankouski@gmail.com, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org Subject: [PATCH 3/5] reset: qcom: Add support for SM6115 SoC reset table Date: Fri, 24 Mar 2023 13:34:16 +0530 Message-Id: <20230324080418.3856409-4-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> References: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 24 Mar 2023 13:54:51 +0100 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 Signed-off-by: Bhupesh Sharma --- drivers/reset/reset-qcom.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/reset/reset-qcom.c b/drivers/reset/reset-qcom.c index 94315e76d5..046d2c083b 100644 --- a/drivers/reset/reset-qcom.c +++ b/drivers/reset/reset-qcom.c @@ -131,6 +131,24 @@ static const struct qcom_reset_map gcc_qcom_resets[] = { }; #endif +#ifdef CONFIG_TARGET_QRB4210RB2 +#include +static const struct qcom_reset_map gcc_qcom_resets[] = { + [GCC_QUSB2PHY_PRIM_BCR] = { 0x1c000 }, + [GCC_QUSB2PHY_SEC_BCR] = { 0x1c004 }, + [GCC_SDCC1_BCR] = { 0x38000 }, + [GCC_SDCC2_BCR] = { 0x1e000 }, + [GCC_UFS_PHY_BCR] = { 0x45000 }, + [GCC_USB30_PRIM_BCR] = { 0x1a000 }, + [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x1d000 }, + [GCC_USB3PHY_PHY_PRIM_SP0_BCR] = { 0x1b008 }, + [GCC_USB3_PHY_PRIM_SP0_BCR] = { 0x1b000 }, + [GCC_VCODEC0_BCR] = { 0x58094 }, + [GCC_VENUS_BCR] = { 0x58078 }, + [GCC_VIDEO_INTERFACE_BCR] = { 0x6e000 }, +}; +#endif + static int qcom_reset_assert(struct reset_ctl *rst) { struct qcom_reset_priv *priv = dev_get_priv(rst->dev); From patchwork Fri Mar 24 08:04:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 666553 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp449225wrt; Fri, 24 Mar 2023 05:56:01 -0700 (PDT) X-Google-Smtp-Source: AKy350bIjY+GqM7Sp8xhkMtJZooM86pGbDYCqksGxYGFjcIDRUChmeyMZdy7ZjcGBdql1NMrXbmG X-Received: by 2002:a17:902:fa48:b0:1a2:1513:44bf with SMTP id lb8-20020a170902fa4800b001a2151344bfmr2375854plb.1.1679662561615; Fri, 24 Mar 2023 05:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679662561; cv=none; d=google.com; s=arc-20160816; b=VR7CYPCcGY/QUSh2HXewv6sjsn+XYtw1qERteosp27jo+qm18gc75VS79sPlcDWcID 8PHWCD/8YbpxnBs2Wa/x9pKeDrsyLNxEI2k+8L+Wa+EuZgysnYIPl5EKQp3WTmThu0jf dIvjYJUax+a9WOXYBenLrO/cp4/NFeBmK6oNXHRgVeHFvijFxxP6F9+kafDyb0w5PlOp o/4eH7r5zLqvX2EQdtZSpBKbCod5lOGXpVyaP5jY+c2AjsPsSxGqHjK9tbHtv7WlBNhF Q/V192h9AQvfbhPvc+Hq/9NYIRtG9VM/u15N4kMVuyIlMJZo8died9ZRGT57BN7AMzm7 gSvg== 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=5DJCYWdUzjDhq6fVFbLKKsDuY51xqKuy1CHbZaEYFUc=; b=xQOd8wYk2wUbbxzloVHMRnljUVzEULAlB/LzyrY7tweMIp0T2nDK/Pslz1XW01lp0F hBOxP/twtgnvsJBdm30reXQPFTaKZkDTWzkuT56RHE640T+iYbWMHiLrc06Jbarr5Ka/ m4LO+15qF0KfQYaP1Y1mvX0eD9F2Rtojy48RE/JgJP2l7L84fkuac4HoDnHrjQEr4rdv ddvI5M8Yf/pwlb7B248A5EjmZk2mhV6mcMOhpT+HYMIOBqKuvxWjF1ZssY/Csya77QMM sfLagwNhp4zxq7Etpjx7Gr4zeuQlPWZbUn27ZKVFhEKrJUjibpJiiP2Y1o1Z6kp9hTG0 ah7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UmLU/n/O"; 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 n8-20020a170902d2c800b0019a95ab6b4esi23126345plc.407.2023.03.24.05.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 05:56:01 -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="UmLU/n/O"; 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 99CB785DBD; Fri, 24 Mar 2023 13:55:06 +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="UmLU/n/O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 18ED6859E5; Fri, 24 Mar 2023 09:05:32 +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 autolearn=ham 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 6E57D859B4 for ; Fri, 24 Mar 2023 09:05: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=bhupesh.sharma@linaro.org Received: by mail-pl1-x62c.google.com with SMTP id k2so1142713pll.8 for ; Fri, 24 Mar 2023 01:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679645127; 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=5DJCYWdUzjDhq6fVFbLKKsDuY51xqKuy1CHbZaEYFUc=; b=UmLU/n/OtLAgeVL+5/fc9gguEYOS6PzIOtFF9EAfErTUsxbBMm8mW6RkUOvNGQAMuz ICDox9Nb+X5HGj+XaDQp85g2kuiBl6EsPAwGufnRSn/JlWjpD72w2afdnWsxbIK/bNAC sMHWDlk4EPNlNSex2/TOWbSwC62+lVgRcxpTgGrOA8ciKnxTcIQBqDtR+0oYRA1ATm6R wuoOUmdbOt/rhtloU3A9t5RqzprnZC8h+X0L76BhbgAz8RtOfEwOaG0w7N3Eh1/QKgV8 wWpxa+V9MU4WbCpp1poN+Q+Y2zGVZhLdFOuNm/fVQxKrYrtgdGfYsFjfBHLb8hkxZiuK Hwtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679645127; 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=5DJCYWdUzjDhq6fVFbLKKsDuY51xqKuy1CHbZaEYFUc=; b=gzkQDXhJL55IAno/AOooIWTJH9XeVBy95X1AN+zpt003lH77IOK2bSjT1394/h74/7 cRD683EqvMTfCrxEvZp5+zajCjlN+1YSwgBeqcNfZtlSHVcY4vBu4Bv/AjjjC/ZzzIaa DqNR2LSjibz0tq7ZFFUjSW39YCavNWmR9HITaPVB3BoZ1yBbmuGCGg9A5l2oNOhdAfY/ I9ow76cwquj3n2SatkG6X7A/VtXo9mTn80ENaNaYcTGdU2NVxW6WK0qb9MsKrTJZADJe h83vR9HIyLVbJvtg9moZuPVMTdUWjnpqgEwJbcc7lrl61FkYGNNdGwbWDNz4YkSybwQJ uKLg== X-Gm-Message-State: AAQBX9fTJeyieBFy73FhTZ3huzcuAYYw3t5W342PjPNlgx7jGyubuAd2 1gU5lI5JTtrFXfAHWDoVEHi+F/rvBW80nSKLzpE= X-Received: by 2002:a17:902:d485:b0:19f:3e33:b845 with SMTP id c5-20020a170902d48500b0019f3e33b845mr2037648plg.26.1679645127348; Fri, 24 Mar 2023 01:05:27 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:1c60:d4c3:8671:83c0:33ae:5a96]) by smtp.gmail.com with ESMTPSA id s22-20020a170902989600b001a04a372fa0sm12205293plp.251.2023.03.24.01.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 01:05:27 -0700 (PDT) From: Bhupesh Sharma To: u-boot@lists.denx.de Cc: jh80.chung@samsung.com, peng.fan@nxp.com, rfried.dev@gmail.com, sjg@chromium.org, trini@konsulko.com, dsankouski@gmail.com, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org Subject: [PATCH 4/5] pinctrl: qcom: Add pinctrl driver for SM6115 SoC Date: Fri, 24 Mar 2023 13:34:17 +0530 Message-Id: <20230324080418.3856409-5-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> References: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 24 Mar 2023 13:54:51 +0100 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 Currently this pinctrl driver only supports debug UART specific pin configuration. Signed-off-by: Bhupesh Sharma --- arch/arm/mach-snapdragon/Makefile | 1 + .../arm/mach-snapdragon/pinctrl-qrb4210-rb2.c | 59 +++++++++++++++++++ arch/arm/mach-snapdragon/pinctrl-snapdragon.c | 1 + arch/arm/mach-snapdragon/pinctrl-snapdragon.h | 1 + 4 files changed, 62 insertions(+) create mode 100644 arch/arm/mach-snapdragon/pinctrl-qrb4210-rb2.c diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile index 23aa1a974c..4ee6a3902e 100644 --- a/arch/arm/mach-snapdragon/Makefile +++ b/arch/arm/mach-snapdragon/Makefile @@ -16,6 +16,7 @@ obj-y += pinctrl-snapdragon.o obj-y += pinctrl-apq8016.o obj-y += pinctrl-apq8096.o obj-y += pinctrl-qcs404.o +obj-y += pinctrl-qrb4210-rb2.o obj-y += pinctrl-sdm845.o obj-$(CONFIG_TARGET_QCS404EVB) += clock-qcs404.o obj-$(CONFIG_TARGET_QCS404EVB) += sysmap-qcs404.o diff --git a/arch/arm/mach-snapdragon/pinctrl-qrb4210-rb2.c b/arch/arm/mach-snapdragon/pinctrl-qrb4210-rb2.c new file mode 100644 index 0000000000..a8ab67f20a --- /dev/null +++ b/arch/arm/mach-snapdragon/pinctrl-qrb4210-rb2.c @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm SM6115 pinctrl + * + * (C) Copyright 2023 Bhupesh Sharma + * + */ + +#include "pinctrl-snapdragon.h" +#include + +#define MAX_PIN_NAME_LEN 32 +static char pin_name[MAX_PIN_NAME_LEN] __section(".data"); + +static const char * const msm_pinctrl_pins[] = { + "UFS_RESET", + "SDC1_RCLK", + "SDC1_CLK", + "SDC1_CMD", + "SDC1_DATA", + "SDC2_CLK", + "SDC2_CMD", + "SDC2_DATA", +}; + +static const struct pinctrl_function msm_pinctrl_functions[] = { + {"qup4", 1}, + {"gpio", 0}, +}; + +static const char *sm6115_get_function_name(struct udevice *dev, + unsigned int selector) +{ + return msm_pinctrl_functions[selector].name; +} + +static const char *sm6115_get_pin_name(struct udevice *dev, + unsigned int selector) +{ + if (selector < 113) { + snprintf(pin_name, MAX_PIN_NAME_LEN, "GPIO_%u", selector); + return pin_name; + } else { + return msm_pinctrl_pins[selector - 113]; + } +} + +static unsigned int sm6115_get_function_mux(unsigned int selector) +{ + return msm_pinctrl_functions[selector].val; +} + +struct msm_pinctrl_data sm6115_data = { + .pin_count = 120, + .functions_count = ARRAY_SIZE(msm_pinctrl_functions), + .get_function_name = sm6115_get_function_name, + .get_function_mux = sm6115_get_function_mux, + .get_pin_name = sm6115_get_pin_name, +}; diff --git a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c index 826dc51486..e7efb5b29f 100644 --- a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c +++ b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c @@ -151,6 +151,7 @@ static const struct udevice_id msm_pinctrl_ids[] = { { .compatible = "qcom,msm8916-pinctrl", .data = (ulong)&apq8016_data }, { .compatible = "qcom,msm8996-pinctrl", .data = (ulong)&apq8096_data }, { .compatible = "qcom,sdm845-pinctrl", .data = (ulong)&sdm845_data }, + { .compatible = "qcom,sm6115-pinctrl", .data = (ulong)&sm6115_data }, { .compatible = "qcom,qcs404-pinctrl", .data = (ulong)&qcs404_data }, { } }; diff --git a/arch/arm/mach-snapdragon/pinctrl-snapdragon.h b/arch/arm/mach-snapdragon/pinctrl-snapdragon.h index 178ee01a41..7f543b0f5a 100644 --- a/arch/arm/mach-snapdragon/pinctrl-snapdragon.h +++ b/arch/arm/mach-snapdragon/pinctrl-snapdragon.h @@ -28,6 +28,7 @@ struct pinctrl_function { extern struct msm_pinctrl_data apq8016_data; extern struct msm_pinctrl_data apq8096_data; extern struct msm_pinctrl_data sdm845_data; +extern struct msm_pinctrl_data sm6115_data; extern struct msm_pinctrl_data qcs404_data; #endif From patchwork Fri Mar 24 08:04:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 666554 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp449326wrt; Fri, 24 Mar 2023 05:56:15 -0700 (PDT) X-Google-Smtp-Source: AKy350aqaLo9bsqhecCmKmrFNBd5CK7mV5PUmtSiNSjvNHZK2fXl6kGikI3dkk5ec14X5Tm0F9Ov X-Received: by 2002:a17:90b:388e:b0:23f:7c8c:4f2d with SMTP id mu14-20020a17090b388e00b0023f7c8c4f2dmr2846888pjb.16.1679662574843; Fri, 24 Mar 2023 05:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679662574; cv=none; d=google.com; s=arc-20160816; b=ChaKJbBUWkJclLSFthqO/oIxLoYT9AOht19SBPsY9GM47U41fOYtbev0Cts6kUM6+W FpQzKxvYjWWRTph3aQjLsfacnbbRwPW1G+o9KlBgVwibTug9W0zE2A2FPbcBcMNLC9Gg SkRR4VsR8HuliwsozI7BAPGffkpRU1V7vC3cLhehC9rgTtWL1dfggDM9bMi7rY7NxCYc DsGGX/z2F8+TSOh7IdrQ3E+R0V4uqSjmYlczH/dts5gcL4eH/JxUDxGy8SY4+IDxQRFW qK1L3+B/62V/GP5LGoHNv/MEWgxgiGC6xnLAZ7E3sTIc2Z9wVs0DQVxxPeli4tQB5+Bb XqWw== 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=JOX0rGQ6R6R9SZxzqhL5AgKyLDECJu7jQuA+oyluP6k=; b=z7CuM4S2iVDwfx2Y+OyVRav5TxMdeEnQ2Iuooa+yJ0j0vbKsJ68BBTmpUTsl0qJSXR lIckD1mFskNn326TBfwnrQbWpsDAZ5VP49bg8/WikzSZ7G0/UTDt0hR1UOzMH1s/phBu 8tw92kfGm5HcfZwbTKLb/ve1/iEEFYpFbfkuvYUiRDI4aDHynq8H+QWP2PQFU2q7lxwe OihO3sFnPRdwrqm8WQIY8Sdp6BVRsj2aPV5R21NocD0Npnlzm+DDNHEiv6sSbxlyN3BJ MYsxZd+kAEKMY+KnOk4tjBz4oJllJeBBc5NZ3anM3zqIL0aL+ZdUwdz/eefGIZwEOKEQ PNWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ADSFSxls; 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 lb4-20020a17090b4a4400b0023def94be5esi4644684pjb.20.2023.03.24.05.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 05:56:14 -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=ADSFSxls; 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 5EAFD85DA9; Fri, 24 Mar 2023 13:55:11 +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="ADSFSxls"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A0F2B859B4; Fri, 24 Mar 2023 09:05:37 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (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 0F00B859BC for ; Fri, 24 Mar 2023 09:05:33 +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=bhupesh.sharma@linaro.org Received: by mail-pj1-x1032.google.com with SMTP id j13so887598pjd.1 for ; Fri, 24 Mar 2023 01:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679645131; 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=JOX0rGQ6R6R9SZxzqhL5AgKyLDECJu7jQuA+oyluP6k=; b=ADSFSxlsCozcmdTPP80iOhLVD7h2MsFsRT5ZGXLlh6GlaY4Gtt2IF0hNQuHiRe36wl F6fvbkP1qnukjoDMOSCx6WYeSiQlxVTikNqAKbDKGegVWV70M72A6xlkajOAL8zmZ6Tn tGzRJ/ogIHbXKRjmKxRmX3iP6+D6udoVZ1h/t0/6bPpaxEty2z87OGh/3TqRK2ld/0TV HUTT/OY+vLRccnNTf5eaa4/8P0Fd+OpQYsmqHwnljZYPLhYBR9+I3NDz7BqYuUD3Mc/Y T7OSUCFOoKyOo9L5W4rFWNAZ8Qmulva5NN9AeR4lM4XPKMjppEDslDYICrN8h7k6h/ab diQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679645131; 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=JOX0rGQ6R6R9SZxzqhL5AgKyLDECJu7jQuA+oyluP6k=; b=hLD0RayNDIpwTe1e6vN6E130+03Okb1Z4JHWQvY0mNZH0undzrbA0Ybugo39tpzq+1 p/10NiT9i03L2C7ZzqDt85BrbwT4Cg+Iqm1vR+J+JRP5ACF7p76Nccrw72b/xBk611vw 99WHgDWwnpL+zJh7uAmLyHA9sxQjM2PayELSRe9dpws6rBjNyFY0kD57XZlXxdxBAxj+ qBVu7PNp0XYQewfCwkgvz21Sm0lW2yaVSRE+ce6C1V2MmOFCAHGIzNBDsgBljc/9kvlP 8BQL0rjdW/5fVHC4DLzwsO1sZo1byxcyZwVVUXPxyUYqEDhEljMO7zcrFbbcNFGlsTcG 8HhA== X-Gm-Message-State: AAQBX9fr9nBDRAJTQ2CXWaEiJoxJic6BACFDfa0QZS/AjIoNutSIMVil tMgFDioP8Run+4puLohM0bVldhQwnTeaTDxVFrE= X-Received: by 2002:a17:903:2448:b0:1a0:5349:6606 with SMTP id l8-20020a170903244800b001a053496606mr2096744pls.56.1679645130815; Fri, 24 Mar 2023 01:05:30 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:1c60:d4c3:8671:83c0:33ae:5a96]) by smtp.gmail.com with ESMTPSA id s22-20020a170902989600b001a04a372fa0sm12205293plp.251.2023.03.24.01.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 01:05:30 -0700 (PDT) From: Bhupesh Sharma To: u-boot@lists.denx.de Cc: jh80.chung@samsung.com, peng.fan@nxp.com, rfried.dev@gmail.com, sjg@chromium.org, trini@konsulko.com, dsankouski@gmail.com, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org Subject: [PATCH 5/5] board: qualcomm: Add support for QRB4210-RB2 Date: Fri, 24 Mar 2023 13:34:18 +0530 Message-Id: <20230324080418.3856409-6-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> References: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 24 Mar 2023 13:54:51 +0100 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 Qualcomm QRB4210-RB2 evaluation board (based on Qualcomm QRB4210 SoC). Features: - Qualcomm Snapdragon QRB4210 (Robotics version of SM6115 SoC). - 2GiB RAM (on-board) [max: 8 GiB]. - 16GiB eMMC, uSD slot. U-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to doc/board/qualcomm/qrb4210-rb2.rst. Signed-off-by: Bhupesh Sharma --- arch/arm/dts/Makefile | 1 + arch/arm/dts/qrb4210-rb2-uboot.dtsi | 24 ++++ arch/arm/dts/qrb4210-rb2.dtsi | 120 ++++++++++++++++++ arch/arm/mach-snapdragon/Kconfig | 11 ++ arch/arm/mach-snapdragon/Makefile | 1 + .../include/mach/sysmap-qrb4210rb2.h | 46 +++++++ arch/arm/mach-snapdragon/sysmap-qrb4210-rb2.c | 35 +++++ board/qualcomm/qrb4210-rb2/Kconfig | 15 +++ board/qualcomm/qrb4210-rb2/MAINTAINERS | 6 + board/qualcomm/qrb4210-rb2/Makefile | 6 + board/qualcomm/qrb4210-rb2/qrb4210-rb2.c | 51 ++++++++ board/qualcomm/qrb4210-rb2/qrb4210-rb2.its | 64 ++++++++++ configs/qrb4210rb2_defconfig | 56 ++++++++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/qrb4210-rb2.rst | 79 ++++++++++++ include/configs/qrb4210-rb2.h | 21 +++ 16 files changed, 537 insertions(+) create mode 100644 arch/arm/dts/qrb4210-rb2-uboot.dtsi create mode 100644 arch/arm/dts/qrb4210-rb2.dtsi create mode 100644 arch/arm/mach-snapdragon/include/mach/sysmap-qrb4210rb2.h create mode 100644 arch/arm/mach-snapdragon/sysmap-qrb4210-rb2.c create mode 100644 board/qualcomm/qrb4210-rb2/Kconfig create mode 100644 board/qualcomm/qrb4210-rb2/MAINTAINERS create mode 100644 board/qualcomm/qrb4210-rb2/Makefile create mode 100644 board/qualcomm/qrb4210-rb2/qrb4210-rb2.c create mode 100644 board/qualcomm/qrb4210-rb2/qrb4210-rb2.its create mode 100644 configs/qrb4210rb2_defconfig create mode 100644 doc/board/qualcomm/qrb4210-rb2.rst create mode 100644 include/configs/qrb4210-rb2.h diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index c160e884bf..b551c904d1 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -534,6 +534,7 @@ dtb-$(CONFIG_TARGET_DRAGONBOARD410C) += dragonboard410c.dtb dtb-$(CONFIG_TARGET_DRAGONBOARD820C) += dragonboard820c.dtb dtb-$(CONFIG_TARGET_STARQLTECHN) += starqltechn.dtb dtb-$(CONFIG_TARGET_QCS404EVB) += qcs404-evb.dtb +dtb-$(CONFIG_TARGET_QRB4210RB2) += qrb4210-rb2.dtb dtb-$(CONFIG_TARGET_STEMMY) += ste-ux500-samsung-stemmy.dtb diff --git a/arch/arm/dts/qrb4210-rb2-uboot.dtsi b/arch/arm/dts/qrb4210-rb2-uboot.dtsi new file mode 100644 index 0000000000..8588dc2bf6 --- /dev/null +++ b/arch/arm/dts/qrb4210-rb2-uboot.dtsi @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * U-Boot addition to handle QRB4210-RB2 pre-relocation devices + * + * (C) Copyright 2023 Bhupesh Sharma + */ + +/ { + soc { + u-boot,dm-pre-reloc; + + pinctrl_west@500000 { + u-boot,dm-pre-reloc; + }; + + clock-controller@1400000 { + u-boot,dm-pre-reloc; + }; + + serial@4a90000 { + u-boot,dm-pre-reloc; + }; + }; +}; diff --git a/arch/arm/dts/qrb4210-rb2.dtsi b/arch/arm/dts/qrb4210-rb2.dtsi new file mode 100644 index 0000000000..ba07263c4a --- /dev/null +++ b/arch/arm/dts/qrb4210-rb2.dtsi @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm QRB4210-RB2 evaluation board device tree source + * + * (C) Copyright 2023 Bhupesh Sharma + */ + +/dts-v1/; + +#include "skeleton64.dtsi" +#include +#include + +/ { + model = "Qualcomm Technologies, Inc. QRB4210 RB2"; + compatible = "qcom,qrb4210-rb2", "qcom,qrb4210", "qcom,sm4250"; + #address-cells = <2>; + #size-cells = <2>; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + serial0 = &debug_uart; + }; + + memory { + device_type = "memory"; + reg = <0 0x80000000 0 0x40000000>; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0xffffffff>; + compatible = "simple-bus"; + + tlmm: pinctrl_west@500000 { + compatible = "qcom,sm6115-pinctrl"; + reg = <0x00500000 0x400000>; + gpio-count = <114>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&tlmm_north 0 0 114>; + + /* DEBUG UART */ + debug_uart_on: debug_uart-default { + pins = "GPIO_12", "GPIO_13"; + function = "qup4"; + }; + }; + + gcc: clock-controller@1400000 { + compatible = "qcom,gcc-sm6115"; + reg = <0x01400000 0x1f0000>; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; + + debug_uart: serial@4a90000 { + compatible = "qcom,msm-geni-uart"; + reg = <0x04a90000 0x4000>; + clock-names = "se-clk"; + clocks = <&gcc GCC_QUPV3_WRAP0_S4_CLK>; + pinctrl-names = "default"; + pinctrl-0 = <&debug_uart_on>; + }; + + sdhc_1: mmc@4744000 { + compatible = "qcom,sdhci-msm-v5"; + reg = <0x04744000 0x1000 0x04745000 0x1000>; + clock = <&gcc GCC_SDCC1_APPS_CLK>, + <&gcc GCC_SDCC1_AHB_CLK>; + bus-width = <8>; + + no-sdio; + non-removable; + }; + + sdhc_2: mmc@4784000 { + compatible = "qcom,sdhci-msm-v5"; + reg = <0x04784000 0x1000>; + clock = <&gcc GCC_SDCC2_APPS_CLK>, + <&gcc GCC_SDCC2_AHB_CLK>; + bus-width = <4>; + + no-sdio; + }; + + spmi@1c40000 { + compatible = "qcom,spmi-pmic-arb"; + reg = <0x01c0a000 0x26000>, + <0x01c40000 0x1100>, + <0x03e00000 0x100000>; + reg-names = "cnfg", "core", "obsrvr"; + #address-cells = <1>; + #size-cells = <0>; + + pm6125: pm6125@0 { + compatible = "qcom,spmi-pmic"; + reg = <0x0 0x1>; + #address-cells = <1>; + #size-cells = <0>; + + pm6125_gpios: pm6125_gpios@c000 { + compatible = "qcom,pm6125-gpio"; + reg = <0xc000>; + gpio-controller; + gpio-count = <9>; + #gpio-cells = <2>; + gpio-bank-name="pmic"; + }; + }; + }; + }; +}; + +#include "qrb4210-rb2-uboot.dtsi" diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig index 914f4d9605..f150192cbb 100644 --- a/arch/arm/mach-snapdragon/Kconfig +++ b/arch/arm/mach-snapdragon/Kconfig @@ -77,6 +77,16 @@ config TARGET_QCS404EVB - 1GiB RAM - 8GiB eMMC, uSD slot +config TARGET_QRB4210RB2 + bool "Qualcomm Technologies, Inc. QRB4210 RB2" + select LINUX_KERNEL_IMAGE_HEADER + help + Support for Qualcomm Technologies, Inc. QRB4210 RB2 board. + Features: + - Qualcomm Snapdragon SM6115 / SM4250 SoC + - 2GiB RAM + - 16GiB eMMC + endchoice source "board/qualcomm/dragonboard410c/Kconfig" @@ -84,5 +94,6 @@ source "board/qualcomm/dragonboard820c/Kconfig" source "board/qualcomm/dragonboard845c/Kconfig" source "board/samsung/starqltechn/Kconfig" source "board/qualcomm/qcs404-evb/Kconfig" +source "board/qualcomm/qrb4210-rb2/Kconfig" endif diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile index 4ee6a3902e..eef584aaed 100644 --- a/arch/arm/mach-snapdragon/Makefile +++ b/arch/arm/mach-snapdragon/Makefile @@ -21,3 +21,4 @@ obj-y += pinctrl-sdm845.o obj-$(CONFIG_TARGET_QCS404EVB) += clock-qcs404.o obj-$(CONFIG_TARGET_QCS404EVB) += sysmap-qcs404.o obj-$(CONFIG_TARGET_QRB4210RB2) += clock-qrb4210-rb2.o +obj-$(CONFIG_TARGET_QRB4210RB2) += sysmap-qrb4210-rb2.o diff --git a/arch/arm/mach-snapdragon/include/mach/sysmap-qrb4210rb2.h b/arch/arm/mach-snapdragon/include/mach/sysmap-qrb4210rb2.h new file mode 100644 index 0000000000..544e48cf00 --- /dev/null +++ b/arch/arm/mach-snapdragon/include/mach/sysmap-qrb4210rb2.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Qualcomm SM6115 sysmap + * + * (C) Copyright 2023 Bhupesh Sharma + */ +#ifndef _MACH_SYSMAP_SM6115_H +#define _MACH_SYSMAP_SM6115_H + +/* Clocks: (from CLK_CTL_BASE) */ +#define GPLL0_STATUS (0x0) +#define APCS_GPLL_ENA_VOTE (0x79000) +#define APCS_CLOCK_BRANCH_ENA_VOTE (0x79004) + +/* Root clock for QUPv3 WRAPPER0 */ +#define QUPV3_WRAPPER_0_BCR (0x1F000) + +/* Uart clock control registers */ +#define UART4_APPS_CBCR (0x1F604) +#define UART4_APPS_CMD_RCGR (0x1F608) +#define UART4_APPS_CFG_RCGR (0x1F60c) +#define UART4_APPS_M (0x1F610) +#define UART4_APPS_N (0x1F614) +#define UART4_APPS_D (0x1F618) + +/* SDCC1 controller clock control registers */ +#define SDCC1_BCR (0x38000) +#define SDCC1_APPS_CBCR (0x38004) +#define SDCC1_AHB_CBCR (0x38008) +#define SDCC1_CMD_RCGR (0x38028) +#define SDCC1_CFG_RCGR (0x3802c) +#define SDCC1_M (0x38030) +#define SDCC1_N (0x38034) +#define SDCC1_D (0x38038) + +/* SDCC2 controller clock control registers */ +#define SDCC2_BCR (0x1E000) +#define SDCC2_APPS_CBCR (0x1E004) +#define SDCC2_AHB_CBCR (0x1E008) +#define SDCC2_CMD_RCGR (0x1E00C) +#define SDCC2_CFG_RCGR (0x1E010) +#define SDCC2_M (0x1E014) +#define SDCC2_N (0x1E018) +#define SDCC2_D (0x1E01c) + +#endif diff --git a/arch/arm/mach-snapdragon/sysmap-qrb4210-rb2.c b/arch/arm/mach-snapdragon/sysmap-qrb4210-rb2.c new file mode 100644 index 0000000000..c08a6d7d9f --- /dev/null +++ b/arch/arm/mach-snapdragon/sysmap-qrb4210-rb2.c @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm SM6115 memory map + * + * (C) Copyright 2023 Bhupesh Sharma + */ + +#include +#include + +static struct mm_region sm6115_mem_map[] = { + /* Peripheral block */ + { + .virt = 0x0UL, + .phys = 0x0UL, + .size = 0x40000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | + PTE_BLOCK_NON_SHARE | + PTE_BLOCK_PXN | + PTE_BLOCK_UXN + }, + + { + .virt = 0x40000000UL, + .phys = 0x40000000UL, + .size = 0x80000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE + }, + + /* Terminator */ + { 0 } +}; + +struct mm_region *mem_map = sm6115_mem_map; diff --git a/board/qualcomm/qrb4210-rb2/Kconfig b/board/qualcomm/qrb4210-rb2/Kconfig new file mode 100644 index 0000000000..485757e268 --- /dev/null +++ b/board/qualcomm/qrb4210-rb2/Kconfig @@ -0,0 +1,15 @@ +if TARGET_QRB4210RB2 + +config SYS_BOARD + default "qrb4210-rb2" + +config SYS_VENDOR + default "qualcomm" + +config SYS_SOC + default "sm6115" + +config SYS_CONFIG_NAME + default "qrb4210-rb2" + +endif diff --git a/board/qualcomm/qrb4210-rb2/MAINTAINERS b/board/qualcomm/qrb4210-rb2/MAINTAINERS new file mode 100644 index 0000000000..2b569bb983 --- /dev/null +++ b/board/qualcomm/qrb4210-rb2/MAINTAINERS @@ -0,0 +1,6 @@ +Qualcomm Technologies, Inc. QRB4210-RB2 evaluation board +M: Bhupesh Sharma +S: Maintained +F: board/qualcomm/qrb4210-rb2/ +F: include/configs/qrb4210-rb2.h +F: configs/qrb4210rb2_defconfig diff --git a/board/qualcomm/qrb4210-rb2/Makefile b/board/qualcomm/qrb4210-rb2/Makefile new file mode 100644 index 0000000000..d3cebdd221 --- /dev/null +++ b/board/qualcomm/qrb4210-rb2/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2023 Bhupesh Sharma +# + +obj-y += qrb4210-rb2.o diff --git a/board/qualcomm/qrb4210-rb2/qrb4210-rb2.c b/board/qualcomm/qrb4210-rb2/qrb4210-rb2.c new file mode 100644 index 0000000000..38c2c23f78 --- /dev/null +++ b/board/qualcomm/qrb4210-rb2/qrb4210-rb2.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Board init file for QRB4210-RB2 + * + * (C) Copyright 2023 Bhupesh Sharma + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + return fdtdec_setup_mem_size_base(); +} + +static void show_psci_version(void) +{ + struct arm_smccc_res res; + + arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res); + + printf("PSCI: v%ld.%ld\n", + PSCI_VERSION_MAJOR(res.a0), + PSCI_VERSION_MINOR(res.a0)); +} + +int board_init(void) +{ + show_psci_version(); + + return 0; +} + +void reset_cpu(void) +{ + psci_system_reset(); +} diff --git a/board/qualcomm/qrb4210-rb2/qrb4210-rb2.its b/board/qualcomm/qrb4210-rb2/qrb4210-rb2.its new file mode 100644 index 0000000000..df77874d60 --- /dev/null +++ b/board/qualcomm/qrb4210-rb2/qrb4210-rb2.its @@ -0,0 +1,64 @@ +/* + * U-Boot uImage source file with multiple kernels, ramdisks and FDT blobs + */ + +/dts-v1/; + +/ { + description = "Various kernels, ramdisks and FDT blobs"; + #address-cells = <1>; + + images { + kernel-1 { + description = "6.2-rc8"; + data = /incbin/("./qrb4210rb2_imgs/Image.gz"); + type = "kernel"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + load = <0x80000000>; + entry = <0x80000000>; + hash-1 { + algo = "sha1"; + }; + }; + + ramdisk-1 { + description = "Initial ramdisk"; + data = /incbin/("./qrb4210rb2_imgs/initramfs-test-image-qemuarm64-20230209073803-1343.rootfs.cpio.gz"); + type = "ramdisk"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + load = <00000000>; + entry = <00000000>; + hash-1 { + algo = "sha1"; + }; + }; + + fdt-1 { + description = "qrb4210-rb2-fdt"; + data = /incbin/("./qrb4210rb2_imgs/qrb4210-rb2.dtb"); + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + load = <0x83000000>; + hash-1 { + algo = "sha1"; + }; + }; + + }; + + configurations { + default = "config-1"; + + config-1 { + description = "qrb4210-rb2 kernel-6.2-rc8 configuration"; + kernel = "kernel-1"; + ramdisk = "ramdisk-1"; + fdt = "fdt-1"; + }; + }; +}; diff --git a/configs/qrb4210rb2_defconfig b/configs/qrb4210rb2_defconfig new file mode 100644 index 0000000000..d04e6af729 --- /dev/null +++ b/configs/qrb4210rb2_defconfig @@ -0,0 +1,56 @@ +CONFIG_ARM=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_COUNTER_FREQUENCY=19000000 +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_SNAPDRAGON=y +CONFIG_DEFAULT_DEVICE_TREE="qrb4210-rb2" +CONFIG_TARGET_QRB4210RB2=y +CONFIG_IDENT_STRING="\nQualcomm QRB4210-RB2" +CONFIG_SYS_LOAD_ADDR=0x80000000 +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_BOOTDELAY=5 +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="earlycon ignore_loglevel root= clk_ignore_unused" +CONFIG_SAVE_PREV_BL_FDT_ADDR=y +CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_HUSH_PARSER=y +CONFIG_SYS_MAXARGS=64 +CONFIG_SYS_CBSIZE=512 +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y +CONFIG_CMD_PART=y +CONFIG_CMD_USB=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +# CONFIG_NET is not set +CONFIG_CLK=y +CONFIG_QCOM_PMIC_GPIO=y +CONFIG_MISC=y +CONFIG_MMC_HS400_SUPPORT=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_ADMA=y +CONFIG_MMC_SDHCI_MSM=y +CONFIG_PHY=y +CONFIG_PHY_QCOM_USB_HS_28NM=y +CONFIG_PHY_QCOM_USB_SS=y +CONFIG_PINCTRL=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_QCOM=y +CONFIG_DM_RESET=y +CONFIG_MSM_GENI_SERIAL=y +CONFIG_REQUIRE_SERIAL_CONSOLE=y +CONFIG_MSM_GPIO=y +CONFIG_SPMI_MSM=y +CONFIG_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_STORAGE=y +CONFIG_LMB_MAX_REGIONS=64 diff --git a/doc/board/qualcomm/index.rst b/doc/board/qualcomm/index.rst index 0f9c429956..8b840a0d5a 100644 --- a/doc/board/qualcomm/index.rst +++ b/doc/board/qualcomm/index.rst @@ -9,3 +9,4 @@ Qualcomm dragonboard410c sdm845 qcs404 + qrb4210-rb2 diff --git a/doc/board/qualcomm/qrb4210-rb2.rst b/doc/board/qualcomm/qrb4210-rb2.rst new file mode 100644 index 0000000000..65815d2325 --- /dev/null +++ b/doc/board/qualcomm/qrb4210-rb2.rst @@ -0,0 +1,79 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. sectionauthor:: Bhupesh Sharma + +QRB4210 RB2 +=========== + +About this +---------- +This document describes the information about Qualcomm QRB4210 RB2 board +and it's usage steps. + +U-Boot can be used as a replacement for Qualcomm's original ABL (UEFI) bootloader. +It is loaded as an Android boot image through ABL. + +Installation +------------ +Build +^^^^^ +Setup ``CROSS_COMPILE`` for aarch64 and build U-Boot for your board:: + + $ export CROSS_COMPILE= + $ make qrb4210rb2_defconfig + $ make + +This will build ``u-boot.bin`` in the configured output directory. + +Generate FIT image +^^^^^^^^^^^^^^^^^^ +A ``qrb4210-rb2.its`` file can be found in ``board/qualcomm/qrb4210-rb2/`` directory. +It expects a folder as ``qrb4210rb2_imgs/`` in the main directory containing +pre-built kernel, dts and ramdisk images. See ``qrb4210-rb2.its`` for full path to +images. + +- Build FIT image:: + + mkimage -f qrb4210-rb2.its qrb4210-rb2.itb + +Pack android boot image +^^^^^^^^^^^^^^^^^^^^^^^ +We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, +and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel +with appended dtb, so let's mimic linux to satisfy stock bootloader: + +- create dump dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + cd "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + model = "Qualcomm Technologies, Inc. QRB4210 RB2"; + compatible = "qcom,qrb4210-rb2", "qcom,sm6115"; + + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot ``gzip u-boot.bin`` +- append dtb to gzipped u-boot: ``cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb`` + +Now we've got everything to build android boot image::: + + mkbootimg --kernel u-boot.bin.gz-dtb \ + --ramdisk qrb4210-rb2.itb --pagesize 4096 \ + --base 0x80000000 --output boot.img + +Flash image on qrb4210 rb2 using fastboot method. diff --git a/include/configs/qrb4210-rb2.h b/include/configs/qrb4210-rb2.h new file mode 100644 index 0000000000..80b9c5e2dd --- /dev/null +++ b/include/configs/qrb4210-rb2.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Configuration file for QRB4210-RB2 board + * + * (C) Copyright 2023 Bhupesh Sharma + */ + +#ifndef __CONFIGS_QRB4210RB2_H +#define __CONFIGS_QRB4210RB2_H + +#include +#include + +#define CFG_SYS_BAUDRATE_TABLE { 115200 } + +#define CFG_EXTRA_ENV_SETTINGS \ + "bootm_size=0x5000000\0" \ + "bootm_low=0x80000000\0" \ + "bootcmd=bootm $prevbl_initrd_start_addr\0" + +#endif