drivers: retained_mem: Add generic retained register driver

Devices like the ATSAM series chips have retained registers
which are used to store memory. The memory is accessed just
like RAM, but since they are registers, their size and
address is used directly.

This commit adds a near complete copy of the generic retained
ram driver and bindings file, adding the reg property to
the bindings file, and updating the init macro in the driver
to use the reg address and size.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
This commit is contained in:
Bjarki Arge Andreasen 2023-12-25 09:44:46 +01:00 committed by Fabio Baltieri
commit c6cb2d6942
4 changed files with 162 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# Copyright (c) 2023 Bjarki Arge Andreasen
# SPDX-License-Identifier: Apache-2.0
description: Retained register based retained memory area.
compatible: "zephyr,retained-reg"
include: base.yaml
properties:
"#address-cells":
const: 1
"#size-cells":
const: 1
reg:
required: true