device: support for mutable devices

Add support for mutable devices. Mutable devices are those which
can be modified after declaration, in-place, in kernel mode.

In order for a device to be mutable, the following must be true

  * `CONFIG_DEVICE_MUTABLE` must be y-selected
  * the Devicetree bindings for the device must include
    `mutable.yaml`
  * the Devicetree node must include the `zephyr,mutable` property

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This commit is contained in:
Christopher Friedt 2023-09-22 15:08:11 -04:00 committed by Carles Cufí
commit afc59112a9
6 changed files with 68 additions and 18 deletions

View file

@ -0,0 +1,13 @@
# Copyright (c) 2023, Meta
# SPDX-License-Identifier: Apache-2.0
# Properties for Mutable devices
properties:
zephyr,mutable:
type: boolean
description: |
True iff the device structure may be mutated.
Inherit this binding for devices that are runtime-modifiable, in-place.
This places the device structure into SRAM rather than Flash.