From patchwork Thu Mar 14 11:30:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13592336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FDE0C54E67 for ; Thu, 14 Mar 2024 11:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=M0npBiNAIdm+pSFpTvA4Np2HHixcbDewuQljqQzu9LQ=; b=bul7BQ9/1Ml2kw 4QAb6S8OFWVRVLN2c77iP0Xeb4TuXtYS9hAI+JS2DOdp0RN+2SmgMHFLUMq8EIzY52ATXpbRPA17l HNf+bKg56ko/6oy/KD6fZ/3Y99V3oVbfoGYB3/KFq7Qry621OiP/Z0OvOyQlw7gifCJFC9GwD6LFs 0KB6AX4n0ie52UIw80hI9Dlx8AiO2Jm/xlzZLi80tXlor5n3I6A4/nkAXWiu5ZqTf662qDHxItFxP ns74Mh78YOS3azozbPpPZHhGtcOjUnxvYMclRowS/0FZylauIe10RmFzGhcRlfHkESK2oUtiKDds5 ClBEK2o5Fuo7YCsWBsXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkjI2-0000000E5EJ-1vZ0; Thu, 14 Mar 2024 11:30:26 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkjHz-0000000E5Cz-0AK9; Thu, 14 Mar 2024 11:30:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1710415819; bh=/MuuARPvl5mfIdBAlNrafkAZafuB245jPxJZSyx6idw=; h=From:To:Cc:Subject:Date:From; b=CuJ8yOW9pw0uAsUmCYvkNZdFBi/1RE27tG8Pi6DOmvkn1OiKYf3HdwlfPXIfD2cEZ lwWt24Sgrz1khmBPZzmIpj26FPdIbbzPUJEJtTpjXPNoy7/74NZ66gyyK95dGPzMt4 6/bnWOi44dCUfR1UvsVlQkePKGCa9lFD+ovRrSjudL4jhMZQjhAER1pejfOA+7lMfJ 0RvAd5X/1P4qbhIN9ovzjdQntWPMzK5Z1JO0cIIRwwPgrPxYXBiJdYNfeBFXrD+hgr h6prBjryRaB0nze11GSihwHAT8UuvNYHwT1Ocd8LPmUqgygg84IiNXpaW6ziLQBsBw pazBSiu+xQMjw== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E51F73781F8E; Thu, 14 Mar 2024 11:30:18 +0000 (UTC) From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: angelogioacchino.delregno@collabora.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wenst@chromium.org, kernel@collabora.com Subject: [PATCH] soc: mediatek: socinfo: Advertise about unknown MediaTek SoC Date: Thu, 14 Mar 2024 12:30:15 +0100 Message-ID: <20240314113015.121940-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240314_043023_330373_2B8ADB54 X-CRM114-Status: GOOD ( 10.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In case we're running on a MediaTek SoC that is not declared in the socinfo_data_table, print a message stating that and, with it, also print out the read eFuse data: this allows to easily add a new SoC in the table, granted that its actual soc/segment/marketing names are already previously known. This is especially useful when booting an already known SoC that already has socinfo support, but has a different silicon version and/or revision, hence different model information in the eFuses. Signed-off-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-socinfo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/soc/mediatek/mtk-socinfo.c b/drivers/soc/mediatek/mtk-socinfo.c index 42572e8c1520..4494cca1d075 100644 --- a/drivers/soc/mediatek/mtk-socinfo.c +++ b/drivers/soc/mediatek/mtk-socinfo.c @@ -144,7 +144,14 @@ static int mtk_socinfo_get_socinfo_data(struct mtk_socinfo *mtk_socinfop) } } - return match_socinfo_index >= 0 ? match_socinfo_index : -ENOENT; + if (match_socinfo_index < 0) { + dev_warn(mtk_socinfop->dev, + "Unknown MediaTek SoC with ID 0x%08x 0x%08x\n", + cell_data[0], cell_data[1]); + return -ENOENT; + } + + return match_socinfo_index; } static int mtk_socinfo_probe(struct platform_device *pdev)