From patchwork Tue Dec 22 13:04:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 11986457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8C70C433E0 for ; Tue, 22 Dec 2020 13:05:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DF0C2313C for ; Tue, 22 Dec 2020 13:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726549AbgLVNFd (ORCPT ); Tue, 22 Dec 2020 08:05:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbgLVNFd (ORCPT ); Tue, 22 Dec 2020 08:05:33 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0712EC0613D3 for ; Tue, 22 Dec 2020 05:04:52 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id l11so31865893lfg.0 for ; Tue, 22 Dec 2020 05:04:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Wpybqc2zF0sExp4ldyJqh4OgXlDOdXRdjhp24OFKG1g=; b=Ja7q77qbiXPz6qhOj8tbOZpq0HNDMBXjs3FQx1SJ6st9hNmdIdnOphBctK/Y82Ttdv aORcR8xO2lqRjYq//AKd51ro2F7xifUoY5/2RC3g4hrt90jBc6LYzj2GQIWvEGu/rhgh wZJ70oUKB4qeZdZSzYZj5wZ/Ckt4GCgj3hhJrSVeedDoIXrNUogt6neMIySIrbfnGIsE lU1j3SgbbjOwX2tWFHvvr/cNYQ/B/bm5Db7Cosrsmmiu7Y9sDRcpb2CubYWSe/JuOC9Z 71n1Pz3oL9Y9BpX5FoEvWECWSLeN5piPHj2w1JEvasFO3GOIF8ESc/t1CNj5ueQ1fLgx de1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Wpybqc2zF0sExp4ldyJqh4OgXlDOdXRdjhp24OFKG1g=; b=azt9HL6Zqb2s+4sA58r3ULQHZJi7JoaJnHZbD1ZYz0NgKvfJWUYUu1zHZDiMcgQmvM k1wTG3fEJHZg81MORhi3EhvYtSGedffyKhMISeNdiiz5vzxiCS1rpLRnRZOpHHaGwkNS xh09giaCzEUXDHqMmaKcrzj0FbG+P4sCn/rhTfc7W6JrN8HDTTPZVhyBI5eN2ndRjXA8 MuUiNC7WNUI+e3bABIxXkgmns3msk+wj4zoMm4DsTkK+jdCif7BbvLPzhwRSdtbdXq0u QWsI8uo69GXjJk3zFcr0ABS2qV3wEyI6qlsjb4fa78ZvdTJvdTBdOt27mEjHMCjoqUbs S2uA== X-Gm-Message-State: AOAM532UrY+UdFhuN/WboUfSnOLJW5Tbv61dVA19grrfUFxIOR00EAAS 9jhcSt2/KG6O6y9Jr4qChWzG6w== X-Google-Smtp-Source: ABdhPJzIWNHOUpYawyIHzHgCO7+UAkD69N0ENBg73rpmXN+wPCYkE9NDuAt4dT9tSNeRVImA+n0YYw== X-Received: by 2002:a05:651c:118a:: with SMTP id w10mr6340515ljo.13.1608642291460; Tue, 22 Dec 2020 05:04:51 -0800 (PST) Received: from eriador.lumag.spb.ru ([94.25.228.224]) by smtp.gmail.com with ESMTPSA id k18sm2864235ljb.80.2020.12.22.05.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 05:04:50 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org Subject: [PATCH 1/3] soc: qcom: socinfo: add qrb5165 SoC ID Date: Tue, 22 Dec 2020 16:04:46 +0300 Message-Id: <20201222130448.4125297-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Signed-off-by: Dmitry Baryshkov --- drivers/soc/qcom/socinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c index b44ede48decc..cbd59937aac5 100644 --- a/drivers/soc/qcom/socinfo.c +++ b/drivers/soc/qcom/socinfo.c @@ -228,6 +228,7 @@ static const struct soc_id soc_id[] = { { 356, "SM8250" }, { 402, "IPQ6018" }, { 425, "SC7180" }, + { 455, "QRB5165" }, }; static const char *socinfo_machine(struct device *dev, unsigned int id) From patchwork Tue Dec 22 13:04:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 11986459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 025E8C433E6 for ; Tue, 22 Dec 2020 13:05:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7D9123133 for ; Tue, 22 Dec 2020 13:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726557AbgLVNFf (ORCPT ); Tue, 22 Dec 2020 08:05:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbgLVNFe (ORCPT ); Tue, 22 Dec 2020 08:05:34 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57174C0613D6 for ; Tue, 22 Dec 2020 05:04:54 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id o13so31811262lfr.3 for ; Tue, 22 Dec 2020 05:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s3V/TtIufHPkQhmtTrjVzj5+nIzx7UpDGpZLYRgMPKs=; b=irN+kovVrKnG5RJweP71z1TelLa1u9KQVwH0GR4kcFdtNJ2IgkP8j9TMyfJmrZb+ZO gsIzeTkTGgeNpgW+cOOMz666APb1CiZ/ZpQmyqDXOjdj2MVrK85eL2uaATSwKdXwyyK3 yvQv94CCrXFmaQa77iCluGxPSJqmx0ApAcnckgY/ga9gieZPad5/6wKigrdKW/Xz1nJ0 iIjZfA8EtQdg1qzvINZCIOpxVjgmNxl0Xv2ovEGg8gBh4CZgz9xzKMx6FDQYNbJX0anL TgMEbEBULznVgxoIC/aiWAHEmd/fC4PSXsPaDaNhla2L2UZAGtup3PmwRt5LM128N7F+ klwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s3V/TtIufHPkQhmtTrjVzj5+nIzx7UpDGpZLYRgMPKs=; b=oz0UCyM5Y3dacUOqV3I0foTxe7jwKLhW/qCjKSGBYqoL9SGz0ev3ug0lEvx/I+lppU qGjFWVoZyEXvodhpNQLAHbVy+Gh6f/lGtTtCxt4Bcl+FdStsHCpghmnRW+OjGER88NUe /qkGokvPtcjht4cRcer/ZHM3AFc7fU0ZocQfUN2d/H4FAQ11uGn2DeAgW212JH8l6F/Z 37TdWEauLRAQHxppPf+I8KPBZZRfZzaksixew+1wSlkp4AVfZFT81NvmjXRrUCv+s084 kql/FSf+BqdpZ4DlL1AwMyC1c6gaya4JZHan8FhgLBGPXzGNgNh5wMsSW1Zrj+2Ylye7 69gw== X-Gm-Message-State: AOAM531jx4VEJyyLn7S/0BBuWc285OgTOd97UlCBAP20U8WCc6VCmk/y fkb2goJzsxxLYhaKHLjdgWRs0g== X-Google-Smtp-Source: ABdhPJy2Sb5bsYgQ7YuoLWh2GAiaau1gVIUm18vrGipq+CdAvpeV0blLEb1dNUZ9aB5Pme85erLmEg== X-Received: by 2002:a2e:b52c:: with SMTP id z12mr10184160ljm.250.1608642292872; Tue, 22 Dec 2020 05:04:52 -0800 (PST) Received: from eriador.lumag.spb.ru ([94.25.228.224]) by smtp.gmail.com with ESMTPSA id k18sm2864235ljb.80.2020.12.22.05.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 05:04:52 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org Subject: [PATCH 2/3] soc: qcom: socinfo: add several PMIC IDs Date: Tue, 22 Dec 2020 16:04:47 +0300 Message-Id: <20201222130448.4125297-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201222130448.4125297-1-dmitry.baryshkov@linaro.org> References: <20201222130448.4125297-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add several PMIC IDs found on Qualcomm RB5 platform. Signed-off-by: Dmitry Baryshkov --- drivers/soc/qcom/socinfo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c index cbd59937aac5..7229c3c04083 100644 --- a/drivers/soc/qcom/socinfo.c +++ b/drivers/soc/qcom/socinfo.c @@ -83,6 +83,11 @@ static const char *const pmic_models[] = { [23] = "PM8038", [24] = "PM8922", [25] = "PM8917", + [30] = "PM8150", + [31] = "PM8150L", + [32] = "PM8150B", + [33] = "PMK8002", + [36] = "PM8009", }; #endif /* CONFIG_DEBUG_FS */ From patchwork Tue Dec 22 13:04:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 11986461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28B09C433E9 for ; Tue, 22 Dec 2020 13:05:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E44392333B for ; Tue, 22 Dec 2020 13:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbgLVNFg (ORCPT ); Tue, 22 Dec 2020 08:05:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbgLVNFg (ORCPT ); Tue, 22 Dec 2020 08:05:36 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3935C061793 for ; Tue, 22 Dec 2020 05:04:55 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id o13so31811398lfr.3 for ; Tue, 22 Dec 2020 05:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cYkvDM+JjtsHyuhPBxoKAqQnB1uujIDD73cQOpWHLB8=; b=GIr1606Hi8p7LResTLRhR/y/hVYL30TsuwUx4zViJsDcCCLqS8INs8GYBvn0EtchFX i26FLy+/6Y0OFffrdKTRgE4sxZb+Hjv4dVwPV5pvjA9d0GP1T0P/T9Unk8YF6qs/xsL4 e7lCSOwmFKbwdWDDGd/XTh1jF/9EeKEIud2Pw3blSBx1FPrtCCgBIwX9JCpyMimuNhbV StCCarFE2kabxpDzLGrXc+c3vj6QDJESD8L5+eO3vbxegYlFylruV9JAg6lMeThG8djz eT2Yz+4e0AMM10ZIQWMMO9inJ3q/9+Gjd20XfjJIoheTGKgxzSEa5S7vIRKffxCUm8cz EdZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cYkvDM+JjtsHyuhPBxoKAqQnB1uujIDD73cQOpWHLB8=; b=MQIoDtLjpWUmxbBHe/Ag5gkqRJH+r4WiVjglyozO0YOfDcZb2J37vyD58CPOc4LQ1i BlOLas6ZX4DVTRLhZJ2Frjkds2YEcdqX8IYExYndGoCGRhVgCxfNcqdG+5iez1b/F3vL Fd+HTGXyhSUFLDjkmsGKjWzZD30rH7jBF3f6OHfK0zkK5FbqWtxDi04MYKli6HVBPX2E 1tbV1N8aOmrGNGPqnu+XQCxk1ZT4YtOATvUptGTNmlBF67se4+tUupPofGxAWhJojl1m UbdbEM4gYsmjZGHfMUVI4K5BiUFEJZWNJ2B18C1Qi4rpVhjfdDyZHOPfJhRPebiSuNJP Ra/g== X-Gm-Message-State: AOAM5309iuD31qekoWdKkqLfk0KwFCt4iL6xbCgo9XjMEA3UNbYvVF8q 3uKoKfCVQbBe9T+HdcUbmFpd2w== X-Google-Smtp-Source: ABdhPJzoHTdN/YbnLWjRAYOtmVOKMLcsARiq5nH8JwsmrZQGMLdFom25IEA04ntvoEKQ4PmtaMWp0A== X-Received: by 2002:a2e:a402:: with SMTP id p2mr9559714ljn.270.1608642294284; Tue, 22 Dec 2020 05:04:54 -0800 (PST) Received: from eriador.lumag.spb.ru ([94.25.228.224]) by smtp.gmail.com with ESMTPSA id k18sm2864235ljb.80.2020.12.22.05.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 05:04:53 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org Subject: [PATCH 3/3] soc: qcom: socinfo: add info from PMIC models array Date: Tue, 22 Dec 2020 16:04:48 +0300 Message-Id: <20201222130448.4125297-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201222130448.4125297-1-dmitry.baryshkov@linaro.org> References: <20201222130448.4125297-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add debugfs file showing information from PMIC model array. Signed-off-by: Dmitry Baryshkov --- drivers/soc/qcom/socinfo.c | 42 +++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c index 7229c3c04083..d255034a2b6f 100644 --- a/drivers/soc/qcom/socinfo.c +++ b/drivers/soc/qcom/socinfo.c @@ -15,6 +15,8 @@ #include #include +#include + /* * SoC version type with major number in the upper 16 bits and minor * number in the lower 16 bits. @@ -294,6 +296,32 @@ static int qcom_show_pmic_model(struct seq_file *seq, void *p) return 0; } +static int qcom_show_pmic_model_array(struct seq_file *seq, void *p) +{ + struct socinfo *socinfo = seq->private; + unsigned int num_pmics = le32_to_cpu(socinfo->num_pmics); + unsigned int pmic_array_offset = le32_to_cpu(socinfo->pmic_array_offset); + int i; + void *ptr = socinfo; + + ptr += pmic_array_offset; + + /* No need for bounds checking, it happened at socinfo_debugfs_init */ + for (i = 0; i < num_pmics; i++) { + unsigned int model = SOCINFO_MINOR(get_unaligned_le32(ptr + 2 * i * sizeof(u32))); + unsigned int die_rev = get_unaligned_le32(ptr + (2 * i + 1) * sizeof(u32)); + + if (model <= ARRAY_SIZE(pmic_models) && pmic_models[model]) + seq_printf(seq, "%s %u.%u\n", pmic_models[model], + SOCINFO_MAJOR(le32_to_cpu(die_rev)), + SOCINFO_MINOR(le32_to_cpu(die_rev))); + else + seq_printf(seq, "unknown (%d)\n", model); + } + + return 0; +} + static int qcom_show_pmic_die_revision(struct seq_file *seq, void *p) { struct socinfo *socinfo = seq->private; @@ -316,6 +344,7 @@ static int qcom_show_chip_id(struct seq_file *seq, void *p) QCOM_OPEN(build_id, qcom_show_build_id); QCOM_OPEN(pmic_model, qcom_show_pmic_model); +QCOM_OPEN(pmic_model_array, qcom_show_pmic_model_array); QCOM_OPEN(pmic_die_rev, qcom_show_pmic_die_revision); QCOM_OPEN(chip_id, qcom_show_chip_id); @@ -344,12 +373,14 @@ DEFINE_IMAGE_OPS(variant); DEFINE_IMAGE_OPS(oem); static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo, - struct socinfo *info) + struct socinfo *info, size_t info_size) { struct smem_image_version *versions; struct dentry *dentry; size_t size; int i; + unsigned int num_pmics; + unsigned int pmic_array_offset; qcom_socinfo->dbg_root = debugfs_create_dir("qcom_socinfo", NULL); @@ -405,6 +436,11 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo, &qcom_socinfo->info.raw_device_num); fallthrough; case SOCINFO_VERSION(0, 11): + num_pmics = le32_to_cpu(info->num_pmics); + pmic_array_offset = le32_to_cpu(info->pmic_array_offset); + if (pmic_array_offset + 2 * num_pmics * sizeof(u32) <= info_size) + DEBUGFS_ADD(info, pmic_model_array); + fallthrough; case SOCINFO_VERSION(0, 10): case SOCINFO_VERSION(0, 9): qcom_socinfo->info.foundry_id = __le32_to_cpu(info->foundry_id); @@ -482,7 +518,7 @@ static void socinfo_debugfs_exit(struct qcom_socinfo *qcom_socinfo) } #else static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo, - struct socinfo *info) + struct socinfo *info, size_t info_size) { } static void socinfo_debugfs_exit(struct qcom_socinfo *qcom_socinfo) { } @@ -522,7 +558,7 @@ static int qcom_socinfo_probe(struct platform_device *pdev) if (IS_ERR(qs->soc_dev)) return PTR_ERR(qs->soc_dev); - socinfo_debugfs_init(qs, info); + socinfo_debugfs_init(qs, info, item_size); /* Feed the soc specific unique data into entropy pool */ add_device_randomness(info, item_size);