356 Commits

Author SHA1 Message Date
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
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