Commit Graph

365 Commits

Author SHA1 Message Date
Evgeniy Paltsev 1234b4919d Revert "boards/arc/qemu_arc: Disable use of branch delay slots"
This reverts commit 8084ea55b7.

The rootcause is fixed in the ARC QEMU which is in SDK 0.16.3.
As we've updated SDK in upstream CI we can revert this
workaround.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-10-04 14:52:03 +01:00
Evgeniy Paltsev 927f09c1b6 ARC: boards: qemu: define vendor properly
Set vendor to `snps` to be consistent with vendor in board yaml
file.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-09-25 07:42:01 -04:00
Evgeniy Paltsev 7ce5a2e629 ARC: board: nSIM: update documentation about new platforms
Update nSIM board documentation about new platforms (12 cores HS5x
& HS6x)

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-09-25 09:49:50 +02:00
Evgeniy Paltsev 6048269f95 ARC: boards: nSIM: add 12-core SMP HS6x platform
Add new simulation (nSIM) SMP platform based on 12-core ARCv3 HS6x

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-09-25 09:49:50 +02:00
Evgeniy Paltsev d76f345688 ARC: boards: nSIM: add 12-core SMP HS5x platform
Add new simulation (nSIM) SMP platform based on 12-core ARCv3 HS5x

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-09-25 09:49:50 +02:00
Anas Nashif c3827ec48e boards: add vendor to board yaml
This is coming from devicetree and corrosponds to what we have in the
dts/bindings/vendor-prefixes.txt file.

This will allow for static filtering, especially with twister, i.e. no
need to build anything to know the vendor of a board

All of the vendor data was extracted automatically from the devicetree,
so some platforms might not have the right vendor or no vendor at all
right now, we need to fix some of the DTS information or do this
manually to get this 100% correct. But we are close.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-22 09:29:36 +02:00
Keith Packard 8084ea55b7 boards/arc/qemu_arc: Disable use of branch delay slots
I spent several hours debugging a weird stack pointer corruption bug and
discovered that QEMU appears to mess up register contents when an interrupt
fires during the execution of a branch with a delay slot.

Instead of trying to fix qemu, let's just tell the compiler to not generate
code that uses the branch instructions with delay slots.

Closes: #60071

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-13 16:34:53 +02:00
Benjamin Cabé 59e4c5aed0 samples: fully migrate basic samples to the new Sphinx extension
- Updated basic samples READMEs to use the new zephyr:code-sample::
  directive. Dropped "-sample" suffix that's not required anymore now
  that samples have their own namespace.
- Updated all references to the samples to use the :zephyr:code-sample:
  role. Checked and updated the wording of said references to account
  for the fact that samples should not have "... sample" in their name
  anymore.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-13 09:15:34 +02:00
Fabio Baltieri dff933c70c boards: emsdp,hsdk: drop GPIO_INIT_PRIORITY overrides
These were also added as part of some major refactoring and should not
be relevant anymore. They are also the last two GPIO_INIT_PRIORITY
overrides left in boards, so after this every GPIO device should be
working with the standard initialization priority.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-29 19:56:45 +01:00
Fabio Baltieri 173627d51b boards: em_starterkit: stop overriding GPIO_INIT_PRIORITY
This was introduced long time ago during a big priority refactoring,
with the current priority changes it should not be necesary anymore, the
current value is causing some build fail in the weekly test.

