]> xenbits.xensource.com Git - people/julieng/boot-wrapper-aarch64.git/commitdiff
Modify cpu nodes to set the enable-method
authorMatthew Leach <Matthew.Leach@arm.com>
Thu, 23 Jan 2014 17:29:31 +0000 (17:29 +0000)
committerMark Rutland <mark.rutland@arm.com>
Wed, 12 Mar 2014 11:15:58 +0000 (11:15 +0000)
When using PSCI, the enable-method property for each CPU node in the
DTB needs to be set to "psci". Add a script and Makefile.am rules so
that this is done automatically for the final pass through DTC.

Signed-off-by: Matthew Leach <matthew.leach@arm.com>
[Mark: remove backticks, fix copyright date, use $(), fix indentation]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Makefile.am
gen-cpu-nodes.sh [new file with mode: 0755]

index 610e3bbcd5121050ff54a9c92e054fda2a47c7e2..5791ad1628ddf7414093822714c11037845c221a 100644 (file)
@@ -32,9 +32,14 @@ PSCI_NODE    := psci {                               \
                        cpu_on = <0x84000002>;          \
                        cpu_off = <0x84000001>;         \
                   };
+CPU_NODES      := $(shell $(top_srcdir)/gen-cpu-nodes.sh $(CPU_IDS))
+CPUS_NODE      := cpus {               \
+                       $(CPU_NODES)    \
+                  };
 else
 BOOTMETHOD     := spin.o
 PSCI_NODE      :=
+CPUS_NODE      :=
 endif
 
 MBOX_OFFSET    := 0xfff8
@@ -78,8 +83,8 @@ $(IMAGE): boot.o cache.o gic.o mmu.o ns.o $(BOOTMETHOD) model.lds fdt.dtb $(KERN
 model.lds: $(LD_SCRIPT) Makefile
        $(CPP) $(CPPFLAGS) -ansi -DPHYS_OFFSET=$(PHYS_OFFSET) -DMBOX_OFFSET=$(MBOX_OFFSET) -DKERNEL_OFFSET=$(KERNEL_OFFSET) -DFDT_OFFSET=$(FDT_OFFSET) -DFS_OFFSET=$(FS_OFFSET) -DKERNEL=$(KERNEL_IMAGE) -DFILESYSTEM=$(FILESYSTEM) -DBOOTMETHOD=$(BOOTMETHOD) -P -C -o $@ $<
 
-fdt.dtb: $(KERNEL_DTB) Makefile
-       ( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) };" ) | $(DTC) -O dtb -o $@ -
+fdt.dtb: $(KERNEL_DTB) Makefile gen-cpu-nodes.sh
+       ( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) $(CPUS_NODE) };" ) | $(DTC) -O dtb -o $@ -
 
 # The filesystem archive might not exist if INITRD is not being used
 .PHONY: all clean $(FILESYSTEM)
diff --git a/gen-cpu-nodes.sh b/gen-cpu-nodes.sh
new file mode 100755 (executable)
index 0000000..4abc03c
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Very dumb shell script to generate DTB nodes that changes the
+# boot-method to PSCI.
+#
+# Copyright (C) 2014 ARM Limited. All rights reserved.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE.txt file.
+
+CPU_IDS=$1;
+CPU_IDS_NO_HEX=$(echo $CPU_IDS | sed s/0x//g);
+CPU_IDS_NO_HEX=$(echo $CPU_IDS_NO_HEX | sed s/\,/\ /g);
+for id in $CPU_IDS_NO_HEX;
+do
+       echo "cpu@$id {";
+       echo '  enable-method = \"psci\";';
+       echo "  reg = <0 0x$id>;";
+       echo "};";
+done