Commit Graph

140 Commits

Author SHA1 Message Date
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
Anna Lyons
86ed25b8c0 cmake: use snake_case for RegisterDriver & CPPFile
Our upcoming cmake styling tool requires any custom functions you want
styled nicely to be lower case. We only need to style these two nicely,
as they have kwargs we would like aligned.
2019-03-22 11:50:04 +11:00
Anna Lyons
dad3b8ba56 python-deps: add cmake-style 2019-03-22 11:47:07 +11:00
Kofi Doku Atuah
16f55f8e4b Device-generation: Add __ASSEMBLER__ guards 2019-03-21 12:31:25 +11:00
Anna Lyons
76267c410e Remove kernel_astyle.sh
Instead style.sh from seL4_tools should be used
2019-03-19 14:02:29 +11:00
Kent McLeod
0cc4997a16 cmake: add check_outfile_stale macro
This checks if a file is older than other files during CMake configure
phase. This is to prevent unnecessary long running execute_process
calls.
2019-03-12 08:55:05 +11:00
Kent McLeod
b7550ca830 hardware_gen.py: Write compat strings to file
This reduces chances of other parts of the script printing to stdout and
allows the compatibility strings file to be inspected or manually
changed for debugging purposes.
2019-03-12 08:55:05 +11:00
Adam Felizzi
e3c7e391c1 hardware_gen: Use logging.warning for import error
Updated YAML validation error message to use logging.warning,
forwarding the output to stderr. This would otherwise end up
in the CMake dts compatibility string.
2019-03-08 16:11:39 +11:00
Oliver Scott
96c63a4b55 serial-refactor: Fixed circular includes
Modify hardware_gen script to only include chosen
serial path. Added newlines to serial drivers to fix
concat issues when compiling. Move cmake macro RegisterDriver
 up a level to support timer refactor. Modify arm cmake to reflect
this.
2019-03-08 10:51:01 +11:00
Kent McLeod
2943f042a7 hardware_gen: Remove build path from output file
This was causing errors with a reproducible build check in the binary
verification toolchains.
2019-03-07 16:11:31 +11:00
Oliver Scott
34ce52e283 serial-refactor: Refactor kernel serial drivers
Have added a drivers/serial folder to kernel, where all serial drivers
will be kept. The point is to have the the dts parsed and generate cmake
to include the right uart.c file prefixed with the compatibility.
Have removed all io.c from plat and includes from plat/config.cmake and
updated CHANGES file.
2019-02-21 16:11:37 +11:00
Simon Shields
ca53350a71 hardware_gen: Add support for /reserved-memory node
Parse the /reserved-memory node per the Linux spec[1].
Ignore regions marked as 'no-map', but keep other regions
as they should be OK to use as RAM.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt?h=v5.0-rc6
2019-02-15 14:05:06 +11:00
Simon Shields
16d98d852f hardware_gen: use full node path in dictionaries
it's not guaranteed that node names will be globally unique,
so use the full path to the node instead.
2019-02-15 14:05:06 +11:00
Simon Shields
cbe6e4c651 hardware_gen: include linker.h in generated header
this is needed for the BOOT_RODATA attribute
2019-02-15 14:05:06 +11:00
Yanyan Shen
f7749ed54c dts: Add Arm FVP device tree file.
This file is based on foundation-v8-gicv3.dts.
2019-02-13 17:16:42 +11:00
Yanyan Shen
8f433d7dbc hardware_gen: Add GICv3 support. 2019-02-13 16:09:53 +11:00
Simon Shields
e9fc74b5a2 hardware_gen: support specifying size of kernel device
This allows for mapping of consecutive pages for a single device in the
kernel.
2019-02-13 11:13:05 +11:00
Simon Shields
21993d8bbc hardware_gen: generate kernel_devices
This change fixes support for instances where we have
multiple kernel devices in the same page, or kernel devices
which aren't at page-aligned addresses.

Also use seL4_UserTop to pick the right address to start
putting the kernel device pages.
2019-02-05 14:58:17 +11:00
Simon Shields
b45de78546 hardware_gen: use "ranges" property for cpu-addressable buses
This removes the need for the buses array in the hardware YAML
2019-02-05 12:14:28 +11:00
Simon Shields
d9b399ff27 hardware_gen: improve region-merging logic
Merge overlapping regions to ensure that we don't expose
the same paddr more than once.
2019-02-04 12:57:15 +11:00
Simon Shields
09e6fbb1c4 hardware_gen: don't merge regions that are conditional
If one region is conditional and another isn't, we shouldn't merge them.
This fixes a problem where some regions wouldn't be exposed to
userspace when they were merged with a conditional region which would
cause userspace apps to fail in unexpected ways.
2019-02-01 16:46:22 +11:00
Simon Shields
4269c70800 hardware_gen: simplify file handling logic
Argparse supports file arguments, use this for all files.
2019-01-31 11:44:42 +11:00
Simon Shields
4700696846 hardware_gen: fix python3 support
This commit stops using FdtNodes as dict keys, as those aren't hashable
with python3. It also opens the DTB in binary mode to prevent decoding
errors under python3.
2019-01-31 11:44:38 +11:00
Anna Lyons
fe67d88c57 Update pydeps version
This is due to the new dependency, pyfdt
2019-01-29 17:10:29 +11:00
Simon Shields
c37d137705 python deps: add pyfdt 2019-01-29 12:30:52 +11:00
Simon Shields
8440f0339a hardware_gen: pull interrupts from DTS
This adds support for extracting interrupt numbers from DTS
to the hardware header file generator, so that the majority
of the per-platform interrupt listings can be removed.
2019-01-16 14:46:08 +11:00
Simon Shields
0ac0792339 arm: generate memory region tables from dts
This change adds infrastructure to automatically generate the
physBase macro, the avail_p_regs array, and the dev_p_regs array
based on a device tree. Platforms can opt-in to using this
by adding DTS files to the KernelDTSList variable.

