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=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=unavailable 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 0067FC4360F for ; Thu, 4 Apr 2019 11:27:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C4C1C206C0 for ; Thu, 4 Apr 2019 11:27:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NKlRxCM5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4C1C206C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jAivFUp2UkOnSojqLyGOCQvWU2fKkAtffDCM76eRNz4=; b=NKlRxCM56nRSeNj7POO+cXzVU 1DsNyX2mO/bXx8EJ1ssfHlUXEe2ztloV7m3mnjqpxO6SmIIeXCVkRNxcFuMco2MFVO0YZu0/dOEao rUDLJm6ws/quMn9NC9tfXpd2ziZcU9U+xETAMpbXN/2a9bPQMdWFiR0pltm0KCHY1ycP2quo8BX+Z U5SETcaajqWua3wsg+I8xMZ3DHQOSp6PZvpNukZ/Vck3Bx/QXRS5upljLTeiSPBd7nZZcKIGo39xT CYnGrSs7no4Ovq9LnL26JixrpUxFkOztSn/Nb6jxuIFy18VssRLz97BexfjrjWPenjRsrrBoiX/qp ploPkasdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hC0Wd-0007nD-G1; Thu, 04 Apr 2019 11:27:19 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hC0Wa-0007mn-NP for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2019 11:27:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 22326EBD; Thu, 4 Apr 2019 04:27:16 -0700 (PDT) Received: from [10.1.196.93] (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF6303F557; Thu, 4 Apr 2019 04:27:14 -0700 (PDT) Subject: Re: [PATCH 23/25] coresight: stm: ACPI support for parsing stimulus base To: mathieu.poirier@linaro.org References: <1553107783-3340-1-git-send-email-suzuki.poulose@arm.com> <1553107783-3340-24-git-send-email-suzuki.poulose@arm.com> <20190328204151.GA7163@xps15> From: Suzuki K Poulose Message-ID: <09baa551-b351-6651-e609-75ed425ae7f4@arm.com> Date: Thu, 4 Apr 2019 12:27:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190328204151.GA7163@xps15> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190404_042716_779892_B8ADDEB6 X-CRM114-Status: GOOD ( 17.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coresight@lists.linaro.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, robert.walker@arm.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mathieu, On 28/03/2019 20:41, Mathieu Poirier wrote: > On Wed, Mar 20, 2019 at 06:49:40PM +0000, Suzuki K Poulose wrote: >> The stimulus base for STM device must be listed as the second memory >> resource, followed by the programming base address. Add support for >> parsing the information for ACPI. >> >> Cc: Mathieu Poirier >> Cc: "Rafael J. Wysocki" >> Signed-off-by: Suzuki K Poulose >> --- >> +#ifdef CONFIG_ACPI >> +static int acpi_stm_get_stimulus_area(struct device *dev, struct resource *res) >> +{ >> + int rc; >> + bool found_base = false; >> + struct resource_entry *rent; >> + LIST_HEAD(res_list); >> + >> + struct acpi_device *adev = ACPI_COMPANION(dev); >> + >> + if (!adev) >> + return -ENODEV; >> + rc = acpi_dev_get_resources(adev, &res_list, NULL, NULL); >> + if (rc < 0) >> + return rc; >> + >> + rc = -ENOENT; >> + list_for_each_entry(rent, &res_list, node) { >> + if (resource_type(rent->res) != IORESOURCE_MEM) >> + continue; >> + if (found_base) { >> + *res = *rent->res; >> + rc = 0; >> + break; >> + } >> + >> + found_base = true; > > Is the ACPI binding crystal clear on the fact that the second resource region > has to be for stimulus ports? Yes. Section 2.3 Resources in ACPI for CoreSightTM 1.0 (DEN0067) : "Each CoresSight component needs to declare the resources it owns using the _CRS method. This must include base address and span covering the MMIO interface of the device. In addition those that can raise interrupts must describe the interrupts they consume. For STM two base addresses must be presented, these must be provided in order. First the configuration base address, and then external stimuli memory region base address" >> static int stm_get_stimulus_area(struct device *dev, struct resource *res) >> { >> if (dev->of_node) > > Wouldn't it be better to use is_of_node()? > >> return of_stm_get_stimulus_area(dev, res); >> + else if (is_acpi_node(dev->fwnode) > > is_acpi_device_node()? > Yes, to both the above. Cheers Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel