Commit Graph

36 Commits

Author SHA1 Message Date
Axel Heider
b59fa0ed20 riscv: use MAX_IRQ instead of PLIC_MAX_NUM_INT
Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-11-24 09:57:46 +00:00
Axel Heider
d2027a1fb9 cmake: rework macro declare_seL4_arch()
Support multiple architectures as parameter.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-11-23 11:53:46 +00:00
Axel Heider
2826d3b0f4 cmake: define KERNEL_ROOT_DIR
Avoid redundancy.

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2023-05-12 12:04:58 +10:00
Kent McLeod
6702f3322e ARM_SMMU: Fix configuration handling for SMMU opt
The TX2 is currently the only platform that supports CONFIG_ARM_SMMU and
wants it on by default, however the CMake scripts wouldn't allow it to
be disabled. Now it should work normally:
- When TX2 is set the config is enabled unless it's preconfigured to
  OFF.
- When the platform is changed to not TX2, the SMMU option is turned
  off.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-03-02 14:35:13 +11:00
Axel Heider
e22412b2be cmake: add a sanity check
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-09-30 11:21:03 +02:00
Indan Zupancic
4a7d08def0 MCS, ARM: Introduce TIMER_OVERHEAD_TICKS
For ARM currently TIMER_PRECISION exists, but that is in microseconds
and not fine-grained enough.

This is needed to make periodic tasks synchronous with the system clock.
If this value is zero every period will be extended with the overhead of
taking an interrupt and reading the system clock. To avoid this drift,
the configured value should be set to at least the average overhead.

See also issue #844.

Signed-off-by: Indan Zupancic <Indan.Zupancic@mep-info.com>
2022-05-23 16:31:45 +10:00
Kent McLeod
35fed131b0 ARMv6: Remove architecture support
Remove all support for ARMv6 architectures now that all platforms and
CPUs that use this architecture have been removed.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-09-30 18:07:19 +10:00
Kent McLeod
449855855d ARM11: Remove CPU support
Remove support for ARM1136JF_S ARMv6 CPU as ARMv6 support is being
removed.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-09-30 18:07:19 +10:00
Ben Leslie
7f6f0008a9 Add additional cmake checks
Verify that KernelArch and KernelWordSize have been correctly
set after including the platform cmake files.

Signed-off-by: Ben Leslie <benno@brkawy.com>
2021-09-06 13:14:20 +10:00
Kent McLeod
b05d681621 cmake: Add seL4Config.cmake include CMakeLists.txt
seL4Config.cmake is responsible for generating a valid
CMAKE_TOOLCHAIN_FILE and setting up platform config options at the start
of the build. The CMAKE_TOOLCHAIN_FILE variable has to be set before the
first cmake `project()` function is processed to take effect.
Previously this file was required to be imported in a CMake script
before the kernel's CMakeLists.txt could be processed. This prevented
the main CMakeLists.txt file from being used without an additional
configuration file:
cmake -G Ninja -C ../configs/ARM_verified.cmake ../

Now it is possible to do:
cmake -G Ninja -DKernelPlatform=imx6 -DKernelARMPlatform=sabre ../

This should make it easier to invoke CMake for building kernel
configurations from other build environments.

Because this file is now imported in the Kernel's CMakeLists.txt
context, there is no longer a requirement to save all the intermediate
settings into the cache and then read them out again.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-08-19 09:24:31 +10:00
Curtis Millar
84e8509997 Add ARM Cortex A55
This adds basic support for the ARM Cortex A55 cpu core as is used in
the Amlogic S905x3 that is found in the ODroid C4.

Signed-off-by: Curtis Millar <curtis@curtism.me>
2021-07-09 14:05:05 +10:00
Kent McLeod
7b0602c5f7 cmake: Apply KernelAArch64SErrorIgnore setting
KernelAArch64SErrorIgnore needs to be saved into the cache in
seL4Config.cmake if it is set by any platform's config.cmake.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-06-10 11:08:13 +10:00
Axel Heider
e1e26c7ef8 CMake: cleanup KernelSel4ArchArmHyp
Don't create CONFIG_ARCH_AARCH32 on every platform and architecture.
Remove KernelSel4ArmHypAarch32.

Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-06-09 09:51:07 +10:00
Curtis Millar
7749b33589 Don't assume timer precision is passed
the function is not always passed the TIMER_PRECISION argument. If it is
not, we should not set the global varaible.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-04-06 11:39:03 +10:00
Lukas Graber
2a0e5a2a1f Bring Raspberry Pi 4 (RPi4) support
Signed-off-by: Lukas Graber <lukas.graber@hensoldt-cyber.de>
2021-03-22 11:41:03 +11:00
Axel Heider
d36ec062a0 CMake: fix comment with usage example
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-03-03 11:47:23 +01:00
Axel Heider
800b2444a1 trivial: style and formatting
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-03-03 11:47:23 +01:00
Axel Heider
e62bd5b31d CMake: remove deprecated variables
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-02-02 02:34:47 +01:00
Axel Heider
651fb65017 CMake: inline set_kernel_32() and set_kernel_64()
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-02-01 18:23:42 +01:00
Ben Leslie
5b611a0d03 Add basic build support for A35 core
The A35 core is available on some recent ARMv8 SOCs (such as the
NXP i.MX8X family).

This change enables building for the A35, however no platforms
currently target the A35. It is an enabler for future platform
support additions.