The Python script uses the hardware.yml file to determine which
devices in the device tree are of interest to the kernel and should
be hidden from userspace and instead mapped into the kernel. Note that
currently the kernel mappings are not (yet) generated, however most
of the infrastructure needed to make that happen is present.
2019-01-16 14:38:25 +11:00
Simon Shields
463c1cc211 python deps: add jsonschema
This will be used to validate the kernel's hardware configuration file
against a schema.
2019-01-16 14:37:35 +11:00
Simon Shields
328a021686 Move DTS to the kernel
Move DTS to the kernel in preparation for using them to autogenerate
hardware headers.

This includes DTS that we didn't have previously, extracted from the
Linux kernel. Everything except TX2 comes from Linux v4.20, extracted
with the following commands:

checkout https://github.com/torvalds/linux.git v4.20
./update-dts.sh /path/to/linux/checkout

The TX2 dts is identical to the one that was found in seL4_tools.
2019-01-16 14:34:16 +11:00
Anna Lyons
eceefa883d cmake: add kernel platform helpers.
Add kernel_platforms_string and kernel_platforms_list to tools/helpers.cmake.
kernel_platforms_string: concatenates all platform strings together into a
newline separated string.
kernel_platforms_list: returns a list of all kernel platforms.
2018-12-10 16:36:22 +11:00
Edward Pierzchalski
1283345bfd bitfield_gen: merge clarsimp/simp in generated proofs
The old generated proofs would fail if a simp set change made
`clarsimp` discharge what `simp` simplified.
2018-10-02 14:41:21 +10:00
Anna Lyons
4e910ebfbb python deps: add seL4 tutorial deps 2018-09-14 17:08:05 +10:00
Kent McLeod
02c9895f66 CMake: Add missing dependency to CPPFile function 2018-09-03 11:11:51 +10:00
Adam Felizzi
43b7bca872 CMake: CPPFile EXACT_NAME creates a temp copy
Modified the behaviour of the EXACT_INPUT option within the
CPPFile helper function. Now named EXACT_NAME, the option
copies the input file to a temporary file. The name of the
temporary file is also passed in by the caller. This
step in necessary in getting the CPP step to correctly
depend on the targets given by the caller
(through EXTRA_DEPS). Also updated the CPP generation of the
kernel_all.i file to reflect the change.
2018-08-27 10:18:10 +10:00
Adam Felizzi
2bf255c8a3 tools: Ignore option for circular_includes script
Added an "ignore" argument to the circular_includes script. This
allows the caller to specify files for the script to ignore when
it parses the source file. Rather than creating a special
ignore case for "kernel_all.c" in the script itself, the user
parses the file as an argument (plus others if needed). Updated
the kernels cmake file to reflect the change.
2018-08-27 10:18:10 +10:00
Kent McLeod
880686dd22 bitfield_gen: Improve prune list generation time
Previously this would create a very big regex to parse the input
sources. This didn't scale as well on architectures with more bitfield
objects
2018-08-24 16:57:31 +10:00
Adam Felizzi
a9fe71ea8d tools: Added astyle,pylint and xmllint checks
Added small bash scripts to run astyle, pylint and xmllint
checks over the kernel source. These style checks were ported
from the old Make build system.
2018-08-10 10:38:53 +10:00
Kent McLeod
639b7fbd37 CMake: Add get_absolute_list_source_or_binary
This function checks CMAKE_CURRENT_LIST_DIR and then calls
get_absolute_source_or_binary if the file wasn't found
2018-07-24 15:00:21 +10:00
Adrian Danis
1dd8015da2 tools: State jinja2 version
Provides a graceful error when jinja2 is the wrong version
2018-06-21 14:38:55 +10:00
Kent McLeod
41a4c424f6 Update sel4-deps for tempite->jinja2 2018-06-13 16:01:27 +10:00
Kent McLeod
e281a47b7c Remove references to unused tempita library 2018-06-13 15:43:48 +10:00
Kent McLeod
66149498ff tools: Correct syscall numbers 2018-06-13 10:43:42 +10:00
Kent McLeod
187445000e tools: Fix whitespace differences in header gen 2018-06-13 10:42:35 +10:00
Summer Li
004891f410 libsel4: change tempita to jinja2 2018-06-12 16:54:25 +10:00
Summer Li
992534d87d libsel4: follow style conventions in python scripts
This commit makes some constant variables upper case to follow the style guide.
2018-06-12 16:24:16 +10:00
Corey Lewis
b50c6a86df cmake: Use ABSOLUTE instead of REALPATH
REALPATH was unnecessary and results in resolving symlinks in the target, although
the working directory will not have its symlink resolved. This results in very strange
paths from the base directory (which is the working directory) to the target.
2018-04-04 15:51:45 +10:00