2019-06-25 22:57:46

by Atish Patra

[permalink] [raw]
Subject: [PATCH] RISC-V: defconfig: enable MMC & SPI for RISC-V

Currently, riscv upstream defconfig doesn't let you boot
through userspace if rootfs is on the SD card.

Let's enable MMC & SPI drivers as well so that one can boot
to the user space using default config in upstream kernel.

Signed-off-by: Atish Patra <[email protected]>
---
arch/riscv/configs/defconfig | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 4f02967e55de..04944fb4fa7a 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -69,6 +69,7 @@ CONFIG_VIRTIO_MMIO=y
CONFIG_CLK_SIFIVE=y
CONFIG_CLK_SIFIVE_FU540_PRCI=y
CONFIG_SIFIVE_PLIC=y
+CONFIG_SPI_SIFIVE=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_AUTOFS4_FS=y
@@ -84,4 +85,8 @@ CONFIG_ROOT_NFS=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_PRINTK_TIME=y
+CONFIG_SPI=y
+CONFIG_MMC_SPI=y
+CONFIG_MMC=y
+CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_RCU_TRACE is not set
--
2.21.0


2019-06-26 00:00:42

by Troy Benjegerdes

[permalink] [raw]
Subject: Re: [PATCH] RISC-V: defconfig: enable MMC & SPI for RISC-V



> On Jun 25, 2019, at 5:56 PM, Atish Patra <[email protected]> wrote:
>
> Currently, riscv upstream defconfig doesn't let you boot
> through userspace if rootfs is on the SD card.
>
> Let's enable MMC & SPI drivers as well so that one can boot
> to the user space using default config in upstream kernel.
>
> Signed-off-by: Atish Patra <[email protected]>
> ---
> arch/riscv/configs/defconfig | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index 4f02967e55de..04944fb4fa7a 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -69,6 +69,7 @@ CONFIG_VIRTIO_MMIO=y
> CONFIG_CLK_SIFIVE=y
> CONFIG_CLK_SIFIVE_FU540_PRCI=y
> CONFIG_SIFIVE_PLIC=y
> +CONFIG_SPI_SIFIVE=y
> CONFIG_EXT4_FS=y
> CONFIG_EXT4_FS_POSIX_ACL=y
> CONFIG_AUTOFS4_FS=y
> @@ -84,4 +85,8 @@ CONFIG_ROOT_NFS=y
> CONFIG_CRYPTO_USER_API_HASH=y
> CONFIG_CRYPTO_DEV_VIRTIO=y
> CONFIG_PRINTK_TIME=y
> +CONFIG_SPI=y
> +CONFIG_MMC_SPI=y
> +CONFIG_MMC=y
> +CONFIG_DEVTMPFS_MOUNT=y
> # CONFIG_RCU_TRACE is not set
> --
> 2.21.0

While we are doing this, can we add and test the /dev/mtd device?

I tried adding the following but I am missing something

CONFIG_MTD=y
CONFIG_MTD_OF_PARTS=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK_RO=y
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y

and I see this in the log

[ 1.106626] m25p80 spi0.0: unrecognized JEDEC id bytes: 9d 70 19 9d 70 19


2019-06-26 08:01:22

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH] RISC-V: defconfig: enable MMC & SPI for RISC-V

On Tue, 25 Jun 2019 15:56:36 PDT (-0700), Atish Patra wrote:
> Currently, riscv upstream defconfig doesn't let you boot
> through userspace if rootfs is on the SD card.
>
> Let's enable MMC & SPI drivers as well so that one can boot
> to the user space using default config in upstream kernel.
>
> Signed-off-by: Atish Patra <[email protected]>
> ---
> arch/riscv/configs/defconfig | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index 4f02967e55de..04944fb4fa7a 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -69,6 +69,7 @@ CONFIG_VIRTIO_MMIO=y
> CONFIG_CLK_SIFIVE=y
> CONFIG_CLK_SIFIVE_FU540_PRCI=y
> CONFIG_SIFIVE_PLIC=y
> +CONFIG_SPI_SIFIVE=y
> CONFIG_EXT4_FS=y
> CONFIG_EXT4_FS_POSIX_ACL=y
> CONFIG_AUTOFS4_FS=y
> @@ -84,4 +85,8 @@ CONFIG_ROOT_NFS=y
> CONFIG_CRYPTO_USER_API_HASH=y
> CONFIG_CRYPTO_DEV_VIRTIO=y
> CONFIG_PRINTK_TIME=y
> +CONFIG_SPI=y
> +CONFIG_MMC_SPI=y
> +CONFIG_MMC=y
> +CONFIG_DEVTMPFS_MOUNT=y
> # CONFIG_RCU_TRACE is not set

Reviewed-by: Palmer Dabbelt <[email protected]>

2019-06-26 16:02:17

by Paul Walmsley

[permalink] [raw]
Subject: Re: [PATCH] RISC-V: defconfig: enable MMC & SPI for RISC-V

On Tue, 25 Jun 2019, Atish Patra wrote:

> Currently, riscv upstream defconfig doesn't let you boot
> through userspace if rootfs is on the SD card.
>
> Let's enable MMC & SPI drivers as well so that one can boot
> to the user space using default config in upstream kernel.
>
> Signed-off-by: Atish Patra <[email protected]>

