Skip to content

Commit

Permalink
Merge branch 'zephyrproject-rtos:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxwelltoo authored Jun 26, 2023
2 parents 967acb6 + e741449 commit 2f4c382
Show file tree
Hide file tree
Showing 17 changed files with 396 additions and 105 deletions.
2 changes: 1 addition & 1 deletion doc/LICENSING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ licensing in this document.
.. _GPLv2 License:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/COPYING

*scripts/{checkpatch.pl,checkstack.pl,get_maintainers.pl,spelling.txt}*
*scripts/{checkpatch.pl,checkstack.pl,spelling.txt}*
*Origin:* Linux Kernel

*Licensing:* `GPLv2 License`_
3 changes: 2 additions & 1 deletion doc/contribute/external.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ automatically implies that the imported source code becomes part of the
- The code is subject to the same checks and verification requirements as the
rest of the code in the main tree, including static analysis
- All files contain an SPDX tag if not already present
- An entry is added to the `licensing page <zephyr_licensing>`
- If the source is not Apache 2.0 licensed,
an entry is added to the :ref:`licensing page <zephyr_licensing>`.

This mode of integration can be applicable to both small and large external
codebases, but it is typically used more commonly with the former.
Expand Down
37 changes: 18 additions & 19 deletions doc/develop/toolchains/designware_arc_mwdt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,27 @@
DesignWare ARC MetaWare Development Toolkit (MWDT)
##################################################

#. You need to have `ARC MWDT
<https://www.synopsys.com/dw/ipdir.php?ds=sw_metaware>`_ installed on your
host.
#. You need to have `ARC MWDT <https://www.synopsys.com/dw/ipdir.php?ds=sw_metaware>`_ installed on
your host.

#. :ref:`Set these environment variables <env_vars>`:

- Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``arcmwdt``.
- Set :envvar:`ARCMWDT_TOOLCHAIN_PATH` to the toolchain installation
directory. MWDT installation provides :envvar:`METAWARE_ROOT` so simply set
:envvar:`ARCMWDT_TOOLCHAIN_PATH` to ``$METAWARE_ROOT/../`` (Linux)
or ``%METAWARE_ROOT%\..\`` (Windows)
#. You need to have :ref:`Zephyr SDK <toolchain_zephyr_sdk>` installed on your host.

.. note::
Even though ARC MWDT compiler is used for Zephyr RTOS sources compilation, still the GNU
preprocessor & GNU objcopy might be used for some steps like DTS preprocessing and ``.bin``
file generation. Hence we need to have either ARC or host GNU tools in :envvar:`PATH`.
Currently Zephyr looks for:
A Zephyr SDK is used as a source of tools like device tree compiler (DTC), QEMU, etc...
Even though ARC MWDT toolchain is used for Zephyr RTOS build, still the GNU preprocessor & GNU
objcopy might be used for some steps like device tree preprocessing and ``.bin`` file
generation. We used Zephyr SDK as a source of these ARC GNU tools as well.

* objcopy binaries: ``arc-elf32-objcopy`` or ``arc-linux-objcopy`` or ``objcopy``
* gcc binaries: ``arc-elf32-gcc`` or ``arc-linux-gcc`` or ``gcc``
#. :ref:`Set these environment variables <env_vars>`:

- Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``arcmwdt``.
- Set :envvar:`ARCMWDT_TOOLCHAIN_PATH` to the toolchain installation directory. MWDT installation
provides :envvar:`METAWARE_ROOT` so simply set :envvar:`ARCMWDT_TOOLCHAIN_PATH` to
``$METAWARE_ROOT/../`` (Linux) or ``%METAWARE_ROOT%\..\`` (Windows).

This list can be extended or modified in future.
.. tip::
If you have only one ARC MWDT toolchain version installed on your machine you may skip setting
:envvar:`ARCMWDT_TOOLCHAIN_PATH` - it would be detected automatically.

#. To check that you have set these variables correctly in your current
environment, follow these example shell sessions (the
Expand All @@ -36,10 +35,10 @@ DesignWare ARC MetaWare Development Toolkit (MWDT)
$ echo $ZEPHYR_TOOLCHAIN_VARIANT
arcmwdt
$ echo $ARCMWDT_TOOLCHAIN_PATH
/home/you/ARC/MWDT_2019.12/
/home/you/ARC/MWDT_2023.03/
# Windows:
> echo %ZEPHYR_TOOLCHAIN_VARIANT%
arcmwdt
> echo %ARCMWDT_TOOLCHAIN_PATH%
C:\ARC\MWDT_2019.12\
C:\ARC\MWDT_2023.03\
11 changes: 7 additions & 4 deletions doc/releases/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ Supported Releases
+-----------------+----------------+---------------+
| Release | Release date | EOL |
+=================+================+===============+
| `Zephyr 2.7.5`_ | 01/06/2023 | 31/08/2024 |
| `Zephyr 2.7.5`_ | 2023-06-01 | 2024-08-31 |
+-----------------+----------------+---------------+
| `Zephyr 3.3.0`_ | 19/02/2023 | 31/10/2023 |
| `Zephyr 3.4.0`_ | 2023-06-16 | 2024-02-29 |
+-----------------+----------------+---------------+
| `Zephyr 3.2.0`_ | 30/09/2022 | 31/06/2023 |
| `Zephyr 3.3.0`_ | 2023-02-19 | 2023-10-31 |
+-----------------+----------------+---------------+
| `Zephyr 3.2.0`_ | 2022-09-30 | 2023-06-30 |
+-----------------+----------------+---------------+


As of 01/01/2022, LTS1 (1.14.x) is not supported and has reached end of life (EOL).
As of 2022-01-01, LTS1 (1.14.x) is not supported and has reached end of life (EOL).

Release Notes
*************
Expand Down Expand Up @@ -95,3 +97,4 @@ specific release and can be found at https://docs.zephyrproject.org/.
.. _`Zephyr 2.7.5`: https://docs.zephyrproject.org/2.7.5/
.. _`Zephyr 3.2.0`: https://docs.zephyrproject.org/3.2.0/
.. _`Zephyr 3.3.0`: https://docs.zephyrproject.org/3.3.0/
.. _`Zephyr 3.4.0`: https://docs.zephyrproject.org/3.4.0/
12 changes: 6 additions & 6 deletions doc/services/portability/posix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Zephyr.
_POSIX_THREAD_ATTR_STACKADDR,yes
_POSIX_THREAD_ATTR_STACKSIZE,yes
_POSIX_THREAD_CPUTIME,
_POSIX_THREAD_PRIO_INHERIT,yes
_POSIX_THREAD_PRIO_INHERIT,
_POSIX_THREAD_PRIO_PROTECT,
_POSIX_THREAD_PRIORITY_SCHEDULING,yes
_POSIX_THREAD_SPORADIC_SERVER,
Expand Down Expand Up @@ -151,8 +151,8 @@ multiple processes.
pthread_cond_signal(),yes
pthread_cond_timedwait(),yes
pthread_cond_wait(),yes
pthread_condattr_destroy(),
pthread_condattr_init(),
pthread_condattr_destroy(),yes
pthread_condattr_init(),yes
pthread_create(),yes
pthread_detach(),yes
pthread_equal(),
Expand All @@ -167,8 +167,8 @@ multiple processes.
pthread_mutex_lock(),yes
pthread_mutex_trylock(),yes
pthread_mutex_unlock(),yes
pthread_mutexattr_destroy(),
pthread_mutexattr_init(),
pthread_mutexattr_destroy(),yes
pthread_mutexattr_init(),yes
pthread_once(),yes
pthread_self(),yes
pthread_setcancelstate(),yes
Expand Down Expand Up @@ -430,7 +430,7 @@ POSIX_DEVICE_IO
read(),yes
scanf(),
setbuf(),
etvbuf(),
setvbuf(),
stderr,yes
stdin,yes
stdout,yes
Expand Down
6 changes: 3 additions & 3 deletions drivers/interrupt_controller/intc_plic.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <zephyr/irq.h>

#define PLIC_MAX_PRIO DT_INST_PROP(0, riscv_max_priority)
#define PLIC_PRIO DT_INST_REG_ADDR_BY_NAME(0, prio)
#define PLIC_IRQ_EN DT_INST_REG_ADDR_BY_NAME(0, irq_en)
#define PLIC_REG DT_INST_REG_ADDR_BY_NAME(0, reg)
#define PLIC_PRIO DT_INST_REG_ADDR_BY_NAME_U64(0, prio)
#define PLIC_IRQ_EN DT_INST_REG_ADDR_BY_NAME_U64(0, irq_en)
#define PLIC_REG DT_INST_REG_ADDR_BY_NAME_U64(0, reg)

#define PLIC_IRQS (CONFIG_NUM_IRQS - CONFIG_2ND_LVL_ISR_TBL_OFFSET)
#define PLIC_EN_SIZE ((PLIC_IRQS >> 5) + 1)
Expand Down
6 changes: 3 additions & 3 deletions drivers/timer/riscv_machine_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
#define DT_DRV_COMPAT scr_machine_timer
#define MTIMER_HAS_DIVIDER

#define MTIMEDIV_REG (DT_INST_REG_ADDR(0) + 4)
#define MTIME_REG (DT_INST_REG_ADDR(0) + 8)
#define MTIMECMP_REG (DT_INST_REG_ADDR(0) + 16)
#define MTIMEDIV_REG (DT_INST_REG_ADDR_U64(0) + 4)
#define MTIME_REG (DT_INST_REG_ADDR_U64(0) + 8)
#define MTIMECMP_REG (DT_INST_REG_ADDR_U64(0) + 16)
#define TIMER_IRQN DT_INST_IRQN(0)
#endif

Expand Down
15 changes: 15 additions & 0 deletions dts/bindings/test/vnd,reg-holder-64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2023 Syntacore
# SPDX-License-Identifier: Apache-2.0

description: Test 64-bit register property container

compatible: "vnd,reg-holder-64"

include: [base.yaml]

properties:
reg:
required: true

reg-names:
required: true
69 changes: 69 additions & 0 deletions include/zephyr/devicetree.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

#include <devicetree_generated.h>

#if !defined(_LINKER) && !defined(_ASMLANGUAGE)
#include <stdint.h>
#endif

#include <zephyr/sys/util.h>

/**
Expand Down Expand Up @@ -2219,6 +2223,18 @@
*/
#define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)

/**
* @brief 64-bit version of DT_REG_ADDR()
*
* This macro version adds the appropriate suffix for 64-bit unsigned
* integer literals.
* Note that this macro is equivalent to DT_REG_ADDR() in linker/ASM context.
*
* @param node_id node identifier
* @return node's register block address
*/
#define DT_REG_ADDR_U64(node_id) DT_U64_C(DT_REG_ADDR(node_id))

/**
* @brief Get a node's (only) register block size
*
Expand All @@ -2237,6 +2253,21 @@
#define DT_REG_ADDR_BY_NAME(node_id, name) \
DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS)

/**
* @brief 64-bit version of DT_REG_ADDR_BY_NAME()
*
* This macro version adds the appropriate suffix for 64-bit unsigned
* integer literals.
* Note that this macro is equivalent to DT_REG_ADDR_BY_NAME() in
* linker/ASM context.
*
* @param node_id node identifier
* @param name lowercase-and-underscores register specifier name
* @return address of the register block specified by name
*/
#define DT_REG_ADDR_BY_NAME_U64(node_id, name) \
DT_U64_C(DT_REG_ADDR_BY_NAME(node_id, name))

/**
* @brief Get a register block's size by name
* @param node_id node identifier
Expand Down Expand Up @@ -3681,6 +3712,21 @@
#define DT_INST_REG_ADDR_BY_NAME(inst, name) \
DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name)

/**
* @brief 64-bit version of DT_INST_REG_ADDR_BY_NAME()
*
* This macro version adds the appropriate suffix for 64-bit unsigned
* integer literals.
* Note that this macro is equivalent to DT_INST_REG_ADDR_BY_NAME() in
* linker/ASM context.
*
* @param inst instance number
* @param name lowercase-and-underscores register specifier name
* @return address of the register block with the given @p name
*/
#define DT_INST_REG_ADDR_BY_NAME_U64(inst, name) \
DT_U64_C(DT_INST_REG_ADDR_BY_NAME(inst, name))

/**
* @brief Get a `DT_DRV_COMPAT`'s register block size by name
* @param inst instance number
Expand All @@ -3697,6 +3743,19 @@
*/
#define DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0)

/**
* @brief 64-bit version of DT_INST_REG_ADDR()
*
* This macro version adds the appropriate suffix for 64-bit unsigned
* integer literals.
* Note that this macro is equivalent to DT_INST_REG_ADDR() in
* linker/ASM context.
*
* @param inst instance number
* @return instance's register block address
*/
#define DT_INST_REG_ADDR_U64(inst) DT_U64_C(DT_INST_REG_ADDR(inst))

/**
* @brief Get a `DT_DRV_COMPAT`'s (only) register block size
* @param inst instance number
Expand Down Expand Up @@ -4172,6 +4231,16 @@
#define DT_INST_NODE_HAS_PROP_AND_OR(inst, prop) \
DT_INST_NODE_HAS_PROP(inst, prop) ||

/**
* @def DT_U64_C
* @brief Macro to add ULL postfix to the devicetree address constants
*/
#if defined(_LINKER) || defined(_ASMLANGUAGE)
#define DT_U64_C(_v) (_v)
#else
#define DT_U64_C(_v) UINT64_C(_v)
#endif

/** @endcond */

/* have these last so they have access to all previously defined macros */
Expand Down
4 changes: 2 additions & 2 deletions include/zephyr/sys/device_mmio.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ struct z_device_mmio_rom {

#define Z_DEVICE_MMIO_ROM_INITIALIZER(node_id) \
{ \
.addr = DT_REG_ADDR(node_id) \
.addr = (mm_reg_t)DT_REG_ADDR_U64(node_id) \
}

#define Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(name, node_id) \
{ \
.addr = DT_REG_ADDR_BY_NAME(node_id, name) \
.addr = (mm_reg_t)DT_REG_ADDR_BY_NAME_U64(node_id, name) \
}

#endif /* DEVICE_MMIO_IS_IN_RAM */
Expand Down
1 change: 1 addition & 0 deletions scripts/pylib/twister/twisterlib/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
logger.setLevel(logging.DEBUG)

SUPPORTED_SIMS = ["mdb-nsim", "nsim", "renode", "qemu", "tsim", "armfvp", "xt-sim", "native"]
SUPPORTED_SIMS_IN_PYTEST = ['native', 'qemu']


def terminate_process(proc):
Expand Down
Loading

0 comments on commit 2f4c382

Please sign in to comment.