--- zzzz-none-000/linux-5.15.111/arch/arm/mm/cache-l2x0.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-arm-6670-761/linux-5.15.111/arch/arm/mm/cache-l2x0.c 2024-02-07 09:27:16.000000000 +0000 @@ -3,7 +3,25 @@ * arch/arm/mm/cache-l2x0.c - L210/L220/L310 cache controller support * * Copyright (C) 2007 ARM Limited + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Includes Intel Corporation's changes/modifications dated: 2015-2018. + * Changed/modified portions - Copyright © 2015-2018, Intel Corporation + * */ + #include #include #include @@ -21,6 +39,30 @@ #include #include "cache-tauros3.h" +/* Puma7 L2C310 is working in BE and this driver assume all l2caches are LE */ +#if CONFIG_CACHE_L2X0_BIG_ENDIAN +# ifdef writel_relaxed +# undef writel_relaxed +# endif +# ifdef readl_relaxed +# undef readl_relaxed +# endif +# define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_be32(v),c) +# define readl_relaxed(c) ({ u32 __r = be32_to_cpu((__force __le32) __raw_readl(c)); __r; }) +#endif + +/* Puma7 L2C310 is working in BE and this driver assume all l2caches are LE */ +#if CONFIG_CACHE_L2X0_BIG_ENDIAN +# ifdef writel_relaxed +# undef writel_relaxed +# endif +# ifdef readl_relaxed +# undef readl_relaxed +# endif +# define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_be32(v),c) +# define readl_relaxed(c) ({ u32 __r = be32_to_cpu((__force __le32) __raw_readl(c)); __r; }) +#endif + struct l2c_init_data { const char *type; unsigned way_size_0;