Skip to contentSkip to conversation

sifive: riscv: streamline HiFive Unleashed configuration infrastructure

PATCH New Sagar Shrikant Kadam 4 participants 12 messages Jul 29, 2019 – Aug 1, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sifive: riscv: streamline HiFive Unleashed configuration infrastructure

This patch is intended to update the current configuration implementation of HiFive Unleashed board so that it is as per the guidelines provided in U-boot's doc/README.kconfig. The board has a FU540-C000 SoC built around U54-MC Core complex.

This patch is based on the commit 75551c8bfc95 ("Merge branch '2019-07-26-ti-imports'") in master branch of repo[1] and is tested with OpenSBI to use the dtb passed as argument in FW_PAYLOAD_FDT_PATH from the mainline kernel and boot's linux image over tftp. The patch is available for testing at dev/sagark/sifive_u540defconfig branch here [2].

[1] http://git.denx.de/u-boot-riscv.git
[2] https://github.com/sagsifive/u-boot

Summary:
-Update TARGET in board select menu.
-Update SYS_CPU from generic to u54-mc.
-Added SYS_SOC.
-Update SYS_BOARD from fu540 to hifive_unleashed.
-Update SYS_CONFIG_NAME from sifive-u540 to hifive_unleashed . -Update MAINTAINERS file with relevant entries corresponding to the above changes.

This patch will conflict with few patches which are already submitted for review, it would be good if U-boot folks would suggest something accordingly.

Sagar Shrikant Kadam (1):
sifive: riscv: update Hifive Unleashed configuration infrastructure

 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h
arch/riscv/Kconfig +3 -3
index 8cfc7d0..82891fd 100644
@@ -17,7 +17,7 @@ config TARGET_MICROCHIP_ICICLE
 config TARGET_QEMU_VIRT
 	bool "Support QEMU Virt Board"
 
-config TARGET_SIFIVE_FU540
+config TARGET_SIFIVE_HIFIVE_UNLEASHED
 	bool "Support SiFive FU540 Board"
 
 endchoice
@@ -52,11 +52,11 @@ config SPL_SYS_DCACHE_OFF
 source "board/AndesTech/ax25-ae350/Kconfig"
 source "board/emulation/qemu-riscv/Kconfig"
 source "board/microchip/mpfs_icicle/Kconfig"
-source "board/sifive/fu540/Kconfig"
+source "board/sifive/hifive_unleashed/Kconfig"
 
 # platform-specific options below
 source "arch/riscv/cpu/ax25/Kconfig"
-source "arch/riscv/cpu/generic/Kconfig"
+source "arch/riscv/cpu/u54-mc/Kconfig"
 
 # architecture-specific options below
 
