Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp789997rwb; Thu, 8 Dec 2022 03:03:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf5h0RcVL7MiNUV43wKIzpI4rwx7rNc87UPtGtxHUGvad58WVmJ5ddnmXf2OraonPpUikZk5 X-Received: by 2002:aa7:dbd8:0:b0:467:60fa:b629 with SMTP id v24-20020aa7dbd8000000b0046760fab629mr81959434edt.281.1670497390051; Thu, 08 Dec 2022 03:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670497390; cv=none; d=google.com; s=arc-20160816; b=MEWVdbKBW4UEut7heW7MtpoWwVRLcKzOa6jiTGb1VWq7txI58MhkkMEtWmIR8lvt2d ZeGEFZTIyaI6Y4uEZPUlLuRn4idvE1n3xM0xJqccED2ND0zHuNXlEoCQ8SFFYhVNbR+6 x1WXHkSvA8zu1A31qM6CtqOCUHQYkw47bor+BFrjuu4yiHH6vpfrcqVxV4wumJIFk1cO oACa3UmxW70UtRGfxGqcY1kQ5wwqMH1jdptfrGhoS/ceP9tWEY8mEkFYPajkNyEO+tCK u19BdTpvOCsKQfQyxCL6pRfN6hKO7zZ5tWr4ImlVdE7DdU8lL2H+b95KaWEI7fmRamSU LCTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=MlpGC5xn2xGP7bMX3/gEGrNONtmDbl7kOuFP3vKpP/A=; b=CpGBuUWKGgaZ7h42tGSKMAoUHfaBNvzu8uUEsbYUer4Tn+yqVfpD749B/zKV7Moqtq n1d7FD74bqmpJWghS6moYifrY5ORduRBzIQGzfHrmNROadXtD4NzkDPEXGpX5qh5WT9x T3TdwNb5XmvhBj7BZLKqxrxJJ2DUZs0Vv5kb/QMg0wUZJuUsw0F942aO2QkAw7BPkhZV e/2on5dh4TwapjBBmjtKKVln+Yqyp7IpK+xChlJ9UX/h5+wfzQabu93jXVv5CmqTiitn rnfXjltywK1y8x19mH0moAWZLkeSi8nKIv+WMIU3gtZDccZ0UpKJxUIMR0paEyseSp6r cJOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o0KcurJG; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu8-20020a170907a08800b007c0ea55da51si9352394ejc.944.2022.12.08.03.02.52; Thu, 08 Dec 2022 03:03:10 -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=@kernel.org header.s=k20201202 header.b=o0KcurJG; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbiLHKW3 (ORCPT + 72 others); Thu, 8 Dec 2022 05:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiLHKW0 (ORCPT ); Thu, 8 Dec 2022 05:22:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 618EB54342; Thu, 8 Dec 2022 02:22:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1C6E5B82362; Thu, 8 Dec 2022 10:22:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0D58C433C1; Thu, 8 Dec 2022 10:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670494942; bh=ErJmS2Ph8pUOWhyn1bGZWvmgNR7aRTvFWTY/3HNMPPU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=o0KcurJGm6y78e9JLdrN//6EMuoWntcFSF144dnvgGcqBiqFKKriISACdEKrx7sxx La5DX1xW1PixYRltDbCUxoduG0dZ6vkKCfUPd7vM3vY2GJIyL7s8yGUE8SJvCbhj48 x64j5qqgULkys6NCYqCYy7XeL+usCTWA6tgKPn4XnlVTHA9P1IbavRKe7OGe8PRVMo VUNXyV++if0t5eP0oqsA2VBcntBoR1GfIZhfr+MuJy9eUjCRFA5QmDCDoKG7544l// K2B4h1+FAntaBDRCZdPq1NERky/C2j9Qx/3Z5Otea0Z1TWwvnrXDhhApZr14fwvE/+ kcUXZlOeTuU+Q== Message-ID: Date: Thu, 8 Dec 2022 12:22:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v11 2/6] remoteproc: pru: Add enum for PRU Core Identifiers. Content-Language: en-US To: MD Danish Anwar , Mathieu Poirier , Krzysztof Kozlowski , Rob Herring Cc: Suman Anna , "Andrew F . Davis" , nm@ti.com, vigneshr@ti.com, srk@ti.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20221207110411.441692-1-danishanwar@ti.com> <20221207110411.441692-3-danishanwar@ti.com> From: Roger Quadros In-Reply-To: <20221207110411.441692-3-danishanwar@ti.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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 On 07/12/2022 13:04, MD Danish Anwar wrote: > 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 -- cheers, -roger > --- > drivers/remoteproc/pru_rproc.c | 7 ++++--- > include/linux/pruss.h | 32 ++++++++++++++++++++++++++++++++ > 2 files changed, 36 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..fbe4fbb45807 > --- /dev/null > +++ b/include/linux/pruss.h > @@ -0,0 +1,32 @@ > +/* 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 */ > \ No newline at end of file