Hello,
Following is a patch series that adds a SOC_SIFIVE config.
The purpose of this config is to group all the code specific to the SiFive
architecture such as device tree and platform drivers.
The initial thought/discussion came from [0].
[0] https://lore.kernel.org/linux-riscv/[email protected]/
Loys Ollivier (3):
arch: riscv: add config option for building SiFive's SoC resource
riscv: select SiFive platform drivers with SOC_SIFIVE
riscv: defconfig: enable SOC_SIFIVE
arch/riscv/Kconfig | 2 ++
arch/riscv/Kconfig.socs | 13 +++++++++++++
arch/riscv/boot/dts/sifive/Makefile | 2 +-
arch/riscv/configs/defconfig | 6 +-----
4 files changed, 17 insertions(+), 6 deletions(-)
create mode 100644 arch/riscv/Kconfig.socs
--
2.7.4
Enable SOC_SIFIVE so the default upstream config is bootable on the SiFive
Unleashed Board.
And have basic support for future boards based on the same SoC.
Signed-off-by: Loys Ollivier <[email protected]>
---
arch/riscv/configs/defconfig | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 4f02967e55de..6e3e37aa8fd1 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -12,6 +12,7 @@ CONFIG_CHECKPOINT_RESTORE=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_EXPERT=y
CONFIG_BPF_SYSCALL=y
+CONFIG_SOC_SIFIVE=y
CONFIG_SMP=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
@@ -49,8 +50,6 @@ CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
-CONFIG_SERIAL_SIFIVE=y
-CONFIG_SERIAL_SIFIVE_CONSOLE=y
CONFIG_HVC_RISCV_SBI=y
# CONFIG_PTP_1588_CLOCK is not set
CONFIG_DRM=y
@@ -66,9 +65,6 @@ CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_UAS=y
CONFIG_VIRTIO_MMIO=y
-CONFIG_CLK_SIFIVE=y
-CONFIG_CLK_SIFIVE_FU540_PRCI=y
-CONFIG_SIFIVE_PLIC=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_AUTOFS4_FS=y
--
2.7.4
Create a config option for building SiFive SoC specific resources
e.g. SiFive device tree, platform drivers...
Signed-off-by: Loys Ollivier <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
---
arch/riscv/Kconfig | 2 ++
arch/riscv/Kconfig.socs | 8 ++++++++
arch/riscv/boot/dts/sifive/Makefile | 2 +-
3 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 arch/riscv/Kconfig.socs
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index ee32c66e1af3..eace5857c9e9 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -94,6 +94,8 @@ config PGTABLE_LEVELS
default 3 if 64BIT
default 2
+source "arch/riscv/Kconfig.socs"
+
menu "Platform type"
choice
diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
new file mode 100644
index 000000000000..60dae1b5f276
--- /dev/null
+++ b/arch/riscv/Kconfig.socs
@@ -0,0 +1,8 @@
+menu "SoC selection"
+
+config SOC_SIFIVE
+ bool "SiFive SoCs"
+ help
+ This enables support for SiFive SoC platform hardware.
+
+endmenu
diff --git a/arch/riscv/boot/dts/sifive/Makefile b/arch/riscv/boot/dts/sifive/Makefile
index baaeef9efdcb..6d6189e6e4af 100644
--- a/arch/riscv/boot/dts/sifive/Makefile
+++ b/arch/riscv/boot/dts/sifive/Makefile
@@ -1,2 +1,2 @@
# SPDX-License-Identifier: GPL-2.0
-dtb-y += hifive-unleashed-a00.dtb
+dtb-$(CONFIG_SOC_SIFIVE) += hifive-unleashed-a00.dtb
--
2.7.4
On selection of SOC_SIFIVE select the corresponding platform drivers.
Signed-off-by: Loys Ollivier <[email protected]>
---
arch/riscv/Kconfig.socs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
index 60dae1b5f276..536c0ef4aee8 100644
--- a/arch/riscv/Kconfig.socs
+++ b/arch/riscv/Kconfig.socs
@@ -2,6 +2,11 @@ menu "SoC selection"
config SOC_SIFIVE
bool "SiFive SoCs"
+ select SERIAL_SIFIVE
+ select SERIAL_SIFIVE_CONSOLE
+ select CLK_SIFIVE
+ select CLK_SIFIVE_FU540_PRCI
+ select SIFIVE_PLIC
help
This enables support for SiFive SoC platform hardware.
--
2.7.4
On Mon, 17 Jun 2019 12:29:48 PDT (-0700), [email protected] wrote:
> Create a config option for building SiFive SoC specific resources
> e.g. SiFive device tree, platform drivers...
>
> Signed-off-by: Loys Ollivier <[email protected]>
> Cc: Paul Walmsley <[email protected]>
> Cc: Palmer Dabbelt <[email protected]>
> ---
> arch/riscv/Kconfig | 2 ++
> arch/riscv/Kconfig.socs | 8 ++++++++
> arch/riscv/boot/dts/sifive/Makefile | 2 +-
> 3 files changed, 11 insertions(+), 1 deletion(-)
> create mode 100644 arch/riscv/Kconfig.socs
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index ee32c66e1af3..eace5857c9e9 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -94,6 +94,8 @@ config PGTABLE_LEVELS
> default 3 if 64BIT
> default 2
>
> +source "arch/riscv/Kconfig.socs"
> +
> menu "Platform type"
>
> choice
> diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
> new file mode 100644
> index 000000000000..60dae1b5f276
> --- /dev/null
> +++ b/arch/riscv/Kconfig.socs
> @@ -0,0 +1,8 @@
> +menu "SoC selection"
> +
> +config SOC_SIFIVE
> + bool "SiFive SoCs"
> + help
> + This enables support for SiFive SoC platform hardware.
> +
> +endmenu
> diff --git a/arch/riscv/boot/dts/sifive/Makefile b/arch/riscv/boot/dts/sifive/Makefile
> index baaeef9efdcb..6d6189e6e4af 100644
> --- a/arch/riscv/boot/dts/sifive/Makefile
> +++ b/arch/riscv/boot/dts/sifive/Makefile
> @@ -1,2 +1,2 @@
> # SPDX-License-Identifier: GPL-2.0
> -dtb-y += hifive-unleashed-a00.dtb
> +dtb-$(CONFIG_SOC_SIFIVE) += hifive-unleashed-a00.dtb
Reviewed-by: Palmer Dabbelt <[email protected]>
On Mon, 17 Jun 2019 12:29:50 PDT (-0700), [email protected] wrote:
> Enable SOC_SIFIVE so the default upstream config is bootable on the SiFive
> Unleashed Board.
> And have basic support for future boards based on the same SoC.
>
> Signed-off-by: Loys Ollivier <[email protected]>
> ---
> arch/riscv/configs/defconfig | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index 4f02967e55de..6e3e37aa8fd1 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -12,6 +12,7 @@ CONFIG_CHECKPOINT_RESTORE=y
> CONFIG_BLK_DEV_INITRD=y
> CONFIG_EXPERT=y
> CONFIG_BPF_SYSCALL=y
> +CONFIG_SOC_SIFIVE=y
> CONFIG_SMP=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> @@ -49,8 +50,6 @@ CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_SERIAL_OF_PLATFORM=y
> CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
> -CONFIG_SERIAL_SIFIVE=y
> -CONFIG_SERIAL_SIFIVE_CONSOLE=y
> CONFIG_HVC_RISCV_SBI=y
> # CONFIG_PTP_1588_CLOCK is not set
> CONFIG_DRM=y
> @@ -66,9 +65,6 @@ CONFIG_USB_OHCI_HCD_PLATFORM=y
> CONFIG_USB_STORAGE=y
> CONFIG_USB_UAS=y
> CONFIG_VIRTIO_MMIO=y
> -CONFIG_CLK_SIFIVE=y
> -CONFIG_CLK_SIFIVE_FU540_PRCI=y
> -CONFIG_SIFIVE_PLIC=y
> CONFIG_EXT4_FS=y
> CONFIG_EXT4_FS_POSIX_ACL=y
> CONFIG_AUTOFS4_FS=y
Reviewed-by: Palmer Dabbelt <[email protected]>
On Mon, 17 Jun 2019 12:29:49 PDT (-0700), [email protected] wrote:
> On selection of SOC_SIFIVE select the corresponding platform drivers.
>
> Signed-off-by: Loys Ollivier <[email protected]>
> ---
> arch/riscv/Kconfig.socs | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
> index 60dae1b5f276..536c0ef4aee8 100644
> --- a/arch/riscv/Kconfig.socs
> +++ b/arch/riscv/Kconfig.socs
> @@ -2,6 +2,11 @@ menu "SoC selection"
>
> config SOC_SIFIVE
> bool "SiFive SoCs"
> + select SERIAL_SIFIVE
> + select SERIAL_SIFIVE_CONSOLE
> + select CLK_SIFIVE
> + select CLK_SIFIVE_FU540_PRCI
> + select SIFIVE_PLIC
> help
> This enables support for SiFive SoC platform hardware.
Reviewed-by: Palmer Dabbelt <[email protected]>
Hi Loys,
On Mon, 17 Jun 2019, Loys Ollivier wrote:
> Following is a patch series that adds a SOC_SIFIVE config.
> The purpose of this config is to group all the code specific to the SiFive
> architecture such as device tree and platform drivers.
>
> The initial thought/discussion came from [0].
>
> [0] https://lore.kernel.org/linux-riscv/[email protected]/
Thanks for giving us a good start here. Queued for v5.3 with Palmer's
Reviewed-by:s.
- Paul