On 10 Sep 01, Nicolas Pitre wrote: > On Wed, 1 Sep 2010, Amit Kucheria wrote: >
[snip] > > Unfortunately, it seems after talking to Nicolas that mdesc->fixup() is > > called too early. > > > > Nicolas suggested linking the i.MX5 code _after_ the VFP module :) > > Something like this patch: > > ----- >8 > From: Nicolas Pitre <nicolas.pi...@linaro.org> > Date: Wed, 1 Sep 2010 09:37:05 -0400 > Subject: [PATCH] ARM: link board specific files after core files > > This allows for board specific issues to override decisions made in generic > code that might not be suitable due to some errata or the like. > > Signed-off-by: Nicolas Pitre <nicolas.pi...@linaro.org> > > diff --git a/arch/arm/Makefile b/arch/arm/Makefile > index df4ab3c..3e8e3d7 100644 > --- a/arch/arm/Makefile > +++ b/arch/arm/Makefile > @@ -243,13 +243,14 @@ ifeq ($(FASTFPE),$(wildcard $(FASTFPE))) > FASTFPE_OBJ :=$(FASTFPE)/ > endif > > -# If we have a machine-specific directory, then include it in the build. > -core-y += arch/arm/kernel/ arch/arm/mm/ > arch/arm/common/ > -core-y += $(machdirs) $(platdirs) > core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ > core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) > core-$(CONFIG_VFP) += arch/arm/vfp/ > > +# If we have a machine-specific directory, then include it in the build. > +core-y += arch/arm/kernel/ arch/arm/mm/ > arch/arm/common/ > +core-y += $(machdirs) $(platdirs) > + > drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ > > libs-y := arch/arm/lib/ $(libs-y) > 8< ----- > > Then, just add your fixup in a separate patch. Beware: the above patch > is untested. > My fixup patch is attached. Compile-tested along with Nico's patch. But I have no TO1/TO2 boards to test. Loic do know anybody that can test with Nico's patch and this fixup? >From caad712990cccb705b44414830d41142277538b8 Mon Sep 17 00:00:00 2001 Message-Id: <caad712990cccb705b44414830d41142277538b8.1283370628.git.amit.kuche...@linaro.org> From: Amit Kucheria <amit.kuche...@linaro.org> Date: Wed, 1 Sep 2010 22:49:13 +0300 Subject: [PATCH] mxc: turn off HWCAP_NEON for older versions of imx51 silicon Versions of silicon older than TO3 have broken NEON implementation. Turn off NEON in such cases. Signed-off-by: Amit Kucheria <amit.kuche...@linaro.org> --- arch/arm/mach-mx5/board-mx51_babbage.c | 9 +++++++++ arch/arm/mach-mx5/cpu.c | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 6e384d9..65d1d2c 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c @@ -45,6 +45,8 @@ #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 #define MX51_USB_PLL_DIV_24_MHZ 0x02 +extern void mx51_neon_fixup(void); + static struct platform_device *devices[] __initdata = { &mxc_fec_device, }; @@ -240,6 +242,12 @@ static int __init babbage_otg_mode(char *options) } __setup("otg_mode=", babbage_otg_mode); +static void __init fixup_mx51_babbage(struct machine_desc *desc, + struct tag *tags, char **cmdline, struct meminfo *mi) +{ + mx51_neon_fixup(); +} + /* * Board specific initialization. */ @@ -284,6 +292,7 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") .phys_io = MX51_AIPS1_BASE_ADDR, .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, .boot_params = PHYS_OFFSET + 0x100, + .fixup = fixup_mx51_babbage, .map_io = mx51_map_io, .init_irq = mx51_init_irq, .init_machine = mxc_board_init, diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c index 2d37785..8d081c6 100644 --- a/arch/arm/mach-mx5/cpu.c +++ b/arch/arm/mach-mx5/cpu.c @@ -70,6 +70,21 @@ int mx51_revision(void) } EXPORT_SYMBOL(mx51_revision); +#ifdef CONFIG_NEON +/* All versions of the silicon before Rev. 3 have broken NEON implementations */ +void mx51_neon_fixup(void) +{ + if (mx51_revision() < MX51_CHIP_REV_3_0) { + if (elf_hwcap & HWCAP_NEON) { + elf_hwcap &= ~HWCAP_NEON; + pr_info("Turning off NEON support, detected broken NEON implemention\n"); + } + } +} +#else +void mx51_neon_fixup(void) {} +#endif + static int __init post_cpu_init(void) { unsigned int reg; -- 1.7.0.4 _______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev