DTC/dts modifications
Kumar Gala
galak at kernel.crashing.org
Tue May 2 06:28:34 EST 2006
On May 1, 2006, at 3:07 PM, Kim Phillips wrote:
> On Mon, 1 May 2006 14:52:23 -0500
> Kumar Gala <galak at kernel.crashing.org> wrote:
>
>> [snip]
>>
>>>> Try running a current .dts through cpp today. You will get errors
>>>> like:
>>>>
>>>> oftree.dts:15:3: error: invalid preprocessing directive #address
>>>
>>>> Because of props like:
>>>>
>>>> #cpus = <1>;
>>>> #address-cells = <1>;
>>>> #size-cells = <0>;
>>>>
>>>> If these used some other symbol instead of '#' cpp will be happy
>>>> and
>>>> we can use it to create macros for us.
>>>
>>> Yeah, we're not going to be able to change those; they
>>> are "By The Book".
>>
>> By what book? It would seem to me that BNF for dtc is completely
>> under our control and if we want to change it we can. I understand
>> that there is some correspondence to Open Firmware, but it seems that
>> if its people are ok with the dts format changing that's a lot easier
>> than implementing tons of support in dtc for features that cpp
>> gives us.
>>
>> [I'm also guessing no one's really got time to go and implement these
>> features in dtc]
>>
> cpp -x assembler-with-cpp seems to not produce the above errors,
> and still honours preprocessing directives like #define. Don't
> know what else is messes with, and whether you want to add CPPFLAGS.
Cool, here's an invocation that seems to work well. Not sure what
causes linux = 1 (thus I need the -U linux). Also address the line
information that is normally spit out.
cpp -U linux -P -x assembler-with-cpp foo.dts
With a 8349 dts I'm using I'm able to run it through cpp then dts and
get the exact same dtb.
- kumar
More information about the Linuxppc-dev
mailing list