arch/riscv/cpu/generic/Kconfig deleted +0 -12
deleted file mode 100644
index 1d6ab50..0000000
@@ -1,12 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (C) 2018, Bin Meng <[email protected]>
-
-config GENERIC_RISCV
-	bool
-	select ARCH_EARLY_INIT_R
-	imply CPU
-	imply CPU_RISCV
-	imply RISCV_TIMER
-	imply SIFIVE_CLINT if RISCV_MMODE
-	imply CMD_CPU
arch/riscv/cpu/generic/Makefile deleted +0 -6
deleted file mode 100644
index 258e462..0000000
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (C) 2018, Bin Meng <[email protected]>
-
-obj-y += dram.o
-obj-y += cpu.o
arch/riscv/cpu/generic/cpu.c deleted +0 -35
deleted file mode 100644
index ad2950c..0000000
@@ -1,35 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2018, Bin Meng <[email protected]>
- */
-
-#include <common.h>
-#include <dm.h>
-
-/*
- * cleanup_before_linux() is called just before we call linux
- * it prepares the processor for linux
- *
- * we disable interrupt and caches.
- */
-int cleanup_before_linux(void)
-{
-	disable_interrupts();
-
-	cache_flush();
-
-	return 0;
-}
-
-/* To enumerate devices on the /soc/ node, create a "simple-bus" driver */
-static const struct udevice_id riscv_virtio_soc_ids[] = {
-	{ .compatible = "riscv-virtio-soc" },
-	{ }
-};
-
-U_BOOT_DRIVER(riscv_virtio_soc) = {
-	.name = "riscv_virtio_soc",
-	.id = UCLASS_SIMPLE_BUS,
-	.of_match = riscv_virtio_soc_ids,
-	.flags = DM_FLAG_PRE_RELOC,
-};
arch/riscv/cpu/generic/dram.c deleted +0 -37
deleted file mode 100644
index b7b1207..0000000
@@ -1,37 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2018, Bin Meng <[email protected]>
- */
-
-#include <common.h>
-#include <fdtdec.h>
-#include <linux/sizes.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int dram_init(void)
-{
-	return fdtdec_setup_mem_size_base();
-}
-
-int dram_init_banksize(void)
-{
-	return fdtdec_setup_memory_banksize();
-}
-
-ulong board_get_usable_ram_top(ulong total_size)
-{
-#ifdef CONFIG_64BIT
-	/*
-	 * Ensure that we run from first 4GB so that all
-	 * addresses used by U-Boot are 32bit addresses.
-	 *
-	 * This in-turn ensures that 32bit DMA capable
-	 * devices work fine because DMA mapping APIs will
-	 * provide 32bit DMA addresses only.
-	 */
-	if (gd->ram_top > SZ_4G)
-		return SZ_4G;
-#endif
-	return gd->ram_top;
-}
arch/riscv/cpu/u54-mc/Kconfig new file +12 -0
new file mode 100644
index 0000000..60189a7
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2018, Bin Meng <[email protected]>
+
+config U54_MC_RISCV
+	bool
+	select ARCH_EARLY_INIT_R
+	imply CPU
+	imply CPU_RISCV
+	imply RISCV_TIMER
+	imply SIFIVE_CLINT if RISCV_MMODE
+	imply CMD_CPU
arch/riscv/cpu/u54-mc/Makefile new file +6 -0
new file mode 100644
index 0000000..258e462
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2018, Bin Meng <[email protected]>
+
+obj-y += dram.o
+obj-y += cpu.o
arch/riscv/cpu/u54-mc/cpu.c new file +35 -0
new file mode 100644
index 0000000..ad2950c
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <[email protected]>
+ */
+
+#include <common.h>
+#include <dm.h>
+
+/*
+ * cleanup_before_linux() is called just before we call linux
+ * it prepares the processor for linux
+ *
+ * we disable interrupt and caches.
+ */
+int cleanup_before_linux(void)
+{
+	disable_interrupts();
+
+	cache_flush();
+
+	return 0;
+}
+
+/* To enumerate devices on the /soc/ node, create a "simple-bus" driver */
+static const struct udevice_id riscv_virtio_soc_ids[] = {
+	{ .compatible = "riscv-virtio-soc" },
+	{ }
+};
+
+U_BOOT_DRIVER(riscv_virtio_soc) = {
+	.name = "riscv_virtio_soc",
+	.id = UCLASS_SIMPLE_BUS,
+	.of_match = riscv_virtio_soc_ids,
+	.flags = DM_FLAG_PRE_RELOC,
+};
arch/riscv/cpu/u54-mc/dram.c new file +37 -0
new file mode 100644
index 0000000..b7b1207
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <[email protected]>
+ */
+
+#include <common.h>
+#include <fdtdec.h>
+#include <linux/sizes.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+	return fdtdec_setup_mem_size_base();
+}
+
+int dram_init_banksize(void)
+{
+	return fdtdec_setup_memory_banksize();
+}
+
+ulong board_get_usable_ram_top(ulong total_size)
+{
+#ifdef CONFIG_64BIT
+	/*
+	 * Ensure that we run from first 4GB so that all
+	 * addresses used by U-Boot are 32bit addresses.
+	 *
+	 * This in-turn ensures that 32bit DMA capable
+	 * devices work fine because DMA mapping APIs will
+	 * provide 32bit DMA addresses only.
+	 */
+	if (gd->ram_top > SZ_4G)
+		return SZ_4G;
+#endif
+	return gd->ram_top;
+}
arch/riscv/include/asm/arch-fu540-c000/clk.h new file +14 -0
new file mode 100644
index 0000000..1631f5f
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2019 Western Digital Corporation or its affiliates.
+ *
+ * Authors:
+ *   Anup Patel <[email protected]>
+ */
+
+#ifndef __ASM_RISCV_ARCH_CLK_H
+#define __ASM_RISCV_ARCH_CLK_H
+
+/* Note: This is a placeholder header for driver compilation. */
+
+#endif
arch/riscv/include/asm/arch-generic/clk.h deleted +0 -14
deleted file mode 100644
index 1631f5f..0000000
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (c) 2019 Western Digital Corporation or its affiliates.
- *
- * Authors:
- *   Anup Patel <[email protected]>
- */
-
-#ifndef __ASM_RISCV_ARCH_CLK_H
-#define __ASM_RISCV_ARCH_CLK_H
-
-/* Note: This is a placeholder header for driver compilation. */
-
-#endif
board/sifive/fu540/Kconfig deleted +0 -49

