Commit graph

26 commits

Author SHA1 Message Date
Kristofer Jonsson 0a02a7adc1 drivers: misc: Add an Ethos-U NPU driver
Add a driver for the Arm Ethos-U NPU, including a Devicetree entry for
the mps3_an547 platform.

Signed-off-by: Kristofer Jonsson <kristofer.jonsson@arm.com>
Signed-off-by: Fredrik Knutsson <fredrik.knutsson@arm.com>
2022-11-15 14:47:43 +01:00
Kristofer Jonsson 911d50d4d5 boards: mps3_an547: Add entry for Ethos-U
Add a DTB entry for the Ethos-U NPU present in the board.

Signed-off-by: Kristofer Jonsson <kristofer.jonsson@arm.com>
2022-11-15 14:47:43 +01:00
Stephanos Ioannidis cf8f42c5e6 boards: mps3_an547: Add flash and RAM size attributes
This commit adds the flash and RAM size attributes to the board YAML
file so that the board can be properly filtered by memory sizes.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-10-18 17:52:48 +09:00
Kumar Gala 390464ce3b timers: remove defconfig setting of timer drivers
Now that timer drivers are enabled based on devicetree we can
remove any cases of them getting enabled by *_defconfig files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-09-09 09:58:48 +00:00
Gerard Marull-Paretas e81e92dbb9 boards: convert images to JPEG and reduce image size
The boards folder uses ~142.8 MB, being the largest in the repository.
This is due mostly to board images, which are in most cases not
optimized for web content. This patch tries to address this problem by
converting all pictures to JPEG (quality 75) and by adjusting its size
up to 750 px (the width of the documentation content). Images that
specified a fixed width in rst files are converted down to that value
instead.

With this patch, folder goes down to ~53.5 MB from 142.8 MB (-~63%).
Note that this patch introduces a new set of binary files to git
history, though (bad).

The process has been automated using this quickly crafted Python script:

