cmake: add declare_default_headers
This allows for arm headers to be generated for an arm platform in include/plat/default that specifies the following: - maxIRQ - TIMER_CLOCK_HZ - the timer header to use - the interrupt controller header to use
This commit is contained in:
parent
b2239d0dbe
commit
d703eab23d
5 changed files with 89 additions and 0 deletions
14
include/plat/default/plat/machine.h
Normal file
14
include/plat/default/plat/machine.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Copyright 2019, Data61
|
||||
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
|
||||
* ABN 41 687 119 230.
|
||||
*
|
||||
* This software may be distributed and modified according to the terms of
|
||||
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
|
||||
* See "LICENSE_GPLv2.txt" for details.
|
||||
*
|
||||
* @TAG(DATA61_GPL)
|
||||
*/
|
||||
|
||||
#include <plat/machine/devices_gen.h>
|
||||
#include <plat/platform_gen.h>
|
||||
21
include/plat/default/plat/machine/hardware.h
Normal file
21
include/plat/default/plat/machine/hardware.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright 2017, Data61
|
||||
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
|
||||
* ABN 41 687 119 230.
|
||||
*
|
||||
* This software may be distributed and modified according to the terms of
|
||||
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
|
||||
* See "LICENSE_GPLv2.txt" for details.
|
||||
*
|
||||
* @TAG(DATA61_GPL)
|
||||
*/
|
||||
|
||||
#ifndef __PLAT_MACHINE_HARDWARE_H
|
||||
#define __PLAT_MACHINE_HARDWARE_H
|
||||
#include <config.h>
|
||||
#include <types.h>
|
||||
#include <basic_types.h>
|
||||
#include <linker.h>
|
||||
#include <machine/io.h>
|
||||
|
||||
#endif /* !__PLAT_MACHINE_HARDWARE_H */
|
||||
17
include/plat/default/plat/machine/timer.h
Normal file
17
include/plat/default/plat/machine/timer.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright 2017, Data61
|
||||
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
|
||||
* ABN 41 687 119 230.
|
||||
*
|
||||
* This software may be distributed and modified according to the terms of
|
||||
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
|
||||
* See "LICENSE_GPLv2.txt" for details.
|
||||
*
|
||||
* @TAG(DATA61_GPL)
|
||||
*/
|
||||
|
||||
#ifndef __PLAT_MACHINE_TIMER_H
|
||||
#define __PLAT_MACHINE_TIMER_H
|
||||
|
||||
|
||||
#endif /* !__PLAT_MACHINE_TIMER_H */
|
||||
|
|
@ -66,6 +66,18 @@ elseif(KernelSel4ArchAarch64)
|
|||
set_kernel_64()
|
||||
endif()
|
||||
|
||||
function(declare_default_headers timer_frequency max_irq irq_header timer_header)
|
||||
set(CONFIGURE_TIMER_FREQUENCY "${timer_frequency}")
|
||||
set(CONFIGURE_MAX_IRQ "${max_irq}")
|
||||
set(CONFIGURE_INTERRUPT_CONTROLLER "${irq_header}")
|
||||
set(CONFIGURE_TIMER "${timer_header}")
|
||||
configure_file(
|
||||
src/arch/arm/platform_gen.h.in ${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/platform_gen.h
|
||||
@ONLY
|
||||
)
|
||||
include_directories(include/plat/default)
|
||||
endfunction()
|
||||
|
||||
# Include all the platforms. For all of the common variables we set a default value here
|
||||
# and let the platforms override them.
|
||||
set(KernelArmMachFeatureModifiers "" CACHE INTERNAL "")
|
||||
|
|
|
|||
25
src/arch/arm/platform_gen.h.in
Normal file
25
src/arch/arm/platform_gen.h.in
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2019, Data61
|
||||
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
|
||||
* ABN 41 687 119 230.
|
||||
*
|
||||
* This software may be distributed and modified according to the terms of
|
||||
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
|
||||
* See "LICENSE_GPLv2.txt" for details.
|
||||
*
|
||||
* @TAG(DATA61_GPL)
|
||||
*/
|
||||
|
||||
#ifndef __ARM_PLAT_H
|
||||
#define __ARM_PLAT_H
|
||||
|
||||
#define TIMER_CLOCK_HZ @CONFIGURE_TIMER_FREQUENCY@
|
||||
enum IRQConstants {
|
||||
maxIRQ = @CONFIGURE_MAX_IRQ@
|
||||
} platform_interrupt_t;
|
||||
|
||||
|
||||
#include <@CONFIGURE_INTERRUPT_CONTROLLER@>
|
||||
#include <@CONFIGURE_TIMER@>
|
||||
|
||||
#endif /* !__ARM_PLAT_H */
|
||||
Loading…
Reference in a new issue