summaryrefslogtreecommitdiff
path: root/bootwrapper/bootwrapper.h
blob: 7aa66053d011476687a53ca7ad0319ecaa089f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * $Copyright:
 * ----------------------------------------------------------------
 * This confidential and proprietary software may be used only as
 * authorised by a licensing agreement from ARM Limited
 *  (C) COPYRIGHT 2008-2011 ARM Limited
 *       ALL RIGHTS RESERVED
 * The entire notice above must be reproduced on all authorised
 * copies and copies may only be made to the extent permitted
 * by a licensing agreement from ARM Limited.
 * ----------------------------------------------------------------
 * File:     bootwrapper.h
 * ----------------------------------------------------------------
 * $
 */

#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__ */