Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp585627rwl; Thu, 5 Jan 2023 01:27:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXso3tEaAisV0FrGDVXc5/4iJMu0KTJQA3aSHJCJXb40qFjYIsBAFWAAzAWN1yshLJWqglOT X-Received: by 2002:a05:6a20:6699:b0:af:b771:1d01 with SMTP id o25-20020a056a20669900b000afb7711d01mr55298580pzh.49.1672910836340; Thu, 05 Jan 2023 01:27:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672910836; cv=none; d=google.com; s=arc-20160816; b=O8th/UQh99mJe08cL8k58yqgNtum8khdz/KjtuoQeCAiLDFYNwmucaBUcrKKsknJoS TOUzOPVE6yPT7YOs+TNeTRSo4PwJJhLv/0LBH/V007ZJd/iD+bTzzDRBP3TKO8MCV3AX k771ZaYtmEcVliObX9E+vSj0BJ4NO/XReYS6s8Z9JIMx8OfJ/VS2e+1Edvjo81tke5pi 1R2XA/OT9i40WJM1XwRQ2HLXdQ1FUVnsXUv8WJsd61Lu1cSqo91uMZolhgT3EgKOoMHV h0/iwZ2+d1ew7E4teZauc/1nnPiHRrR6Fqz1rLRBzm/nZeBMBvQbKU+FGpnyWqIF7WjM G3ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cR5y/PziJF8sI/xPZHzTMgAfoYzVvCPCn4igqnTFLdo=; b=XFthQraxqHampZWnu/ENJkO0BbjqN2Qx+jQZ1Dn0fwYpQYKD/P6QOyeFBQOQJ+DYyX mU3vcRKW2ER81sVZGKkHymhQbyDdigZT3b+y2bATuUohvcNzkpOSfTTF0ipCdk45gb7I ZpiQ2e6G2KJha6mFkJeXagJgXqOy3D3RkCk8oVUDltZhdf0TVfnATVkLETulo2B08VPK 49r0r6rPS9Eu6OvFc+mO0igPeWT26SzrPFMEQvhDvP35RZvs+8EizTAqIbiQgCIK8IlC biI7RJpVIWgY+7XuybrLK0/XasyEm/Rny5yOZqbAhigiMsZHCYHnjR/+ueS+IoZwCpQE QwVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=TVGS9e7I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 84-20020a630257000000b00477ff64b022si39701403pgc.19.2023.01.05.01.27.09; Thu, 05 Jan 2023 01:27:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=TVGS9e7I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232195AbjAEJW3 (ORCPT + 55 others); Thu, 5 Jan 2023 04:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232079AbjAEJWO (ORCPT ); Thu, 5 Jan 2023 04:22:14 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A545850E5D; Thu, 5 Jan 2023 01:22:12 -0800 (PST) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3059Lv3V072092; Thu, 5 Jan 2023 03:21:57 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1672910517; bh=cR5y/PziJF8sI/xPZHzTMgAfoYzVvCPCn4igqnTFLdo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TVGS9e7IbqI58VEpJqccl9/f7rV/0AibDrlmmIcjrVi4uOZ5jwmdCmRarlxeYDZMm T6KHOdHd6YxxAzLttoQNx+eDQgN3ghJJ5eWRSs8ZCaSdQ9G05cIJdvqoNr4aFqYTQq /XVHAZb7YTaFXgVAwwsHTxvi12UfD6k8lIqGC1Ss= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3059Lvwg025477 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 5 Jan 2023 03:21:57 -0600 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 5 Jan 2023 03:21:57 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE110.ent.ti.com (157.170.170.21) 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, 5 Jan 2023 03:21:57 -0600 Received: from lelv0854.itg.ti.com (lelv0854.itg.ti.com [10.181.64.140]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3059LvAk062929; Thu, 5 Jan 2023 03:21:57 -0600 Received: from localhost (a0501179-pc.dhcp.ti.com [10.24.69.114]) by lelv0854.itg.ti.com (8.14.7/8.14.7) with ESMTP id 3059LtQk018133; Thu, 5 Jan 2023 03:21:56 -0600 From: MD Danish Anwar To: Mathieu Poirier , Krzysztof Kozlowski , Rob Herring CC: Suman Anna , Roger Quadros , "Andrew F . Davis" , , , , , , , , MD Danish Anwar Subject: [PATCH v13 2/6] remoteproc: pru: Add enum for PRU Core Identifiers. Date: Thu, 5 Jan 2023 14:51:45 +0530 Message-ID: <20230105092149.686201-3-danishanwar@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230105092149.686201-1-danishanwar@ti.com> References: <20230105092149.686201-1-danishanwar@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introducing enum pruss_pru_id for PRU Core Identifiers. PRUSS_PRU0 indicates PRU Core 0. PRUSS_PRU1 indicates PRU Core 1. PRUSS_NUM_PRUS indicates the total number of PRU Cores. Signed-off-by: MD Danish Anwar Reviewed-by: Roger Quadros --- drivers/remoteproc/pru_rproc.c | 7 ++++--- include/linux/pruss.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 include/linux/pruss.h diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c index 128bf9912f2c..a1a208b31846 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -438,7 +439,7 @@ static void *pru_d_da_to_va(struct pru_rproc *pru, u32 da, size_t len) dram0 = pruss->mem_regions[PRUSS_MEM_DRAM0]; dram1 = pruss->mem_regions[PRUSS_MEM_DRAM1]; /* PRU1 has its local RAM addresses reversed */ - if (pru->id == 1) + if (pru->id == PRUSS_PRU1) swap(dram0, dram1); shrd_ram = pruss->mem_regions[PRUSS_MEM_SHRD_RAM2]; @@ -747,14 +748,14 @@ static int pru_rproc_set_id(struct pru_rproc *pru) case RTU0_IRAM_ADDR_MASK: fallthrough; case PRU0_IRAM_ADDR_MASK: - pru->id = 0; + pru->id = PRUSS_PRU0; break; case TX_PRU1_IRAM_ADDR_MASK: fallthrough; case RTU1_IRAM_ADDR_MASK: fallthrough; case PRU1_IRAM_ADDR_MASK: - pru->id = 1; + pru->id = PRUSS_PRU1; break; default: ret = -EINVAL; diff --git a/include/linux/pruss.h b/include/linux/pruss.h new file mode 100644 index 000000000000..e94a81e97a4c --- /dev/null +++ b/include/linux/pruss.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/** + * PRU-ICSS Subsystem user interfaces + * + * Copyright (C) 2015-2022 Texas Instruments Incorporated - http://www.ti.com + * Suman Anna + */ + +#ifndef __LINUX_PRUSS_H +#define __LINUX_PRUSS_H + +#include +#include + +#define PRU_RPROC_DRVNAME "pru-rproc" + +/** + * enum pruss_pru_id - PRU core identifiers + * @PRUSS_PRU0: PRU Core 0. + * @PRUSS_PRU1: PRU Core 1. + * @PRUSS_NUM_PRUS: Total number of PRU Cores available. + * + */ + +enum pruss_pru_id { + PRUSS_PRU0 = 0, + PRUSS_PRU1, + PRUSS_NUM_PRUS, +}; + +#endif /* __LINUX_PRUSS_H */ -- 2.25.1