49 lines not on this page · raw message

board/sifive/fu540/MAINTAINERS deleted +0 -9
deleted file mode 100644
index 702d803..0000000
@@ -1,9 +0,0 @@
-SiFive FU540 BOARD
-M:	Paul Walmsley <[email protected]>
-M:	Palmer Dabbelt <[email protected]>
-M:	Anup Patel <[email protected]>
-M:	Atish Patra <[email protected]>
-S:	Maintained
-F:	board/sifive/fu540/
-F:	include/configs/sifive-fu540.h
-F:	configs/sifive_fu540_defconfig
board/sifive/fu540/Makefile deleted +0 -5
deleted file mode 100644
index 6e1862c..0000000
@@ -1,5 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (c) 2019 Western Digital Corporation or its affiliates.
-
-obj-y	+= fu540.o
board/sifive/fu540/fu540.c deleted +0 -139

139 lines not on this page · raw message

board/sifive/hifive_unleashed/Kconfig new file +52 -0

52 lines not on this page · raw message

board/sifive/hifive_unleashed/MAINTAINERS new file +9 -0
new file mode 100644
index 0000000..94539dd
@@ -0,0 +1,9 @@
+SiFive HIFIVE UNLEASHED BOARD
+M:	Paul Walmsley <[email protected]>
+M:	Palmer Dabbelt <[email protected]>
+M:	Anup Patel <[email protected]>
+M:	Atish Patra <[email protected]>
+S:	Maintained
+F:	board/sifive/hifive_unleashed/
+F:	include/configs/hifive_unleashed.h
+F:	configs/hifive_unleashed_defconfig
board/sifive/hifive_unleashed/Makefile new file +5 -0
new file mode 100644
index 0000000..6e1862c
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (c) 2019 Western Digital Corporation or its affiliates.
+
+obj-y	+= fu540.o
board/sifive/hifive_unleashed/fu540.c new file +139 -0

139 lines not on this page · raw message

configs/hifive_unleashed_defconfig new file +11 -0
new file mode 100644
index 0000000..5a3b421
@@ -0,0 +1,11 @@
+CONFIG_RISCV=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_TARGET_SIFIVE_HIFIVE_UNLEASHED=y
+CONFIG_ARCH_RV64I=y
+CONFIG_RISCV_SMODE=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_DISPLAY_CPUINFO=y
+CONFIG_DISPLAY_BOARDINFO=y
+CONFIG_MISC_INIT_R=y
+CONFIG_OF_PRIOR_STAGE=y
configs/sifive_fu540_defconfig deleted +0 -11
deleted file mode 100644
index f192037..0000000
@@ -1,11 +0,0 @@
-CONFIG_RISCV=y
-CONFIG_NR_DRAM_BANKS=1
-CONFIG_TARGET_SIFIVE_FU540=y
-CONFIG_ARCH_RV64I=y
-CONFIG_RISCV_SMODE=y
-CONFIG_DISTRO_DEFAULTS=y
-CONFIG_FIT=y
-CONFIG_DISPLAY_CPUINFO=y
-CONFIG_DISPLAY_BOARDINFO=y
-CONFIG_MISC_INIT_R=y
-CONFIG_OF_PRIOR_STAGE=y
include/configs/hifive_unleashed.h new file +47 -0

47 lines not on this page · raw message

include/configs/sifive-fu540.h deleted +0 -47

47 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Hi,

Quoted 4 lines · Sagar Shrikant Kadam

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

Can you please explain why these changes are needed? It looks that the changes are only to rename the "generic" cpu name to "u54-mc", and rename the board name "fu540" to "hifive_unleashed"?

This breaks the QEMU virt boards.

Quoted 22 lines
---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
Quoted 8 lines
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c

It looks that you did not use "git mv" command.

Quoted 10 lines
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
Quoted 9 lines
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h

Regards,
Bin

#3 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Hello Bin,

Quoted 6 lines · Bin Meng

Hi,

Quoted 1 line · Sagar Shrikant Kadam
Quoted 8 lines
Quoted 3 lines

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

Can you please explain why these changes are needed? It looks that the changes are only to rename the "generic" cpu name to "u54-mc", and rename the board name "fu540" to "hifive_unleashed"?

This patch is intended to update the naming convention which U-boot mentions in doc/README.kconfig. As we know that FU540-C000 has a U54-MC CPU core, I thought of naming it as u54-mc and board name from fu540 to hifive_unleashed which is the
actual case.

Quoted 2 lines

This breaks the QEMU virt boards.

Unfortunately yes. Hence I raised a request in the cover letter for suggestions accordingly.

Quoted 31 lines
Quoted 22 lines
---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
Quoted 8 lines
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
Quoted 2 lines

It looks that you did not use "git mv" command.

I do remember using "git mv" here. Probably adding '-M' (detect renames) switch to git format-patch would have helped to include the renamed files instead of delete and create information. Next time I will ensure to include it. Thanks for pointing this.

BR,
Sagar Kadam

Quoted 22 lines
Quoted 10 lines
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
Quoted 9 lines
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h

Regards,
Bin

#4 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Quoted 1 line · Sagar Kadam

I do remember using "git mv" here.

git mv is identical to git rm + git add. A git repository has no concept of file renames.

Andreas.

Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#5 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Hi Andreas,

Quoted 10 lines · Andreas Schwab
Quoted 1 line · Sagar Kadam

I do remember using "git mv" here.

git mv is identical to git rm + git add. A git repository has no concept of file renames.

Andreas.

Thanks, for clarifying.

Regards,
Sagar Kadam

Quoted 4 lines

--
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

#6 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

In reply to Sagar Shrikant Kadam
Quoted 44 lines · Sagar Shrikant Kadam

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
Quoted 9 lines
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h

I agree with Bin's concerns.

Please don't rename generic CPU support under arch/riscv

We should think long-term here. If every SOC vendor starts adding their CPU support directory under arch/riscv then U-Boot RISC port will be eventually difficult to manage and we will also have duplicate code across various CPU support.

IMHO, we should avoid adding new CPU support under arch/riscv as much as possible. We can call weak functions from generic CPU support and board support code can implement it. We should only add new CPU support under arch/riscv when we are not able to re-use generic CPU support.

Other board support renaming is fine but there is lot of documentation in U-Boot, OpenSBI and other places which needs to be also updated.

Regards,
Anup

#7 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Hello Anup,

Quoted 66 lines · Anup Patel
Quoted 44 lines · Sagar Shrikant Kadam

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
Quoted 9 lines
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h

I agree with Bin's concerns.

Please don't rename generic CPU support under arch/riscv

We should think long-term here. If every SOC vendor starts adding their CPU support directory under arch/riscv then U-Boot RISC port will be eventually difficult to manage and we will also have duplicate code across various CPU support.

Quoted 6 lines

IMHO, we should avoid adding new CPU support under arch/riscv as much as possible. We can call weak functions from generic CPU support and board support code can implement it. We should only add new CPU support under arch/riscv when we are not able to re-use generic CPU support.

Yes, your points are valid. I am Ok with it.
My intent here was that as the support for riscv in U-boot is in its early stages
and doing it now would be better as minimum changes will be required and going ahead as other CPU vendors introduce their CPU under arch/riscv/ we could isolate a generic CPU code as it grows.

Quoted 2 lines

Other board support renaming is fine but there is lot of documentation

If board support renaming is fine. Shall I submit another patch excluding the CPU
changes?

Thanks & BR,
Sagar Kadam

Quoted 6 lines

in U-Boot, OpenSBI and other places which needs to be also updated.

Regards,
Anup

#8 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Quoted 77 lines · Sagar Kadam

Hello Anup,

Quoted 66 lines · Anup Patel
Quoted 44 lines · Sagar Shrikant Kadam

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
Quoted 9 lines
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h

I agree with Bin's concerns.

Please don't rename generic CPU support under arch/riscv

We should think long-term here. If every SOC vendor starts adding their CPU support directory under arch/riscv then U-Boot RISC port will be eventually difficult to manage and we will also have duplicate code across various CPU support.

Quoted 6 lines

IMHO, we should avoid adding new CPU support under arch/riscv as much as possible. We can call weak functions from generic CPU support and board support code can implement it. We should only add new CPU support under arch/riscv when we are not able to re-use generic CPU support.

Quoted 6 lines

Yes, your points are valid. I am Ok with it.
My intent here was that as the support for riscv in U-boot is in its early stages
and doing it now would be better as minimum changes will be required and going ahead as other CPU vendors introduce their CPU under arch/riscv/ we could isolate a generic CPU code as it grows.

Thanks.

Let's try to make arch/riscv/cpu/generic extensible from start itself so that it is relatively easy to fit newer RISC-V SOCs and boards.

Quoted 6 lines
Quoted 3 lines

Other board support renaming is fine but there is lot of documentation

If board support renaming is fine. Shall I submit another patch excluding the CPU
changes?

Yes, please send another revision.

Also have consider updating U-Boot and OpenSBI documentation as separate patches.

Regards,
Anup

#9 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Hi Anup,

Quoted 86 lines · Anup Patel
Quoted 77 lines · Sagar Kadam

Hello Anup,

Quoted 66 lines · Anup Patel
Quoted 44 lines · Sagar Shrikant Kadam

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
Quoted 9 lines
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h

I agree with Bin's concerns.

Please don't rename generic CPU support under arch/riscv

We should think long-term here. If every SOC vendor starts adding their CPU support directory under arch/riscv then U-Boot RISC port will be eventually difficult to manage and we will also have duplicate code across various CPU support.

Quoted 6 lines

IMHO, we should avoid adding new CPU support under arch/riscv as much as possible. We can call weak functions from generic CPU support and board support code can implement it. We should only add new CPU support under arch/riscv when we are not able to re-use generic CPU support.

Quoted 6 lines

Yes, your points are valid. I am Ok with it.
My intent here was that as the support for riscv in U-boot is in its early stages
and doing it now would be better as minimum changes will be required and going ahead as other CPU vendors introduce their CPU under arch/riscv/ we could isolate a generic CPU code as it grows.

Quoted 5 lines

Thanks.

Let's try to make arch/riscv/cpu/generic extensible from start itself so that it is relatively easy to fit newer RISC-V SOCs and boards.

Thanks. So can I assume that we agree on adding new CPU support under arch/riscv. Will provide a new patch for the same.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Other board support renaming is fine but there is lot of documentation

If board support renaming is fine. Shall I submit another patch excluding the CPU
changes?

Yes, please send another revision.

Yes, I will do send another revision.

Quoted 3 lines

Also have consider updating U-Boot and OpenSBI documentation as separate patches.

Yes, I will also update the docs accordingly.

Thanks & BR,
Sagar Kadam

Quoted 2 lines

Regards,
Anup

#10 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Quoted 90 lines · Sagar Kadam

Hi Anup,

Quoted 86 lines · Anup Patel
Quoted 83 lines · Sagar Kadam

Hello Anup,

Quoted 66 lines · Anup Patel
Quoted 44 lines · Sagar Shrikant Kadam

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
Quoted 9 lines
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h

I agree with Bin's concerns.

Please don't rename generic CPU support under arch/riscv

We should think long-term here. If every SOC vendor starts adding their CPU support directory under arch/riscv then U-Boot RISC port will be eventually difficult to manage and we will also have duplicate code across various CPU support.

Quoted 6 lines

IMHO, we should avoid adding new CPU support under arch/riscv as much as possible. We can call weak functions from generic CPU support and board support code can implement it. We should only add new CPU support under arch/riscv when we are not able to re-use generic CPU support.

Yes, your points are valid. I am Ok with it.
My intent here was that as the support for riscv in U-boot is in its early stages
and doing it now would be better as minimum changes will be required and going ahead as other CPU vendors introduce their CPU under arch/riscv/ we could isolate a generic CPU code as it grows.

Quoted 7 lines
Quoted 5 lines

Thanks.

Let's try to make arch/riscv/cpu/generic extensible from start itself so that it is relatively easy to fit newer RISC-V SOCs and boards.

Thanks. So can I assume that we agree on adding new CPU support under arch/riscv. Will provide a new patch for the same.

I think you misunderstood my previous comment.

We should use the generic CPU support from start itself and promote use of generic CPU support as much as possible.

Adding specific CPU support under arch/riscv will require strong justification about why generic CPU support is not suitable for particular SOC.

Regards,
Anup

Quoted 20 lines
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Other board support renaming is fine but there is lot of documentation

If board support renaming is fine. Shall I submit another patch excluding the CPU
changes?

Yes, please send another revision.

Yes, I will do send another revision.

Quoted 3 lines

Also have consider updating U-Boot and OpenSBI documentation as separate patches.

Yes, I will also update the docs accordingly.

Thanks & BR,
Sagar Kadam

Quoted 2 lines

Regards,
Anup

#11 lore raw

PATCH 1/1 sifive: riscv: update Hifive Unleashed configuration infrastructure

Hi Anup,

Quoted 97 lines · Anup Patel
Quoted 95 lines · Sagar Kadam

Hi Anup,

Quoted 91 lines · Anup Patel
Quoted 77 lines · Sagar Kadam

Hello Anup,

Quoted 66 lines · Anup Patel
Quoted 44 lines · Sagar Shrikant Kadam

This patch aligns the current implementation of HiFive Unleashed board configuration framework with the one described in doc/README.kconfig.

