* [PATCH] ARM: cache-tauros2: remove ARMv6 code
@ 2014-03-11 18:51 Arnd Bergmann
2014-03-18 8:27 ` Haojian Zhuang
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2014-03-11 18:51 UTC (permalink / raw)
To: linux-arm-kernel
When building a kernel with support for both ARMv6 and ARMv7 but
no MMU, the call from tauros2_internal_init to adjust_cr causes
a link error. While that could probably be resolved, we don't
actually support cache-tauros2 on ARMv6 any more. All PJ4 CPU
implementations support both ARMv6 and ARMv7 and we already assume
that we are using them only in ARMv7 mode.
Removing the ARMv6 code path reduces the code size and avoids
the linker error.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
index 1be0f4e..7964ef2 100644
--- a/arch/arm/mm/cache-tauros2.c
+++ b/arch/arm/mm/cache-tauros2.c
@@ -229,33 +229,6 @@ static void __init tauros2_internal_init(unsigned int features)
}
#endif
-#ifdef CONFIG_CPU_32v6
- /*
- * Check whether this CPU lacks support for the v7 hierarchical
- * cache ops. (PJ4 is in its v6 personality mode if the MMFR3
- * register indicates no support for the v7 hierarchical cache
- * ops.)
- */
- if (cpuid_scheme() && (read_mmfr3() & 0xf) == 0) {
- /*
- * When Tauros2 is used in an ARMv6 system, the L2
- * enable bit is in the ARMv6 ARM-mandated position
- * (bit [26] of the System Control Register).
- */
- if (!(get_cr() & 0x04000000)) {
- printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
- adjust_cr(0x04000000, 0x04000000);
- }
-
- mode = "ARMv6";
- outer_cache.inv_range = tauros2_inv_range;
- outer_cache.clean_range = tauros2_clean_range;
- outer_cache.flush_range = tauros2_flush_range;
- outer_cache.disable = tauros2_disable;
- outer_cache.resume = tauros2_resume;
- }
-#endif
-
#ifdef CONFIG_CPU_32v7
/*
* Check whether this CPU has support for the v7 hierarchical
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: cache-tauros2: remove ARMv6 code
2014-03-11 18:51 [PATCH] ARM: cache-tauros2: remove ARMv6 code Arnd Bergmann
@ 2014-03-18 8:27 ` Haojian Zhuang
2014-03-18 15:01 ` Arnd Bergmann
2014-03-27 1:53 ` Arnd Bergmann
0 siblings, 2 replies; 4+ messages in thread
From: Haojian Zhuang @ 2014-03-18 8:27 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Mar 12, 2014 at 2:51 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> When building a kernel with support for both ARMv6 and ARMv7 but
> no MMU, the call from tauros2_internal_init to adjust_cr causes
> a link error. While that could probably be resolved, we don't
> actually support cache-tauros2 on ARMv6 any more. All PJ4 CPU
> implementations support both ARMv6 and ARMv7 and we already assume
> that we are using them only in ARMv7 mode.
>
> Removing the ARMv6 code path reduces the code size and avoids
> the linker error.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>
>
> diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
> index 1be0f4e..7964ef2 100644
> --- a/arch/arm/mm/cache-tauros2.c
> +++ b/arch/arm/mm/cache-tauros2.c
> @@ -229,33 +229,6 @@ static void __init tauros2_internal_init(unsigned int features)
> }
> #endif
>
> -#ifdef CONFIG_CPU_32v6
> - /*
> - * Check whether this CPU lacks support for the v7 hierarchical
> - * cache ops. (PJ4 is in its v6 personality mode if the MMFR3
> - * register indicates no support for the v7 hierarchical cache
> - * ops.)
> - */
> - if (cpuid_scheme() && (read_mmfr3() & 0xf) == 0) {
> - /*
> - * When Tauros2 is used in an ARMv6 system, the L2
> - * enable bit is in the ARMv6 ARM-mandated position
> - * (bit [26] of the System Control Register).
> - */
> - if (!(get_cr() & 0x04000000)) {
> - printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
> - adjust_cr(0x04000000, 0x04000000);
> - }
> -
> - mode = "ARMv6";
> - outer_cache.inv_range = tauros2_inv_range;
> - outer_cache.clean_range = tauros2_clean_range;
> - outer_cache.flush_range = tauros2_flush_range;
> - outer_cache.disable = tauros2_disable;
> - outer_cache.resume = tauros2_resume;
> - }
> -#endif
> -
> #ifdef CONFIG_CPU_32v7
> /*
> * Check whether this CPU has support for the v7 hierarchical
>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: cache-tauros2: remove ARMv6 code
2014-03-18 8:27 ` Haojian Zhuang
@ 2014-03-18 15:01 ` Arnd Bergmann
2014-03-27 1:53 ` Arnd Bergmann
1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2014-03-18 15:01 UTC (permalink / raw)
To: linux-arm-kernel
On Tuesday 18 March 2014, Haojian Zhuang wrote:
> On Wed, Mar 12, 2014 at 2:51 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > When building a kernel with support for both ARMv6 and ARMv7 but
> > no MMU, the call from tauros2_internal_init to adjust_cr causes
> > a link error. While that could probably be resolved, we don't
> > actually support cache-tauros2 on ARMv6 any more. All PJ4 CPU
> > implementations support both ARMv6 and ARMv7 and we already assume
> > that we are using them only in ARMv7 mode.
> >
> > Removing the ARMv6 code path reduces the code size and avoids
> > the linker error.
>
> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Thanks!
Russell, do you want to add this patch to your l2x0 series, or
should I put it into the patch tracker by itself?
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: cache-tauros2: remove ARMv6 code
2014-03-18 8:27 ` Haojian Zhuang
2014-03-18 15:01 ` Arnd Bergmann
@ 2014-03-27 1:53 ` Arnd Bergmann
1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2014-03-27 1:53 UTC (permalink / raw)
To: linux-arm-kernel
On Tuesday 18 March 2014, Haojian Zhuang wrote:
> On Wed, Mar 12, 2014 at 2:51 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > When building a kernel with support for both ARMv6 and ARMv7 but
> > no MMU, the call from tauros2_internal_init to adjust_cr causes
> > a link error. While that could probably be resolved, we don't
> > actually support cache-tauros2 on ARMv6 any more. All PJ4 CPU
> > implementations support both ARMv6 and ARMv7 and we already assume
> > that we are using them only in ARMv7 mode.
> >
> > Removing the ARMv6 code path reduces the code size and avoids
> > the linker error.
> > -
> > #ifdef CONFIG_CPU_32v7
> > /*
> > * Check whether this CPU has support for the v7 hierarchical
> >
>
> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
I've merged it into next/soc now, since that branch originally
introduced the bug, which now prevents 'allmodconfig' from building.
I had to another oneline change to the patch, see below. This has
no functional impact, but just avoids a few "unused function" warnings
when building with both v6 and v7 enabled. Previously some of the
functions were shared between v5 and v6 code, but the v6 version
is removed now.
Arnd
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
index 7964ef2..b273739 100644
--- a/arch/arm/mm/cache-tauros2.c
+++ b/arch/arm/mm/cache-tauros2.c
@@ -33,7 +33,7 @@
* outer cache operations into the kernel image if the kernel has been
* configured to support a pre-v7 CPU.
*/
-#if __LINUX_ARM_ARCH__ < 7
+#ifdef CONFIG_CPU_32v5
/*
* Low-level cache maintenance operations.
*/
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-27 1:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 18:51 [PATCH] ARM: cache-tauros2: remove ARMv6 code Arnd Bergmann
2014-03-18 8:27 ` Haojian Zhuang
2014-03-18 15:01 ` Arnd Bergmann
2014-03-27 1:53 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).