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>
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
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)
--- /dev/null
+#!/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