Signed-off-by: Ben Leslie <benno@brkawy.com>
2020-12-08 09:34:54 +11:00
Oliver Scott
6ad15c0f45 trivial: clean up code for C parser
Remove unused cases and add break in switch statements.
Add conditions to sel4arch.xml.
Change guard in capdl printing to correct TK1_SMMU.
Set KernelArmSMMU default to off.
Add types to aarch32 syscall_stub_gen.py.

Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2020-10-28 17:30:42 +11:00
Oliver Scott
c66d9cee7a trivial: style and comment
Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2020-10-28 17:30:42 +11:00
Qian Ge
7316bfc676 SMMU: providing master control caps to root task
Adding the master control caps that are used to create transaction
and context banks caps. This commit includes the internal kernel
structure that required to manage any created transaction and
context bank caps.

Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2020-10-28 17:30:42 +11:00
Qian Ge
1a9756f65b SMMU: basic driver for init and probing
Introducing the driver in kernel for detecting SMMU features
and initialise the hardware.

Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2020-10-28 17:30:42 +11:00
Gerwin Klein
79da079239 Convert license tags to SPDX identifiers
This commit also converts our own copyright headers to directly use
SPDX, but leaves all other copyright header intact, only adding the
SPDX ident. As far as possible this commit also merges multiple
Data61 copyright statements/headers into one for consistency.
2020-03-09 13:21:49 +08:00
Axel Heider
49dd638a8a cmake: add helper functions 2019-11-16 16:31:00 +01:00
Kent McLeod
8748d8ea5e seL4Config.cmake: Add FORCE to KernelSel4Arch
Without FORCE being added to `set` in declare_seL4_arch for
KernelSel4Arch, the set command doesn't seem to persist as the variable
must be already initialised in some cases. In this part of the script
processing, a platform has already been selected and is setting its seL4
arch and so using FORCE seems appropriate anyway.
2019-09-19 17:28:34 +10:00
Kent McLeod
d258af82ab CMake: Error if toolchain file changes
The toolchain file given to CMake is required to be immutable after
first build configuration. CMake caches certain build flags based on
this assumption. We now throw an error if the platform configuration
changes in a way that changes this toolchain file.
2019-09-13 18:42:42 +10:00
Kent McLeod
7d9297326b CMake: Possibly set toolchain file automatically
If CMAKE_TOOLCHAIN_FILE is unset in seL4Config.cmake then generate one
that selects the correct toolchain based on configured kernel arch
settings.

This means that initialising a build goes from:
`cmake -DCMAKE_TOOLCHAIN_FILE=gcc.cmake -DAARCH32=ON -G Ninja -C
../configs/ARM_verified.cmake ..`
to:
`cmake -G Ninja -C ../configs/ARM_verified.cmake ..`

gcc.cmake is modified to be used as an input to configure_file.
@KernelArch@ and other @@ arguments will be replaced with the
configuration settings. The file will still work if passed directly to
cmake via -DCMAKE_TOOLCHAIN_FILE=gcc.cmake without being templated.
2019-09-13 18:42:42 +10:00
Curtis Millar
2f00d10f0e mcs: enable MCS for riscv
This allows an MCS kernel to be built on a RISC-V platform.
2019-08-27 10:46:13 +10:00
Anna Lyons
742cabf15b mcs: provide tickless api for arm timers
This does not implement the timers for any platforms, but
provides the generic arm arch, and aarch32/aarch64 infrastructure for
tickless timer drivers.
2019-08-22 11:22:34 +10:00
Anna Lyons
952134d1b8 mcs: Add a scheduling context object
This is the first part of the seL4 MCS. This commit:

    * adds a scheduling context object. Threads without scheduling
      context objects cannot be scheduled.
    * replaces tcbTimeSlice with the scheduling context object
    * adds seL4_SchedControl caps for each core
    * adds seL4_SchedControl_Configure which allows users to configure
      amount of ticks a scheduling context has, and set a core for the
      scheduling context.
    * adds seL4_SchedContext_Bind, Unbind and UnbindObject, which allows
      a tcb to be bound to a scheduling context.
2019-08-22 11:22:34 +10:00
Kent McLeod
caad010a09 CMake: Add KernelIsMCS option
This switches between master and mcs configurations.
This also adds a build system variable KernelPlatformSupportsMCS that
can be used to error on platforms that don't support MCS due to
unimplemented functionality.
2019-08-22 11:22:33 +10:00
Kent McLeod
e0887c9629 CMake: Set KernelArmPASizeBits* based on Arm CPU
The physical address range supported by each aarch64 platform is defined
by which Arm CPUs it has. We therefore configure KernelArmPASizeBits*
based on which CPU is selected.
2019-07-25 09:25:22 +10:00
Sylvain Gauthier
121943c3c7 [SMP] Added PPI support for gic_v2
Correctly defined the macros to translate between virtual and hardware
IRQs such that PPIs can be properly handled on gic_v2. It is now
possible to create a per-core handler for PPIs on platforms using this
GIC.
2019-07-19 16:37:03 +10:00
Kent McLeod
d5ded0c4f5 CMake: Process platform files in -C config
Allow projects that use the kernel as a subproject to configure the
kernel in -C scripts.

CMake supports providing a script via -C upon first initialisation of a
build directory. This script is expected to populate the configuration
cache for the rest of the build to depend on. This is how standalone
kernel builds are currently configured. However in buildsystems that add
the kernel as a subproject, it was up to the application to modify
configuration properties before or after the kernel was imported. This
lead to circular dependencies where properties were changed by a module
later in the build, but this then invalidated properties that were set
based on the first property's original value. This lead to running CMake
multiple times in order for settings to reach a stable state.

We now assume that most shared system configuration occurs in initial -C
settings evaluation. seL4Config.cmake is a configuration module that the
kernel exports that allows a configuration script to set kernel platform
and architecture settings in a way that doesn't introduce circular
dependencies.

seL4Config can be imported into other configuration files. This should
make it easier for a full system configuration script to query and
configure kernel configuration values without introducing circular
dependencies on configuration properties.
2019-07-03 17:32:54 +10:00