From patchwork Mon Feb 1 03:35:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 374208 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp920751jah; Sun, 31 Jan 2021 19:38:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOrUeMXU0huEtxgL3wdpa51WL1grZgHhAjUzevJMELg9ZfXwpbLam0DJhi9GtB0ViMDmAR X-Received: by 2002:a05:6402:524a:: with SMTP id t10mr16973590edd.270.1612150685677; Sun, 31 Jan 2021 19:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612150685; cv=none; d=google.com; s=arc-20160816; b=SW76h82QjVGB12m1eBaGXMPv0fw0H6WUtb0T7qVyVZ7SrkERQqGI+cqBE+9OKOhTrK WWAzUQzSDJI1uUPn8fJr6HiGi16K2pbSimkQs0M33DZHWxgwDRHmI3WGuuheMwevz8ip dAkJa4PviFIyq72YfhYl/ufJVbuCCn8+cdE3EbVWSOciTSCldngO6PFposNJ7ICFdqS5 oJqx5VtX/h/DuyPZZaf+fiWilkUp4kRZclYBLz+L1CSqxCbH56NPPHN/dzoUgMUrPpDh /7Wt86HD257P/Bv6e7O1+pFkGxRfaVU6qBYfBLS9a+s9WmYHnFdyx4M0IFHgS9xzIlY2 mt/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=LW5oG4VDN8KdLQBIZWGq15O0uouKdSkZyZJZBpaDFB8=; b=BFe22kxUPuMSdsVmJr1n+CNgMU1cpDTQXb7yZ+tGlE7X0Ssl/jI+yzFUzV5mNce5hL YEkqS+2MTV7oHeUcPoPUz81mPoq+l1gLeZH6UFyEMPUz9O4eTkVDN2MaulQ57AbwbpGB WqO4pj+H5JdtSo2OBBqHnAJnzVA26f7wfXJC4E/4u6tC2h2nVzNn3eR0c7JkMR17oATs T8fE47WtuQlnf2Y7Zf4DD6smwFjjkTF+0iAyuDA0TZ4oUdXkYn/mL2f0J/XQQ+xGfRwe mRoxD3malONP5HC3Kx2cf+l8WewuRNiSuvjC354120qwKNi1tdORUacziMv/SDQjEEiY rGnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si232941ejf.666.2021.01.31.19.38.05; Sun, 31 Jan 2021 19:38:05 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbhBADiE (ORCPT + 6 others); Sun, 31 Jan 2021 22:38:04 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:11962 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231392AbhBADiC (ORCPT ); Sun, 31 Jan 2021 22:38:02 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DTYWj6P2VzjG05; Mon, 1 Feb 2021 11:36:17 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.176.220) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Mon, 1 Feb 2021 11:37:13 +0800 From: Zhen Lei To: Russell King , Greg Kroah-Hartman , Will Deacon , "Haojian Zhuang" , Arnd Bergmann , Rob Herring , Wei Xu , devicetree , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH v6 0/4] ARM: Add support for Hisilicon Kunpeng L3 cache controller Date: Mon, 1 Feb 2021 11:35:57 +0800 Message-ID: <20210201033601.1642-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.176.220] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org v5 --> v6: 1. Use raw_spin_lock_irqsave() instead of spin_lock_irqsave() 2. Move the macros defined in cache-kunpeng-l3.h into cache-kunpeng-l3.c, and delete that header file. 3. In some places, replace readl()/writel() with readl_relaxed()/writel_relaxed() to improve performance without affecting functions. 4. Returns 0 instead of an error code when Kunpeng L3 Cache matching failed. Thank you for Arnd's review comments and Russell's help. v4 --> v5: 1. Add SoC macro ARCH_KUNPENG50X, and the Kunpeng L3 cache controller only enabled on that platform. 2. Require the compatible string of the Kunpeng L3 cache controller must have a relevant name on a specific SoC. For example: compatible = "hisilicon,kunpeng509-l3cache", "hisilicon,kunpeng-l3cache"; v3 --> v4: Rename the compatible string from "hisilicon,l3cache" to "hisilicon,kunpeng-l3cache". Then adjust the file name, configuration option name, and description accordingly. v2 --> v3: Add Hisilicon L3 cache controller driver and its document. That's: patch 2-3. v1 --> v2: Discard the middle-tier functions and do silent narrowing cast in the outcache hook functions. For example: -static void l2c220_inv_range(unsigned long start, unsigned long end) +static void l2c220_inv_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; v1: Do cast phys_addr_t to unsigned long by adding a middle-tier function. For example: -static void l2c220_inv_range(unsigned long start, unsigned long end) +static void __l2c220_inv_range(unsigned long start, unsigned long end) { ... } +static void l2c220_inv_range(phys_addr_t start, phys_addr_t end) +{ + __l2c220_inv_range(start, end); +} Zhen Lei (4): ARM: LPAE: Use phys_addr_t instead of unsigned long in outercache hooks ARM: hisi: add support for Kunpeng50x SoC dt-bindings: arm: hisilicon: Add binding for Kunpeng L3 cache controller ARM: Add support for Hisilicon Kunpeng L3 cache controller .../arm/hisilicon/kunpeng-l3cache.yaml | 40 ++++ arch/arm/include/asm/outercache.h | 6 +- arch/arm/mach-hisi/Kconfig | 6 + arch/arm/mm/Kconfig | 10 + arch/arm/mm/Makefile | 1 + arch/arm/mm/cache-feroceon-l2.c | 15 +- arch/arm/mm/cache-kunpeng-l3.c | 176 ++++++++++++++++++ arch/arm/mm/cache-l2x0.c | 50 +++-- arch/arm/mm/cache-tauros2.c | 15 +- arch/arm/mm/cache-uniphier.c | 6 +- arch/arm/mm/cache-xsc3l2.c | 12 +- 11 files changed, 308 insertions(+), 29 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/kunpeng-l3cache.yaml create mode 100644 arch/arm/mm/cache-kunpeng-l3.c -- 2.26.0.106.g9fadedd