[sodaville] [RFC] [PATCH] Adding DTB to architecture independent vmlinux
H. Peter Anvin
hpa at linux.intel.com
Thu Oct 28 04:27:11 EST 2010
On 10/27/2010 4:09 AM, Grant Likely wrote:
> On Tue, Oct 26, 2010 at 07:24:17AM -0700, Dirk Brandewie wrote:
>> Hi All,
>>
>> I am working on working on adding support device tree support to an
>> x86 based platform, hpa pointed out that the device tree blob is
>> architecture independent and should be part of the generic kernel.
>>
>> The patch below is a first cut at adding dtb support to the architecture
>> independent kernel and adding a generic dts->dtb build rule.
>>
>> This has only been tested on x86.
>>
>> Comments/suggestions gratefully accepted.
>>
>> --Dirk
>>
>> of: add support for linking platform dtb into vmlinux
>>
>> From: Dirk Brandewie<dirk.brandewie at gmail.com>
>>
>> This patch adds support for linking a device tree blob into
>> vmlinux. The platform DTB to be built and linked into the kernel is
>> specified by passing PLATFORM_DTB=<platform name> to make.
>
> I don't think it is worth trying to do this in a cross-architecture
> way. The powerpc zImage wrappers are already very platform-specific
> code, and there are no assumptions made about how a dtb image is
> linked into the wrapper. A wrapper could even link in multiple dtb
> images.
>
> For the x86 code, linking the dtb into the vmlinux itself is not
> something that is desired without the option of selecting it between
> multiple linked-in dtb files if firmware doesn't pass one in for you.
> This will require some discussion about how best to manage dtbs before
> merging a patch like this.
>
I have to disagree, strongly, that it is not worth doing a
cross-architectural patch. There is nothing that prevents an
architecture from having any number of different ones *in addition to*
the independent way, but that would clearly establish a baseline that
everyone can benefit from. This is a Very Good Thing[TM]. We already
have too many gratuitous differences between architectures in Linux.
As far as linking in multiple dtbs, the one architecture-independent way
we have to pass data into the kernel is the kernel command line, and it
might make sense to have a command line parameter like "dtb=foo",
although I expect the vast majority of all users who don't rely on the
firmware/bootloader to feed them information are going to have one
kernel image per platform anyway, just for space reasons.
-hpa
More information about the devicetree-discuss
mailing list