lkml.org 
[lkml]   [2020]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: [PATCH v2] spi: spi-nxp-fspi: Add ACPI support
> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Sent: Friday, September 11, 2020 4:46 PM
> To: Mark Brown <broonie@kernel.org>; kuldip dwivedi
> <kuldip.dwivedi@puresoftware.com>
> Cc: Ashish Kumar <ashish.kumar@nxp.com>; Yogesh Gaur
> <yogeshgaur.83@gmail.com>; linux-spi@vger.kernel.org; linux-
> kernel@vger.kernel.org; Varun Sethi <V.Sethi@nxp.com>; Arokia Samy
> <arokia.samy@nxp.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Paul Yang <Paul.Yang@arm.com>
> Subject: Re: [PATCH v2] spi: spi-nxp-fspi: Add ACPI support
>
> On 9/11/20 1:00 PM, Mark Brown wrote:
> > On Fri, Sep 11, 2020 at 01:58:06PM +0530, kuldip dwivedi wrote:
> >
> >> /* find the resources - configuration register address space */
> >> res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> >> "fspi_base");
> >> +#ifdef CONFIG_ACPI
> >> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); #endif
> >
> > This is buggy, it is equivalent to just removing the name based lookup
> > since we'll do the name based lookup then unconditionally overwrite
> > the results with an index based lookup.
> >
>
> Also, note that CONFIG_ACPI kernels may still boot in DT mode.
In case of ACPI we need to use indexed based lookup.
For reference Please see , Line :23 and Line:24
https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platfor
ms/tree/Platform/NXP/LX2160aRdbPkg/AcpiTables/Dsdt/FSPI.asl?h=LX2160_UEFI_
ACPI_EAR3
Here I can think two possible approaches
1. Changes in DT to use indexed based lookup
2. We Can check for ACPI fw node to distinguish between DT and ACPI like
below..
if (is_acpi_node(f->dev->fwnode))
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
else
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"fspi_base");
Please share your thoughts

Thanks

\
 
 \ /
  Last update: 2020-09-11 14:03    [W:0.047 / U:2.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site