diff mbox series

[RESEND,v5,4/6] riscv: Setup reserved-memory node for FU540

Message ID 20200418060758.4839-5-atish.patra@wdc.com
State Superseded
Headers show
Series RISC-V DT related fixes for reserved memory & UEFI | expand

Commit Message

Atish Patra April 18, 2020, 6:07 a.m. UTC
FU540 uses OF_SEPARATE instead of OF_PRIOR.

Enable OF_BOARD_FIXUP to update the DT with reserved-memory node.

Signed-off-by: Atish Patra <atish.patra at wdc.com>
---
 arch/riscv/lib/fdt_fixup.c     | 15 +++++++++++++++
 configs/sifive_fu540_defconfig |  1 +
 2 files changed, 16 insertions(+)

Comments

Bin Meng April 18, 2020, 12:25 p.m. UTC | #1
On Sat, Apr 18, 2020 at 2:10 PM Atish Patra <atish.patra at wdc.com> wrote:
>
> FU540 uses OF_SEPARATE instead of OF_PRIOR.

Should be OF_PRIOR_STAGE

>
> Enable OF_BOARD_FIXUP to update the DT with reserved-memory node.
>
> Signed-off-by: Atish Patra <atish.patra at wdc.com>
> ---
>  arch/riscv/lib/fdt_fixup.c     | 15 +++++++++++++++
>  configs/sifive_fu540_defconfig |  1 +
>  2 files changed, 16 insertions(+)
>
> diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
> index 1fce41490973..af12e484db9b 100644
> --- a/arch/riscv/lib/fdt_fixup.c
> +++ b/arch/riscv/lib/fdt_fixup.c
> @@ -100,3 +100,18 @@ int riscv_board_reserved_mem_fixup(void *fdt)
>
>         return 0;
>  }
> +
> +#ifdef CONFIG_OF_BOARD_FIXUP
> +int board_fix_fdt(void *fdt)
> +{
> +       int err;
> +
> +       err = riscv_board_reserved_mem_fixup(fdt);
> +       if (err < 0) {
> +               printf("failed to fixup DT for reserved memory: %d\n", err);
> +               return err;
> +       }
> +
> +       return 0;
> +}
> +#endif
> diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
> index 6d61e6c960ee..8fb3794cd578 100644
> --- a/configs/sifive_fu540_defconfig
> +++ b/configs/sifive_fu540_defconfig
> @@ -12,3 +12,4 @@ CONFIG_DISPLAY_BOARDINFO=y
>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_DM_MTD=y
> +CONFIG_OF_BOARD_FIXUP=y

This should be inserted before CONFIG_DEFAULT_DEVICE_TREE

> --

Other than above:
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>

Regards,
Bin
diff mbox series

Patch

diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
index 1fce41490973..af12e484db9b 100644
--- a/arch/riscv/lib/fdt_fixup.c
+++ b/arch/riscv/lib/fdt_fixup.c
@@ -100,3 +100,18 @@  int riscv_board_reserved_mem_fixup(void *fdt)
 
 	return 0;
 }
+
+#ifdef CONFIG_OF_BOARD_FIXUP
+int board_fix_fdt(void *fdt)
+{
+	int err;
+
+	err = riscv_board_reserved_mem_fixup(fdt);
+	if (err < 0) {
+		printf("failed to fixup DT for reserved memory: %d\n", err);
+		return err;
+	}
+
+	return 0;
+}
+#endif
diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
index 6d61e6c960ee..8fb3794cd578 100644
--- a/configs/sifive_fu540_defconfig
+++ b/configs/sifive_fu540_defconfig
@@ -12,3 +12,4 @@  CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM_MTD=y
+CONFIG_OF_BOARD_FIXUP=y