Commit Graph

185 Commits

Author SHA1 Message Date
Kent McLeod
b785b59930 cmake: Add SEL4_CONFIG_DEFAULT_ADVANCED variable
This directory-scoped varible is now used by config_option,
config_choice and config_string to set a created CMake cache variable as
advanced or not. An advanced variable is hidden by default in the CMake
configuration editors. Setting SEL4_CONFIG_DEFAULT_ADVANCED to ON will
cause variables to be advanced and not show up in the cache. Projects
can set this to limit the amount of options presented in the
config editor. Any cache variable can have this overridden by calling
mark_as_advanced(CLEAR config_name)
2019-09-13 18:42:42 +10:00
Kent McLeod
297d2b63da CMake: Invoke configuration files to build kernel
This leverages #!/usr/bin/env -S cmake -P to invoke a cmake
configuration file as a script that configures and builds a kernel in
the current directory with the configuration that was invoked. It is a
quick way for producing a kernel.elf or kernel_all_pp.c input file to
verification for a particular config.
2019-09-13 18:42:42 +10:00
G. Branden Robinson
2b5c8d3f84 setup.py: depend on 'pyyaml', not 'pyaml'
In the pip namespace, 'pyaml' is "pretty-yaml", a YAML generator (but
not a YAML parser); 'pyyaml' (accessed with "import yaml"), a.k.a.
"PyYAML", is the YAML serialiser and reader we actually use.

Bump the minor version number per semantic versioning rules.  (One could
argue that we are "removing" pyaml (pretty-yaml) from our interface and
therefore a major version bump is required, but we weren't _actually_
using that module so I would argue that the introduction of 'pyyaml' is
the visible change.)

Thanks to Japheth Lim for identifying this issue.
2019-08-30 16:53:16 +10:00
G. Branden Robinson
fc251b5067 setup.py: add Python dependency on libarchive-c
The `shoehorn` tool in tools/seL4 (the sel4_tools repository) requires
this.

Bump minor version number per semantic versioning rules (interface
extension).  (0.3.1 instead of 0.3.0 because 0.3.0 saw the light of day
with an incorrect dependency on `libarchive` instead of `libarchive-c`.)
2019-08-28 15:54:10 +10:00
G. Branden Robinson
568f509b50 Revert "setup.py: add Python dep[] on libarchive"
This reverts commit a14264336c.

There are (at least) 3 namespaces relevant to Python module names:
Debian package names, PyPI module names, and the name of a module used
by actual Python language imports.  That's one more than my brain could
handle.  I wanted "libarchive-c" in setup.py instead of "libarchive".
2019-08-28 15:49:28 +10:00
G. Branden Robinson
a14264336c setup.py: add Python dependency on libarchive
The `shoehorn` tool in the tools/seL4 (the sel4_tools repository) will
require this in a future commit.

Bump minor version number per semantic versioning rules (interface
extension).
2019-08-26 14:31:18 +10:00
G. Branden Robinson
d09cdc8329 trivial: add trailing comma to list element
Python syntax allows a comma after the last element of a list, and
having one helps avoid surprises in the event the lines of the list
are rearranged.
2019-08-26 14:29:29 +10:00
Anna Lyons
554f812da3 mcs: scheduling context donation over ipc
After this commit, threads blocked on an endpoint can recieve a
scheduling context from the thread that wakes the blocked thread.
2019-08-22 11:22:37 +10:00
Anna Lyons
4db4a3b882 kzm: implement MCS timer driver
- use gpt, so we can have overflow and compare interrupts at the same
time (epit only allows compare)
- set the gpt to use the ipg_highfreq timer, as the standard ipg is too
low and breaks the timer calculations
2019-08-22 11:22:35 +10:00
Anna Lyons
a7fb6b56b7 cortex-a9: tickless global timer driver
- use in sabre (imx6) and zynq7000, the two platforms that were using
  the private timer.
