2019-06-17 19:30:25

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 0/3] riscv: add SOC_SIFIVE config for SiFive specific resource

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


2019-06-17 19:30:35

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 3/3] riscv: defconfig: enable SOC_SIFIVE

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

2019-06-17 19:30:46

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 1/3] arch: riscv: add config option for building SiFive's SoC resource

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

2019-06-17 19:31:51

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 2/3] riscv: select SiFive platform drivers with SOC_SIFIVE

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

2019-06-19 07:04:37

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH 1/3] arch: riscv: add config option for building SiFive's SoC resource

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]>

2019-06-19 07:04:52

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH 3/3] riscv: defconfig: enable SOC_SIFIVE

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]>

2019-06-19 07:06:28

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH 2/3] riscv: select SiFive platform drivers with SOC_SIFIVE

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]>

2019-06-28 03:11:22

by Paul Walmsley

[permalink] [raw]
Subject: Re: [PATCH 0/3] riscv: add SOC_SIFIVE config for SiFive specific resource

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