History log of /seL4-test-master/kernel/tools/hardware_gen.py
Revision Date Author Comments
# 79da0792 01-Mar-2020 Gerwin Klein <gerwin.klein@data61.csiro.au>

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.


# 7eb4147e 04-Nov-2019 Simon Shields <simon.shields@data61.csiro.au>

hardware_gen: add elfloader output

The elfloader is going to start using devices based on the device tree.
Add an output method for hardware_gen.py that generates header files
that the elfloader can use. Currently they contain an array of
"devices", where each device has a compatiblity string and a series of
regions (represented simply as the physical address of the region).

For now, the elfloader only uses the serial device specified by the
stdout-path property in the DTB.


# 75f2c54b 12-Aug-2019 Simon Shields <simon.shields@data61.csiro.au>

tools: rewrite hardware_gen.py

This is almost a complete rewrite from the old hardware_gen.py.

It separates the 'parse DT' stage from the 'generate output'
devices more strictly, and is hopefully easier to understand and
easier to extend.

We also no longer generate the 'devices' list (in YAML)
or the dev_p_regs array (in C), as the kernel will implicitly
expose all non-RAM untypeds as devices.


# b5a39a92 24-Oct-2019 Oliver Scott <Oliver.Scott@data61.csiro.au>

trivial: update licence


# 9abe8a4f 15-Jul-2019 Oliver Scott <Oliver.Scott@data61.csiro.au>

add support for rockpro64

Kernel support for 64 bit rockpro board.
Dts was taken from the linux kernel.


# 28901889 12-Aug-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

hardware_gen: Correctly set default kernel_size

kernel_size has a default value of 0x1000 according to
hardware_schema.yml.


# d764d5f1 12-Aug-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

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.


# cf997974 12-Aug-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

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.


# 44fce7dd 12-Aug-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

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.


# 1bd86aab 12-Aug-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

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.


# ad45ffc1 12-Aug-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

hardware_gen: Remove unused method is_compatible

Not used and it is unlikely that it will be needed in the near future.


# 51f55342 12-Aug-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

hardware_gen,Device: extract get_affinities method

Returns an array of interrupt affinities corresponding to an array of
interrupts for a Device.


# bc61a7f3 24-Jun-2019 Anna Lyons <anna@gh.st>

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).


# 8b4ed994 23-Jun-2019 Siwei Zhuang <siwei.zhuang@data61.csiro.au>

RISCV: Add Hifive unleashed platform

This change adds support for Hifive unleashed board. It also removes the
outdated hifive suport from the spike platform.


# 375a98c8 19-Jun-2019 Siwei Zhuang <siwei.zhuang@data61.csiro.au>

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.


# 24131333 03-Jun-2019 cvluca <z5155740@unsw.edu.au>

trivial: disable YAML loading warning

Use of PyYAML's yaml.load function without specifying the Loader=...
parameter, has been deprecated.


# 28c3dfe1 30-Apr-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

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>.


# d3446bc5 30-Apr-2019 G. Branden Robinson <Branden.Robinson@data61.csiro.au>

hardware_gen.py: List required paramaters first

In the usage message, identify all the required parameters before the
optional ones.


# 2ee6496a 30-Apr-2019 G. Branden Robinson <Branden.Robinson@data61.csiro.au>

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.


# 8d0950ff 30-Apr-2019 G. Branden Robinson <Branden.Robinson@data61.csiro.au>

hardware_gen.py: Give tool a description

Nothing said what this tool actually _does_.


# c75a270f 22-Apr-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

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.


# cf57914c 26-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

style: run autopep8 on python files


# 16f55f8e 19-Mar-2019 Kofi Doku Atuah <kofidoku.atuah@data61.csiro.au>

Device-generation: Add __ASSEMBLER__ guards


# b7550ca8 11-Mar-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

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.


# e3c7e391 07-Mar-2019 Adam Felizzi <Adam.Felizzi@data61.csiro.au>

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.


# 96c63a4b 06-Mar-2019 Oliver Scott <Oliver.Scott@data61.csiro.au>

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.


# 2943f042 06-Mar-2019 Kent McLeod <Kent.Mcleod@data61.csiro.au>

hardware_gen: Remove build path from output file

This was causing errors with a reproducible build check in the binary
verification toolchains.


# 34ce52e2 18-Feb-2019 Oliver Scott <Oliver.Scott@data61.csiro.au>

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.


# ca53350a 13-Feb-2019 Simon Shields <simon.shields@data61.csiro.au>

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


# 16d98d85 13-Feb-2019 Simon Shields <simon.shields@data61.csiro.au>

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.


# cbe6e4c6 07-Feb-2019 Simon Shields <simon.shields@data61.csiro.au>

hardware_gen: include linker.h in generated header

this is needed for the BOOT_RODATA attribute


# 8f433d7d 12-Feb-2019 Yanyan Shen <yanyan.shen@data61.csiro.au>

hardware_gen: Add GICv3 support.


# e9fc74b5 05-Feb-2019 Simon Shields <simon.shields@data61.csiro.au>

hardware_gen: support specifying size of kernel device

This allows for mapping of consecutive pages for a single device in the
kernel.


# 21993d8b 28-Jan-2019 Simon Shields <simon.shields@data61.csiro.au>

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.


# b45de785 04-Feb-2019 Simon Shields <simon.shields@data61.csiro.au>

hardware_gen: use "ranges" property for cpu-addressable buses

This removes the need for the buses array in the hardware YAML


# d9b399ff 31-Jan-2019 Simon Shields <simon.shields@data61.csiro.au>

hardware_gen: improve region-merging logic

Merge overlapping regions to ensure that we don't expose
the same paddr more than once.


# 09e6fbb1 31-Jan-2019 Simon Shields <simon.shields@data61.csiro.au>

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.


# 4269c708 30-Jan-2019 Simon Shields <simon.shields@data61.csiro.au>

hardware_gen: simplify file handling logic

Argparse supports file arguments, use this for all files.


# 47006968 30-Jan-2019 Simon Shields <simon.shields@data61.csiro.au>

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.


# 8440f033 09-Jan-2019 Simon Shields <simon.shields@data61.csiro.au>

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.


# 0ac07923 09-Dec-2018 Simon Shields <simon.shields@data61.csiro.au>

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.