2019-08-22 11:22:35 +10:00
Anna Lyons
fad8781c81 mcs: Add reciprocal.py
Used for calculating constants for reciprocal division.
2019-08-22 11:22:34 +10:00
G. Branden Robinson
940b43b767 setup: add versioned dependency on pyaml
In commit 24131333ac ("trivial: disable
YAML loading warning"), an assumption was made that the version of pyaml
present was 5.1 or later; see https://msg.pyyaml.org/load .

Version the dependency.
2019-08-20 12:04:27 +10:00
Kent McLeod
2890188994 hardware_gen: Correctly set default kernel_size
kernel_size has a default value of 0x1000 according to
hardware_schema.yml.
2019-08-13 14:54:39 +10:00
Kent McLeod
d764d5f183 hardware_gen: Refactor script after recent changes
- remove add_build_rules() and replace with shorter inline impl.
- Remove nested for looping from Config.get_irqs() and .split_regions()
as we already know that a rule exists and have a reference to it via the
kernel device.
- Don't allow multiple rules for a single compatibility string. There
currently aren't multiple rules for a single string without any
motivating examples it is unclear whether this should be supported.
2019-08-13 14:54:39 +10:00
Kent McLeod
cf997974a8 hardware_gen: Always specify kernel devices
The kernel device IRQs and Frame mappings generated by this script will
only come from nodes specified in the seL4,kernel-devices property of
the chosen node.  Previously these devices were inferred by the script
but this led to false matching and didn't support easily overriding
which devices to match under different configurations or across
different platforms.

Explicitly specifying which devices from the device tree will be used in
the kernel makes it easier to check which devices the kernel is actually
using and makes it easier to change on a per platform or per
configuration basis.
2019-08-13 14:54:35 +10:00
Kent McLeod
44fce7ddf1 hardware_gen: Refactor calculating device regions
- Device.regions() now just calculates memory regions without splitting
them into user and kernel groups.
- Config.split_regions() now calls Device.regions() and performs the
splitting if the device is a kernel device, otherwise returns the
original regions.
- Config.split_regions() is now only used in a context when dealing with
kernel devices, otherwise Device.regions() can be called to return only
informatioin extracted from the device tree.
2019-08-13 14:52:01 +10:00
Kent McLeod
1bd86aabc6 hardware_gen: Refactor calculating kernel IRQs
- directly return IRQs from Device.get_interrupts(): Previously, these
IRQs were then mutated by Config.get_irqs() based on driver definitions
in hardware.yml. Inverting this order makes get_interrupts more general.
- Config.get_irqs() uses the Device it gets passed to call
get_interrupts() only when it needs to extract interrupts for a device.
- Use Config.get_irqs() for building kernel's IRQ list instead of
calling Device.get_interrupts() due to the new inversion.
2019-08-13 14:52:01 +10:00
Kent McLeod
ad45ffc1e4 hardware_gen: Remove unused method is_compatible
Not used and it is unlikely that it will be needed in the near future.
2019-08-13 14:52:01 +10:00
Kent McLeod
51f55342ca hardware_gen,Device: extract get_affinities method
Returns an array of interrupt affinities corresponding to an array of
interrupts for a Device.
2019-08-13 14:52:01 +10:00
Kent McLeod
a603c7f811 CMake: Correct allwinnerA20 platform name
This name is case sensitive
2019-08-13 14:51:57 +10:00
Edward Pierzchalski
cfc544ab49 bitfields: Specify iteration order over dicts
In Python 3, dict value iterators aren't deterministic between runs,
which causes nondeterministic definition output order. Some L4V proofs
are sensitive to this order.

Use sorted keys to guarantee order when iterating over values.
2019-08-08 10:19:24 +10:00
Anna Lyons
bc61a7f3bd python2 --> python3
Update all scripts and build system to call python3, given python2's
upcoming doom. Use sys.maxsize instead of sys.maxint in one script
(maxint does not exist in python3).
2019-08-08 10:19:24 +10:00
Kent McLeod
158ab9a3eb python-deps: Add pyelftools to sel4-deps package
This dep is required by the elfloader for loading Arm and RISC-V
platforms.
2019-07-31 11:32:34 +10:00
Kent McLeod
9b1877de21 Add initial i.MX8M Mini evk 64-bit Support
This adds support for the 64-bit i.MX8M Mini evaluation kit.
Currently only AArch64 EL1 is supported.
2019-07-19 14:32:53 +10:00
Yanyan Shen
d6d3aa4c32 trivial: dts: Change the DTS for FVP 2019-07-10 06:59:13 +10:00
Simon Shields
55ad2c4dca GICv2: map VCPU region as execute never
This matches the other GIC regions.
2019-07-02 16:04:39 +10:00
Kent McLeod
051d32beab Add initial i.MX8M Quad evk 64-bit Support
This adds support for the 64-bit i.MX8M Quad evaluation kit.
Currently only AArch64 EL1 is supported.
2019-07-01 23:31:47 +10:00
Kent McLeod
0d60f6f298 arm: Rename gic_pl390 to gic_v2
This is to reflect that this driver provides support for features that
are newer than gic_pl390 such as virtualisation.
2019-07-01 23:30:39 +10:00
Kent McLeod
82f2d1fc9c helpers.cmake: Add FORCE to all INTERNAL sets
INTERNAL implies FORCE but in some versions of CMake if a config option
has been passed in via a -D option the INTERNAL set doesn't override the
value when it should.

See: https://gitlab.kitware.com/cmake/cmake/issues/19015
  INTERNAL does not imply FORCE for CACHE
2019-06-27 18:29:55 +10:00
Siwei Zhuang
8b4ed9941a RISCV: Add Hifive unleashed platform
This change adds support for Hifive unleashed board. It also removes the
outdated hifive suport from the spike platform.
2019-06-26 15:11:47 +10:00
Siwei Zhuang
efda335b8c RISCV: Add DTS for 32bit spike platform
There is a different DTS file for 32bit spike platform.
2019-06-26 11:38:08 +10:00
Siwei Zhuang
375a98c8b3 CMake: Generate device headers from DTS for spike
The DTS compilation was arm platforms only. Moving it to the top level
config file, making it available to RISCV platforms. The generated files
are almost identical with minor differences. A new argument(--arch) is
added to the hardware_gen.py for the differences.
2019-06-26 11:38:08 +10:00
James Ye
ff418649c1 am335x: add BeagleBone Blue support
BeagleBone Blue is a BeagleBone variant aimed at robotics applications.
Device Tree generated from Linux 4.20.17
2019-06-24 11:28:20 +10:00
James Ye
b7950aa332 tools/dts: use correct dts for am335x-boneblack
Device Tree generated from Linux 4.20.17
2019-06-24 11:28:20 +10:00
James Ye
33fd7b0423 Rename am335x to am335x-boneblack
There are other am335x boards which require different platform
configurations, such as the BeagleBone Blue.
2019-06-24 11:28:20 +10:00
Kent McLeod
664ac2288c python,sel4-deps: Pin versions for style tools
These tools sometimes style differently across different versions.
2019-06-18 15:33:36 +10:00
cvluca
24131333ac trivial: disable YAML loading warning
Use of PyYAML's yaml.load function without specifying the Loader=...
parameter, has been deprecated.
2019-06-14 10:17:10 +10:00
Anna Lyons
28c3dfe187 hardware_gen.py: Add YAML output support
We need other tools to be able to gather information about the kernel
memory reservation areas and device memory regions.  Add mandatory
parameter --yaml for specifying the name of the output file to receive
this information.  Write it.

Committed by G. Branden Robinson <Branden.Robinson@data61.csiro.au>.
2019-05-14 15:37:52 +10:00
G. Branden Robinson
d3446bc534 hardware_gen.py: List required paramaters first
In the usage message, identify all the required parameters before the
optional ones.
2019-05-14 15:37:52 +10:00
G. Branden Robinson
2ee6496af3 hardware_gen.py: Defer module import attempt
Move module imports that are not absolutely required into a function
instead of at the top level so that we don't spew the diagnostic message
in scenarios like `--help` or usage errors.
2019-05-14 15:37:52 +10:00
G. Branden Robinson
8d0950ff4f hardware_gen.py: Give tool a description
Nothing said what this tool actually _does_.
2019-05-14 15:37:52 +10:00
Kent McLeod
3707f65c6f CMake: Refactor DTS compilation step in CMake
- Minimise calls to external_process as this is more expensive than
using built-in CMake file operations.
- Update check_outfile_stale to also save the list of files it checks
for stale checks so if a config changes the list of files then the
output file will still be stale even if the input list of files are
older than it.
2019-05-07 10:15:54 +10:00
Kent McLeod
9db06db088 CMake: Remove unused cmake module import
While some functionality in helpers.cmake is based on
CMakeDependentOption, this module isn't actually used.
2019-05-07 10:00:08 +10:00
Kent McLeod
c75a270f56 hardware_gen.py: memoize should_parse_regions
should_parse_regions performs a lot of repeated recursive calls on
immutable inputs. Memoizing it to cache previous calls leads
to a noticible reduction in execution time.
2019-04-23 09:16:09 +10:00
James Ye
a16cc57e21 Add Odroid-C2 support
Add support for the Hardkernel Odroid-C2 board.

Co-Authored-By: Anna Lyons <Anna.Lyons@data61.csiro.au>
2019-04-18 11:14:17 +10:00
Anna Lyons
fa60ebabc6 tools: add autopep8 dependency 2019-03-27 10:50:26 +11:00
Anna Lyons
cf57914c7f style: run autopep8 on python files 2019-03-27 10:43:58 +11:00
Anna Lyons
305b5f9c3d tools: add guardonce python dependency 2019-03-25 16:02:51 +11:00
Luke Mondy
715e595193 Fix cmake-format dep name 2019-03-22 14:38:04 +11:00
Anna Lyons
ffa9fda8f0 style: use consistent styling for all cmake files
Add .cmake-format.yaml which defines custom functions with kwargs to
style nicely
2019-03-22 11:52:06 +11:00