Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8736534rwb; Thu, 24 Nov 2022 03:43:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf6J+nOKZymsCqqd9io5eqeLY+tAZwBmy5zjS352Kx5MI6+Q4klimZLFmZU6ayEOiKjFLuUv X-Received: by 2002:aa7:c58f:0:b0:469:668:3a63 with SMTP id g15-20020aa7c58f000000b0046906683a63mr27550183edq.331.1669290227297; Thu, 24 Nov 2022 03:43:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669290227; cv=none; d=google.com; s=arc-20160816; b=JxGKs/AcpdFDGzlSTJCS/NVNV153Yn1WeGDelTOFP39l7IZeH7UD15eEh3hzZs58wf Hk9btT+uVdwLVY10Oes1VTsqWV8ADziBmeNAw2lyr6nY8DuWnpcI3K6jSSv8PRDZTOMn DpE6/o64wfofMfPIHcy920+n8k+BSTLsaxzB2QbD/9AgjT8b7pYBk3uOhKjIIoDtriqq X1HxIfWZl2NT1yVU+QQVydUgg2mYEUdcCDaACbPEDJaUVeLmFP/Ln0eCSiDR9r4+qNDq 3y+pd+l6ImNSmE9T4opq6myQleYW8asKHkvka/v7AOikZFLVO28UlkhUrFEadHyWpGWv hhWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=XM9ks47Jb/bVZibEz088q+KAjC5SReGA+bcLQDyOSwQ=; b=PWojeWY8SJGcIY5TgcNLadQrJu520xZfsfrZLrlZq9S76aDnCQrR9dxGxpWcah8vQV 3syVSCNcCkf/Za2U4bowKXku46dcp080xZLtDSPHcOzKhzOTtaQ5lXIZMGC5wcwZa3vS 3200eAesr8HE1c8X3RqYk6ffdP8yQwydM5BTSyUf53Cg4jXXU7U1DOZ0yWCn7RchAIa6 Dv2Kk9HIGIeWQZlFyApSC5eC1RhSWnS6uwB4vYY6C6KpJhLv/mFTEdrdM5Gp7C/z0Sol vSK1tUkvwfZMbJDOiFYCtUPfqNDVhRahLGQMzIu5nwRHfaxi+jmxQHVtggcENTVMyNLU 0Eqw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eq9-20020a056402298900b00459060fce1bsi717929edb.574.2022.11.24.03.43.22; Thu, 24 Nov 2022 03:43:47 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbiKXLDh (ORCPT + 86 others); Thu, 24 Nov 2022 06:03:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbiKXLD2 (ORCPT ); Thu, 24 Nov 2022 06:03:28 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6F43F61BBB for ; Thu, 24 Nov 2022 03:03:26 -0800 (PST) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 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.