diff options
author | Matthew Leach <Matthew.Leach@arm.com> | 2014-01-23 17:29:31 +0000 |
---|---|---|
committer | Mark Rutland <mark.rutland@arm.com> | 2014-03-12 11:15:58 +0000 |
commit | 4266507a84f8c06452109d38e0350d4759740694 (patch) | |
tree | 8382900b6b14d8b938dc506540b719ab9d49d4d8 | |
parent | e4ae51a1c128ccaac01bdc834692fd15c3a3c8de (diff) | |
download | boot-wrapper-aarch64-4266507a84f8c06452109d38e0350d4759740694.tar.gz |
Modify cpu nodes to set the enable-method
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>
-rw-r--r-- | Makefile.am | 9 | ||||
-rwxr-xr-x | gen-cpu-nodes.sh | 19 |
2 files changed, 26 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 610e3bb..5791ad1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 0000000..4abc03c --- /dev/null +++ b/gen-cpu-nodes.sh @@ -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 |