From patchwork Wed Feb 21 14:36:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viacheslav X-Patchwork-Id: 20737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1081694dyc; Wed, 21 Feb 2024 06:46:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVqQWgKezEmA2tersG3QJw4UNn1yBHTCjXipfiV45oOo4O3Kd1BsCyruIkSIUt9UW6kVpo2o9FN/YVmWYCieSyHqGAdHw== X-Google-Smtp-Source: AGHT+IF1JxScLu3aUnyCVql6p0+2PQ74tDJsbZL+Keyg+TZpjjr05j0dIke0wUKS+wcrHR3e2yVP X-Received: by 2002:ac8:5c0d:0:b0:42c:9e27:ee41 with SMTP id i13-20020ac85c0d000000b0042c9e27ee41mr21104375qti.56.1708526815379; Wed, 21 Feb 2024 06:46:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708526815; cv=pass; d=google.com; s=arc-20160816; b=zzieuNj8eEYj06qsDoBl0tvAQk8QalDykeT4sqx6y8afVrrqFYrid3zOJ9DNEb/Qk5 KbuYsC0Fi+ZuFEYxXLvC+Mc6QieU+/y294feNYeuJzONPLxl64ihbPo+h9DdVXuJ5BHQ VPtipaHB5Xn/oVNiVsLzMCS0c7WANrROCPTQNGzJl0fCNzrCSwGYYYndlkzbMKgdE9OU Mh2wd3r+s2OswaRsSiHO33npB9UfeN54eqPEUouTlQdrwLef2PBnKjjbl4EI4tS9tqo5 k9VxpE0ZENHnqREuSrsnfpCI6InBBeMjhT2gQG5UwSo3a5JXKWDeBhavLQ49gRBGVctZ O7NQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=xOI+di+u1t+xx84e/LdGPQbr3Lc5cpKuos/uIxbddAE=; fh=6ye5sfpe/TM9xWizQQ3lHI+o0LQSsxWMiDp3fZRYvv8=; b=sdvNSKwUsamPnAC0Wo9eTcXpp78+Q4wg37wTk86Muy6btmO1be2w+K+YMOYnrf45Od oBLOjgmT3Y0Us9InxkBjDc2GpKtSY9i2sYr7La1MuTbabam7U0pn8yIut/OZ0P4vR01S MzprRZbrb0ZvKBcR02JFIcKneSZCEjrmQrXUKiHwfxJi6jYEmvGM/14n2EbDt4eR085T z7W/plfXanRwAei4mK/MLJ7xNsaUhgRiHUs1T/dVvHfHqu4e9K+/h1fUmRKs2rwx+v8Y NtDN8ve8XVI9eByyyFTBjMseBIX3XwC+3w3oUdpw/SI+WGMyVQZazBpa+AlegdK1YHE6 a5PQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lexina.in header.s=dkim header.b=U1ME9svf; arc=pass (i=1 spf=pass spfdomain=lexina.in dkim=pass dkdomain=lexina.in dmarc=pass fromdomain=lexina.in); spf=pass (google.com: domain of linux-kernel+bounces-74932-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74932-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=lexina.in Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q2-20020ac84502000000b0042c28835da4si10097640qtn.717.2024.02.21.06.46.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 06:46:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74932-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@lexina.in header.s=dkim header.b=U1ME9svf; arc=pass (i=1 spf=pass spfdomain=lexina.in dkim=pass dkdomain=lexina.in dmarc=pass fromdomain=lexina.in); spf=pass (google.com: domain of linux-kernel+bounces-74932-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74932-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=lexina.in Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1EC8C1C225E9 for ; Wed, 21 Feb 2024 14:46:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EE9480607; Wed, 21 Feb 2024 14:46:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lexina.in header.i=@lexina.in header.b="U1ME9svf" Received: from mx.msync.work (mx.msync.work [62.182.159.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C7881FDB for ; Wed, 21 Feb 2024 14:46:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.182.159.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708526780; cv=none; b=mdv6EFob4nK9/MnQ3lcxptcQHRxYH3CD9FbIdAUrb6mW45UkXYnpVWosn4QZWWpDzuri4Z74F+w9xGJvNKDN9e745n7oVDSfwWxgj0WJE2yb1zGN65WIjEF8LAdUCJDcaB6RE1+uynzzyreOlrpaH1i3rgoV6hoI62pJzyA1+d8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708526780; c=relaxed/simple; bh=N7PhYA47Cw1XbQo5+JYiIgr/qRAM4AbMyCyWIpFITFc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=EvW1UyHw/rvWSP5dMvLkSJWwMnVQH7+fgvmo9OQUynZSW99V4k2eXqcTVltYuiDl9bEEBvKcH+tf4n9n7oFuhG03gXfMick2ebKP1B17D8I6iR+JJil32u/0ttHl5o2jR8wwwbmy2DNCZAGCrtdUNSoJPVfrlQFoMl5UgJd+drU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=lexina.in; spf=pass smtp.mailfrom=lexina.in; dkim=pass (2048-bit key) header.d=lexina.in header.i=@lexina.in header.b=U1ME9svf; arc=none smtp.client-ip=62.182.159.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2D99610D6EE; Wed, 21 Feb 2024 14:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1708526221; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding; bh=xOI+di+u1t+xx84e/LdGPQbr3Lc5cpKuos/uIxbddAE=; b=U1ME9svf2hGDxCabb2U4g5IaHVT6xZEAd9N2zQz2yGXyLPyiPt4W7sR5N1BZo7M+vG7yQd +uAB6fCO06MloQI2Ag0mc2opsItrt2b6ojehwTLTywvsQzZIHFiMH9bh7SVepliq92608+ Je29QX+q+f4tx82ykpAQi0f1vHOVyZGLFaClzOfGDB7zTVCb+Kq446KFJ5aBnfd2w78zwQ pOqgMSP2yTl/m8WUjk9lMmwpt68Rl3Wy4QoEnrX4Ug4PvZb2mBBm9o4ojbIuUzS7SuEUyp ImliwEcc89OourAMELt9AqRkRkpK8ZVkMzUHzEtLYsI9FPqFOHPGYjQyKHvVnw== From: Viacheslav Bocharov To: Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: [PATCH v2 0/3] soc: amlogic: add new meson-gx-socinfo-sm driver Date: Wed, 21 Feb 2024 17:36:13 +0300 Message-ID: <20240221143654.544444-1-adeep@lexina.in> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791520214248256165 X-GMAIL-MSGID: 1791520214248256165 The Amlogic Meson SoC Secure Monitor implements a call to retrieve an unique SoC ID starting from the GX Family and all new families. But GX-family chips (e.g. GXB, GXL and newer) supports also 128-bit chip ID. 128-bit chip ID consists 32-bit SoC version and 96-bit OTP data. This is the third attempt to publish data from the Amlogic secure monitor chipid call. After discussions with Neil Armstrong, it was decided to publish the chipid call results through the soc driver. Since soc_device_match cannot wait for the soc driver to load, and the secure monitor calls in turn depend on the sm driver, it was necessary to create a new driver rather than expand an existing one. In the patches, in addition to writing the driver: - convert commonly used structures and functions of the meson-gx-socinfo driver to a header file. - add secure-monitor references for amlogic,meson-gx-ao-secure sections in dts files of the a1, axg, g12, gx families. --- Changes V1 -> V2 [1]: - create cpu_id structure for socinfo variable - create meson_sm_chip_id for result of sm call - remove shared functions - move from funcs for bit operations to C bit fields Links: - [1] https://lore.kernel.org/linux-arm-kernel/202311242104.RjBPI3uI-lkp@intel.com/T/ Viacheslav Bocharov (3): soc: amlogic: meson-gx-socinfo: move common code to header file soc: amlogic: meson-gx-socinfo-sm: Add Amlogic secure-monitor SoC Information driver soc: amlogic: meson-gx-socinfo: add new definition for Amlogic A113X package drivers/soc/amlogic/Kconfig | 10 + drivers/soc/amlogic/Makefile | 1 + .../soc/amlogic/meson-gx-socinfo-internal.h | 121 +++++++++++ drivers/soc/amlogic/meson-gx-socinfo-sm.c | 192 ++++++++++++++++++ drivers/soc/amlogic/meson-gx-socinfo.c | 136 ++----------- 5 files changed, 338 insertions(+), 122 deletions(-) create mode 100644 drivers/soc/amlogic/meson-gx-socinfo-internal.h create mode 100644 drivers/soc/amlogic/meson-gx-socinfo-sm.c base-commit: 9fc1ccccfd8d53dc7936fe6d633f2373fc9f62e8