Fixes the following breakage:
```
$ west build -p -b em_starterkit_em11d -T
	tests/drivers/build_all/gpio/drivers.gpio.build
...
ERROR: /test/nct3807_alert_1 POST_KERNEL 52 51 <
	/test/gpio@deadbeef POST_KERNEL 70 47
ninja: build stopped: subcommand failed.
```

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-29 19:56:45 +01:00
Evgeniy Paltsev 45e3cfc220 ARC: add scalar VPX port
Add add scalar ARC VPX port and nSIM-based VPX5 platform
(close to vpx5_integer_full template)

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-08-11 19:45:48 +00:00
Evgeniy Paltsev 8dd4dcdf8d ARC: nSIM: dts: make UART IRQ configurable
Make make UART IRQ line number configurable in nSIM
nsim-uart-ns16550.dtsi DTS helper.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-08-11 19:45:48 +00:00
Fabio Baltieri 57e0da4d80 boards: add zephyr,code properties to the various gpio-keys nodes
Add gpio-keys codes for all boards. These are mostly INPUT_KEY_0 and so
on but I've used some more specific ones where it was obvious that
there's something else on the boards.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-07 11:26:26 +02:00
Siyuan Cheng 24efa6720d drivers: pinctrl_emsdp: fix definition location
Mux Control Register Index are internals of driver, now
moved from dt-binding header to driver itself.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-06-13 07:02:08 -04:00
Siyuan Cheng 1a6b6e7b84 drivers: pinctrl_emsdp: add dummy mux for unmuxed peripheral
ARC EMSDP board has some peripherals are internal connected,
such as DW spi1 and DFSS i2c0. They are unmuxed and have fix
connection to spi-flash or sensor. For these peripheral, add
dummy mux type to avoid pinctrl ENOENT error.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-06-13 07:02:08 -04:00
Siyuan Cheng 4babd545cc drivers: pinctrl: add pinctrl driver for ARC emsdp
Add Synopsys ARC EMSDP board Pin controller for its Pmod
and Arduino shield interface.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-05-29 09:21:07 -04:00
Nikolay Agishev 6994c22891 ARC: HSDK4XD: Add documentation
Add missing documentation for HSDK4XD board.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2023-05-25 08:23:44 +00:00
Anas Nashif 689ea54b78 tests: do not filter on SMP, use board yaml file
Avoid expensive runtime filtering and use platform features instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-05-24 07:50:50 -04:00
Siyuan Cheng cbdd2f38da drivers: spi: add Data Fusion Subsystem SPI driver
Introduce DesignWare ARC Data Fusion IP Subsystem(DFSS) SPI
driver for ARC boards, i.e. EMSDP, which uses DW SPI to controll
SPI-Flash and DFSS SPI to connect external devices. Both drivers
share most source code, but DFSS uses ARC auxiliary registers.
Move FIFO depth setting to device tree.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-05-22 15:25:19 +02:00
Siyuan Cheng a1982cdecd Board: nsim_hs: fix nsim dccm size property
Actual DCCM size is 100000 in nsim_hs_mpuv6, nsim_hs
and nsim_hs3x_hostlink, but their nsim property is
40000. Now fixed the difference to avoid data access
to unpopulated region during picolibc malloc heap init.
In minimal libc, it is set not using malloc as default.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-05-16 12:10:58 -04:00
Nikolay Agishev 0d8292ab6b ARC: Add HS4x support
Minimal HSDK4xD support

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2023-05-02 16:54:24 +02:00
Nikolay Agishev 66b80396e6 arc: boards: openocd: replace obsolete syntax
Replace obsolete syntax in OpenOCD configuration scripts

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2023-04-19 03:45:58 -04:00
Gerard Marull-Paretas a5fd0d184a init: remove the need for a dummy device pointer in SYS_INIT functions
The init infrastructure, found in `init.h`, is currently used by:

- `SYS_INIT`: to call functions before `main`
- `DEVICE_*`: to initialize devices

They are all sorted according to an initialization level + a priority.
`SYS_INIT` calls are really orthogonal to devices, however, the required
function signature requires a `const struct device *dev` as a first
argument. The only reason for that is because the same init machinery is
used by devices, so we have something like:

```c
struct init_entry {
	int (*init)(const struct device *dev);
	/* only set by DEVICE_*, otherwise NULL */
	const struct device *dev;
}
```

As a result, we end up with such weird/ugly pattern:

```c
static int my_init(const struct device *dev)
{
	/* always NULL! add ARG_UNUSED to avoid compiler warning */
	ARG_UNUSED(dev);
	...
}
```

This is really a result of poor internals isolation. This patch proposes
a to make init entries more flexible so that they can accept sytem
initialization calls like this:

```c
static int my_init(void)
{
	...
}
```

This is achieved using a union:

```c
union init_function {
	/* for SYS_INIT, used when init_entry.dev == NULL */
	int (*sys)(void);
	/* for DEVICE*, used when init_entry.dev != NULL */
	int (*dev)(const struct device *dev);
};

struct init_entry {
	/* stores init function (either for SYS_INIT or DEVICE*)
	union init_function init_fn;
	/* stores device pointer for DEVICE*, NULL for SYS_INIT. Allows
	 * to know which union entry to call.
	 */
	const struct device *dev;
}
```

This solution **does not increase ROM usage**, and allows to offer clean
public APIs for both SYS_INIT and DEVICE*. Note that however, init
machinery keeps a coupling with devices.

**NOTE**: This is a breaking change! All `SYS_INIT` functions will need
to be converted to the new signature. See the script offered in the
following commit.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

init: convert SYS_INIT functions to the new signature

Conversion scripted using scripts/utils/migrate_sys_init.py.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

manifest: update projects for SYS_INIT changes

Update modules with updated SYS_INIT calls:

- hal_ti
- lvgl
- sof
- TraceRecorderSource

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

tests: devicetree: devices: adjust test

Adjust test according to the recently introduced SYS_INIT
infrastructure.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

tests: kernel: threads: adjust SYS_INIT call

Adjust to the new signature: int (*init_fn)(void);

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-12 14:28:07 +00:00
Nikolay Agishev 14ec9e9dcb ARC: Add MWDT support into qemu_arc_hs platform
Add Metaware toolchain into qemu_arc_hs* platforms

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2023-03-20 11:43:37 +01:00
Evgeniy Paltsev d4a5f183d0 ARC: boards: add nsim-based board with hostlink uart support
Add nsim_hs3x_hostlink nsim-based board to test virtual UART
emulated with hostlink channel.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-03-17 11:49:02 +01:00
Siyuan Cheng f9d155b7d5 dts: boards :emsdp: add SPI support
There is a spi-flash fl256s on emsdp board, which can be
contolled by DesignWare SPI driver. Now add DW SPI and
SPI-FLASH support for emsdp board.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-03-10 11:39:24 +01:00
Maciej Perkowski 091ca7bcf6 nsim: Description of nsim_em11d was missing simulation_exec
Yaml description for simulators should contain simulation_exec
telling which tool to use. nsim_em11d was missing this entry
causing twister to only build but not execute tests on this
platform. Value from other nsims was used.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-02-20 09:37:47 -05:00
Evgeniy Paltsev c2f52a7548 ARC: doc overhaul for nSIM board (with few fixes to MWDT docs)
Completely rewrite nSIM board documentation with additional fixes
to ARC MWDT toolchain documentation.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-02-18 06:55:51 +09:00
Siyuan Cheng 74c44dc273 board: enable FPU for nsim_sem_mpu and update mdb.args
Enable FPU for nsim_sem_mpu_stack_guard to fix zdsp.basicmath.fpu
failure due to lack of FPU option. Add FPU feature to its related
mdb.args, also for nsim_sem and nsim_em7d_v22 boards.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-02-09 13:36:01 +01:00
Siyuan Cheng 575dfbf5d6 board: nsim: enable FPU for nsim_sem and nsim_em7d_v22
To run zdsp tests on nsim_sem and nsim_em7d_v22, FPU feature
is needed to be added in their nsim.props file.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-02-06 10:05:17 +01:00
Siyuan Cheng 10ebdfc5d7 dts: flash: em_starterkit: Add spi flash support
Add spi flash support for em_starterkit

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-01-31 10:16:46 +00:00
Evgeniy Paltsev fb0802a5b6 ARC: boards: allow cross-compile toolchain where zephyr toolchain supported
Allow cross-compile toolchain for all ARC target which support zephyr
toolchain.

This aligns the behavior between ARC targets - as some of them
were supporting zephyr toolchain but weren't supporting cross-compile
toolchain (which wasn't actually true).

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-01-30 23:48:31 +00:00
Evgeniy Paltsev 5c1d311ba0 ARC: hsdk: openocd: replace depricated syntax
Replace depricated openocd syntax with proper one

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-01-24 19:00:13 -08:00
Siyuan Cheng 5854670b98 DSP: add dsp unit test
add dsp context switch test
add complex multiplication test for ARC processor

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2022-12-19 11:56:55 +01:00
Siyuan Cheng a147a26a2b arc: add nsim_em11d target
add nsim_em11d target specific for DSP feature

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2022-12-19 11:56:55 +01:00
Siyuan Cheng 9a7ed58b25 arc: add XY mem support
The XY Memory is a feature commonly found in DSP processors to increase
the DSP performance. The XY component allows a ARC processor to
implicitly load source operands and store results into a closely coupled
memory using a single instruction.

Add XY memory for ARC EM9D/EM11D processors including em_starterkit,
em_starterkit_em11d. emsdp_em9d, nsim_em, iotdk.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2022-12-12 14:38:13 +00:00
Evgeniy Paltsev 975823c298 ARC: boards: nsim_hs: add missing MPU enabling
We mark MPU existing for nSIM HS SoC, but doesn't enable
it for nsim_hs board. Fix that.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2022-11-28 17:43:49 +01:00
Anas Nashif 3e870495f2 boards: add simulation executable for 3rd party sims
Provide the information as part of the board yaml file, this way we will
know what binary to check for.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-25 06:09:02 -05:00
Nikolay Agishev 6e215ce6af boards: nsim_hs: Add separate config for XIP memory organization
Add XIP support with MWDT toolchain. To have it proper tested
add separate nsim platforms for XIP (flash + sram) and
non-XIP (sram) memory organization in addition to existing
nsim_hs platfor with CCMs (ICCM + DCCM) memory organization.

This PR also enables MPU for all nsim hs3x based platforms
(like we previously enabled it for qemu_arc_hs) to have proper
memory regions permissions.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2022-11-16 11:18:51 +01:00
Kumar Gala bfd6d1bfd2 boards: arc: hsdk: Convert to CONFIG_MP_MAX_NUM_CPUS
Convert CONFIG_MP_NUM_CPUS to CONFIG_MP_MAX_NUM_CPUS as we work on
phasing out CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-11-02 14:35:32 -04:00
Nikolay Agishev 2fb1384da6 boards: qemu_arc_hs: Add separate xip & non-xip configs
Two separate configs for qemu_arc_hs and qemu_arc_hs_xip
were added.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2022-10-31 17:03:44 +01:00
Nikolay Agishev 0422a04bfe boards: qemu_arc: fix of MPU regions setup for !XIP config
Add some changes to ARC linker script. They make correct alignment
for ROMable region. Now regions borders are aligned with respect
to MPU settings.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2022-10-21 20:31:31 +02:00
Kumar Gala 81d904554a boards: Change defconfigs to use CONFIG_MP_MAX_NUM_CPUS
Move to using CONFIG_MP_MAX_NUM_CPUS in defconfig as we phase
out CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-19 16:01:20 +02:00
Kumar Gala 2f031efea8 cmake: sim: Update simulator related cmake to use CONFIG_MP_MAX_NUM_CPUS
Update cmake related files that are used by simulators to use
CONFIG_MP_MAX_NUM_CPUS instead of CONFIG_MP_NUM_CPUS as we work to
phase out CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-19 16:01:10 +02:00
Gerard Marull-Paretas 343e900799 soc: arc: add missing aux_regs.h include
It is required for z_arc_v2_core_id()  or register read/write functions.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-11 18:05:17 +02:00
Gerard Marull-Paretas 34a6848887 include: add missing arch/cpu.h include
The sys* ops like sys_clear_bit are indirectly included via arch CPU
header. Other stuff like find_msb_set end up included via this header as
well.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-11 18:05:17 +02:00
Stephanos Ioannidis b6d312a7ac boards: arc: Update outdated links
This commit updates the outdated ARC board links.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Anas Nashif 39d78faa42 boards: arc/nsim: all nsim variants are simualtors
Needed for proper filtering based on type in twister.
Sometimes we do not want to run a test in a simulator.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-09-26 16:49:58 +00:00
Gerard Marull-Paretas f9ccac29cd doc: delete dead JIRA links
Zephyr JIRA instance is no longer available. Make JIRA links literals.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-23 17:28:47 +00:00
Evgeniy Paltsev 0c7f3efb98 ARC: boards: hs5x: enable zephyr toolchain
As we've finally switched to 0.15.0 Zephyr SDK in upstream
verification we can enable zephyr toolchain for all ARC HS5x
targets.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2022-09-07 10:32:01 +02:00