summaryrefslogtreecommitdiff
path: root/bootwrapper/bootwrapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'bootwrapper/bootwrapper.h')
-rw-r--r--bootwrapper/bootwrapper.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/bootwrapper/bootwrapper.h b/bootwrapper/bootwrapper.h
new file mode 100644
index 0000000..7d44493
--- /dev/null
+++ b/bootwrapper/bootwrapper.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the
+ * above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * Neither the name of ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
+
+#ifndef __BOOTWRAPPER_H__
+#define __BOOTWRAPPER_H__
+
+/* A stack of 128 words per cpu */
+#define STACK_SIZE 128
+#define NUM_CPUS 4
+#define NUM_CLUSTERS 4
+#define TRUE 1
+#define FALSE 0
+#define PLATFORM_MASK 0x0FFFFFFF
+
+/* Permissions for architected timers/counters */
+#define PL1PCTEN (1 << 0)
+#define PL1PCEN (1 << 1)
+#define PL0PCTEN (1 << 0)
+#define PL0VCTEN (1 << 1)
+#define PL0VTEN (1 << 8)
+#define PL0PTEN (1 << 9)
+#define CP15_TIMER_FREQ 12000000
+
+#define VERSATILE_EXPRESS 2272
+#define UART0_BASE 0X1C090000
+#define VE_SYS_BASE 0X1C010000
+#define CCI_BASE 0x2C090000
+#define SECURE_ACCESS_REG 0x8
+#define FLAGS_SET 0x30
+#define FLAGS_CLR 0x34
+
+#define VE_KFSCB_BASE 0x10020000 /* Kingfisher System Configuration Block */
+#define KFS_ID_OFFSET 0xFFC /* Kingfisher System Platform ID register offset (KFS_ID) */
+#define KFS_ID_ARCH_MASK 0x000F0000 /* Mask for extracting KFS architecture */
+#define KFS_ID_ARCH_SHIFT 16 /* Shift for extracting KFS architecture */
+#define KFS_CFG_R 0x30 /* Kingfisher System static configuration read register */
+#define ACTIVE_CLUSTER_MASK 0x3 /* Returns the value that was driven on the CFG_ACTIVECLUSTER configuration inputs at the last system power-on reset. */
+#define KFS_CFG_R_OFFSET 0x30 /* Kingfisher System Static Configuration Read register */
+#define ACTIVE_CLUSTER_MASK 0x3 /* Returns the value that was driven on the CFG_ACTIVECLUSTER configuration input */
+
+#define CLUSTER_CPU_COUNT(x) (((read32(VE_KFSCB_BASE + KFS_CFG_R) >> 16) >> (x << 2)) & 0xf)
+#define write32(addr, val) (*(volatile unsigned int *)(addr) = (val))
+#define read32(addr) (*(volatile unsigned int *)(addr))
+
+extern void config_uart(void);
+extern void drain_uart_fifo(void);
+extern void start(void);
+
+#endif /* __BOOTWRAPPER_H__ */