From patchwork Fri Jun 29 20:22:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Linz X-Patchwork-Id: 168260 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 881F2B6EE6 for ; Sat, 30 Jun 2012 06:24:00 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6895128083; Fri, 29 Jun 2012 22:23:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OZ5DouvVB9be; Fri, 29 Jun 2012 22:23:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C595F28088; Fri, 29 Jun 2012 22:23:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 76DF62807D for ; Fri, 29 Jun 2012 22:23:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ujsx9xZEjXyy for ; Fri, 29 Jun 2012 22:22:55 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.161]) by theia.denx.de (Postfix) with ESMTPS id 3B4202807E for ; Fri, 29 Jun 2012 22:22:47 +0200 (CEST) X-RZG-AUTH: :IGUKb2CkcrLHmZv+FHarxbxlXmJO7WRQLa+vsyW+4RLunWeioNrxKu39Rg== X-RZG-CLASS-ID: mo00 Received: from [192.168.10.57] ([88.130.135.4]) by smtp.strato.de (josoe mo79) (RZmta 29.19 DYNA|AUTH) with (DHE-RSA-CAMELLIA256-SHA encrypted) ESMTPA id m04076o5THwrVe ; Fri, 29 Jun 2012 22:22:42 +0200 (CEST) From: Stephan Linz To: monstr@monstr.eu In-Reply-To: <4FED64C3.8050302@monstr.eu> References: <4FEAD263.2020707@monstr.eu> <4FEB1A3C.7050207@monstr.eu> <4FEBF08D.2060604@monstr.eu> <4FEBFE72.20106@monstr.eu> <4FED64C3.8050302@monstr.eu> Organization: Li-Pro.Net Date: Fri, 29 Jun 2012 22:22:39 +0200 Message-ID: <1341001359.3999.106.camel@keto> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Cc: "u-boot@lists.denx.de" Subject: Re: [U-Boot] ARM CONFIG_OF_CONTROL status X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list Reply-To: linz@li-pro.net List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Am Freitag, den 29.06.2012, 10:18 +0200 schrieb Michal Simek: > On 06/29/2012 04:32 AM, Simon Glass wrote: > > Hi, > > > > --snip-- > > I have sent support for Microblaze. Currently without dts because I want to clear this part a little bit. Hi Michal, looks good, I've been waiting a long time on the FDT support in U-Boot for Microblaze -- great -- PS: see my comment on patch 5 ... > > Tegra is using ./arch/arm/dts/tegra20.dtsi and board/nvidia/dts/tegra2-seaboard.dts > and they are composed together in dts/Makefile by calling preprocessor. > Microblaze will be totally different case because every Microblaze hw design is different. Yes, that's right. We will never be in the position to define a skeleton or a basic platform configuration. > We can use two main buses (little and big endian) and cpu is also configurable. > Based on this for Microblaze is the best solution directly to use dts. > (DTS for Microblaze is also generated directly from design tool). ... directly in the context of a board, not arch/cpu, right? > > > Anyway - here is the bug message I am getting if I use full dts in board//dts/microblaze.dts > and empty arch/microblaze/dts/microblaze.dtsi > > :34:3: error: invalid preprocessing directive #address > :35:3: error: invalid preprocessing directive #size > :52:4: error: invalid preprocessing directive #address > :53:4: error: invalid preprocessing directive #cpus > :54:4: error: invalid preprocessing directive #size > :155:4: error: invalid preprocessing directive #address > :156:4: error: invalid preprocessing directive #size > :160:5: error: invalid preprocessing directive #gpio > :192:5: error: invalid preprocessing directive #gpio > :209:5: error: invalid preprocessing directive #gpio > :241:5: error: invalid preprocessing directive #gpio > :267:5: error: invalid preprocessing directive #address > :268:5: error: invalid preprocessing directive #size > :394:5: error: invalid preprocessing directive #interrupt > > This is error for opposite case - empty microblaze.dts and full microblaze.dtsi. That are CPP errors, because the auto generated xilinx.dts is full of CPP pragma like syntax (#something) that are wrong (invalid). > > make[1]: Entering directory `/mnt/projects/u-boot/dts' > rc=$( cat /mnt/projects/u-boot/board/petalogix/dts/microblaze.dts | microblaze-unknown-linux-gnu-gcc -E > -P -DARCH_CPU_DTS=\"/mnt/projects/u-boot/arch/microblaze/dts/microblaze.dtsi\" - | { { dtc -R 4 -p 0x1000 > -O dtb -o dt.dtb - 2>&1 ; echo $? >&3 ; } | grep -v '^DTC: dts->dtb on file' ; } 3>&1 ) ; \ > exit $rc > /bin/sh: line 1: exit: too many arguments > make[1]: *** [dt.dtb] Error 1 > make[1]: Leaving directory `/mnt/projects/u-boot/dts' > > > I have just tried to fix it by introducing new CONFIG option for skipping that preprocessor > part. Instead of disable / skipp the CPP step you can hide the auto generated xilinx.dts with a second include stage, for example: board/microblaze/dts/microblaze.dts looks like: /include/ ARCH_CPU_DTS /include/ BOARD_DTS Right, only two lines. The arch/microblaze/dts/microblaze.dtsi remains empty as you have said above. Just new is BOARD_DTS -- with the attached patch for dts/Makefile you can copy the auto generated xilinx.dts into the specific board directory and the CPP step substitute the right place to board/microblaze/microblaze-generic/dts/microblaze.dts I think there are no side effects with other ports like the tegra2. If you want you can omit the ARCH_CPU_DTS inclusion. The architectural microblaze.dtsi file is empty and (!!) have to be empty, because the DTC will break with an error on multiple "/dts-v1/;" lines! Here is the patch: \"$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts\" all: $(obj).depend $(LIB) br, Stephan > It will be good for Microblaze (probably there is any smarter solution for SKIP case not to have two cats there). > The same situation will happen for Xilinx ppc support and partially for upcoming ARM zynq where > full DTS is generated for unique hw design. > > Here is the patch to show you what phase I would like to skip. > > diff --git a/dts/Makefile b/dts/Makefile > index 914e479..d670cb8 100644 > --- a/dts/Makefile > +++ b/dts/Makefile > @@ -45,9 +45,15 @@ all: $(obj).depend $(LIB) > # the filename. > DT_BIN := $(obj)dt.dtb > > +ifndef CONFIG_DTS_SKIP_PREPROCESSOR > +SKIP := $(CPP) -P $(DTS_CPPFLAGS) - > +else > +SKIP := cat > +endif > + > $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts > rc=$$( \ > - cat $< | $(CPP) -P $(DTS_CPPFLAGS) - | \ > + cat $< | $(SKIP) |\ > { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \ > echo $$? >&3 ; } | \ > grep -v '^DTC: dts->dtb on file' ; \ > > > Thanks for your comments. > Michal > diff --git a/dts/Makefile b/dts/Makefile index 914e479..b1f47a1 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -36,7 +36,8 @@ $(error Your architecture does not have device tree support enabled. \ Please define CONFIG_ARCH_DEVICE_TREE)) # We preprocess the device tree file provide a useful define -DTS_CPPFLAGS := -DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\" +DTS_CPPFLAGS := -DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\" \ + -DBOARD_DTS=\"$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts\" all: $(obj).depend $(LIB)