diff mbox series

fdt_support: Add kernel-doc for fdt_fixup_memory_banks()

Message ID f9f4693e10e9c0c54de75d3ace60189406f33f9b.1628580615.git.michal.simek@xilinx.com
State Accepted
Commit 5e1a3be6674ba9945ad28291cb6d8e511db6eb92
Delegated to: Simon Glass
Headers show
Series fdt_support: Add kernel-doc for fdt_fixup_memory_banks() | expand

Commit Message

Michal Simek Aug. 10, 2021, 7:30 a.m. UTC
Add kernel-doc description for fdt_fixup_memory_banks() because it is
implemented in one specific way and this information should be available
for others to decide if their SoC conforms to it.
If you don't want U-Boot to update your memory DT layout please disable
CONFIG_ARCH_FIXUP_FDT_MEMORY.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 common/fdt_support.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Simon Glass Aug. 12, 2021, 9:46 p.m. UTC | #1
On Tue, 10 Aug 2021 at 01:30, Michal Simek <michal.simek@xilinx.com> wrote:
>
> Add kernel-doc description for fdt_fixup_memory_banks() because it is
> implemented in one specific way and this information should be available
> for others to decide if their SoC conforms to it.
> If you don't want U-Boot to update your memory DT layout please disable
> CONFIG_ARCH_FIXUP_FDT_MEMORY.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  common/fdt_support.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
Michal Simek Aug. 23, 2021, 6:50 a.m. UTC | #2
Ășt 10. 8. 2021 v 9:30 odesĂ­latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Add kernel-doc description for fdt_fixup_memory_banks() because it is
> implemented in one specific way and this information should be available
> for others to decide if their SoC conforms to it.
> If you don't want U-Boot to update your memory DT layout please disable
> CONFIG_ARCH_FIXUP_FDT_MEMORY.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  common/fdt_support.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/common/fdt_support.c b/common/fdt_support.c
> index 4341d84bd5ec..8992ac5d3fca 100644
> --- a/common/fdt_support.c
> +++ b/common/fdt_support.c
> @@ -420,6 +420,24 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
>  #else
>  #define MEMORY_BANKS_MAX 4
>  #endif
> +
> +/**
> + * fdt_fixup_memory_banks - Update DT memory node
> + * @blob: Pointer to DT blob
> + * @start: Pointer to memory start addresses array
> + * @size: Pointer to memory sizes array
> + * @banks: Number of memory banks
> + *
> + * Return: 0 on success, negative value on failure
> + *
> + * Based on the passed number of banks and arrays, the function is able to
> + * update existing DT memory nodes to match run time detected/changed memory
> + * configuration. Implementation is handling one specific case with only one
> + * memory node where multiple tuples could be added/updated.
> + * The case where multiple memory nodes with a single tuple (base, size) are
> + * used, this function is only updating the first memory node without removing
> + * others.
> + */
>  int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
>  {
>         int err, nodeoffset;
> --
> 2.32.0
>

Applied.
M
diff mbox series

Patch

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 4341d84bd5ec..8992ac5d3fca 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -420,6 +420,24 @@  static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
 #else
 #define MEMORY_BANKS_MAX 4
 #endif
+
+/**
+ * fdt_fixup_memory_banks - Update DT memory node
+ * @blob: Pointer to DT blob
+ * @start: Pointer to memory start addresses array
+ * @size: Pointer to memory sizes array
+ * @banks: Number of memory banks
+ *
+ * Return: 0 on success, negative value on failure
+ *
+ * Based on the passed number of banks and arrays, the function is able to
+ * update existing DT memory nodes to match run time detected/changed memory
+ * configuration. Implementation is handling one specific case with only one
+ * memory node where multiple tuples could be added/updated.
+ * The case where multiple memory nodes with a single tuple (base, size) are
+ * used, this function is only updating the first memory node without removing
+ * others.
+ */
 int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
 {
 	int err, nodeoffset;