xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xensource.com
Cc: David Vrabel <david.vrabel@citrix.com>
Subject: [PATCH 3/7] arm: link a device tree blob into the xen image
Date: Fri, 3 Feb 2012 19:15:11 +0000	[thread overview]
Message-ID: <1328296515-25876-4-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1328296515-25876-1-git-send-email-david.vrabel@citrix.com>

From: David Vrabel <david.vrabel@citrix.com>

Link a device tree blob (DTB) into the xen image.  This is loaded to
start of RAM + 0x100 and xen_start() is called with the correct
address in atag_paddr.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/arch/arm/Makefile  |    7 +++++--
 xen/arch/arm/dtb.S     |    2 ++
 xen/arch/arm/head.S    |    5 +++++
 xen/arch/arm/xen.lds.S |    6 ++++++
 4 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100644 xen/arch/arm/dtb.S

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 9bc2fc8..ac346a5 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -1,5 +1,6 @@
 subdir-y += lib
 
+obj-y += dtb.o
 obj-y += dummy.o
 obj-y += entry.o
 obj-y += domain.o
@@ -27,7 +28,7 @@ ALL_OBJS := head.o $(ALL_OBJS)
 $(TARGET): $(TARGET)-syms
 	# XXX: VE model loads by VMA so instead of
 	# making a proper ELF we link with LMA == VMA and adjust crudely
-	$(OBJCOPY) --change-addresses +0x7fe00000 $< $@
+	$(OBJCOPY) --change-addresses +0x80000000 $< $@
 	# XXX strip it
 
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
@@ -50,7 +51,7 @@ endif
 $(BASEDIR)/common/symbols-dummy.o:
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C $(BASEDIR)/common symbols-dummy.o
 
-$(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o
+$(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o dtb.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
 	$(NM) -n $(@D)/.$(@F).0 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).0.S
@@ -71,6 +72,8 @@ xen.lds: xen.lds.S
 	sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new
 	mv -f .xen.lds.d.new .xen.lds.d
 
+dtb.o: platform.dtb
+
 .PHONY: clean
 clean::
 	rm -f asm-offsets.s xen.lds
diff --git a/xen/arch/arm/dtb.S b/xen/arch/arm/dtb.S
new file mode 100644
index 0000000..0728c04
--- /dev/null
+++ b/xen/arch/arm/dtb.S
@@ -0,0 +1,2 @@
+        .section .dtb,#alloc
+        .incbin "platform.dtb"
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index b98c921..9951f37 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -55,6 +55,11 @@ start:
 	adr   r9, start              /* r9  := paddr (start) */
 	sub   r10, r9, r0            /* r10 := phys-offset */
 
+        /* FIXME: using the DTB in the .dtb section. */
+        mov   r7, #0
+        ldr   r8, =_sdtb
+        add   r8, r10
+
 #ifdef EARLY_UART_ADDRESS
 	/* Say hello */
 	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 5a62e2c..4bcca57 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -122,6 +122,12 @@ SECTIONS
   } :text
   _end = . ;
 
+  /* FIXME: don't yet have a bootloader to provide the DTB, link it
+     into Xen in its own section. */
+  . = 0x100;
+  _sdtb = .;
+  .dtb : { dtb.o(.dtb) }
+
   /* Sections to be discarded */
   /DISCARD/ : {
        *(.exit.text)
-- 
1.7.2.5

  parent reply	other threads:[~2012-02-03 19:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 19:15 [PATCH 0/7] RFC: arm: (really) minimal device tree support David Vrabel
2012-02-03 19:15 ` [PATCH 1/7] libfdt: add version 1.3.0 David Vrabel
2012-02-03 19:15 ` [PATCH 2/7] libfdt: add to build David Vrabel
2012-02-03 19:15 ` David Vrabel [this message]
2012-02-03 20:22   ` [PATCH 3/7] arm: link a device tree blob into the xen image Tim Deegan
2012-02-03 19:15 ` [PATCH 4/7] arm: map device tree blob in initial page tables David Vrabel
2012-02-03 21:18   ` Tim Deegan
2012-02-06 17:36     ` David Vrabel
2012-02-07  9:28       ` Tim Deegan
2012-02-03 19:15 ` [PATCH 5/7] libfdt: fixup libfdt_env.h for xen David Vrabel
2012-02-03 19:15 ` [PATCH 6/7] arm: add early_printk() David Vrabel
2012-02-03 19:15 ` [PATCH 7/7] arm, device tree: parse the DTB for RAM location and size David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328296515-25876-4-git-send-email-david.vrabel@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).