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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no 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 6509DC432C0 for ; Tue, 3 Dec 2019 12:26:09 +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 3BB6120684 for ; Tue, 3 Dec 2019 12:26:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jMZrfwB0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bpJPXACy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BB6120684 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HmaW8cAQ1FaxvWtY40PfK3/90c51whpBua55la1NdLk=; b=jMZrfwB0duDg0o Ff+88gZoMJiN4Izn15iWam8qlA7SuUSj0HeqdmGclFqiunRPKDHZkDvHxDM5BpEOi5fwIVt4TjAwO EEYllBxXOFaObKasV74YuykYPzJTOZzggYzVduLwhqWXoZtCNZvy7TCNHmjC3UVhoJk7DeJeXnPQg /yop0LIhSbPwSAoTZCRNWlzAT4XxoqS6zppK7TuKgtZ8m/uF4tUK2qL/xAaEt9VTbixMZroSCd0v2 0GipgXpYsJ9ytwjtW4zqb48e5RS6nv/xB7LnXwJA9QC/emdF5Cm7BA775TTZ8ulcP1qHRKnmsYNSI rhxADwBZX5cZTpw6cnFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ic7Fo-0006nY-Ic; Tue, 03 Dec 2019 12:26:08 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ic7Fl-0006mj-TY for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2019 12:26:07 +0000 Received: by mail-qt1-x843.google.com with SMTP id g24so3473494qtq.11 for ; Tue, 03 Dec 2019 04:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KCV6d9hCioXwDxQSc+9jtdCsRf9f3DSaaCIPQTYGbKY=; b=bpJPXACy569Uou4xeEkwZe9zGcFmIVFTruFj2RkHy7VtyGHrOoGRz3FqXS6kIL+sRo daMX5qEwAaWytvZEWpXQrsbW2BR8GJe0aPT3Cj7ggNoQNY3Dh2zJwsQVDGqIjqUv/hdQ v2w7Is0MN86M34UBMlqsoquVNzg/LUCns7zy7DYnvPW3vKggDzp9hAMv6pdFnZgEqcvf C4CXXVbJGvuwu7Bf8+AGrGMJmfi+XQ46PkOQY/Y8DnSF1xg5jRT4EnhFTXMHrLm63DYi Nr3L1gbqGsTXMpQbHcQsMQwZRuobk3Bz4Nzsvvx5aTaYSsezK7fEDiHD4k3YJUebl9YQ mqrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KCV6d9hCioXwDxQSc+9jtdCsRf9f3DSaaCIPQTYGbKY=; b=Ds5OnGxi8ff+L51LayMzPzOPuo9byjhbfXmwJKUDZeDAW+7KLHXHzqmDiuphHOzMSo JBxT/YlcR41MuL8mnOxPhcoifzrMVjNCktEMSruVlBCiyYIwTTvLTM2lwFZg21WtTbjO 6HBuXxODA3wDI0Ih8y7pJuJmakAIjxEd7m7HFZT7w3PMK1KoSsHZhgkEPes0OxckwGL7 1xQCcO2z/CadJnkQNYSWkeLb1Aki6SzXD8cxMKbsvUhb2yFi4q7ImeYHgFT2NmaVlpt3 x7IJUVg/dR25WvaPSB+1gvidmGFfBeYDeB5Bp5lYO/q2q9ylo27q7yyvdLHyO+KVA6ln w42w== X-Gm-Message-State: APjAAAVCkbYzpb19Yz87m32D3LV7MDIWtN0+xFH9F5V/85tLJcjr3jW9 F47A78R44daqz+DJ/23F3L24TAvF2dtQm0vmTwKhVQ== X-Google-Smtp-Source: APXvYqweLlybh/rT5gfnZhz0yyuec8Zuu65/mrhliV+x4arFaG745EaW3zCKngE6hVl+mIngkPeM29sDhed2WB7clT0= X-Received: by 2002:ac8:1098:: with SMTP id a24mr4859094qtj.62.1575375964252; Tue, 03 Dec 2019 04:26:04 -0800 (PST) MIME-Version: 1.0 References: <20191119231912.12768-1-mike.leach@linaro.org> <20191119231912.12768-7-mike.leach@linaro.org> In-Reply-To: From: Mike Leach Date: Tue, 3 Dec 2019 12:25:52 +0000 Message-ID: Subject: Re: [PATCH v5 06/14] coresight: cti: Add device tree support for v8 arch CTI To: Suzuki Kuruppassery Poulose X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191203_042605_964706_C707F9D2 X-CRM114-Status: GOOD ( 27.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Coresight ML , Mathieu Poirier , linux-arm-kernel , "open list:DOCUMENTATION" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Suzuki, On Tue, 3 Dec 2019 at 11:28, Suzuki Kuruppassery Poulose wrote: > > On 03/12/2019 10:59, Mike Leach wrote: > > Hi Suzuki, > > > > On Fri, 29 Nov 2019 at 11:33, Suzuki Kuruppassery Poulose > > wrote: > >> > >> On 19/11/2019 23:19, Mike Leach wrote: > >>> The v8 architecture defines the relationship between a PE, its optional ETM > >>> and a CTI. Unlike non-architectural CTIs which are implementation defined, > >>> this has a fixed set of connections which can therefore be represented as a > >>> simple tag in the device tree. > >>> > >>> This patch defines the tags needed to create an entry for this PE/ETM/CTI > >>> relationship, and provides functionality to implement the connection model > >>> in the CTI driver. > >>> > >>> Signed-off-by: Mike Leach > >>> --- > > > >>> +#ifdef CONFIG_OF > >>> +/* > >>> + * CTI can be bound to a CPU, or a system device. > >>> + * CPU can be declared at the device top level or in a connections node > >>> + * so need to check relative to node not device. > >>> + */ > >>> +static int of_cti_get_cpu_at_node(const struct device_node *node) > >>> +{ > >>> + int cpu; > >>> + struct device_node *dn; > >>> + > >>> + if (node == NULL) > >>> + return -1; > >>> + > >>> + dn = of_parse_phandle(node, "cpu", 0); > >>> + /* CTI affinity defaults to no cpu */ > >>> + if (!dn) > >>> + return -1; > >>> + cpu = of_cpu_node_to_id(dn); > >>> + of_node_put(dn); > >>> + > >>> + /* No Affinity if no cpu nodes are found */ > >>> + return (cpu < 0) ? -1 : cpu; > >>> +} > >>> + > >>> +static const char *of_cti_get_node_name(const struct device_node *node) > >>> +{ > >>> + if (node) > >>> + return node->full_name; > >>> + return "unknown"; > >>> +} > >>> +#else > >>> +static int of_cti_get_cpu_at_node(const struct device_node *node) > >>> +{ > >>> + return -1; > >>> +} > >>> + > >>> +static const char *of_cti_get_node_name(const struct device_node *node) > >>> +{ > >>> + return "unknown"; > >>> +} > >>> +#endif > >>> + > >>> +static int cti_plat_get_cpu_at_node(struct fwnode_handle *fwnode) > >>> +{ > >> > >> You may simply reuse coresight_get_cpu() below, instead of adding this > >> duplicate set of functions. See below. > >> > >> > > > > No we can't. coresight_get_cpu gets the 'cpu' entry relative to the > > device node, this gets the 'cpu' relative to the supplied node. > > This is very important for the case where a none v8 architected PE is > > attached to a CTI. This will use the devicetree form:- > > > > cti@ { > > [ some stuff ] > > trig_conns@1 { > > cpu = <&CPU0> > > [trigger signal connection info for this cpu] > > } > > } > > > > trig_conns is a child node and we must look for 'cpu' relative to it. > > Ok. May be we could refactor the function to find the 'CPU' node > relative to the given "fwnode" and let the coresight_get_cpu() use it ? > > int coresight_get_cpu(struct device *dev) > { > return coresight_get_fwnode_cpu(dev_fwnode(dev)); > } > > That way it is clear what we are dealing with. i.e, fwnode of any level > (device or an intermediate node). > At present the generic coresight_get_cpu() deals with both DT and ACPI bindings. To refactor this would require re-factoring both binding types - and at present we have no definition for ACPI bindings for CTI and hence no way of knowing how the embedded cpu node is going to be represented. I think we have to take just the DT binding as is for now as a CTI specific element and consider if it is worth re-factoring once the ACPI bindings are defined Regards Mike > >>> + csdev = cti_get_assoc_csdev_by_fwnode(cs_fwnode); > >>> + if (csdev) > >>> + assoc_name = dev_name(&csdev->dev); > >> > >> Does it make sense to defer the probing until the ETM device turn up ? > >> Its fine either way. > >> > > > > Not really as the ETM is optional but the PE still has a CTI. > > Ah, you're right. Please ignore my comment. > > Kind regards > Suzuki -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel