3 * \brief Platform interface for ARM boards.
5 * This file defines the hardware abstraction layer for ARM targets. Each
6 * board is expected to have an implementation that corresponds to this
9 * This interface is expected to change as new boards are added.
13 * Copyright (c) 2016 ETH Zurich.
14 * All rights reserved.
16 * This file is distributed under the terms in the attached LICENSE file.
17 * If you do not find this file, copies can be found by writing to:
18 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
21 #ifndef __ARM_PLATFORM_H__
22 #define __ARM_PLATFORM_H__
24 #include <barrelfish_kpi/types.h>
25 #include <barrelfish_kpi/platform.h>
28 * Do any extra initialisation for this particular CPU (e.g. A9/A15).
30 void platform_revision_init(void);
33 * Return the core count
35 size_t platform_get_core_count(void);
38 * Print system identification. MMU is NOT yet enabled.
40 void platform_print_id(void);
43 * Return the base address of the private peripheral region.
45 lpaddr_t platform_get_private_region(void);
48 * Fill out provided `struct platform_info`
50 void platform_get_info(struct platform_info *pi);
51 void armv7_get_info(struct arch_info_armv7 *ai);
52 void armv8_get_info(struct arch_info_armv8 *ai);
55 * Figure out how much RAM we have
57 size_t platform_get_ram_size(void);
60 * Boot secondary processors
62 errval_t platform_boot_core(hwid_t target, genpaddr_t gen_entry, genpaddr_t context);
63 void platform_notify_bsp(lpaddr_t *mailbox);
68 extern lpaddr_t platform_uart_base[];
69 extern size_t platform_uart_size[];
71 // Helpers for enabling interrupts
72 #define IRQ_PRIO_LOWEST (0xF)
73 #define IRQ_CPU_TRG_ALL (0x3) // For two cores on the PandaBoard
74 #define IRQ_CPU_TRG_BSP (0x1)
75 #define IRQ_EDGE_TRIGGERED (0x1)
76 #define IRQ_LEVEL_SENSITIVE (0x0)
77 #define IRQ_1_TO_N (0x1)
78 #define IRQ_N_TO_N (0x0)
81 * Interrupt controller interface
83 errval_t platform_init_ic_bsp(void);
84 errval_t platform_init_ic_app(void);
85 uint32_t platform_get_active_irq(void);
86 void platform_acknowledge_irq(uint32_t irq);
87 errval_t platform_enable_interrupt(uint32_t int_id, uint16_t prio,
88 bool edge_triggered, bool one_to_n);
95 * @brief initialize the timer
97 void platform_timer_init(int timeslice);
100 * @brief check if the interrupt is a timer interrupt
102 * @param interrupt number
103 * @return TRUE if it's the timer interrupt
105 bool platform_is_timer_interrupt(uint32_t irq);
108 * @brief Return the IRQ to be used for the cpu driver timer
109 * @return The IRQ number of the timer interrupt.
111 uint32_t platform_get_timer_interrupt(void);
114 #endif // __ARM_PLATFORM_H__