From patchwork Mon Aug 17 05:30:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 1345628 X-Patchwork-Delegate: lokeshvutla@ti.com 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=L+lfjs4S; 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 4BVN293j5wz9sPC for ; Mon, 17 Aug 2020 15:31:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD5958223B; Mon, 17 Aug 2020 07:31:07 +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="L+lfjs4S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 931E18222C; Mon, 17 Aug 2020 07:31:04 +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 1D4AC821F8 for ; Mon, 17 Aug 2020 07:30:59 +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=lokeshvutla@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 07H5Uw4l032374 for ; Mon, 17 Aug 2020 00:30:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1597642258; bh=zYDSmpEppv+AmGqSK+7skWNPxSbNY3QHOoXM/kFdfUY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=L+lfjs4SdmpS37JxoPqchRoAIMBQ9yVz9JT4HyPK321dBlYol/Fxk9q3kUjNvUQTi jDt7C4Q1tvuq1py1vTPknbNaEhv8hLr7qISpahVbYOE7ozuqT/N2ISx4d6QY7Va41f qtfRsz7oRqV4Qh/CYpR1qk1iu3iP7Z72/fHI1NG4= 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 07H5Uwie002059 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 17 Aug 2020 00:30:58 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) 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.1979.3; Mon, 17 Aug 2020 00:30:58 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE101.ent.ti.com (157.170.170.31) 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, 17 Aug 2020 00:30:58 -0500 Received: from lokesh-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 07H5UqhS066651; Mon, 17 Aug 2020 00:30:57 -0500 From: Lokesh Vutla To: CC: Sekhar Nori , Lokesh Vutla Subject: [PATCH 2/3] firmware: ti_sci: Drop unused structure ti_sci_rm_type_map Date: Mon, 17 Aug 2020 11:00:48 +0530 Message-ID: <20200817053049.9399-3-lokeshvutla@ti.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200817053049.9399-1-lokeshvutla@ti.com> References: <20200817053049.9399-1-lokeshvutla@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.34 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 struct ti_sci_rm_type_map is no longer used. Drop its definition and its declarations. Signed-off-by: Lokesh Vutla --- drivers/firmware/ti_sci.c | 52 +++------------------------------------ 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index a784b4ea29..e311f55ef8 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -60,14 +60,12 @@ struct ti_sci_rm_type_map { * @max_msgs: Maximum number of messages that can be pending * simultaneously in the system * @max_msg_size: Maximum size of data per message that can be handled. - * @rm_type_map: RM resource type mapping structure. */ struct ti_sci_desc { u8 default_host_id; int max_rx_timeout_ms; int max_msgs; int max_msg_size; - struct ti_sci_rm_type_map *rm_type_map; }; /** @@ -1605,33 +1603,6 @@ static int ti_sci_cmd_core_reboot(const struct ti_sci_handle *handle) return ret; } -static int ti_sci_get_resource_type(struct ti_sci_info *info, u16 dev_id, - u16 *type) -{ - struct ti_sci_rm_type_map *rm_type_map = info->desc->rm_type_map; - bool found = false; - int i; - - /* If map is not provided then assume dev_id is used as type */ - if (!rm_type_map) { - *type = dev_id; - return 0; - } - - for (i = 0; rm_type_map[i].dev_id; i++) { - if (rm_type_map[i].dev_id == dev_id) { - *type = rm_type_map[i].type; - found = true; - break; - } - } - - if (!found) - return -EINVAL; - - return 0; -} - /** * ti_sci_get_resource_range - Helper to get a range of resources assigned * to a host. Resource is uniquely identified by @@ -1654,7 +1625,6 @@ static int ti_sci_get_resource_range(const struct ti_sci_handle *handle, struct ti_sci_msg_req_get_resource_range req; struct ti_sci_xfer *xfer; struct ti_sci_info *info; - u16 type; int ret = 0; if (IS_ERR(handle)) @@ -1673,14 +1643,8 @@ static int ti_sci_get_resource_range(const struct ti_sci_handle *handle, return ret; } - ret = ti_sci_get_resource_type(info, dev_id, &type); - if (ret) { - dev_err(dev, "rm type lookup failed for %u\n", dev_id); - goto fail; - } - req.secondary_host = s_host; - req.type = type & MSG_RM_RESOURCE_TYPE_MASK; + req.type = dev_id & MSG_RM_RESOURCE_TYPE_MASK; req.subtype = subtype & MSG_RM_RESOURCE_SUBTYPE_MASK; ret = ti_sci_do_xfer(info, xfer); @@ -3096,7 +3060,6 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, struct udevice *dev, u32 dev_id, char *of_prop) { u32 resource_subtype; - u16 resource_type; struct ti_sci_resource *res; bool valid_set = false; int sets, i, ret; @@ -3120,13 +3083,6 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, if (!res->desc) return ERR_PTR(-ENOMEM); - ret = ti_sci_get_resource_type(handle_to_ti_sci_info(handle), dev_id, - &resource_type); - if (ret) { - dev_err(dev, "No valid resource type for %u\n", dev_id); - return ERR_PTR(-EINVAL); - } - ret = dev_read_u32_array(dev, of_prop, temp, res->sets); if (ret) return ERR_PTR(-EINVAL); @@ -3139,7 +3095,7 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, &res->desc[i].num); if (ret) { dev_dbg(dev, "type %d subtype %d not allocated for host %d\n", - resource_type, resource_subtype, + dev_id, resource_subtype, handle_to_ti_sci_info(handle)->host_id); res->desc[i].start = 0; res->desc[i].num = 0; @@ -3148,7 +3104,7 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, valid_set = true; dev_dbg(dev, "res type = %d, subtype = %d, start = %d, num = %d\n", - resource_type, resource_subtype, res->desc[i].start, + dev_id, resource_subtype, res->desc[i].start, res->desc[i].num); res->desc[i].res_map = @@ -3172,7 +3128,6 @@ static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = { /* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */ .max_msgs = 20, .max_msg_size = 64, - .rm_type_map = NULL, }; /* Description for AM654 */ @@ -3183,7 +3138,6 @@ static const struct ti_sci_desc ti_sci_pmmc_am654_desc = { /* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */ .max_msgs = 20, .max_msg_size = 60, - .rm_type_map = NULL, }; static const struct udevice_id ti_sci_ids[] = {