From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FDE2C433EF for ; Thu, 14 Oct 2021 18:41:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0398A611C7 for ; Thu, 14 Oct 2021 18:41:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0398A611C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=grimler.se Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qUHgV97Xk3vtNVBmWmmzXOVvuuqXgZxEtcTDiT8b+jM=; b=hhtLRIukfFYR79 JT6+nnFIWFmDy7AMaz1y0tvwn0jUreL5C3sYlGre8JM+FSdJzCFzYd5EcxfHpA/jfpKZh+3eHcMNT zfG230I7C8f2fJDCt8V6CJZXE5/Cy3GarDFSpV0asRvOstitK6pIEB7F2bX6lPo/E8za7+v8hhKmg p9SSuQmmNw9AkalBhgYGxraomNjnPwAm5OloRTkHDx4RL9lNfxR23fOeYOtLKmQPjN00DvgD1p7cP /4m68vQ5KXWtkIeB1kh50H3pzd+V2w0Qr2lPY5ozXNN3sBVVFLPCk2PrkKiJ2d5G6leWGdrmfEppW QqIYbuDCjNZb4Aph54xA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mb5eN-0048du-Uw; Thu, 14 Oct 2021 18:40:20 +0000 Received: from h01mx15.reliablemail.org ([173.236.5.211]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mb5eJ-0048cb-2w for linux-arm-kernel@lists.infradead.org; Thu, 14 Oct 2021 18:40:16 +0000 X-Halon-Out: 2859651f-2d1e-11ec-90dc-00163c81f1a9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=grimler.se; s=default; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xWuSLLDQK3bmsp6fReNTqiPlde9m5Pr1/bVcaTiCQ1w=; b=dntantpBFDGpkCtyt32ftHFMWm 4pFENwu8mcYDalt7qYNa7eS3Rz8OTt0FBvEzvptMSAOP/LpjSYbIRuvsmjPraIG+RrSHSmQv7DvPI 4DJp/XHniUPdbVMOhY7I0Y3aKrIhAe2dzJRkzQuNNiPO4IuCbqc8+2n7/KAVBcx1rj7SZTuRzQowE SIwL069qyZU9BJ++s1d24/MQxFt/YRxVOhtDjThlTIfc5T3ou1IT88lVam1LFNTWO+AEzD6kClw3C gxouVPvDlUmKhGzDNFFOQ8rTgDjaRvQ+rD4Mua3n8pkNnb25P5/ILhT26/sQ9YUUEt5txxGVJz7i8 h5UZnNEA==; Date: Thu, 14 Oct 2021 20:40:05 +0200 From: Henrik Grimler To: Sam Protsenko Cc: Krzysztof Kozlowski , Rob Herring , Sumit Semwal , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] soc: samsung: exynos-chipid: Pass revision reg offsets Message-ID: References: <20211014133508.1210-1-semen.protsenko@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211014133508.1210-1-semen.protsenko@linaro.org> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpsrv07.misshosting.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - grimler.se X-Get-Message-Sender-Via: cpsrv07.misshosting.com: authenticated_id: henrik@grimler.se X-Authenticated-Sender: cpsrv07.misshosting.com: henrik@grimler.se X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211014_114015_366945_912F7C24 X-CRM114-Status: GOOD ( 15.05 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Sam, On Thu, Oct 14, 2021 at 04:35:06PM +0300, Sam Protsenko wrote: > Old Exynos SoCs have both Product ID and Revision ID in one single > register, while new SoCs tend to have two separate registers for those > IDs. Implement handling of both cases by passing Revision ID register > offsets in driver data. > > Previously existing macros for Exynos4210 (removed in this patch) were > incorrect: > > #define EXYNOS_SUBREV_MASK (0xf << 4) > #define EXYNOS_MAINREV_MASK (0xf << 0) > > Actual format of PRO_ID register in Exynos4210 (offset 0x0): > > [31:12] Product ID > [9:8] Package information > [7:4] Main Revision Number > [3:0] Sub Revision Number > > This patch doesn't change the behavior on existing platforms, so > '/sys/devices/soc0/revision' will show the same string as before. > > Signed-off-by: Sam Protsenko > --- > Changes in v2: > - Renamed *_rev_bit fields in 'struct exynos_chipid_variant' to > *_rev_shift > - Renamed EXYNOS_REV_PART_LEN to EXYNOS_REV_PART_MASK > - Renamed EXYNOS_REV_PART_OFF to EXYNOS_REV_PART_SHIFT > > Changes in v3: > - Rebased on top of krzk/for-next tree > - Fixed wrong *_rev_shift values in exynos4210_chipid_drv_data > - Implemented reading the register only once in case when both > Product ID and Revision ID are stored in the same register > - Tested all possible cases by emulating read register values > - Provided more detailed explanation in commit message > > drivers/soc/samsung/exynos-chipid.c | 69 +++++++++++++++++++---- > include/linux/soc/samsung/exynos-chipid.h | 6 +- > 2 files changed, 60 insertions(+), 15 deletions(-) > I tested this on exynos4412-i9300 and an exynos5420 tablet that is not yet in mainline. /sys/devices/soc0/* looks identical, I have: $ cat /sys/devices/soc0/{family,revision,soc_id} Samsung Exynos 11 EXYNOS4412 and $ cat /sys/devices/soc0/{family,revision,soc_id} Samsung Exynos 20 EXYNOS5420 before and after these patches. The printed PRO_ID in dmesg changed though, before I had: [ 0.894683] soc soc0: Exynos: CPU[EXYNOS4412] PRO_ID[0xe4412211] REV[0x11] Detected [ 4.964215] soc soc0: Exynos: CPU[EXYNOS5420] PRO_ID[0xe5420020] REV[0x20] Detected But after it looks like package information and revision is missing from the reported PRO_ID: [ 0.885515] soc soc0: Exynos: CPU[EXYNOS4412] PRO_ID[0xe4412000] REV[0x11] Detected [ 4.965560] soc soc0: Exynos: CPU[EXYNOS5420] PRO_ID[0xe5420000] REV[0x20] Detected Best regards, Henrik Grimler _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel