All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fdt_support: Add kernel-doc for fdt_fixup_memory_banks()
@ 2021-08-10  7:30 Michal Simek
  2021-08-12 21:46 ` Simon Glass
  2021-08-23  6:50 ` Michal Simek
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Simek @ 2021-08-10  7:30 UTC (permalink / raw)
  To: u-boot, git, Tom Rini; +Cc: Simon Glass

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fdt_support: Add kernel-doc for fdt_fixup_memory_banks()
  2021-08-10  7:30 [PATCH] fdt_support: Add kernel-doc for fdt_fixup_memory_banks() Michal Simek
@ 2021-08-12 21:46 ` Simon Glass
  2021-08-23  6:50 ` Michal Simek
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-08-12 21:46 UTC (permalink / raw)
  To: Michal Simek; +Cc: U-Boot Mailing List, git, Tom Rini

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fdt_support: Add kernel-doc for fdt_fixup_memory_banks()
  2021-08-10  7:30 [PATCH] fdt_support: Add kernel-doc for fdt_fixup_memory_banks() Michal Simek
  2021-08-12 21:46 ` Simon Glass
@ 2021-08-23  6:50 ` Michal Simek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2021-08-23  6:50 UTC (permalink / raw)
  To: U-Boot, git, Tom Rini; +Cc: Simon Glass

ú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

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-23  6:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10  7:30 [PATCH] fdt_support: Add kernel-doc for fdt_fixup_memory_banks() Michal Simek
2021-08-12 21:46 ` Simon Glass
2021-08-23  6:50 ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.