356 Commits

Author SHA1 Message Date
Stephen Sherratt
86abcd33a1 Add device tree spec for bone
Generated by:
- clone linux from https://github.com/torvalds/linux.git
- checkout v4.20
- run update-dts.sh script

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
2021-10-27 21:25:39 +11:00
Stephen Sherratt
5888e3a9a6 Add beaglebone to update-dts.sh script
Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
2021-10-27 21:25:39 +11:00
elelel
be34e323e5 Fix indexing into an empty array
Signed-off-by: elelel <elelel@3wh.net>
2021-10-18 18:10:59 +11:00
Kent McLeod
18a3fb3bae hardware.py: Create smaller UT at end of addresses
At the end of the physical address range, the last address isn't turned
into an UT object. The scripts generating the memory regions
unnecessarily round down to a small page size when they could instead
round down to the smallest UT size and this memory could be used for
smaller kernel objects.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-10-03 10:10:43 +11:00
Kent McLeod
3defbff461 Remove KZM/imx31 platform
The platform was the original verification target of seL4 over 10 years
ago and by now there doesn't appear to be any ways to obtain new
hardware.

Currently, the KZM platform is the only ARMv6 platform and supporting it
requires a few work-arounds for emulating mechanisms that newer hardware
supports. Removing this platform also implies removing armv6 support
soon.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-09-30 18:07:19 +10:00
Axel Heider
77fb21aa90 python: add __str__() for Region
- Provide a nicer string for debugging purposes.
- improve comments about the purpose of __repr__() and __str__()

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-09-27 23:09:24 +10:00
Axel Heider
7d7a404bff python: raise exceptions on errors
- A region can't be created from an invalid range
- A region might be too small to support the change. There is no trivial
  way to fix this.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-09-27 20:49:56 +10:00
Axel Heider
14314983a6 risc-v: clarify PLIC is for SiFive U54/U74
RISC-V defines the concept of a PLIC, but leaves the details open. The
driver is for the PLIC of the SiFive U54/U74 SOC, which is used on
the HiFive Unleashed/Unmatched and Polarfire board.

Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-09-26 11:31:51 +10:00
Bertrand Virfollet
b32b9568b2 tools: merge adjacent memory regions
Merge memory regions before checking for reserved areas

Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems>

Signed-off-by: Bertrand Virfollet <bvirfollet@silicom.fr>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-08 07:53:53 +10:00
Alexander Fasching
560f215489 tools: Fix regex for ignore pattern (#535)
Signed-off-by: Alexander Fasching <fasching.a91@gmail.com>
2021-09-03 12:54:17 +10:00
Ben Leslie
e3eda12d03 Add support for the TQMa8XQP 1GiB module
TQ Group produces a system-on-module family called TQMa8Xx.

The user manual for this SoM is available here:

https://www.tq-group.com/filedownloads/files/products/embedded/manuals/arm/embedded-modul/TQ-Socket/TQMa8Xx/TQMa8Xx.UM.0104.pdf

This SoM comes in a number of different configurations.

The specific NXP SoC used, and the amount of memory are both
configurable.

The TQMa8XQP is the part number for the TQMa8Xx family configured with
the i.MX 8QuadXPlus SoC.

The datasheet for the SoC is available here:

https://www.nxp.com/docs/en/data-sheet/IMX8QXPAEC.pdf

In addition to the SoC being configurable the amount of SDRAM
on the SoM is also configurable.

The support provided in this PR is specifically for the TQMa8XQP
configured for 1GiB of memory. Note: Actual usable memory available
to the ARM application processor is 1022MiB.

System-on-modules rely on an appropriate carrier board.
Testing of this PR has been done on the MBa8Xx carrier board
that is available from TQ Group as part of their starter kit.

To the best of my knowledge there is nothing in this PR
that depends on the carrier board itself; all code is SoM
specific and should support any carrier board.

Note: This support is very specifically for the TQMa8XQP configured
with 1GiB of memory.

This may be a starting point for supporting other boards that
also have the NXP i.MX 8QuadXPlus SoC (as well as the i.MX 8DXP
and possibly other SoC in the i.MX 8 family).

Support is limited to the specific SoM due to the way in which
platform support currently works for seL4. Building a kernel
currently relies on the information from the DTS file (which is
SoM + RAM configuration specific). It would be preferable to
allow more generic support but SoC families but that is beyond
the scope of this PR.

Signed-off-by: Ben Leslie <benno@brkawy.com>
2021-08-31 08:38:25 +10:00
Axel Heider
da0aad0330 make kernel device frame handling more generic
The structure actually describes kernel frames and not kernel devices.
In most of the cases a peripherals will fit into one page, but some can
need more pages. On some platform there are no kernel devices at all.
Provides the macro NUM_KERNEL_DEVICE_FRAMES as simple way to find out if
there are mapping that hides the corner cases. This eventually allows
implementing a generic handling even on RISC-V without much overhead, so
the hack for HiFive/Spike can be removed.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-27 21:15:11 +10:00
Axel Heider
048c84fb94 use explicit field names in generated code
Using explicit field name in the assignment states more clearly what the
generated code does. It is also more robust and allows the compiler to
catch potential inconsistencies in case the structure details change.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-27 21:15:11 +10:00
Axel Heider
69204d0d2e trivial: break long lines in comment
Improve readability by breaking the line at around 80 chars.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-27 21:15:11 +10:00
Gerwin Klein
7892335ca1 tools: more portable shell test
No need for bash style test `[[ .. ]]`, normal POSIX test `[ .. ]`
works fine.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-25 17:56:49 +10:00
Gerwin Klein
00879fa943 tools: use /usr/bin/env for bash/sh invocation
This implements GitHub PR #115 on the current repo state. /usr/bin/env
is already used for other (cmake/python/etc) invocations, and this PR
brings bash/sh into line with that for slightly improved portability.

Co-authored-by: Douglas Wilson <douglas.wilson@gmail.com>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-25 17:56:49 +10:00
Gerwin Klein
7f562e1633 tools: consolidate RISC-V + Arm memory base logic
Co-authored-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
Co-authored-by: Axel Heider <axel-h@users.noreply.github.com>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-24 18:04:43 +10:00
Gerwin Klein
2296484665 tools: add risc-v dtb interrupt parsing
Co-authored-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-24 18:04:43 +10:00
Gerwin Klein
3398c01ee9 umm.py: no memoization
Memoization is not worth it here, the runtime of the entire program
is tiny. Removing the comment to curb temptations in the future.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-24 18:04:43 +10:00
Axel Heider
d0a3b28005 risc-v: avoid warning about interrupt parsing
Avoid the warning 'WARNING:root:Not sure how to parse interrupts for
"/cpus/cpu@0/interrupt-controller"' when building for platform hifive.

Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-08-24 10:04:56 +10:00
Kent McLeod
379bf5abe3 hardware_gen.py: Address some warning messages
CMake treats any text output that is generated by tools during the
configuration phase as important if it isn't part of a message(STATUS)
command. Output generated by hardware_gen.py often shows up as warnings
about device tree properties that are usually uninformative. Resolving
some of the warning conditions removes these messages for most
platforms.

- Setting kernel_size in hardware.yml to 0x1000 to handle cases where
  the kernel only needs the first page of a device that has a
  device-tree definition larger than that.
- Remove status print about each Interrupt processed as it's usually not
  useful information.
- Only process IRQs for a selected kernel device if the rule for that
  device has any interrupt queries. This prevents warnings for IRQ
  controllers that the script doesn't know how to process when it
  doesn't need to.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-07-29 16:03:01 +10:00
Curtis Millar
76b1de0670 Add ODroid C4 support
This adds support for the ODroidC4. The ODroidC4 is just a beefier
ODroidC2 with some bits moved around. The devices we care about here are
all essentially the same except the cores are A55s instead of A53s.

Signed-off-by: Curtis Millar <curtis@curtism.me>
2021-07-09 14:05:05 +10:00
Axel Heider
ad4ea6cd08 CMake: unify config options define generation
Add disabled options from the build system as comments in the generated
header files.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 12:05:37 +10:00
Axel Heider
d1fb5c01a7 use '#pragma once' include guards
Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-06-20 11:53:58 +10:00
Axel Heider
9a4d3ae51d CMake/autoconf: remove unused AUTOCONF_INCLUDED
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-06-09 09:50:02 +10:00
Ben Leslie
7dc6dffa0f Add support for iMX LP UART
Add support the i.MX low-power UART. This is available on
chipsets such as i.MX8QXP.

Note: This is a preliminary patch in advance of providing
full support for the i.MX8QXP platform.

Note: getchar is not implemented (current) for this platform.

Signed-off-by: Ben Leslie <benno@brkawy.com>
2021-06-02 11:43:48 +10:00
Axel Heider
d486bc0b5a Add i.MX6 Nitrogen6_SoloX board
Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-03-31 13:38:25 +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
Alistair Francis
0972c4e9a9 RISC-V: Replace mentions of BBL with OpenSBI
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2021-03-09 11:20:57 +11:00
Axel Heider
0a6e04769e autoconf: use "#pragma once" include guard
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-03-06 02:24:41 +01:00
Damon Lee
05222c2288 exynos5: Update device definitions
The max IRQ and devicetree definitions are slightly outdated. This
commit updates these definitions.

Signed-off-by: Damon Lee <Damon.Lee@data61.csiro.au>
2021-03-05 15:04:41 +11:00
Axel Heider
a5c2d51386 CMake: add include guard to auto-generated files
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-03-03 11:49:07 +01:00
Axel Heider
36ebac4fb4 trivial: fix typo in comment
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-03-03 11:47:23 +01:00
Axel Heider
f46df2ad6d CMake: remove unused macros
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-02-01 18:44:20 +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
Gerwin Klein
b5e48eb787 bitfield_gen: prep for Isabelle2021
Isabelle2021 sometimes gets further with mask_simps, so this commit
makes them optional. Also removes a duplicate simp-rule warning.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-01-24 18:42:27 +11:00
Damon Lee
2d9881065b zynqmp: Remove duplicate interrupt entries
There are duplicate interrupts in some of the devices in the devicetree.
This commit removes these duplicate interrupt entries to avoid errors
with some of our tools (CAmkES, etc).

Signed-off-by: Damon Lee <Damon.Lee@data61.csiro.au>
2021-01-22 16:02:53 +11:00
Curtis Millar
ab3d8c44cb riscv: Map devices with large pages on 32 & 64-bit
For 64-bit, this adds a 2nd-level page table for mapping devices using
2MiB frames instead of 1GiB frames.

The boot mapping and hardware header generator have also been fixed to
correctly report the number of large frames needed for devices rather
than only reporting the first. The frame size is also specified
correctly (rather than assuming mapping with 4KiB frames).

This likely fixes an issue whereby only the first 4KiB frame of a device
was reserved but the remaining region of that kernel device could be
mapped at user level.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2020-12-03 10:31:16 +11:00
Nils Wistoff
cd96ee330f ariane: update PLIC and dts
add PLIC driver for Ariane and update dts

Signed-off-by: Nils Wistoff <nwistoff@iis.ee.ethz.ch>
Reviewed-by: Siwei Zhuang <siwei.zhuang@data61.csiro.au>
2020-11-16 11:43:28 +11:00
Oliver Scott
73b0773d90 tk1-smmu: corrections
Fix tk1 smmu cmake config variables.
Fix platforn_gen for tk1.
Add separate hardware.yml for tk1.

Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2020-11-06 15:21:25 +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
4fd7cb0360 unify license tags
The tags now all conform to REUSE version 3.0

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-28 16:03:11 +11:00
Jesse Millwood
b77c9b2051 PolarFire SoC: Initial support for platform
Signed-off-by: Jesse Millwood <jesse.millwood@dornerworks.com>
2020-10-28 08:33:05 +10:00
Stefan O'Rear
a91e979c5a clang: Fix errors on zero kernel devices
"const TYPE *ptr" creates a non-const pointer to const data; for the
pointer itself to be rodata requires "TYPE *const ptr".

Taking the size of the pointer is caught by -Werror by default; suppress
that.

Signed-off-by: Stefan O'Rear <sorear@fastmail.com>
2020-08-26 14:21:35 +10:00
Matthew Brecknell
5362c6b26a bitfield_gen: update proofs to support RISC-V MCS
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-12 16:31:13 +10:00
Matthew Brecknell
a09d6f023a bitfield_gen: emit fields in visible order
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-12 16:31:13 +10:00
Edward Pierzchalski
4c0f16c7b8 bitfield_gen: fixups for MCS
Changes the 'size suffix map' to be useful in more places. In general,
when we use the 'short name' of a variable in these generated proofs, we
run the risk of a change in variable declaration order breaking the
resulting proofs (since declaration order is how the C parser chooses
which variables get the short name). Best practice is to use the long
names whenever possible.

Uses the suffix map for some generated proofs.

Removes an unnecessary simp step.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-07-28 17:49:19 +10:00
Matthew Fernandez
cf1428630e tools: BSD compat for changed.sh
On e.g. FreeBSD, Bash lives at /usr/local/bin/bash. This change
makes the script find Bash wherever it may be hiding.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-18 12:39:46 +10:00
Axel Heider
fb71ef926a tools: fix brackets in format parameters
Signed-off-by: Axel Heider <axelheider@gmx.de>
2020-06-02 23:41:15 +02:00
Gerwin Klein
f16411a518 review Linux-derived dts file license
These files are derived from the output of the device tree compiler in
the Linux kernel. The licenses of the input files do all have to be
compatible with at least GPL-2.0-only to be part of Linux.
2020-03-09 17:59:07 +08:00