From patchwork Sat Jan 16 03:27:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 364671 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp422214jap; Fri, 15 Jan 2021 19:33:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcdCxb8oBlF123M4TFAFf2bRnWXlb6rE85junE0GfJo4yBrlfhXkSOwDjRMVX2hoT+wg66 X-Received: by 2002:a17:906:1e87:: with SMTP id e7mr5237662ejj.322.1610768003868; Fri, 15 Jan 2021 19:33:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610768003; cv=none; d=google.com; s=arc-20160816; b=qLc7RVC7MSE5TLdONe4baUYk8SFFqiOq4SfmbUibkdXHHMZeR3rVbROU/KWaelOJ4H SSjQz/YSBybuGXr0Olcu4TBbdj29cGNzmOq/H8SUP4cyJBTRvV2o5kPsiFt1+1MfBXpW LDyiUhsZC1gnqzcIXtpe2dOeNh4xRfHdQj5ZcmtITyqkNdO8IgEm3juR0MEcWvsGKvcP 1VZpOL1n8IqHLw/1zOEXpO2W0tq7J1HWZfHWnh37GMGKeo+x1J0J380aST9eNUxWFBzF MffmzRQlFFFsxHNJbvxM0LaccGOnx5he2OxHNJXdY2A6QKJNejHPZLcy1Xu3bv8XPLH0 zrZg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1d0ivLCSrX+9H524c1Vojlc6XhJRw7mc+WdrngL9/Ag=; b=EJfhlnb/JlokfqnfvI5DFY1b92mH+eRdGo9xcgn+PI4MkfC9/MX62j6Wb1b4J63Iob YuODnMoaW1jAmXFCKGL0Ge7SqM77/8YNognu0fwsIUBi2CQ1VgWTkuos8gGmRaBTR6Ne AOhx6pGlLZ1cw6QSrYl4pZhpoLjBBZBYCVIyTRnKkzrFk3cyfHSu2fgLqY5cm0fcBCsm c8zJFlgdiSFEqbJgnlazCRKM1kZViXeXmY6zyfpgxkMZJymU70RhqbagnQ+vHghKnS0y h5twCPmN/Lib3ZlD29+/N879VgwtIRrA1plgiBoPGUyFnGQYoURunTDDU/OM8WYLrIti iyXQ== 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 q3si4755042ejb.483.2021.01.15.19.33.23; Fri, 15 Jan 2021 19:33:23 -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 S1726157AbhAPDcL (ORCPT + 6 others); Fri, 15 Jan 2021 22:32:11 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11027 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbhAPDcB (ORCPT ); Fri, 15 Jan 2021 22:32:01 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DHk875Psmzj7Qk; Sat, 16 Jan 2021 11:30:15 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.176.220) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 16 Jan 2021 11:31:09 +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 v5 1/4] ARM: LPAE: Use phys_addr_t instead of unsigned long in outercache hooks Date: Sat, 16 Jan 2021 11:27:37 +0800 Message-ID: <20210116032740.873-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210116032740.873-1-thunder.leizhen@huawei.com> References: <20210116032740.873-1-thunder.leizhen@huawei.com> 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 The outercache of some Hisilicon SOCs support physical addresses wider than 32-bits. The unsigned long datatype is not sufficient for mapping physical addresses >= 4GB. The commit ad6b9c9d78b9 ("ARM: 6671/1: LPAE: use phys_addr_t instead of unsigned long in outercache functions") has already modified the outercache functions. But the parameters of the outercache hooks are not changed. This patch use phys_addr_t instead of unsigned long in outercache hooks: inv_range, clean_range, flush_range. To ensure the outercache that does not support LPAE works properly, do cast phys_addr_t to unsigned long by adding a group of temporary variables. 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; Note that the outercache functions have been doing this cast before this patch. So now, the cast is just moved into the outercache hook functions. No functional change. Signed-off-by: Zhen Lei --- arch/arm/include/asm/outercache.h | 6 ++-- arch/arm/mm/cache-feroceon-l2.c | 15 ++++++++-- 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 ++++++-- 6 files changed, 75 insertions(+), 29 deletions(-) -- 2.26.0.106.g9fadedd Reviewed-by: Arnd Bergmann diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h index 3364637755e86aa..4cee1ea0c15449a 100644 --- a/arch/arm/include/asm/outercache.h +++ b/arch/arm/include/asm/outercache.h @@ -14,9 +14,9 @@ struct l2x0_regs; struct outer_cache_fns { - void (*inv_range)(unsigned long, unsigned long); - void (*clean_range)(unsigned long, unsigned long); - void (*flush_range)(unsigned long, unsigned long); + void (*inv_range)(phys_addr_t, phys_addr_t); + void (*clean_range)(phys_addr_t, phys_addr_t); + void (*flush_range)(phys_addr_t, phys_addr_t); void (*flush_all)(void); void (*disable)(void); #ifdef CONFIG_OUTER_CACHE_SYNC diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c index 5c1b7a7b9af6300..10f909744d5e963 100644 --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c @@ -168,8 +168,11 @@ static unsigned long calc_range_end(unsigned long start, unsigned long end) return range_end; } -static void feroceon_l2_inv_range(unsigned long start, unsigned long end) +static void feroceon_l2_inv_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; + /* * Clean and invalidate partial first cache line. */ @@ -198,8 +201,11 @@ static void feroceon_l2_inv_range(unsigned long start, unsigned long end) dsb(); } -static void feroceon_l2_clean_range(unsigned long start, unsigned long end) +static void feroceon_l2_clean_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; + /* * If L2 is forced to WT, the L2 will always be clean and we * don't need to do anything here. @@ -217,8 +223,11 @@ static void feroceon_l2_clean_range(unsigned long start, unsigned long end) dsb(); } -static void feroceon_l2_flush_range(unsigned long start, unsigned long end) +static void feroceon_l2_flush_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; + start &= ~(CACHE_LINE_SIZE - 1); end = (end + CACHE_LINE_SIZE - 1) & ~(CACHE_LINE_SIZE - 1); while (start != end) { diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 43d91bfd2360086..cdaddd772b09ede 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -184,8 +184,10 @@ static void __l2c210_op_pa_range(void __iomem *reg, unsigned long start, } } -static void l2c210_inv_range(unsigned long start, unsigned long end) +static void l2c210_inv_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; void __iomem *base = l2x0_base; if (start & (CACHE_LINE_SIZE - 1)) { @@ -203,8 +205,10 @@ static void l2c210_inv_range(unsigned long start, unsigned long end) __l2c210_cache_sync(base); } -static void l2c210_clean_range(unsigned long start, unsigned long end) +static void l2c210_clean_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; void __iomem *base = l2x0_base; start &= ~(CACHE_LINE_SIZE - 1); @@ -212,8 +216,10 @@ static void l2c210_clean_range(unsigned long start, unsigned long end) __l2c210_cache_sync(base); } -static void l2c210_flush_range(unsigned long start, unsigned long end) +static void l2c210_flush_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; void __iomem *base = l2x0_base; start &= ~(CACHE_LINE_SIZE - 1); @@ -304,8 +310,10 @@ static unsigned long l2c220_op_pa_range(void __iomem *reg, unsigned long start, return flags; } -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; void __iomem *base = l2x0_base; unsigned long flags; @@ -331,8 +339,10 @@ static void l2c220_inv_range(unsigned long start, unsigned long end) raw_spin_unlock_irqrestore(&l2x0_lock, flags); } -static void l2c220_clean_range(unsigned long start, unsigned long end) +static void l2c220_clean_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; void __iomem *base = l2x0_base; unsigned long flags; @@ -350,8 +360,10 @@ static void l2c220_clean_range(unsigned long start, unsigned long end) raw_spin_unlock_irqrestore(&l2x0_lock, flags); } -static void l2c220_flush_range(unsigned long start, unsigned long end) +static void l2c220_flush_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; void __iomem *base = l2x0_base; unsigned long flags; @@ -464,8 +476,10 @@ static const struct l2c_init_data l2c220_data = { * Affects: store buffer * store buffer is not automatically drained. */ -static void l2c310_inv_range_erratum(unsigned long start, unsigned long end) +static void l2c310_inv_range_erratum(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; void __iomem *base = l2x0_base; if ((start | end) & (CACHE_LINE_SIZE - 1)) { @@ -496,8 +510,10 @@ static void l2c310_inv_range_erratum(unsigned long start, unsigned long end) __l2c210_cache_sync(base); } -static void l2c310_flush_range_erratum(unsigned long start, unsigned long end) +static void l2c310_flush_range_erratum(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; raw_spinlock_t *lock = &l2x0_lock; unsigned long flags; void __iomem *base = l2x0_base; @@ -1400,12 +1416,12 @@ static void aurora_pa_range(unsigned long start, unsigned long end, start = range_end; } } -static void aurora_inv_range(unsigned long start, unsigned long end) +static void aurora_inv_range(phys_addr_t start, phys_addr_t end) { aurora_pa_range(start, end, AURORA_INVAL_RANGE_REG); } -static void aurora_clean_range(unsigned long start, unsigned long end) +static void aurora_clean_range(phys_addr_t start, phys_addr_t end) { /* * If L2 is forced to WT, the L2 will always be clean and we @@ -1415,7 +1431,7 @@ static void aurora_clean_range(unsigned long start, unsigned long end) aurora_pa_range(start, end, AURORA_CLEAN_RANGE_REG); } -static void aurora_flush_range(unsigned long start, unsigned long end) +static void aurora_flush_range(phys_addr_t start, phys_addr_t end) { if (l2_wt_override) aurora_pa_range(start, end, AURORA_INVAL_RANGE_REG); @@ -1604,8 +1620,10 @@ static inline unsigned long bcm_l2_phys_addr(unsigned long addr) return addr + BCM_VC_EMI_OFFSET; } -static void bcm_inv_range(unsigned long start, unsigned long end) +static void bcm_inv_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; unsigned long new_start, new_end; BUG_ON(start < BCM_SYS_EMI_START_ADDR); @@ -1631,8 +1649,10 @@ static void bcm_inv_range(unsigned long start, unsigned long end) new_end); } -static void bcm_clean_range(unsigned long start, unsigned long end) +static void bcm_clean_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; unsigned long new_start, new_end; BUG_ON(start < BCM_SYS_EMI_START_ADDR); @@ -1658,8 +1678,10 @@ static void bcm_clean_range(unsigned long start, unsigned long end) new_end); } -static void bcm_flush_range(unsigned long start, unsigned long end) +static void bcm_flush_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; unsigned long new_start, new_end; BUG_ON(start < BCM_SYS_EMI_START_ADDR); diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c index 88255bea65e41e6..d768bbb5e05c690 100644 --- a/arch/arm/mm/cache-tauros2.c +++ b/arch/arm/mm/cache-tauros2.c @@ -66,8 +66,11 @@ static inline void tauros2_inv_pa(unsigned long addr) */ #define CACHE_LINE_SIZE 32 -static void tauros2_inv_range(unsigned long start, unsigned long end) +static void tauros2_inv_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; + /* * Clean and invalidate partial first cache line. */ @@ -95,8 +98,11 @@ static void tauros2_inv_range(unsigned long start, unsigned long end) dsb(); } -static void tauros2_clean_range(unsigned long start, unsigned long end) +static void tauros2_clean_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; + start &= ~(CACHE_LINE_SIZE - 1); while (start < end) { tauros2_clean_pa(start); @@ -106,8 +112,11 @@ static void tauros2_clean_range(unsigned long start, unsigned long end) dsb(); } -static void tauros2_flush_range(unsigned long start, unsigned long end) +static void tauros2_flush_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; + start &= ~(CACHE_LINE_SIZE - 1); while (start < end) { tauros2_clean_inv_pa(start); diff --git a/arch/arm/mm/cache-uniphier.c b/arch/arm/mm/cache-uniphier.c index ff2881458504329..e2508358e9f4082 100644 --- a/arch/arm/mm/cache-uniphier.c +++ b/arch/arm/mm/cache-uniphier.c @@ -250,17 +250,17 @@ static void uniphier_cache_maint_all(u32 operation) __uniphier_cache_maint_all(data, operation); } -static void uniphier_cache_inv_range(unsigned long start, unsigned long end) +static void uniphier_cache_inv_range(phys_addr_t start, phys_addr_t end) { uniphier_cache_maint_range(start, end, UNIPHIER_SSCOQM_CM_INV); } -static void uniphier_cache_clean_range(unsigned long start, unsigned long end) +static void uniphier_cache_clean_range(phys_addr_t start, phys_addr_t end) { uniphier_cache_maint_range(start, end, UNIPHIER_SSCOQM_CM_CLEAN); } -static void uniphier_cache_flush_range(unsigned long start, unsigned long end) +static void uniphier_cache_flush_range(phys_addr_t start, phys_addr_t end) { uniphier_cache_maint_range(start, end, UNIPHIER_SSCOQM_CM_FLUSH); } diff --git a/arch/arm/mm/cache-xsc3l2.c b/arch/arm/mm/cache-xsc3l2.c index d20d7af02d10fc0..5814731653d9091 100644 --- a/arch/arm/mm/cache-xsc3l2.c +++ b/arch/arm/mm/cache-xsc3l2.c @@ -83,8 +83,10 @@ static inline unsigned long l2_map_va(unsigned long pa, unsigned long prev_va) #endif } -static void xsc3_l2_inv_range(unsigned long start, unsigned long end) +static void xsc3_l2_inv_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; unsigned long vaddr; if (start == 0 && end == -1ul) { @@ -127,8 +129,10 @@ static void xsc3_l2_inv_range(unsigned long start, unsigned long end) dsb(); } -static void xsc3_l2_clean_range(unsigned long start, unsigned long end) +static void xsc3_l2_clean_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; unsigned long vaddr; vaddr = -1; /* to force the first mapping */ @@ -165,8 +169,10 @@ static inline void xsc3_l2_flush_all(void) dsb(); } -static void xsc3_l2_flush_range(unsigned long start, unsigned long end) +static void xsc3_l2_flush_range(phys_addr_t pa_start, phys_addr_t pa_end) { + unsigned long start = pa_start; + unsigned long end = pa_end; unsigned long vaddr; if (start == 0 && end == -1ul) { From patchwork Sat Jan 16 03:27:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 364668 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp422151jap; Fri, 15 Jan 2021 19:33:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3gvzyphh5OedkMFu52MMekNzgrSc74kg2VLe3XYd09LD0e+BgdPqNhIfkH5Ywwl6gVp9v X-Received: by 2002:aa7:c358:: with SMTP id j24mr12173503edr.265.1610767998004; Fri, 15 Jan 2021 19:33:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610767998; cv=none; d=google.com; s=arc-20160816; b=R0DpN1DLTVed5dreXpl3DI7Yl1RApM2YYOBl5EE6VtXn1YYYfftui86SdwSfNnjtX+ Vu7eX5LXQq8bGw1meWRw3it9hlYFgk42b/lOW5bFjWHNa2aQaTk4pau1sUZM8YAm5r1s +eREsoNtGdiosllBISrwklpNdSgFL/hkdx98SEv8SxpJb27OzE2mJZAQ3ekRf036ATbl r9jr4Czbbo9GqIF7XHiORkUAaaScx+CMx29Oba/2t54b4JHvVpeRQbn23HLrUct5zba2 Q44wqZVv1OGv29hy6Pdwg8cGvE9Jl1ga9AvmEibz7OFlCszOfWwSIyR+sHhukNzw/tPP Leog== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BXXfvCgzXaHNybZpi0vBVNv4+KrxrBnjqntSNaESztE=; b=dsqZ9vI3GxFa3viQbY6TtjQx8cIoPeSYSg5MrafvN/pAJ/hRretgTKsDhwnHVpY4fn bmWjMkBJz+zknhbixWHfSRkUXokVGNrn3xGGA8+LnW3H/IRrpFKwvK9GiflQm5fPOs2M 9jaNFoZvCWUf42ytMWCJl3UBcrRu5J15Yw7WesH/ffUEivi9A+HThkxU8XcJ+AK2YlWP 6Xl6XDcyfQZD7vT+bEpoceH1M6NvnDS/SRYyLmF18R1cZDAz//R3wLxdcKz4pfDeUbDC MN8zsIGXzTuJnpE1F46LQNlkBXb3z/mQV45K/GQzJTP2LnSWSGy5Z24OtMp24m0wCRXo DHBw== 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 q3si4755042ejb.483.2021.01.15.19.33.17; Fri, 15 Jan 2021 19:33:17 -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 S1725923AbhAPDcB (ORCPT + 6 others); Fri, 15 Jan 2021 22:32:01 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11547 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727480AbhAPDcA (ORCPT ); Fri, 15 Jan 2021 22:32:00 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DHk7p4MCczMJqR; Sat, 16 Jan 2021 11:29:58 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.176.220) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 16 Jan 2021 11:31:10 +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 v5 2/4] ARM: hisi: add support for Kunpeng50x SoC Date: Sat, 16 Jan 2021 11:27:38 +0800 Message-ID: <20210116032740.873-3-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210116032740.873-1-thunder.leizhen@huawei.com> References: <20210116032740.873-1-thunder.leizhen@huawei.com> 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 Enable support for the Hisilicon Kunpeng506 and Kunpeng509 SoC. Signed-off-by: Zhen Lei --- arch/arm/mach-hisi/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.26.0.106.g9fadedd diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig index 2e980f834a6aa1b..c724acc5c642b97 100644 --- a/arch/arm/mach-hisi/Kconfig +++ b/arch/arm/mach-hisi/Kconfig @@ -55,6 +55,14 @@ config ARCH_HIX5HD2 help Support for Hisilicon HIX5HD2 SoC family +config ARCH_KUNPENG50X + bool "Hisilicon Kunpeng50x family" + depends on ARCH_MULTI_V7 + select ARCH_FLATMEM_ENABLE + select ARCH_HAS_HOLES_MEMORYMODEL if SPARSEMEM + help + Support for Hisilicon Kunpeng506 and Kunpeng509 SoC family + config ARCH_SD5203 bool "Hisilicon SD5203 family" depends on ARCH_MULTI_V5 From patchwork Sat Jan 16 03:27:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 364669 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp422200jap; Fri, 15 Jan 2021 19:33:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuLrhVtBZplGmaXcOV6ZBZjpzFwNVNB5Ch+IVarmCWyAQUi3tcZ/gP6Og5xMUHoV9szCbX X-Received: by 2002:a17:906:707:: with SMTP id y7mr10781932ejb.212.1610768002977; Fri, 15 Jan 2021 19:33:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610768002; cv=none; d=google.com; s=arc-20160816; b=FjfbzIuFHdcsDZE4Iivg7K7y7wc6bBpxAKc5IoUK8SWOlMtL6REYoCBn73CFKiBftZ K7FW1e8BPvGNpK8ZZIrrmMSuqvpQ+raBR0h1gzfKK+5LD66hQvxVTC6ZRo2RnnKCWR4N LEs/s7Q7SKE/6XZYbwz9q21lusvqNv6YTj7/ULlVC10SGY1lPj2qZMI5U9DSEeoEbmQi ue+kyO3QyhM8oPUTDp4ow4cZYSpfumXD/ZlpKj9P4XQzojlItW1ObXMVrfTAyUKrgKtC NK+y3IJNQZsovfSRqw5+VT5i0wwWxRGB7Ihl1ut9reydcFyFn9iVEOKxseT9c9MttWsb BVdA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=oTU5BS1gG3IO95e0D6GcKpAMPovYC5eGzIWZPCfzGuk=; b=x9L3xCsG+S6Pmhw6i07EIrfr8W9gbrB38BY7/wSuCLsbHOxbohoNALF0hC5zR8KLsS RMRdKoFx5a8SkBmwFVumBHNyAqliEG1HW8iOmwsQ+EOGrB7HS3JVvDfInENjNBJHypNm sL/zE9UIOkGY1GGn7baYvmDYYvmXnXYfrHmBOsiTTRN+ZOsnYhlzTkbFoTf3bgJe0vtL xhYaWpMuEtMgzzY5aDvnAsrYEhSAs2waK6+KdF2Lr4JFaqpZrzvwICeX9ClFJSewCQ23 hs9wDIB73N8/kqIf5Q/ivfUJ9b8bUn3NixafPjsCTfch9EBWmx+SKNuR44Yf0juaryUx 612A== 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 q3si4755042ejb.483.2021.01.15.19.33.22; Fri, 15 Jan 2021 19:33:22 -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 S1729508AbhAPDcH (ORCPT + 6 others); Fri, 15 Jan 2021 22:32:07 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11026 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbhAPDcC (ORCPT ); Fri, 15 Jan 2021 22:32:02 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DHk875klQzj7SN; Sat, 16 Jan 2021 11:30:15 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.176.220) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 16 Jan 2021 11:31:11 +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 v5 3/4] dt-bindings: arm: hisilicon: Add binding for Kunpeng L3 cache controller Date: Sat, 16 Jan 2021 11:27:39 +0800 Message-ID: <20210116032740.873-4-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210116032740.873-1-thunder.leizhen@huawei.com> References: <20210116032740.873-1-thunder.leizhen@huawei.com> 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 Add devicetree binding for Hisilicon Kunpeng L3 cache controller. Signed-off-by: Zhen Lei --- .../arm/hisilicon/kunpeng-l3cache.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/kunpeng-l3cache.yaml -- 2.26.0.106.g9fadedd Reviewed-by: Arnd Bergmann diff --git a/Documentation/devicetree/bindings/arm/hisilicon/kunpeng-l3cache.yaml b/Documentation/devicetree/bindings/arm/hisilicon/kunpeng-l3cache.yaml new file mode 100644 index 000000000000000..5bf33c0e4d14b7f --- /dev/null +++ b/Documentation/devicetree/bindings/arm/hisilicon/kunpeng-l3cache.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/hisilicon/kunpeng-l3cache.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon Kunpeng L3 cache controller + +maintainers: + - Wei Xu + +description: | + The Hisilicon Kunpeng L3 outer cache controller supports a maximum of 36-bit + physical addresses. The data cached in the L3 outer cache can be operated + based on the physical address range or the entire cache. + +properties: + compatible: + items: + - enum: + - hisilicon,kunpeng506-l3cache + - hisilicon,kunpeng509-l3cache + - const: hisilicon,kunpeng-l3cache + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + l3cache@f302b000 { + compatible = "hisilicon,kunpeng509-l3cache", "hisilicon,kunpeng-l3cache"; + reg = <0xf302b000 0x1000>; + }; +... From patchwork Sat Jan 16 03:27:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 364672 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp422224jap; Fri, 15 Jan 2021 19:33:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxF30Gc8E+eruX+rm0sRP5B6rLvmLiz7TUHV5qFXz3FEfDBG8TRAtSUhZxpGaEqSKVauEls X-Received: by 2002:aa7:d4c8:: with SMTP id t8mr12515424edr.199.1610768004906; Fri, 15 Jan 2021 19:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610768004; cv=none; d=google.com; s=arc-20160816; b=H7FJeDf9FHkdkyfHxOjpl0W29duHJ7/DX4DveN9SjNQY/6Ycrw/IX7TqDDhd751IEc ZXCdToabr2GjFMbFQxyJ18gd2iJ3OxJpUMb2dFvW3FVq3YoPUHIZxlrY4c+ETfQDdmfc r9BgeG98ZmU7NktcgqbEsktgKW+X4Y7D1W9aenMjGwEmfxGim7WLZVRAKXLPJ/3W1FJY d1g+09jCeFehV+5KH9MTU2kLPokRGkxZG+Fi8qUGPh9fIenu+duoIpUvqL5bmC+GvGa1 tEW9MAYhPr0QL1aIc3AOk76aD2NhIKZqod8ovxSPeGAB+QN6lS3Ijd5UqqHiTgcZ39gL hX1Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=k906kLzwWQ/t9E6OWqHDH/6EmCKSubBKQUMnX8C5vGw=; b=z8ucW/YwH8pY+euSM9CxZW1DiRSf6t+iNlOHQkjChT3Zt4W/ND6EcmwglZPqrL+EXZ IzKlI2S5Be8B7+U4LnCLFNXii+rzdVl7J7ASEFGZhzXwrmba6byo4lHAaRwUHOC5M0TN +f9NCB7tn/agYQFc9ch29YaDiaDwlaeNK7kgpnG061I/4YOIeOzp1E7qMLHp3bqeQGnM UwfVlY+8H245yNGUVc6NdiKF4dWH3wDvz8WGglA7EwIaBHVXE0FjzoQ0ztUfiet8feHr dngFiKHgcMXCoQjX4dY/dYfyz/BFpcXoPGrqxVyYTQGMOGy29PQJEnWTh3MQXFjDzWNt Mzew== 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 q3si4755042ejb.483.2021.01.15.19.33.24; Fri, 15 Jan 2021 19:33:24 -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 S1729260AbhAPDcB (ORCPT + 6 others); Fri, 15 Jan 2021 22:32:01 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11028 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727649AbhAPDcB (ORCPT ); Fri, 15 Jan 2021 22:32:01 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DHk87620yzj7ZC; Sat, 16 Jan 2021 11:30:15 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.176.220) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 16 Jan 2021 11:31:12 +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 v5 4/4] ARM: Add support for Hisilicon Kunpeng L3 cache controller Date: Sat, 16 Jan 2021 11:27:40 +0800 Message-ID: <20210116032740.873-5-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210116032740.873-1-thunder.leizhen@huawei.com> References: <20210116032740.873-1-thunder.leizhen@huawei.com> 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 Add support for the Hisilicon Kunpeng L3 cache controller as used with Kunpeng506 and Kunpeng509 SoCs. These Hisilicon SoCs support LPAE, so the physical addresses is wider than 32-bits, but the actual bit width does not exceed 36 bits. When the cache operation is performed based on the address range, the upper 30 bits of the physical address are recorded in registers L3_MAINT_START and L3_MAINT_END, and ignore the lower 6 bits cacheline offset. Signed-off-by: Zhen Lei --- arch/arm/mm/Kconfig | 10 +++ arch/arm/mm/Makefile | 1 + arch/arm/mm/cache-kunpeng-l3.c | 153 +++++++++++++++++++++++++++++++++ arch/arm/mm/cache-kunpeng-l3.h | 30 +++++++ 4 files changed, 194 insertions(+) create mode 100644 arch/arm/mm/cache-kunpeng-l3.c create mode 100644 arch/arm/mm/cache-kunpeng-l3.h -- 2.26.0.106.g9fadedd diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 02692fbe2db5c59..d2082503de053d2 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -1070,6 +1070,16 @@ config CACHE_XSC3L2 help This option enables the L2 cache on XScale3. +config CACHE_KUNPENG_L3 + bool "Enable the Hisilicon Kunpeng L3 cache controller" + depends on ARCH_KUNPENG50X && OF + default y + select OUTER_CACHE + help + This option enables the Kunpeng L3 cache controller on Hisilicon + Kunpeng506 and Kunpeng509 SoCs. It supports a maximum of 36-bit + physical addresses. + config ARM_L1_CACHE_SHIFT_6 bool default y if CPU_V7 diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile index 3510503bc5e688b..ececc5489e353eb 100644 --- a/arch/arm/mm/Makefile +++ b/arch/arm/mm/Makefile @@ -112,6 +112,7 @@ obj-$(CONFIG_CACHE_L2X0_PMU) += cache-l2x0-pmu.o obj-$(CONFIG_CACHE_XSC3L2) += cache-xsc3l2.o obj-$(CONFIG_CACHE_TAUROS2) += cache-tauros2.o obj-$(CONFIG_CACHE_UNIPHIER) += cache-uniphier.o +obj-$(CONFIG_CACHE_KUNPENG_L3) += cache-kunpeng-l3.o KASAN_SANITIZE_kasan_init.o := n obj-$(CONFIG_KASAN) += kasan_init.o diff --git a/arch/arm/mm/cache-kunpeng-l3.c b/arch/arm/mm/cache-kunpeng-l3.c new file mode 100644 index 000000000000000..cb81f15d26a0cf2 --- /dev/null +++ b/arch/arm/mm/cache-kunpeng-l3.c @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2021 Hisilicon Limited. + */ + +#include +#include +#include +#include + +#include + +#include "cache-kunpeng-l3.h" + +static DEFINE_SPINLOCK(l3cache_lock); +static void __iomem *l3_ctrl_base; + + +static void l3cache_maint_common(u32 range, u32 op_type) +{ + u32 reg; + + reg = readl(l3_ctrl_base + L3_MAINT_CTRL); + reg &= ~(L3_MAINT_RANGE_MASK | L3_MAINT_TYPE_MASK); + reg |= range | op_type; + reg |= L3_MAINT_STATUS_START; + writel(reg, l3_ctrl_base + L3_MAINT_CTRL); + + /* Wait until the hardware maintenance operation is complete. */ + do { + cpu_relax(); + reg = readl(l3_ctrl_base + L3_MAINT_CTRL); + } while ((reg & L3_MAINT_STATUS_MASK) != L3_MAINT_STATUS_END); +} + +static void l3cache_maint_range(phys_addr_t start, phys_addr_t end, u32 op_type) +{ + start = start >> L3_CACHE_LINE_SHITF; + end = ((end - 1) >> L3_CACHE_LINE_SHITF) + 1; + + writel(start, l3_ctrl_base + L3_MAINT_START); + writel(end, l3_ctrl_base + L3_MAINT_END); + + l3cache_maint_common(L3_MAINT_RANGE_ADDR, op_type); +} + +static inline void l3cache_flush_all_nolock(void) +{ + l3cache_maint_common(L3_MAINT_RANGE_ALL, L3_MAINT_TYPE_FLUSH); +} + +static void l3cache_flush_all(void) +{ + unsigned long flags; + + spin_lock_irqsave(&l3cache_lock, flags); + l3cache_flush_all_nolock(); + spin_unlock_irqrestore(&l3cache_lock, flags); +} + +static void l3cache_inv_range(phys_addr_t start, phys_addr_t end) +{ + unsigned long flags; + + spin_lock_irqsave(&l3cache_lock, flags); + l3cache_maint_range(start, end, L3_MAINT_TYPE_INV); + spin_unlock_irqrestore(&l3cache_lock, flags); +} + +static void l3cache_clean_range(phys_addr_t start, phys_addr_t end) +{ + unsigned long flags; + + spin_lock_irqsave(&l3cache_lock, flags); + l3cache_maint_range(start, end, L3_MAINT_TYPE_CLEAN); + spin_unlock_irqrestore(&l3cache_lock, flags); +} + +static void l3cache_flush_range(phys_addr_t start, phys_addr_t end) +{ + unsigned long flags; + + spin_lock_irqsave(&l3cache_lock, flags); + l3cache_maint_range(start, end, L3_MAINT_TYPE_FLUSH); + spin_unlock_irqrestore(&l3cache_lock, flags); +} + +static void l3cache_disable(void) +{ + unsigned long flags; + + spin_lock_irqsave(&l3cache_lock, flags); + l3cache_flush_all_nolock(); + writel(L3_CTRL_DISABLE, l3_ctrl_base + L3_CTRL); + spin_unlock_irqrestore(&l3cache_lock, flags); +} + +static const struct of_device_id l3cache_ids[] __initconst = { + {.compatible = "hisilicon,kunpeng-l3cache", .data = NULL}, + {} +}; + +static int __init l3cache_init(void) +{ + u32 reg; + struct device_node *node; + + node = of_find_matching_node(NULL, l3cache_ids); + if (!node) + return -ENODEV; + + l3_ctrl_base = of_iomap(node, 0); + if (!l3_ctrl_base) { + pr_err("failed to map Kunpeng L3 cache controller registers\n"); + return -ENOMEM; + } + + reg = readl(l3_ctrl_base + L3_CTRL); + if (!(reg & L3_CTRL_ENABLE)) { + unsigned long flags; + + spin_lock_irqsave(&l3cache_lock, flags); + + /* + * Ensure that no L3 cache hardware maintenance operations are + * being performed before enabling the L3 cache. Wait for it to + * finish. + */ + do { + cpu_relax(); + reg = readl(l3_ctrl_base + L3_MAINT_CTRL); + } while ((reg & L3_MAINT_STATUS_MASK) != L3_MAINT_STATUS_END); + + reg = readl(l3_ctrl_base + L3_AUCTRL); + reg |= L3_AUCTRL_EVENT_EN | L3_AUCTRL_ECC_EN; + writel(reg, l3_ctrl_base + L3_AUCTRL); + + writel(L3_CTRL_ENABLE, l3_ctrl_base + L3_CTRL); + + spin_unlock_irqrestore(&l3cache_lock, flags); + } + + outer_cache.inv_range = l3cache_inv_range; + outer_cache.clean_range = l3cache_clean_range; + outer_cache.flush_range = l3cache_flush_range; + outer_cache.flush_all = l3cache_flush_all; + outer_cache.disable = l3cache_disable; + + pr_info("Hisilicon Kunpeng L3 cache controller enabled\n"); + + return 0; +} +arch_initcall(l3cache_init); diff --git a/arch/arm/mm/cache-kunpeng-l3.h b/arch/arm/mm/cache-kunpeng-l3.h new file mode 100644 index 000000000000000..9ef6a53e7d4db49 --- /dev/null +++ b/arch/arm/mm/cache-kunpeng-l3.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __CACHE_KUNPENG_L3_H +#define __CACHE_KUNPENG_L3_H + +#define L3_CACHE_LINE_SHITF 6 + +#define L3_CTRL 0x0 +#define L3_CTRL_ENABLE (1U << 0) +#define L3_CTRL_DISABLE (0U << 0) + +#define L3_AUCTRL 0x4 +#define L3_AUCTRL_EVENT_EN BIT(23) +#define L3_AUCTRL_ECC_EN BIT(8) + +#define L3_MAINT_CTRL 0x20 +#define L3_MAINT_RANGE_MASK GENMASK(3, 3) +#define L3_MAINT_RANGE_ALL (0U << 3) +#define L3_MAINT_RANGE_ADDR (1U << 3) +#define L3_MAINT_TYPE_MASK GENMASK(2, 1) +#define L3_MAINT_TYPE_CLEAN (1U << 1) +#define L3_MAINT_TYPE_INV (2U << 1) +#define L3_MAINT_TYPE_FLUSH (3U << 1) +#define L3_MAINT_STATUS_MASK GENMASK(0, 0) +#define L3_MAINT_STATUS_START (1U << 0) +#define L3_MAINT_STATUS_END (0U << 0) + +#define L3_MAINT_START 0x24 +#define L3_MAINT_END 0x28 + +#endif