---
 arch/riscv/Kconfig                           |   6 +-
 arch/riscv/cpu/generic/Kconfig               |  12 ---
 arch/riscv/cpu/generic/Makefile              |   6 --
 arch/riscv/cpu/generic/cpu.c                 |  35 -------
 arch/riscv/cpu/generic/dram.c                |  37 -------
 arch/riscv/cpu/u54-mc/Kconfig                |  12 +++
 arch/riscv/cpu/u54-mc/Makefile               |   6 ++
 arch/riscv/cpu/u54-mc/cpu.c                  |  35 +++++++
 arch/riscv/cpu/u54-mc/dram.c                 |  37 +++++++
 arch/riscv/include/asm/arch-fu540-c000/clk.h |  14 +++
 arch/riscv/include/asm/arch-generic/clk.h    |  14 ---
 board/sifive/fu540/Kconfig                   |  49 ----------
 board/sifive/fu540/MAINTAINERS               |   9 --
 board/sifive/fu540/Makefile                  |   5 -
 board/sifive/fu540/fu540.c                   | 139 ---------------------------
 board/sifive/hifive_unleashed/Kconfig        |  52 ++++++++++
 board/sifive/hifive_unleashed/MAINTAINERS    |   9 ++
 board/sifive/hifive_unleashed/Makefile       |   5 +
 board/sifive/hifive_unleashed/fu540.c        | 139 +++++++++++++++++++++++++++
 configs/hifive_unleashed_defconfig           |  11 +++
 configs/sifive_fu540_defconfig               |  11 ---
 include/configs/hifive_unleashed.h           |  47 +++++++++
 include/configs/sifive-fu540.h               |  47 ---------
 23 files changed, 370 insertions(+), 367 deletions(-)
 delete mode 100644 arch/riscv/cpu/generic/Kconfig
 delete mode 100644 arch/riscv/cpu/generic/Makefile
 delete mode 100644 arch/riscv/cpu/generic/cpu.c
 delete mode 100644 arch/riscv/cpu/generic/dram.c
 create mode 100644 arch/riscv/cpu/u54-mc/Kconfig
 create mode 100644 arch/riscv/cpu/u54-mc/Makefile
 create mode 100644 arch/riscv/cpu/u54-mc/cpu.c
 create mode 100644 arch/riscv/cpu/u54-mc/dram.c
 create mode 100644 arch/riscv/include/asm/arch-fu540-c000/clk.h
 delete mode 100644 arch/riscv/include/asm/arch-generic/clk.h
 delete mode 100644 board/sifive/fu540/Kconfig
 delete mode 100644 board/sifive/fu540/MAINTAINERS
 delete mode 100644 board/sifive/fu540/Makefile
 delete mode 100644 board/sifive/fu540/fu540.c
Quoted 9 lines
 create mode 100644 board/sifive/hifive_unleashed/Kconfig
 create mode 100644 board/sifive/hifive_unleashed/MAINTAINERS
 create mode 100644 board/sifive/hifive_unleashed/Makefile
 create mode 100644 board/sifive/hifive_unleashed/fu540.c
 create mode 100644 configs/hifive_unleashed_defconfig
 delete mode 100644 configs/sifive_fu540_defconfig
 create mode 100644 include/configs/hifive_unleashed.h
 delete mode 100644 include/configs/sifive-fu540.h

I agree with Bin's concerns.

Please don't rename generic CPU support under arch/riscv

We should think long-term here. If every SOC vendor starts adding their CPU support directory under arch/riscv then U-Boot RISC port will be eventually difficult to manage and we will also have duplicate code across various CPU support.

Quoted 6 lines

IMHO, we should avoid adding new CPU support under arch/riscv as much as possible. We can call weak functions from generic CPU support and board support code can implement it. We should only add new CPU support under arch/riscv when we are not able to re-use generic CPU support.

Quoted 6 lines

Yes, your points are valid. I am Ok with it.
My intent here was that as the support for riscv in U-boot is in its early stages
and doing it now would be better as minimum changes will be required and going ahead as other CPU vendors introduce their CPU under arch/riscv/ we could isolate a generic CPU code as it grows.

Thanks.

Let's try to make arch/riscv/cpu/generic extensible from start itself so that it is relatively easy to fit newer RISC-V SOCs and boards.

Quoted 8 lines
Quoted 2 lines

Thanks. So can I assume that we agree on adding new CPU support under arch/riscv. Will provide a new patch for the same.

I think you misunderstood my previous comment.

We should use the generic CPU support from start itself and promote use of generic CPU support as much as possible.

Ohh, Ok, thanks for clarifying my assumption.

Quoted 6 lines

Adding specific CPU support under arch/riscv will require strong justification about why generic CPU support is not suitable for particular SOC.

Regards,
Anup

Regards,
Sagar

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Other board support renaming is fine but there is lot of documentation

If board support renaming is fine. Shall I submit another patch excluding the CPU
changes?

Yes, please send another revision.

Yes, I will do send another revision.

Quoted 3 lines

Also have consider updating U-Boot and OpenSBI documentation as separate patches.

Yes, I will also update the docs accordingly.

Thanks & BR,
Sagar Kadam

Quoted 2 lines

Regards,
Anup