[PATCH 2/9] ARM: sunxi: quirk support
Emilio López
emilio at elopez.com.ar
Sun Aug 3 14:37:31 PDT 2014
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 <emilio at elopez.com.ar>
>> ---
(...)
>> +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
More information about the linux-arm-kernel
mailing list