From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C203C43219 for ; Thu, 24 Nov 2022 11:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RUVwGTBlk7gEh9W4IWZ2HSAxgCnZxGEPIi+R6tJvjs4=; b=GB0RyKH8pv0shB k/rfIITOMSWFujwVk+XdjHzxebEvIbINb4hc+KfYWSTNpUhAm1yYqG3SyRNvG5tU6MxkaNHd5s08H TZGabcVjKpwXB2AYDpxaab4VzEDQ5nN4LJTY1kfRHwd1BOsi0uUyoJKN8TtqP97ej8U/l4BPGGHHq LHblhB1vVf7/idHEy7t8ImC4HDUbqT+enDb3bZz0Fg2YdT4koTKL+ki04wxVoXXCCOESsTB6XTklb 71QcKGEsACPyRs10u1B1gwipZ3pbq+3Q+h3VYmQbmnVVbPM1TQ6KutYyKdzs5xM3eZFfiIEHTU53w Fiby0sO98LLv9iCMJMKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyA10-007scG-Qi; Thu, 24 Nov 2022 11:03:35 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyA0u-007sYl-LG for linux-arm-kernel@lists.infradead.org; Thu, 24 Nov 2022 11:03:31 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B7FB823A; Thu, 24 Nov 2022 03:03:32 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.5.138]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2877B3F587; Thu, 24 Nov 2022 03:03:25 -0800 (PST) Date: Thu, 24 Nov 2022 11:03:22 +0000 From: Mark Rutland To: Wang Honghui Cc: Sudeep Holla , Cristian Maruss , Jassi Brar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] arm_scpi: modify to support acpi Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_030328_793077_D31DF592 X-CRM114-Status: GOOD ( 17.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 24, 2022 at 03:09:31PM +0800, Wang Honghui wrote: > arm_scpi: modify to support acpi > > Signed-off-by: Wang Honghui > @@ -937,55 +952,116 @@ static int scpi_probe(struct platform_device *pdev) > if (ret) > return ret; > > - for (; scpi_drvinfo->num_chans < count; scpi_drvinfo->num_chans++) { > - resource_size_t size; > - int idx = scpi_drvinfo->num_chans; > - struct scpi_chan *pchan = scpi_drvinfo->channels + idx; > - struct mbox_client *cl = &pchan->cl; > - struct device_node *shmem = of_parse_phandle(np, "shmem", idx); > - > - if (!of_match_node(shmem_of_match, shmem)) > - return -ENXIO; > + /* Wang Honghui modified to support acpi */ > + if (dev->of_node) { [...] > + } else { > + for (; scpi_info->num_chans < count; scpi_info->num_chans++) { > + u32 size; > + u32 addr; > + int idx = scpi_info->num_chans; > + struct scpi_chan *pchan = scpi_info->channels + idx; > + struct mbox_client *cl = &pchan->cl; > + struct fwnode_handle *fn; > + > + fn = dev_fwnode(&(pdev->dev)); > + ret = fwnode_property_read_u32(fn, "shmem_start", &addr); > + if (ret < 0) { > + dev_err(dev, "failed to get SCPI payload mem resource\n"); > + return ret; > + } > + > + ret = fwnode_property_read_u32(fn, "shmem_size", &size); > + if (ret < 0) { > + dev_err(dev, "failed to ioremap SCPI payload\n"); > + return -EADDRNOTAVAIL; > + } ACPI has native mechanisms to describe IO resources, so this doesn't look right at all. Does ARM have ACPI bindings for SCPI? I don't think we should be inventing vendor-specific bindings for this.... > + if (!ret) { > + pchan->chan = phytium_mbox_request_channel(cl); ... so this looks very wrong. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel