From mboxrd@z Thu Jan 1 00:00:00 1970 From: emilio@elopez.com.ar (=?windows-1252?Q?Emilio_L=F3pez?=) Date: Sun, 03 Aug 2014 18:37:31 -0300 Subject: [PATCH 2/9] ARM: sunxi: quirk support In-Reply-To: <20140803124211.GU3952@lukather> References: <1406842092-25207-1-git-send-email-emilio@elopez.com.ar> <1406842092-25207-3-git-send-email-emilio@elopez.com.ar> <20140803124211.GU3952@lukather> Message-ID: <53DEAB9B.1090400@elopez.com.ar> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Maxime, El 03/08/14 a las 09:42, Maxime Ripard escibi?: > On Thu, Jul 31, 2014 at 06:28:05PM -0300, Emilio L?pez wrote: >> Currently, some hardware revisions of sunxi SoCs need special care on >> some blocks because of hardware differences and/or bugs. Unfortunately, >> it is unfeasible to account for these issues directly when writing the >> device tree, as SoC revision can vary between different units of the >> same device. This commit introduces a place to adjust DT compatibles >> as needed to work around said issues before devices are probed. To >> demonstrate usage, two quirks are added for the PLL2 and audio codec >> on sun4i. >> >> Signed-off-by: Emilio L?pez >> --- (...) >> +static int __init sunxi_apply_quirks(void) >> +{ >> + if (of_machine_is_compatible("allwinner,sun4i-a10")) { >> + sun4i_pll2_quirk(); >> + sun4i_codec_quirk(); >> + } >> + >> + return 0; >> +} >> +postcore_initcall(sunxi_apply_quirks) > > Have you tested it? My guess is that it wolud have to run *much* > sooner, before of_platform_populate to be effective. I have, I was able to break my UART with it :) of_platform_populate() is called from arch/arm/kernel/setup.c on arch_initcall. From include/linux/init.h ... #define postcore_initcall(fn) __define_initcall(fn, 2) #define postcore_initcall_sync(fn) __define_initcall(fn, 2s) #define arch_initcall(fn) __define_initcall(fn, 3) ... So it should be fine. Cheers, Emilio