summaryrefslogtreecommitdiff
path: root/bootwrapper
diff options
context:
space:
mode:
authorDietmar Eggemann <dietmar.eggemann@arm.com>2012-04-12 14:43:32 +0100
committerDietmar Eggemann <dietmar.eggemann@arm.com>2012-05-23 12:44:34 +0100
commit100e5e7658672dc5aa41a97c252c419ee73b27e4 (patch)
tree9d674018daa693fc337f320041fd298bb48603b9 /bootwrapper
parentf977857d403d56af55436ba331cf6314223d2b47 (diff)
Get booting from A7 cluster working on A15x4-A7x4 model.
The for loop in wait_for_secondaries() was only considering the array elements cpus_ready[0][j]. In case the A7 cluster is the boot cluster, the secondaries write to the array elements cpus_ready[1][j]. That's why the end condition of the for loop has to be increased by one in the 'switching' case. Please note, that active_clusters is always one in the 'switching' case, whereas it is two in the 'always on' case. To be able to distinguish between these cases, the SWITCHER variable is introduced into the bootwrapper Makefile. Although it is already defined in the big-little Makefile, we do not want to create a shared Makefile between bootwrapper and big-little for now. Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Diffstat (limited to 'bootwrapper')
-rw-r--r--bootwrapper/Makefile5
-rw-r--r--bootwrapper/c_start.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/bootwrapper/Makefile b/bootwrapper/Makefile
index 15a6419..3af7c5d 100644
--- a/bootwrapper/Makefile
+++ b/bootwrapper/Makefile
@@ -46,6 +46,8 @@ HIBASE?=0x8FF
FSADDR?=0x8e400000
DEBUG=TRUE
BOOT_CLUSTER?=0
+# SWITCHER is also defined in big-little/Makefile!
+SWITCHER?=TRUE
ifeq "$(BA)" ""
BOOTARGS=mem=255M console=ttyAMA0,115200 migration_cost=500 cachepolicy=writealloc
@@ -66,7 +68,8 @@ CFLAGS:=--cpu=Eagle -O2 \
-DHIBASE=$(HIBASE) \
-DVE=$(VE) \
-DBOOT_CLUSTER=$(BOOT_CLUSTER) \
- -DVECTBASE=$(VECTBASE)
+ -DVECTBASE=$(VECTBASE) \
+ -DSWITCHER=$(SWITCHER)
ifdef DEBUG
CFLAGS += -g -O0
diff --git a/bootwrapper/c_start.c b/bootwrapper/c_start.c
index d50e214..0678db3 100644
--- a/bootwrapper/c_start.c
+++ b/bootwrapper/c_start.c
@@ -37,6 +37,7 @@ unsigned char cpus_ready[NUM_CLUSTERS][NUM_CPUS];
unsigned thumb = T2;
void (*kernel_start_address) (int, int, int, int);
volatile unsigned model_pen = 0;
+unsigned switcher = SWITCHER;
unsigned gic_int_num(void)
{
@@ -127,13 +128,14 @@ void secondary_main(unsigned cluster_id, unsigned cpu_id)
void wait_for_secondaries(unsigned active_clusters, unsigned secondary_cpus)
{
int i, j, ready;
+ int num_clusters = switcher ? active_clusters + 1 : active_clusters;
printf("Waiting for %d secondary CPUs\n", secondary_cpus);
while (TRUE) {
ready = 0;
- for (i = 0; i < active_clusters; i++) {
+ for (i = 0; i < num_clusters; i++) {
for (j = 0; j < NUM_CPUS; j++) {
if (cpus_ready[i][j]) {
++ready;