From patchwork Tue Jun 30 04:38:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Gerlach X-Patchwork-Id: 1319765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=ybCtX0q9; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49x1zP6qzjz9s6w for ; Tue, 30 Jun 2020 21:17:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B6A5981B7F; Tue, 30 Jun 2020 13:16:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="ybCtX0q9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 25153804BA; Tue, 30 Jun 2020 06:39:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1069B80929 for ; Tue, 30 Jun 2020 06:38:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=d-gerlach@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05U4crrC098283; Mon, 29 Jun 2020 23:38:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1593491933; bh=VpoPOtN803CzdngwsvHOYhmldTQfqTFmjxPIUDVh6GE=; h=From:To:CC:Subject:Date; b=ybCtX0q9b/tf6R2jJ0F6ON4anuSy6InpocsG/lq2GP7yI57je3kh7cIcxRO6zVUmU m8Y724xepfQYhOWqcLII6ucqRQ4VO3KDUKIR+g3W3UEYvC9BHrKiHpCZt6V+ccAUOo p0e0I7a4qXPq2ZaZLrYH0N/d/BeE/1OMNQjFcNJ0= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05U4cr3C092234 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Jun 2020 23:38:53 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 29 Jun 2020 23:38:53 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Mon, 29 Jun 2020 23:38:53 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05U4crpo077828; Mon, 29 Jun 2020 23:38:53 -0500 From: Dave Gerlach To: CC: Sekhar Nori , Mohammad Faiz Abbas Rivzi , Lokesh Vutla , Tom Rini , Simon Glass , Grygorii Strashko Subject: [PATCH 0/8] Introduce UCLASS_SOC Date: Mon, 29 Jun 2020 23:38:45 -0500 Message-ID: <20200630043853.13276-1-d-gerlach@ti.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Approved-At: Tue, 30 Jun 2020 13:15:30 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.3 at phobos.denx.de X-Virus-Status: Clean Hi, This patch series introduces UCLASS_SOC to be used for SOC identification and attribute matching based on SoC ID info. This allows drivers to be provided for SoCs to retrieve SoC identifying information and also for matching device attributes for selecting SoC specific data. This is intended to be a counterpart to the soc-device framework in the Linux kernel. I started with attempts to extend either UCLASS_CPU and UCLASS_BOARD to provide equivalent functionality, but UCLASS_CPU is focused specifically on processing units, of which multiples can exist heterogeneously in a system, and UCLASS_BOARD is focused on indentifying things connected to an SoC dynamically. Rather than try to force this into the existing UCLASS's, a new UCLASS seemed appropriate to provide same services as the soc-device functionality in the kernel. This is useful for other device drivers that may need different parameters or quirks enabled depending on the specific device variant or revision in use. Additionally, this introduces a user of UCLASS_SOC, soc_ti_k3, which provides SoC identifying information for K3 SoCs which can be used directly, for print_cpuinfo, and for selecting SoC specific data using soc_device_match. Regards, Dave Dave Gerlach (8): dm: soc: Introduce UCLASS_SOC for SOC ID and attribute matching test: Add tests for SOC uclass dm: soc: Introduce soc_ti_k3 driver for TI K3 SoCs arm: dts: k3-am65-wakeup: Introduce chipid node arm: dts: k3-j721e-mcu-wakeup: Introduce chipid node configs: am65x_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3 configs: j721e_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3 arm: mach-k3: Use SOC driver for device identification arch/arm/dts/k3-am65-wakeup.dtsi | 5 + arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 4 + .../k3-j721e-common-proc-board-u-boot.dtsi | 4 + arch/arm/dts/k3-j721e-mcu-wakeup.dtsi | 5 + arch/arm/mach-k3/common.c | 48 +++---- arch/arm/mach-k3/include/mach/hardware.h | 1 - arch/sandbox/dts/test.dts | 4 + configs/am65x_evm_a53_defconfig | 2 + configs/am65x_evm_r5_defconfig | 2 + configs/am65x_hs_evm_a53_defconfig | 2 + configs/am65x_hs_evm_r5_defconfig | 2 + configs/j721e_evm_a72_defconfig | 2 + configs/j721e_evm_r5_defconfig | 2 + configs/j721e_hs_evm_a72_defconfig | 2 + configs/j721e_hs_evm_r5_defconfig | 2 + configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + drivers/soc/Kconfig | 16 +++ drivers/soc/Makefile | 3 + drivers/soc/soc-uclass.c | 102 ++++++++++++++ drivers/soc/soc_sandbox.c | 56 ++++++++ drivers/soc/soc_ti_k3.c | 124 ++++++++++++++++ include/dm/uclass-id.h | 1 + include/soc.h | 132 ++++++++++++++++++ test/dm/Makefile | 1 + test/dm/soc.c | 120 ++++++++++++++++ 28 files changed, 616 insertions(+), 30 deletions(-) create mode 100644 drivers/soc/soc-uclass.c create mode 100644 drivers/soc/soc_sandbox.c create mode 100644 drivers/soc/soc_ti_k3.c create mode 100644 include/soc.h create mode 100644 test/dm/soc.c