From patchwork Thu Nov 15 01:28:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 10683409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B51314D6 for ; Thu, 15 Nov 2018 01:31:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43F782C09F for ; Thu, 15 Nov 2018 01:31:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3769A2C0AF; Thu, 15 Nov 2018 01:31:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD5662C09F for ; Thu, 15 Nov 2018 01:31:19 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MiSZEG4N1hhHCX6IFiX3nq9/T0vkxMDobH/yc88Gh2A=; b=JsyPP+Kw+ajDEO mwB/EX43wbOVNlmiX3S2AjKILmj9MQGfb1Lc+EUiRKd9Xqd56Ln7AXOTgHRDLro6wdvvDE53307dE 0Q18FVocLippoEGPzKY3yDxQL8D2QO/zVmrGj6+AJBDY0xcJWHwifFuNBMHt05fvvQDXGwFFlIB3p 4zsXS+GSnGNRQBGqVPtNww7iteRkqN/BXuVmGzEleVTsR9spFu7HycrKiLYfAKJskf0uws/KkB7M7 LZn39isfBjfKRfywoj3VTM/Q/38SRv8qVryvlN4auNnl+73M5RwXDoq2IXUlK++2buBvb+cRweV/b CX0Rtt5VuB744RomvxkQ==; 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 1gN6Uw-00018M-Hn; Thu, 15 Nov 2018 01:31:10 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN6Ul-0000xS-3m for linux-arm-kernel@lists.infradead.org; Thu, 15 Nov 2018 01:31:00 +0000 Received: by mail-wm1-x342.google.com with SMTP id f10-v6so17165560wme.3 for ; Wed, 14 Nov 2018 17:30:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xHSv5vgxSr8YmVa5kWyp/vxFkBRT3PMtEIqZhvTEefI=; b=ZfXkS4Urdwiwp6RHn9FNstp6RVrr0sakEXABz6uFMrGI0UuTKST0LJXK8iTjMh1yEI bifuNvgWltE9KWVMIEZ85bqXdMVWU1j0m1ta11NCAEKGdRbJchgShvbj26Xnnjbok21P 22wZgayBSTb8EvqMt9AxtjExA66BZBn17TQmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xHSv5vgxSr8YmVa5kWyp/vxFkBRT3PMtEIqZhvTEefI=; b=BkQvTA3zsk9dRtUTmjNTlfhpuLBlEU0MTwgzzzOW8DFT6Uhjc6PV+PqmrJ85YDVfUW FHYg5lKjRbrbeo/RY2ys0yMk1VIp+gEYdxuc9646uI8JM9wq+HblvDYJo0X+9mjRUGxb WxyisCZPbElggM9diNQPxbgdXgSbhGgyPhINqe9bRZXuioNwlZVehgZBwPU1L54vu3gL BHgwQVCl6uiTycjkrfBAef+cfmjYuTtXJmD5T7ITSIT9Yjh5Z2MU1iqkpQxIhua+dxcE 1e5JnjW4o3bSocrwxqel3gwxdGKuFKFWphFJyUqbJ73nqUUtH9uSqsffP0IKo5MV0XoV Ql6A== X-Gm-Message-State: AGRZ1gLssKFtd+z86BS1HIzpxbh3b05eZpBNO6VPuA7QdGBkmSUj1M4d T+pF8dhni7I/Px/PdbsknK7tLA== X-Google-Smtp-Source: AJdET5fyLxMqa5iECpFpbE+w5XtpWGYpJD4yJugFI3Cod1rgSb7bJV/d721Kav9KLUqpdbqxPgDLrw== X-Received: by 2002:a1c:28c6:: with SMTP id o189-v6mr3367657wmo.89.1542245447409; Wed, 14 Nov 2018 17:30:47 -0800 (PST) Received: from linaro.org (host86-129-101-165.range86-129.btcentralplus.com. [86.129.101.165]) by smtp.gmail.com with ESMTPSA id v23-v6sm17219890wrd.92.2018.11.14.17.30.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Nov 2018 17:30:46 -0800 (PST) From: Mike Leach To: mathieu.poirier@linaro.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 1/3] drivers: amba: Updates to component identification for driver matching. Date: Thu, 15 Nov 2018 01:28:40 +0000 Message-Id: <20181115012842.2353-2-mike.leach@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115012842.2353-1-mike.leach@linaro.org> References: <20181115012842.2353-1-mike.leach@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181114_173059_150763_4C9CF669 X-CRM114-Status: GOOD ( 19.91 ) 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: Mike Leach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The CoreSight specification (ARM IHI 0029E), updates the ID register requirements for components on an AMBA bus, to cover both traditional ARM Primecell type devices, and newer CoreSight and other components. The Peripheral ID (PID) / Component ID (CID) pair is extended in certain cases to uniquely identify components. CoreSight components related to a single function can share Peripheral ID values, and must be further identified using a Unique Component Identifier (UCI). e.g. the ETM, CTI, PMU and Debug hardware of the A35 all share the same PID. Bits 11:8 of the CID are defined to be the device class. Class 0xF remains for PrimeCell and legacy components. Class 0x9 defines the component as CoreSight (CORESIGHT_CID above) Class 0x0, 0x1, 0xB, 0xE define components that do not have driver support at present. Class 0x2-0x8,0xA and 0xD-0xD are presently reserved. The specification futher defines which classes of device use the standard CID/PID pair, and when additional ID registers are required. The patches provide an update of amba_device and matching code to handle the additional registers required for the Class 0x9 (CoreSight) UCI. The *data pointer in the amba_id is used by the driver to provide extended ID register values for matching. CoreSight components where PID/CID pair is currently sufficient for unique identification need not provide this additional information. Signed-off-by: Mike Leach --- drivers/amba/bus.c | 48 ++++++++++++++++++++++++++++++++++++---- include/linux/amba/bus.h | 33 +++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 41b706403ef7..6eab977f4314 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -26,6 +26,28 @@ #define to_amba_driver(d) container_of(d, struct amba_driver, drv) +/* called on periphid match and class 0x9 coresight device. */ +static int amba_uci_match(const struct amba_id *table, struct amba_device *dev) +{ + int ret = 0; + struct amba_cs_uci_id *uci; + + uci = table->data; + + /* no table data - return match on periphid */ + if (!uci) + return 1; + + if (uci->devarch) { + ret = (dev->uci.devtype == uci->devtype) && + ((dev->uci.devarch & uci->mask) == uci->devarch); + } else { + /* devtype only if devarch set to 0 */ + ret = dev->uci.devtype == uci->devtype; + } + return ret; +} + static const struct amba_id * amba_lookup(const struct amba_id *table, struct amba_device *dev) { @@ -33,11 +55,17 @@ amba_lookup(const struct amba_id *table, struct amba_device *dev) while (table->mask) { ret = (dev->periphid & table->mask) == table->id; - if (ret) - break; + /* matched on periphid - check UCI if CoreSight */ + if (ret) { + if (dev->cid == CORESIGHT_CID) { + ret = amba_uci_match(table, dev); + if (ret) + break; + } else + break; + } table++; } - return ret ? table : NULL; } @@ -399,10 +427,22 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent) cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) << (i * 8); + if (cid == CORESIGHT_CID) { + /* set the base to the start of the last 4k block */ + void __iomem *csbase = tmp + size - 4096; + + dev->uci.devarch = + readl(csbase + UCI_REG_DEVARCH_OFFSET); + dev->uci.devtype = + readl(csbase + UCI_REG_DEVTYPE_OFFSET) & 0xff; + } + amba_put_disable_pclk(dev); - if (cid == AMBA_CID || cid == CORESIGHT_CID) + if (cid == AMBA_CID || cid == CORESIGHT_CID) { dev->periphid = pid; + dev->cid = cid; + } if (!dev->periphid) ret = -ENODEV; diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index d143c13bed26..a83a0a3dece8 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -25,6 +25,36 @@ #define AMBA_CID 0xb105f00d #define CORESIGHT_CID 0xb105900d +/* + * CoreSight Architecture specification updates the ID specification + * for components on the AMBA bus. (ARM IHI 0029E) + * + * Bits 11:8 of the CID are the device class. + * + * Class 0xF remains for PrimeCell and legacy components. (AMBA_CID above) + * Class 0x9 defines the component as CoreSight (CORESIGHT_CID above) + * Class 0x0, 0x1, 0xB, 0xE define components that do not have driver support + * at present. + * Class 0x2-0x8,0xA and 0xD-0xD are presently reserved. + * + * Remaining CID bits stay as 0xb105-00d + */ + +/* + * Class 0x9 components use additional values to form a Unique Component + * Identifier (UCI), where peripheral ID values are identical for different + * components. Passed to the amba bus code from the component driver via + * the amba_id->data pointer. + */ +struct amba_cs_uci_id { + unsigned int devarch; + unsigned int mask; + unsigned int devtype; +}; + +#define UCI_REG_DEVTYPE_OFFSET 0xFCC +#define UCI_REG_DEVARCH_OFFSET 0xFBC + struct clk; struct amba_device { @@ -32,6 +62,8 @@ struct amba_device { struct resource res; struct clk *pclk; unsigned int periphid; + unsigned int cid; + struct amba_cs_uci_id uci; unsigned int irq[AMBA_NR_IRQS]; char *driver_override; }; @@ -61,6 +93,7 @@ enum amba_vendor { (((conf) & 0xff) << 24 | ((rev) & 0xf) << 20 | \ AMBA_VENDOR_LINUX << 12 | ((part) & 0xfff)) + extern struct bus_type amba_bustype; #define to_amba_device(d) container_of(d, struct amba_device, dev) From patchwork Thu Nov 15 01:28:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 10683413 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D917D14DB for ; Thu, 15 Nov 2018 01:31:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0DFE2C09F for ; Thu, 15 Nov 2018 01:31:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3FBD2C0AF; Thu, 15 Nov 2018 01:31:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5F62F2C09F for ; Thu, 15 Nov 2018 01:31:47 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1uCoG7PLjmepuQRhymb7AabpLU0+Ehea2Qb3dfGvqcI=; b=OgQ4FljRvl6Jgd rdkyWDSQmnG/67OoT97OMkeng86PDLRqkCfBv7DRh9ABZbmgnX6BOWa7oRQZrMy2pl+MyayiuK7Io 1E58z0BP17/D0cnz6LABDgjWh/AR1yJ0j9PEuxDzXygClU8iUIZMFsZqxSSuuqJlDUUAMClOKkakL Ct1JWjNoJ9nRHSPvodXQLl0kMbNKys9OUaUWwf448wIH75yxb9HDjAX66FKfKajMtEDiUcj3qUWL/ 4F3fwUamAZN+l06M+xtx1UT6JfbLV/LHIQuuKn3D31LzTDz3hWB+Of77+RReiFn0feM+8V+I59oHH lMCXneKfBrNdRTmn7Nag==; 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 1gN6VM-0001eF-Pz; Thu, 15 Nov 2018 01:31:36 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN6Um-0000xT-Ra for linux-arm-kernel@lists.infradead.org; Thu, 15 Nov 2018 01:31:02 +0000 Received: by mail-wr1-x442.google.com with SMTP id z13-v6so19363285wrs.3 for ; Wed, 14 Nov 2018 17:30:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8Yp4sGqGBab6tZEJM57aUksriP+p2+t07efziwws/O0=; b=glDYf3kOvnI4/u6DJvJ7I/TINhiRTdjuxZYdeha1Oc0vXR20sJxcBySU7CHnCz2DW9 0ssghk63b5/JQBRnfjuUWxcUKBpaD9JbdcSjw1oZrhmi81mfPYUilUrrLbQ+HrsLmlpY +Aa8D9yXzf3zvwlP8Rfv2d9Xsx9+qRUvHhFdo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8Yp4sGqGBab6tZEJM57aUksriP+p2+t07efziwws/O0=; b=uIt3n8SY8xMk4FgHdHna35gl3wshxkG2550PlzPwMri4a4lalKwautHNzLsOjz9oQ7 GRbidBKFlksvYFGag0u/R4fdPAmAy/PHpiNPre++JumAHP5HyjbU8BoNnV+KesfcvnJ4 r7p7kww16bYzYo5519VIEjycV0MwZIBKGKsq4rkqlJ5aYrM1nrLVbr5X84wEqhkeZuuj qmsVTG0H4oibqYHmO7SpRyMJpR/5+9SkPRrgQrHKohQ6U4OK46oPkZBaVgFRZsd+sLAe 2Ggckq6JTbWA16iza+6A9Zz0RW0aMo3zvSkj8S+dbYvnJfA63jFaeouirsYc5zdgjdTe QOYg== X-Gm-Message-State: AGRZ1gKvV9N3rrF9DFVlA/1Ou0kwQX3w7kmqukgdly4uH7WUt+kEDjql xm8bh7Vqygytj/uGDFcxmbsDHA== X-Google-Smtp-Source: AJdET5c2Gx5CqcZt8WNEzay+Iw++E99jxW4Q/kVYzTq09eAAao/YrNl7KOdPiqhobebiuuyJlRmNPg== X-Received: by 2002:a5d:6585:: with SMTP id q5-v6mr3965203wru.141.1542245448407; Wed, 14 Nov 2018 17:30:48 -0800 (PST) Received: from linaro.org (host86-129-101-165.range86-129.btcentralplus.com. [86.129.101.165]) by smtp.gmail.com with ESMTPSA id v23-v6sm17219890wrd.92.2018.11.14.17.30.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Nov 2018 17:30:47 -0800 (PST) From: Mike Leach To: mathieu.poirier@linaro.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 2/3] coresight: etmv4: Update ID register table to add UCI support Date: Thu, 15 Nov 2018 01:28:41 +0000 Message-Id: <20181115012842.2353-3-mike.leach@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115012842.2353-1-mike.leach@linaro.org> References: <20181115012842.2353-1-mike.leach@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181114_173100_909928_37AE34DE X-CRM114-Status: GOOD ( 14.57 ) 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: Mike Leach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Updates the ID register tables to contain a UCI entry for the A35 ETM device to allow correct matching of driver in the amba bus code. Signed-off-by: Mike Leach --- drivers/hwtracing/coresight/coresight-etm4x.c | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 53e2fb6e86f6..1dcb7e14ea6b 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1073,12 +1073,28 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) .mask = 0x000fffff, \ } +static struct amba_cs_uci_id uci_id_etm4[] = { + { + /* ETMv4 UCI data */ + .devarch = 0x00004a13, + .mask = 0x0000ffff, + .devtype = 0x00000013, + } +}; + +#define ETM4x_AMBA_UCI_ID(pid) \ + { \ + .id = pid, \ + .mask = 0x000fffff, \ + .data = uci_id_etm4, \ + } + static const struct amba_id etm4_ids[] = { - ETM4x_AMBA_ID(0x000bb95d), /* Cortex-A53 */ - ETM4x_AMBA_ID(0x000bb95e), /* Cortex-A57 */ - ETM4x_AMBA_ID(0x000bb95a), /* Cortex-A72 */ - ETM4x_AMBA_ID(0x000bb959), /* Cortex-A73 */ - ETM4x_AMBA_ID(0x000bb9da), /* Cortex-A35 */ + ETM4x_AMBA_ID(0x000bb95d), /* Cortex-A53 */ + ETM4x_AMBA_ID(0x000bb95e), /* Cortex-A57 */ + ETM4x_AMBA_ID(0x000bb95a), /* Cortex-A72 */ + ETM4x_AMBA_ID(0x000bb959), /* Cortex-A73 */ + ETM4x_AMBA_UCI_ID(0x000bb9da), /* Cortex-A35 */ {}, }; From patchwork Thu Nov 15 01:28:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 10683411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D53014DB for ; Thu, 15 Nov 2018 01:31:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E92B02C09F for ; Thu, 15 Nov 2018 01:31:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBCFE2C0AF; Thu, 15 Nov 2018 01:31:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6E4A92C09F for ; Thu, 15 Nov 2018 01:31:21 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fMMQv1+Inv1v/esa5EJZE9obkY/5E7O/ld0s51lqZ78=; b=HjrxDNBzOOgimu AvkRt9uxK/DmFs1KePfFtwR0tlHR+gm+/l49h2CXgKOHaGnGu4raxl5emBEt+9g2jLs2OQMGpckep GrCTOukq7174JCQxkkLzLAMnKuj5bvmu6uJGknzDzAQi/TzitdQxro6QnFxQ21iRoLpA/UpO0HSmu +CaXVb5whPbE3Qa2DRl2oD8G/5N4irgDHSkBqyLaPHJLBdt3zZNCOSPoXVD0Yvm2NgqTEqOkyqc9w t8Es/2MHfrj/25jD90aWlA4ZdeTvjcD8oZ0f2sM4Hvr/bwFDOC1UK7rGFDji3dS/Xe2b/kemicYvb Ih7n/RC4tKIUEf5QDxRA==; 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 1gN6V5-0001Mc-Oa; Thu, 15 Nov 2018 01:31:19 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN6Un-0000xU-9j for linux-arm-kernel@lists.infradead.org; Thu, 15 Nov 2018 01:31:02 +0000 Received: by mail-wr1-x441.google.com with SMTP id j10so5144509wru.4 for ; Wed, 14 Nov 2018 17:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D0NWtVdUkvf03gEAl6Mgz7ASn2+epe5rCmKA11S9J80=; b=guaxGoNX1PrS5dChvu/u7OE5US3IV3iR3bg93ZvSl83edrSsIMEgRBBr22+83H7zmu w8EG3uidWNg5y5xPu9+Ebe4j66nfPdxArdoRzW93pjNqS/uDcfx09/MfQr8Bm8sE26wb AACYU4sIeWmqBmxJbqRSqmNe0eEXMGyHMOS54= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D0NWtVdUkvf03gEAl6Mgz7ASn2+epe5rCmKA11S9J80=; b=jW3sZgPSuUanKPMrJm7SM9TktFaTy4cqt9CCdfq4dE533Cf6qd3+r3Bmq9RP7TLOfG xcCYdCYtYRpBffzIVJHQA3LZqX/voGfctGGCJ+ztZPIofukvpRvPRpHyfCqMM3R7NTRq L+Usa/UNTcVsnx6Jhw9rlu7MgnuCImw4TruHfV36YFAoFY9cTHe16kapxIbY0MzmGn/n YNCRorpMXE5naUqdxsxW+jqFrPaaRlqTGD5BjsUNi1meObje5rameZSTFo+5IMsPz650 0JgXSyW55HVEEAvhr84KnW3UZvCoJdB3t7RI/FcIpwRf3gOtZYB09aTzzBn5Okr/4XsS VGZw== X-Gm-Message-State: AGRZ1gJEuLk0PnLrLNf9OpJN655yti0M5pW6Z9NAKEvykQttfdaXT+4W oe7WHw3gP9yh10xtLyVkkCShFg== X-Google-Smtp-Source: AJdET5ck9AEmS/RlszMycLUxfyWc5QLw7P0jvD/R04lnxUDA6hvuGkBpoGPA51a3y00nzK0gl/uBxA== X-Received: by 2002:a5d:5206:: with SMTP id j6-v6mr3718256wrv.147.1542245449563; Wed, 14 Nov 2018 17:30:49 -0800 (PST) Received: from linaro.org (host86-129-101-165.range86-129.btcentralplus.com. [86.129.101.165]) by smtp.gmail.com with ESMTPSA id v23-v6sm17219890wrd.92.2018.11.14.17.30.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Nov 2018 17:30:49 -0800 (PST) From: Mike Leach To: mathieu.poirier@linaro.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 3/3] amba: coresight: Driver test for new CoreSight UCI matching Date: Thu, 15 Nov 2018 01:28:42 +0000 Message-Id: <20181115012842.2353-4-mike.leach@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115012842.2353-1-mike.leach@linaro.org> References: <20181115012842.2353-1-mike.leach@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181114_173101_360245_BCC42016 X-CRM114-Status: GOOD ( 18.36 ) 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: Mike Leach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds in logging and modifications to amba driver, etmv4 driver and DB410C device tree to allow testing of the new UCI component matching algorithm used for certain class of components on an AMBA bus. Signed-off-by: Mike Leach --- arch/arm64/boot/dts/qcom/msm8916.dtsi | 9 +++++++++ drivers/amba/bus.c | 13 ++++++++++++- drivers/hwtracing/coresight/coresight-etm4x.c | 3 ++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index d302d8d639a1..c8b503a63b2c 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -1368,6 +1368,15 @@ }; }; + /* add an as yet unsupported CTI for UCI test - CPU-0 */ + cti@858000 { + compatible = "arm,coresight-cti", "arm,primecell"; + reg = <0x858000 0x1000>; + + clocks = <&rpmcc RPM_QDSS_CLK>; + clock-names = "apb_pclk"; + }; + venus: video-codec@1d00000 { compatible = "qcom,msm8916-venus"; reg = <0x01d00000 0xff000>; diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 6eab977f4314..3a27d655dcc9 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -31,19 +31,30 @@ static int amba_uci_match(const struct amba_id *table, struct amba_device *dev) { int ret = 0; struct amba_cs_uci_id *uci; + struct device *adev; /* device for test logging */ uci = table->data; + adev = &dev->dev; /* no table data - return match on periphid */ - if (!uci) + if (!uci) { + dev_info(adev, "uci_match: no UCI, use periphID\n"); return 1; + } if (uci->devarch) { ret = (dev->uci.devtype == uci->devtype) && ((dev->uci.devarch & uci->mask) == uci->devarch); + dev_info(adev, "device: devtype[%x]; devarch[%x];\n", + dev->uci.devtype, dev->uci.devarch); + dev_info(adev, "uci_match: devtype[%x]; devarch[%x]; (%s)\n", + uci->devtype, uci->devarch, + ret ? "match" : "no match"); } else { /* devtype only if devarch set to 0 */ ret = dev->uci.devtype == uci->devtype; + dev_info(adev, "uci_match: devtype-only[%x]; (%s)\n", + uci->devtype, ret ? "match" : "no match"); } return ret; } diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 1dcb7e14ea6b..13d674a02194 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1090,11 +1090,12 @@ static struct amba_cs_uci_id uci_id_etm4[] = { } static const struct amba_id etm4_ids[] = { - ETM4x_AMBA_ID(0x000bb95d), /* Cortex-A53 */ + ETM4x_AMBA_UCI_ID(0x000bb95d), /* C-A53 - UCI optional for test */ ETM4x_AMBA_ID(0x000bb95e), /* Cortex-A57 */ ETM4x_AMBA_ID(0x000bb95a), /* Cortex-A72 */ ETM4x_AMBA_ID(0x000bb959), /* Cortex-A73 */ ETM4x_AMBA_UCI_ID(0x000bb9da), /* Cortex-A35 */ + ETM4x_AMBA_UCI_ID(0x000bb9a8), /* CTI PID A53 - test fail UCI match */ {}, };