Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp575429rwd; Thu, 1 Jun 2023 04:12:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GbljSDxUFbJ8up9Yz1MI2bCqi2ieAGReFGqTJh0cXaDi1WfZFNqs3Nb7LO7eSQjYUV+zB X-Received: by 2002:a17:90a:1dd:b0:258:7fae:dce with SMTP id 29-20020a17090a01dd00b002587fae0dcemr3751072pjd.24.1685617930665; Thu, 01 Jun 2023 04:12:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685617930; cv=none; d=google.com; s=arc-20160816; b=HkF0YMBi3QMDYp6OA6OvB3/T2T0gcwdgFaG7kwB9OjCpu/GgpU+c3PYJpqxImSHkKq 9ZOoj3QvbDrqJJArIamoVVEXN8loBT7lPVywMopvOBCZ80/zP6rZ9VS4MoR3wKDYZJFp pAVQQNZeJi+oYmgviDWyAlJheafyKbeL3vymW2VogBLI18xmzwTP4qirqsdwI8f1+qAl A80rS4yxYEayWcGy3dMeNOYh2/520Jgz/ukBlf9GN6KIEdEK5Cw37pvbGG3XhvjcQy8e ANq1oDaR3+lXwqiEbbzMoF30Y6gO6dRd53sT0euGidK+JGAAWpluaPg/cEgF4CAx5yKV QsgQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Su7R47v4W5yO6beC23P257B1E8f3gfa6U+NgWZ0c6fE=; b=JETYtsFFPxbjBPkovNyMc15Ub0XVchli5cgNZ7h4Qt2UYCYCcmchLGluYsnNAENaaw Hqp0P0t18h4PYnelmnVLd6vkXsnT3z+LHmR9/fmssvwFSh145W0LQ3yNe3rBufLK1F9g 8hlTvE4FK+tbcCrmQby0dui3O4o2hiV2dsvIGOKaLziIMQ3WnOQ8Zx/iqnm1XrMa90fY a/ti6xarp/ax6MlNZnD8WKTf/f7Ijawx8sLgTianNcpzbY5T6QY4cK1u/3zgmyj+LhGg nnNM484skfSwZ04JzBpZ4M6Hyw9dCFlOtSGBOWeE4Zdbvcnz/JLJ8mx/7S/HfD9WJYzm Ofrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ILYoAtU4; 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 u72-20020a63794b000000b00538edfb070dsi2603493pgc.478.2023.06.01.04.11.57; Thu, 01 Jun 2023 04:12:10 -0700 (PDT) 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=ILYoAtU4; 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 S232434AbjFAK7v (ORCPT + 99 others); Thu, 1 Jun 2023 06:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233322AbjFAK7m (ORCPT ); Thu, 1 Jun 2023 06:59:42 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8137012C; Thu, 1 Jun 2023 03:59:22 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 351Ax8s5121002; Thu, 1 Jun 2023 05:59:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1685617148; bh=Su7R47v4W5yO6beC23P257B1E8f3gfa6U+NgWZ0c6fE=; h=From:To:CC:Subject:Date; b=ILYoAtU434Bw9nLblRFw0m8HJnE2yBrkz5O91voAn1RFqb4HjzLJTt0rEpd70S5js MSyhffXPvZIoyUahdsQ397ivTu8wWV5fyldw0HNzAfLMASfH6rMD02GQQfaJgH94Mf 5xgjFPnA8+1Uqt2Uz+lXQzO32ch8AwyRwFWEMAO8= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 351Ax8nS087594 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Jun 2023 05:59:08 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 1 Jun 2023 05:59:07 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 1 Jun 2023 05:59:07 -0500 Received: from fllv0122.itg.ti.com (fllv0122.itg.ti.com [10.247.120.72]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 351Ax7ZJ027859; Thu, 1 Jun 2023 05:59:07 -0500 Received: from localhost (uda0501179.dhcp.ti.com [10.24.69.114]) by fllv0122.itg.ti.com (8.14.7/8.14.7) with ESMTP id 351Ax6BY024592; Thu, 1 Jun 2023 05:59:06 -0500 From: MD Danish Anwar To: Mathieu Poirier , Bjorn Andersson CC: , , , , , , , , Subject: [PATCH] remoteproc: pru: add support for configuring GPMUX based on client setup Date: Thu, 1 Jun 2023 16:29:04 +0530 Message-ID: <20230601105904.3204260-1-danishanwar@ti.com> X-Mailer: git-send-email 2.34.1 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.6 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_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Tero Kristo Client device node property ti,pruss-gp-mux-sel can now be used to configure the GPMUX config value for PRU. Signed-off-by: Tero Kristo Signed-off-by: Suman Anna Signed-off-by: MD Danish Anwar --- drivers/remoteproc/pru_rproc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c index 2874c8d324f7..29d3a5a930c1 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c @@ -109,6 +109,7 @@ struct pru_private_data { * @dbg_single_step: debug state variable to set PRU into single step mode * @dbg_continuous: debug state variable to restore PRU execution mode * @evt_count: number of mapped events + * @gpmux_save: saved value for gpmux config */ struct pru_rproc { int id; @@ -127,6 +128,7 @@ struct pru_rproc { u32 dbg_single_step; u32 dbg_continuous; u8 evt_count; + u8 gpmux_save; }; static inline u32 pru_control_read_reg(struct pru_rproc *pru, unsigned int reg) @@ -228,6 +230,7 @@ struct rproc *pru_rproc_get(struct device_node *np, int index, struct device *dev; const char *fw_name; int ret; + u32 mux; rproc = __pru_rproc_get(np, index); if (IS_ERR(rproc)) @@ -252,6 +255,22 @@ struct rproc *pru_rproc_get(struct device_node *np, int index, if (pru_id) *pru_id = pru->id; + ret = pruss_cfg_get_gpmux(pru->pruss, pru->id, &pru->gpmux_save); + if (ret) { + dev_err(dev, "failed to get cfg gpmux: %d\n", ret); + goto err; + } + + ret = of_property_read_u32_index(np, "ti,pruss-gp-mux-sel", index, + &mux); + if (!ret) { + ret = pruss_cfg_set_gpmux(pru->pruss, pru->id, mux); + if (ret) { + dev_err(dev, "failed to set cfg gpmux: %d\n", ret); + goto err; + } + } + ret = of_property_read_string_index(np, "firmware-name", index, &fw_name); if (!ret) { @@ -290,6 +309,8 @@ void pru_rproc_put(struct rproc *rproc) pru = rproc->priv; + pruss_cfg_set_gpmux(pru->pruss, pru->id, pru->gpmux_save); + pru_rproc_set_firmware(rproc, NULL); mutex_lock(&pru->lock); -- 2.34.1