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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE9EEC31E49 for ; Thu, 13 Jun 2019 17:08:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C15A2205ED for ; Thu, 13 Jun 2019 17:08:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729593AbfFMRIs (ORCPT ); Thu, 13 Jun 2019 13:08:48 -0400 Received: from foss.arm.com ([217.140.110.172]:47692 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729910AbfFMRIi (ORCPT ); Thu, 13 Jun 2019 13:08:38 -0400 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 E6C06367; Thu, 13 Jun 2019 10:08:37 -0700 (PDT) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07C4A3F694; Thu, 13 Jun 2019 10:08:36 -0700 (PDT) Date: Thu, 13 Jun 2019 18:08:31 +0100 From: Sudeep Holla To: Udit Kumar Cc: "Schmauss, Erik" , ACPI Devel Maling List , "lenb@kernel.org" , Sudeep Holla , "Rafael J. Wysocki" Subject: Re: [EXT] Re: Help on named object in kernel Message-ID: <20190613170831.GA27717@e107155-lin> References: <20190612170059.GA30299@e107155-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Thu, Jun 13, 2019 at 01:20:32AM +0000, Udit Kumar wrote: > > > > -----Original Message----- > > From: linux-acpi-owner@vger.kernel.org > > On Behalf Of Sudeep Holla > > Sent: Wednesday, June 12, 2019 10:31 PM > > To: Schmauss, Erik > > Cc: Udit Kumar ; ACPI Devel Maling List > acpi@vger.kernel.org>; lenb@kernel.org; Sudeep Holla > > ; Rafael J. Wysocki > > Subject: [EXT] Re: Help on named object in kernel > > > > Caution: EXT Email > > > > On Wed, Jun 12, 2019 at 04:37:09PM +0000, Schmauss, Erik wrote: > > > > > > > > > > -----Original Message----- > > > > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi- > > > > owner@vger.kernel.org] On Behalf Of Udit Kumar > > > > Sent: Wednesday, June 12, 2019 4:48 AM > > > > To: ACPI Devel Maling List > > > > Cc: lenb@kernel.org; Rafael J. Wysocki > > > > Subject: Help on named object in kernel > > > > > > > > Dear ACPI experts, > > > > I need your help on defining named objected in ACPI under _CRS. > > > > In my firmware, I have defined two addresses for my device using > > > > Memory32Fixed and QwordMemory under _CRS. > > > > These two addresses are 32-bit and 64-bit long respectively. > > > > For Memory32Fixed, I gave DescriptorName name as REG0 and for > > > > QwordMemory I gave DescriptorName as SATA. > > > > > > Could you give us the ASL for the code snippet that you're talking about? > > > > > > > IIUC, something like below(a very rough example based on the description > > above): > > > > Name (_CRS, ResourceTemplate (){ > > QwordMemory ( > > ResourceConsumer, PosDecode, MinFixed, MaxFixed, NonCacheable, > > ReadWrite, 0x0, 0x700100520, 0x700100523, 0x0, 4, , , "SATA",) > > Memory32Fixed(ReadWrite, 0x3200000, 0x10000, "REG0") > > } > > > > Basically 2 or more entries of Memory/Address Space Resource Descriptor > > which can be identified in OSPM by DescriptorName. IOW if a device has > > 2 sets of registers/memory/address space associated with it, instead of relying > > on the order of declaration, identify them by the descriptor name provided in > > ASL namespace. > > Thanks Sudeep, > Shouldn't acpi frame work encapsulate descriptor name while adding resource. > So that driver can rely on platform_get_resource_byname . > In such way, same driver could be used with device tree and acpi based systems. > > I am not sure, if acpi_evaluate_xx sort of api would work for > descriptor-name , even if this does it will be limited to acpi only. > IIUC acpi_resource_source should have all the information, just not used for this purpose yet. I do see some uses of string_ptr in that elsewhere. I haven't tried it, but looking at the code I think the support is there already. But the question is who/where will the list of names for such resource is listed for a given HID/CID/... ? -- Regards, Sudeep