Thanks. The patch also enables CONFIG_DEVTMPFS_MOUNT, but doesn't mention
it, so the following is what I've queued for v5.2-rc. Let me know if you
object to it.


- Paul


From: Atish Patra <[email protected]>
Date: Tue, 25 Jun 2019 15:56:36 -0700
Subject: [PATCH] RISC-V: defconfig: enable MMC & SPI for RISC-V

Currently, riscv upstream defconfig doesn't let you boot
through userspace if rootfs is on the SD card.

Let's enable MMC & SPI drivers as well so that one can boot
to the user space using default config in upstream kernel.

While here, enable automatic mounting of devtmpfs to simplify
kernel testing with minimal root filesystems. (pjw)

Signed-off-by: Atish Patra <[email protected]>
Reviewed-by: Palmer Dabbelt <[email protected]>
[[email protected]: mention the DEVTMPFS_MOUNT change in the
patch description]
Signed-off-by: Paul Walmsley <[email protected]>
---
arch/riscv/configs/defconfig | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 4f02967e55de..04944fb4fa7a 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -69,6 +69,7 @@ CONFIG_VIRTIO_MMIO=y
CONFIG_CLK_SIFIVE=y
CONFIG_CLK_SIFIVE_FU540_PRCI=y
CONFIG_SIFIVE_PLIC=y
+CONFIG_SPI_SIFIVE=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_AUTOFS4_FS=y
@@ -84,4 +85,8 @@ CONFIG_ROOT_NFS=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_PRINTK_TIME=y
+CONFIG_SPI=y
+CONFIG_MMC_SPI=y
+CONFIG_MMC=y
+CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_RCU_TRACE is not set
--
2.20.1

2019-06-26 17:22:26

by Atish Patra

[permalink] [raw]
Subject: Re: [PATCH] RISC-V: defconfig: enable MMC & SPI for RISC-V

On 6/26/19 9:00 AM, Paul Walmsley wrote:
> On Tue, 25 Jun 2019, Atish Patra wrote:
>
>> Currently, riscv upstream defconfig doesn't let you boot
>> through userspace if rootfs is on the SD card.
>>
>> Let's enable MMC & SPI drivers as well so that one can boot
>> to the user space using default config in upstream kernel.
>>
>> Signed-off-by: Atish Patra <[email protected]>
>
> Thanks. The patch also enables CONFIG_DEVTMPFS_MOUNT, but doesn't mention
> it, so the following is what I've queued for v5.2-rc. Let me know if you
> object to it.
>

Apologies for forgetting about CONFIG_DEVTMPFS_MOUNT in the commit text.
Thanks for the update.

>
> - Paul
>
>
> From: Atish Patra <[email protected]>
> Date: Tue, 25 Jun 2019 15:56:36 -0700
> Subject: [PATCH] RISC-V: defconfig: enable MMC & SPI for RISC-V
>
> Currently, riscv upstream defconfig doesn't let you boot
> through userspace if rootfs is on the SD card.
>
> Let's enable MMC & SPI drivers as well so that one can boot
> to the user space using default config in upstream kernel.
>
> While here, enable automatic mounting of devtmpfs to simplify
> kernel testing with minimal root filesystems. (pjw)
>
> Signed-off-by: Atish Patra <[email protected]>
> Reviewed-by: Palmer Dabbelt <[email protected]>
> [[email protected]: mention the DEVTMPFS_MOUNT change in the
> patch description]
> Signed-off-by: Paul Walmsley <[email protected]>
> ---
> arch/riscv/configs/defconfig | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index 4f02967e55de..04944fb4fa7a 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -69,6 +69,7 @@ CONFIG_VIRTIO_MMIO=y
> CONFIG_CLK_SIFIVE=y
> CONFIG_CLK_SIFIVE_FU540_PRCI=y
> CONFIG_SIFIVE_PLIC=y
> +CONFIG_SPI_SIFIVE=y
> CONFIG_EXT4_FS=y
> CONFIG_EXT4_FS_POSIX_ACL=y
> CONFIG_AUTOFS4_FS=y
> @@ -84,4 +85,8 @@ CONFIG_ROOT_NFS=y
> CONFIG_CRYPTO_USER_API_HASH=y
> CONFIG_CRYPTO_DEV_VIRTIO=y
> CONFIG_PRINTK_TIME=y
> +CONFIG_SPI=y
> +CONFIG_MMC_SPI=y
> +CONFIG_MMC=y
> +CONFIG_DEVTMPFS_MOUNT=y
> # CONFIG_RCU_TRACE is not set
>


--
Regards,
Atish

2019-06-27 09:16:23

by Andreas Schwab

[permalink] [raw]
Subject: Re: [PATCH] RISC-V: defconfig: enable MMC & SPI for RISC-V

On Jun 25 2019, Troy Benjegerdes <[email protected]> wrote:

> and I see this in the log
>
> [ 1.106626] m25p80 spi0.0: unrecognized JEDEC id bytes: 9d 70 19 9d 70 19

You need the patchset "mtd: spi-nor: add support for is25wp256 spi-nor
flash".

Andreas.

--
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."