```python
from pathlib import Path
import re
import subprocess

def process(doc, image, image_jpeg, size):
    subprocess.run(
        (
	     f"convert {image}"
	     "-background white -alpha remove -alpha off -quality 75"
	     f"-resize {size}\> {image_jpeg}"
	),
        shell=True,
        check=True,
        cwd=doc.parent,
    )
    if image != image_jpeg:
        (doc.parent / image).unlink()

for doc in Path(".").glob("boards/**/*.rst"):
    with open(doc) as f:
        content = ""
        image = None
        for line in f:
            m = re.match(r"^(\s*)\.\. (image|figure):: (.*)$", line)
            if m:
                if image:
                    process(doc, image, image_jpeg, size)

                image = Path(m.group(3))
                if image.suffix not in (".jpg", ".jpeg", ".png"):
                    content += line
                    image = None
                    continue

                image_jpeg = image.parent / (image.stem + ".jpg")
                size = 750
                content += (
                    f"{m.group(1)}.. {m.group(2)}:: {image_jpeg}\n"
                )
            elif image:
                m = re.match(r"\s*:height:\s*[0-9]+.*$", line)
                if m:
                    continue

                m = re.match(r"\s*:width:\s*([0-9]+).*$", line)
                if m:
                    size = min(int(m.group(1)), size)
                    continue

                content += line
                if line == "\n":
                    process(doc, image, image_jpeg, size)
                    image = None
            else:
                content += line

    with open(doc, "w") as f:
        f.write(content)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-29 10:18:18 +02:00
Kumar Gala af3065d0f5 boards: arm: Remove label property from devicetree
The label property isn't needed in devicetree so remove it.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-09 12:30:59 +02:00
Gerard Marull-Paretas ada8d72888 boards: remove non-minimal peripherals from defconfig
According to the board porting guidelines, boards should "leave
peripherals and their drivers disabled by default". In Zephyr we
tipically enable GPIO and SERIAL, as they are virtually required by all
samples/tests in tree. However, for the rest of peripherals it is up to
the application/test to enable the necessary driver classes. It is also
useful that board's Kconfig.defconfig enables certain driver peripherals
based on a condition, e.g. enable I2C if SENSOR=y.

Ref. https://docs.zephyrproject.org/latest/hardware/porting/
board_porting.html#general-recommendations

This patch removes the following driver classes from defconfig files:

- CONFIG_ADC
- CONFIG_COUNTER
- CONFIG_EEPROM
- CONFIG_ENTROPY
- CONFIG_ESPI
- CONFIG_HWINFO
- CONFIG_I2C
- CONFIG_LED
- CONFIG_NETWORKING
- CONFIG_PS2
- CONFIG_PWM
- CONFIG_SENSOR
- CONFIG_SPI
- CONFIG_SPI_SLAVE
- CONFIG_WATCHDOG

Note that a previous attempt was done in #38510.

Fixes #30694

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Kumar Gala 5c57a36f9d i2c: remove Kconfig.defconfig setting of I2C drivers
Now that I2C drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the I2C.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-01 18:01:44 +02:00
Kumar Gala 9a501e0922 serial: remove Kconfig.defconfig setting of serial drivers
Now that serial drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the serial.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 09:29:24 -05:00
Kumar Gala 10329165be serial: remove defconfig/proj setting of serial drivers
Now that serial drivers are enabled based on devicetree we can remove
any cases of them getting enabled by *defconfig and proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 09:29:24 -05:00
Kumar Gala 600d749cf3 gpio: remove Kconfig.defconfig setting of GPIO drivers
Now that gpio drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the GPIO.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 08:49:38 +02:00
Joakim Andersson 21dcb29660 boards: mps3_an547: Fix strange symbol in example run command
Fix strange symbol instead of underscore in example run command

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-06-02 12:56:49 +02:00
Gerard Marull-Paretas db508379c2 boards: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all boards code to the
new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:57:15 +02:00
Stephanos Ioannidis ae0d3f8ba0 boards: mps3_an547: Update obsolete emulation instructions
The commit 94428044e2, which introduced
this behavioural change, forgot to update the instructions provided in
the comments.

This commit updates the obsolete instructions for using an alternate
emulation platform in the comments.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Carlo Caione 18ffcdcf74 linker: Introduce zephyr,memory-region compatible
Introduce a new "zephyr,memory-region" compatible to be used when a new
memory region must be created in the linker script from the devicetree
nodes using the compatible.

Remove also the LINKER_DT_REGION_FROM_NODE macro and add a new
LINKER_DT_REGIONS macro to cycle through all the compatible regions.

In the same PR modify the DTS files and the linker scripts.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-21 22:02:04 -05:00
Jimmy Brisson 95bc04a034 boards: mpsX-anY: Allow more time between watchdog resets in qemu
mps2_an521 and mps3_an547 need more time with TFM 1.5 to pass their
tests. This change gives it 2x as many instructions by changing the
tick speed of the watchdog to half it's prior frequency.

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-01-04 12:33:23 +01:00
Jordan Yates dcce5b1a74 dts: linker region properties
Add `zephyr,linker-region` properties to all nodes sram1, sram2, sram3,
sram4, sdram1, sdram2, backup_sram, ti_ccfg, dtcm and itcm.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-12-09 16:23:03 +01:00
Jimmy Brisson 33c97f6116 board: docs: Describe mps3 an547 firmware modes
Documented both secure-only and nonsecure firmware modes

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2021-12-07 10:44:23 -06:00
Jimmy Brisson fe687fa993 boards: Run the combined an547 hex in qemu
Zephyr will try to run the `zephyr.elf` file by default. This is
problematic for any `..._ns` target, as they all need to boot through
[mcuboot and] TF-M. They simply hardfault without the rest of their
system image.

This corrects the `west build -t run ...` for the `mps3_an547_ns`
board, as it now has special treatment.

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2021-12-07 10:44:23 -06:00
Jimmy Brisson ee001fa4bb boards: Add mps3-an547-ns target; build mps3-an547 with TFM in secure mode
This includes a new device tree, new target yaml and new target
defconfig

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2021-12-07 10:44:23 -06:00
Filip Kokosinski 94428044e2 cmake: support multiple entries in board.cmake
Currently there is no way to support running a board on multiple
emulation platforms nor to choose a desired emulation platform for the
simulation to be run on. This commit introduces a new
SUPPORTED_EMU_PLATFORMS list, which defines available emulation
platforms for a given board.

Fixes #12375.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-11-12 21:33:42 -05:00
Stephanos Ioannidis fcceceafad boards: mps3_an547: Fix typo in the board documentation
The mps3_an547 board documentation incorrectly referred to the
Ethos-U55 coprocessor as an FPU (floating point unit) when it is really
an NPU (neural processing unit).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 18:01:36 -04:00
Stephanos Ioannidis ad6835fab1 boards: arm: mps3_an547: Disable null pointer detection for QEMU
This commit disables the Cortex-M null pointer detection feature for
the QEMU mps3_an547 targets because QEMU permits bus access to the
unmapped 0x0-0x400 region used by the MPU-based null pointer detection
feature.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-14 20:28:23 -04:00
Kumar Gala ad8ca3ee5a boards: mps3_an547: Enable QEMU support
Now that SDK 0.13.0 is out we can enable QEMU support on the
MPS3-AN547 to get coverage on Cortex-M55.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-08-14 20:28:23 -04:00
Kevin Townsend b5f9ba67fc boards: arm: mps3_an547: Enable FVP and QEMU simulation
This commit enables emulation of the `mps3_an547` platform
using, by default, The Arm Corstone-300 MPS3 FVP executable.
This FVP includes support for emulating the Ethos-U55 NPU.

Optionally, the default FVP selection can be overriden in favor
of QEMU, which supports the MPS3 without the proprietary
Ethos-U55 FPU extension. To enable qemu as an emulation target,
add `-DEMU_PLATFORM=qemu` when building an mps3_an547 image.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-06-19 16:55:40 -05:00
Kumar Gala da903e423e arm: boards: mps3_an547: Add board support for AN547 on MPS3
Add initial board support for the MPS3 AN547.  The board support is
based on the MPS2+ AN521 board support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-23 13:13:32 -05:00