From patchwork Thu Apr 6 16:38:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 1766239 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.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=b3mkZpmn; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PsnJz4f4Pz1yZF for ; Fri, 7 Apr 2023 02:39:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B7EBF860A5; Thu, 6 Apr 2023 18:38:52 +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="b3mkZpmn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C26F860B3; Thu, 6 Apr 2023 18:38:37 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 342AA86081 for ; Thu, 6 Apr 2023 18:38:27 +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=afd@ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 336GcPSr101115; Thu, 6 Apr 2023 11:38:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1680799105; bh=6dIBo3TXOYhEQH1LY8F4uApyuGPd6dS5GrDFHY7KctQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=b3mkZpmnQefCrWfhWXBLdx7QEFGOYf31Q1DgYpKJfL0KCmRMIwCtOUu7aTdII+Sk6 9uC/Ksn0I06yWe00dnqJQRpnyksZtYe/RuIOleT3xs7po+uO27ilvdwk1ktPCdnApV TVV7NdfR1AwZr46/APLiDR3BRsewp917sQe0lfdY= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 336GcPYL094278 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Apr 2023 11:38:25 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 6 Apr 2023 11:38:24 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 6 Apr 2023 11:38:24 -0500 Received: from lelv0854.itg.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 336GcN25049417; Thu, 6 Apr 2023 11:38:24 -0500 From: Andrew Davis To: Simon Glass , Tom Rini , Christian Gmeiner , CC: Andrew Davis Subject: [PATCH v4 03/12] soc: soc_ti_k3: Use hardware.h to remove definition duplication Date: Thu, 6 Apr 2023 11:38:12 -0500 Message-ID: <20230406163821.25968-4-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230406163821.25968-1-afd@ti.com> References: <20230406163821.25968-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean The K3 JTAG and SoC ID information is already stored in the K3 arch hardware file, include that and use its definitions here. Signed-off-by: Andrew Davis Reviewed-by: Christian Gmeiner --- drivers/soc/Kconfig | 2 +- drivers/soc/soc_ti_k3.c | 30 +++++++++--------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index acf555baaec..85dac9de78a 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -10,7 +10,7 @@ config SOC_DEVICE specific device variant in use. config SOC_DEVICE_TI_K3 - depends on SOC_DEVICE + depends on SOC_DEVICE && ARCH_K3 bool "Enable SoC Device ID driver for TI K3 SoCs" help This allows Texas Instruments Keystone 3 SoCs to identify diff --git a/drivers/soc/soc_ti_k3.c b/drivers/soc/soc_ti_k3.c index 8af0ac70519..42430d79a7a 100644 --- a/drivers/soc/soc_ti_k3.c +++ b/drivers/soc/soc_ti_k3.c @@ -8,21 +8,9 @@ #include #include +#include #include -#define AM65X 0xbb5a -#define J721E 0xbb64 -#define J7200 0xbb6d -#define AM64X 0xbb38 -#define J721S2 0xbb75 -#define AM62X 0xbb7e -#define AM62AX 0xbb8d - -#define JTAG_ID_VARIANT_SHIFT 28 -#define JTAG_ID_VARIANT_MASK (0xf << 28) -#define JTAG_ID_PARTNO_SHIFT 12 -#define JTAG_ID_PARTNO_MASK (0xffff << 12) - struct soc_ti_k3_plat { const char *family; const char *revision; @@ -36,25 +24,25 @@ static const char *get_family_string(u32 idreg) soc = (idreg & JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT; switch (soc) { - case AM65X: + case JTAG_ID_PARTNO_AM65X: family = "AM65X"; break; - case J721E: + case JTAG_ID_PARTNO_J721E: family = "J721E"; break; - case J7200: + case JTAG_ID_PARTNO_J7200: family = "J7200"; break; - case AM64X: + case JTAG_ID_PARTNO_AM64X: family = "AM64X"; break; - case J721S2: + case JTAG_ID_PARTNO_J721S2: family = "J721S2"; break; - case AM62X: + case JTAG_ID_PARTNO_AM62X: family = "AM62X"; break; - case AM62AX: + case JTAG_ID_PARTNO_AM62AX: family = "AM62AX"; break; default: @@ -81,7 +69,7 @@ static const char *get_rev_string(u32 idreg) soc = (idreg & JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT; switch (soc) { - case J721E: + case JTAG_ID_PARTNO_J721E: if (rev > ARRAY_SIZE(j721e_rev_string_map)) goto bail; return j721e_rev_string_map[rev];