Commit graph

55626 commits

Author SHA1 Message Date
Emil Gydesen
ecb265be36 Bluetooth: ISO: Clear up ACL/ISO bt_conn pointer names
Make the name of the internal bt_conn pointers explicit as to
whether they point to an ACL or ISO bt_conn.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 11:46:07 -04:00
Yuguo Zou
7d8d4fd0cd boards: arc: add a nsim_hs_mpuv6 board simulator
We add support of mpu v6 therefore it is needed to have a board to
validate that feature. This commit add a new HS nsim simulator
which supports mpu v6.

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
2021-08-27 11:45:43 -04:00
Yuguo Zou
eb14e21d18 arch: arc: add support of mpu v6
Add support of ARC mpu v6
* minimal region size down to 32 bytes
* maximal region number up to 32
* not support uncacheable region and volatile uncached region
* clean up mpu code for better readablity

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
2021-08-27 11:45:43 -04:00
Yuguo Zou
333501e871 arch: arc: add support of mpu v3
Add support of ARC mpu version 3 which can have region size down to 32
bytes

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
2021-08-27 11:45:43 -04:00
Arvin Farahmand
f4ad81bb29 boards: sam_v71_xult: add support for PHY driver
Update to dts file to use the generic MII PHY driver.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
c2add72676 boards: sam_e70_xplained: add support for PHY driver
Update to dts file to use the generic MII PHY driver.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
4b6c9ff266 boards: sam4e_xpro: add support for PHY driver
Update to dts file to use the generic MII PHY driver.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
4daaa1a10f boards: atsame54_xpro add support for PHY driver
Update to dts file to use the generic MII PHY driver.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
44dc95f9e4 soc: arm: atmel: same70: add support for MDIO driver
Update to dts file to add MDIO driver.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
9ab2fc7c72 soc: arm: atmel: sam4e: add support for MDIO driver
Update to dts file to add MDIO driver.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
ce24eb7f71 soc: arm: atmel: same5x: add support for MDIO driver
Update to dts file to add MDIO driver.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
276996d754 drivers: eth_sam_gmac: use PHY driver
This commit removes PHY and MDIO specific code from the ATSAM
Ethernet driver and instead relies on a separate PHY driver to
handle the PHY.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
f845cddcf7 drivers: Add Ethernet PHY API
This commit adds support for Ethernet PHY drivers via a PHY API.

It also includes a driver for a generic MII compliant PHY
which supports most PHYs on the market.

Separating PHY driver from the SoC specific Ethernet driver
simplifies the Ethernet driver code and enables code re-use.
Drivers for specific PHYs with more advanced features, such as
RGMII delay in PHY can be developed independent of the Ethernet
MAC driver.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
2bec7587e9 drivers: mdio: add shell
MDIO shell support.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
c4cb45eaac drivers: mdio: add Atmel SAM MDIO driver
MDIO driver for ATSAM platform with Ethernet.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Arvin Farahmand
419b103dd6 drivers: Add mdio API
This commit adds support for MDIO bus. The bus is used by Ethernet
MACs to communicate with PHYs.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-08-27 11:43:48 -04:00
Emil Gydesen
f0e1823846 Bluetooth: bsim: Update bsim_test_iso to use defined broadcast code size
Use the #define for the broadcast code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Emil Gydesen
ed46180ab8 Bluetooth: samples: Update iso parameter check in iso_broadcast_benchmark
Update the iso parameter value checks from using literals to
the defined #defines.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Emil Gydesen
90eb48b111 Bluetooth: samples: Update iso parameter check in iso_connected_benchmark
Update the iso parameter value checks from using literals to
the defined #defines.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Emil Gydesen
d8d8d82f0e Bluetooth: ISO: Add ISO limits as #defines and use them
Add #define's for ISO HCI limits and use them to validate
input parameters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Vinayak Kariappa Chettimada
50280c67cf Bluetooth: Controller: Ignore PDU with RFU field set
Ignore received Extended Advertising PDU with RFU field set
in the Common Extended Advertising Payload Format of the
PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
41ed5b2173 Bluetooth: Controller: Use defines to access hdr_data fields
Use defines to access hdr_data fields used by interfaces to
populate the Common Extended Advertising Payload Format in
the PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
e976a146d2 Bluetooth: Controller: Use define for channel map size
Use a defined for channel map size of 5 octets.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
cf3b04534e Bluetooth: Controller: Periodic Adv Review Rework
Changes addressing Periodic Advertising and Synchronization
Channel Map Update Indication feature.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
e5d93d5757 Bluetooth: Controller: Use helper function to check instant past
Use a helper function to check at instant or past to apply
the channelMapNew.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
bb51848b93 Bluetooth: Controller: Use defined for event instant and latency max
Use defines for event instant and event instant latency
maximum values of 65536 and 32767 respectively.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
3f14c4602c tests: Bluetooth: bsim: Include Periodic Adv Chan Map Update Indication
Include Periodic Advertising Channel Map Update Indication
in the BabbleSim test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
b76070d57a Bluetooth: Controller: Periodic Sync with Chan Map Update Indication
Added implementation in Periodic Advertising Synchronization
to support Channel Map Update Indications present in the
ACAD fields of the AUX_SYNC_IND PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
fbc7cafaf5 Bluetooth: Controller: Periodic Advertising Chan Map Update Indication
Added implementation to perform Periodic Advertising Channel
Map Update Indication as a Broadcaster.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
4487bc0019 Bluetooth: Add Channel Map Update Indication AD Data Type
Add Channel Map Update Indication AD Data Type.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Gerard Marull-Paretas
fe2014ae1f device: organize state and device initializers
Organize in a more logical flow the device state initializer and
the device initializer parts.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-27 09:06:51 -04:00
Gerard Marull-Paretas
90465fe537 device: improve device data initialization
The Z_DEVICE_STATE_DEFINE macro was conditioned by CONFIG_PM_DEVICE.
This is a problem if one day we have other conditional fields in the
device state field that need to be initialized. The approach has been
changed to have an always existing initializer for the PM field, that is
a no-op if device PM is not enabled.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-27 09:06:51 -04:00
Gerard Marull-Paretas
a89cc157af pm: device: create struct pm_device initializer
Create a utility macro to initialize struct pm_device. The initializer
is kept in the pm/device.h header.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-27 09:06:51 -04:00
Gerard Marull-Paretas
ae26b38870 pm: fix usage initialization
The usage field was being initialized using the ATOMIC_INIT macro,
however, it is just a uint32_t variable.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-27 09:06:51 -04:00
Gerard Marull-Paretas
9917de4a1b pm: fully initialize pm_device on Z_DEVICE_STATE_DEFINE
The initialization of the struct pm_device pm field found in the device
state can be statically initialized without the need of doing it at
runtime.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-27 09:06:51 -04:00
Vinayak Kariappa Chettimada
c5e077c48f Bluetooth: Controller: Make node rx release code conditionally reusable
Make the block of code that is used to release node rx with
type NODE_RX_TYPE_RELEASE to be conditionally available for
other Kconfig selectable features like Extended Scanning.

Previously it was only available for CONFIG_BT_CONN, but now
Extended Scanning with LLL scheduling releases node rx when
radio event is closed due to failure to receive an auxiliary
PDU.

Relates to commit 2feffaf719 ("Bluetooth: Controller:
Release LLL scheduling aux on incomplete data").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:42 -04:00
Vinayak Kariappa Chettimada
fa02dc4d02 Bluetooth: Controller: Fix missing reset of connection handle
Fix missing reset of connection handle in the LLL context.
During a central connection, if LL reset is called, then
disabled connection context's handle has to be reset
otherwise new connection creation will fail by detecting
that there exists a connection to same peer.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:21 -04:00
Vinayak Kariappa Chettimada
19099fc980 Bluetooth: Controller: Use define for invalid LLL context handle
Use a define for invalid LLL context handle instead of
0xFFFF magic value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:21 -04:00
Vinayak Kariappa Chettimada
631cc825da Bluetooth: Controller: Add same peer connection check to initiator
Add implementation to initiator to check and reject
connection requests to already connected peer.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:21 -04:00
Vinayak Kariappa Chettimada
1c564e750b Bluetooth: Controller: Use id addr type to check same peer connection
Store and check device identity addr type of public or
random.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:21 -04:00
Vinayak Kariappa Chettimada
22a48e502e Bluetooth: Controller: Minor rename of disabled callback functions
Minor rename of Connection ISO disabled callback function
names.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:46:55 -04:00
Vinayak Kariappa Chettimada
f06ac2be2c Bluetooth: Controller: Fix LLL events pending check from ULL Low
ULL reference count is checked in ULL_LOW context to decide
if LLL events are pending, but the reference count can be
decremented by the ULL HIGH execution context which can
prevent the set `disabled_cb` function not being called due
to no pending event to produce the done events.

Fixed by checking the reference count in the ULL HIGH
execution context using a mayfly to schedule the check.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:46:55 -04:00
Vinayak Kariappa Chettimada
d2be89d725 Bluetooth: Controller: Use consistent naming for ticker op callbacks
Use consistent naming for ticker operation callback
functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:46:55 -04:00
Gerson Fernando Budke
c3db83ba58 scripts: runners: openocd: Enable thread awareness
Zephyr thread awareness is available for openocd but boards don't
have debuggers configuration.  This configure OpenOCD runner
automatically to complete configuration.

User still require enable CONFIG_DEBUG_THREAD_INFO=y to visualize
thread debug information.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-27 06:44:45 -04:00
Carlo Caione
0c2dabb4b9 ipc: rpmsg_multi_instance: Rework instance tracking
This patch is the first step to make the rpmsg_multi_instance usable in
a multi-core scenario.

The current driver is using a local driver variable (instance) to track
the number of allocated instances. This counter is practically used to
allocate to the instance the correct portion of the shared memory.

This is fundamentally wrong because this is assuming that it does exist
only one single shared memory region to split amongs all the allocated
instances.  When the platform has more than one core this is obviously
not the case since each couple of cores are communicating using a
different memory region.

To solve this issue we introduce a new struct rpmsg_mi_ctx_shm_cfg that
is doing two things: (1) it's carrying the information about the shared
memory and (2) it's carrying an internal variable used to track the
instances allocated in that region. The same struct should be used every
time a new instance is allocated in the same shared memory region.

We also fix a problem with the current code where there is a race
between threads when accessing the instance variable, so this patch is
adding a serializing mutex.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-08-27 06:44:08 -04:00
Carlo Caione
66fb1bc2bc ipc: rpmsg_multi_instance: Use only rpsmg_mi_ctx_cfg for configuration
For the instance configuration the rpmsg_multi_instance code is
currently using a set of configuration info coming from two different
sources: the rpsmg_mi_ctx_cfg struct and Kconfig.

This is not only confusing but it's preventing to configure the
instances using information not coming from Kconfig (for example if we
want to configure the instance using DT).

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-08-27 06:44:08 -04:00
Daniel Leung
27f36bda51 boards: qemu_x86_tiny: enabled for general demand paging testing
This enables qemu_x86_tiny to be used for more general demand
paging testing where non-pinned code and data is not available
in physical memory at boot. This adds a custom linker script to
qemu_x86_tiny for pinning code and data. In the process, a new
kconfig CONFIG_BOARD_QEMU_X86_TINY has to be introduced to
distinguish from other qemu_x86* boards. This linker script
is based on the generic x86-32 one in
include/arch/x86/ia32/linker.ld, with additions to
put symbols into boot and pinned sections.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-26 21:16:22 -04:00
Daniel Leung
c3abd7a383 demand_paging: add a flash-based backing store for qemu_x86_tiny
This adds a flash-based backing store for qemu_x86_tiny board for
testing demand paging. This allows us to test code execution where
.text section is not in physical memory at boot.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-26 21:16:22 -04:00
Daniel Leung
fa3267165c samples: prod_consumer: don't reuse main stack for app_b
With demand paging, the main stack is not user mode capable
and it would fail k_thread_user_mode_enter() under
app_b_entry(). So create another thread and stack for app_b
as this stack can be used in user mode.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-26 21:16:22 -04:00
Daniel Leung
6a58c34aa6 tests: x86/pagetables: limit permission test under demand paging
When demand paging is enabled and not all generic sections are
in physical memory at boot, only tests the permission up to the end
of the pinned section.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-26 21:16:22 -04:00