lkml.org 
[lkml]   [2020]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] riscv: defconfig: enable spi nor on Hifive Unleashed A00 board.
On Wed, May 6, 2020 at 9:26 AM Sagar Kadam <sagar.kadam@sifive.com> wrote:
>
> Hi Palmer,
>
> > -----Original Message-----
> > From: Palmer Dabbelt <palmer@dabbelt.com>
> > Sent: Wednesday, May 6, 2020 4:54 AM
> > To: Sagar Kadam <sagar.kadam@sifive.com>
> > Cc: tudor.ambarus@microchip.com; miquel.raynal@bootlin.com;
> > richard@nod.at; vigneshr@ti.com; Paul Walmsley
> > <paul.walmsley@sifive.com>; linux-riscv@lists.infradead.org; linux-
> > kernel@vger.kernel.org; linux-mtd@lists.infradead.org
> > Subject: RE: [PATCH 1/2] riscv: defconfig: enable spi nor on Hifive Unleashed
> > A00 board.
> >
> > [External Email] Do not click links or attachments unless you recognize the
> > sender and know the content is safe
> >
> > On Tue, 05 May 2020 00:18:45 PDT (-0700), sagar.kadam@sifive.com wrote:
> > > Hello Palmer,
> > >
> > >> -----Original Message-----
> > >> From: Palmer Dabbelt <palmer@dabbelt.com>
> > >> Sent: Tuesday, May 5, 2020 3:40 AM
> > >> To: Sagar Kadam <sagar.kadam@sifive.com>
> > >> Cc: tudor.ambarus@microchip.com; miquel.raynal@bootlin.com;
> > >> richard@nod.at; vigneshr@ti.com; Paul Walmsley
> > >> <paul.walmsley@sifive.com>; linux-riscv@lists.infradead.org; linux-
> > >> kernel@vger.kernel.org; linux-mtd@lists.infradead.org; Sagar Kadam
> > >> <sagar.kadam@sifive.com>
> > >> Subject: Re: [PATCH 1/2] riscv: defconfig: enable spi nor on Hifive
> > Unleashed
> > >> A00 board.
> > >>
> > >> [External Email] Do not click links or attachments unless you recognize
> > the
> > >> sender and know the content is safe
> > >>
> > >> On Thu, 30 Apr 2020 02:58:51 PDT (-0700), sagar.kadam@sifive.com
> > wrote:
> > >> > Enable MTD based SPI-NOR framework in order to use spi flash
> > available
> > >> > on HiFive Unleashed A00 board.
> > >> >
> > >> > Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
> > >> > ---
> > >> > arch/riscv/configs/defconfig | 2 ++
> > >> > 1 file changed, 2 insertions(+)
> > >> >
> > >> > diff --git a/arch/riscv/configs/defconfig
> > >> > b/arch/riscv/configs/defconfig index 4da4886..970580b 100644
> > >> > --- a/arch/riscv/configs/defconfig
> > >> > +++ b/arch/riscv/configs/defconfig
> > >> > @@ -80,6 +80,8 @@ CONFIG_USB_STORAGE=y CONFIG_USB_UAS=y
> > >> CONFIG_MMC=y
> > >> > CONFIG_MMC_SPI=y
> > >> > +CONFIG_MTD=y
> > >> > +CONFIG_MTD_SPI_NOR=y
> > >> > CONFIG_RTC_CLASS=y
> > >> > CONFIG_VIRTIO_PCI=y
> > >> > CONFIG_VIRTIO_BALLOON=y
> > >>
> > >> From the second patch's description I'm assuming that MTD still
> > functions
> > >> correctly without that change?
> > >
> > > Yes Palmer, the second patch is to enable QUAD write to nor flash..
> > > MTD function's correctly without second patch.
> > >
> > > Using the character interface (/dev/mtd0) mtd_utils (mtd_debug :
> > erase/read/write) work fine.
> > > We might require CONFIG_MTD_BLOCK, CONFIG_MTD_CMDLINE_PARTS
> > in order to use MTD partitioning.
> > > IMHO it can be at user's choice weather to use flash partitions or not, so I
> > have not enabled. Please let me
> > > know if I should enable these features as well.
> >
> > Looks like arm64 has these:
> >
> > arch/arm64/configs/defconfig:CONFIG_MTD=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_BLOCK=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_CFI=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_CFI_ADV_OPTIONS=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_CFI_INTELEXT=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_CFI_AMDSTD=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_CFI_STAA=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_PHYSMAP=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_PHYSMAP_OF=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_DATAFLASH=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_SST25L=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_RAW_NAND=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_NAND_DENALI_DT=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_NAND_MARVELL=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_NAND_FSL_IFC=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_NAND_QCOM=y
> > arch/arm64/configs/defconfig:CONFIG_MTD_SPI_NOR=y
> >
> > so I think we're good with just what you have here: MTD_BLOCK doesn't
> > seem that
> > useful, and the rest are drivers. That said, these (along with SPI and
> > SPI_SIFIVE) should really be in Kconfig.socs rather than defconfig. Can you
> > send a patch that does that?
> >
>
> Yes sure, I will send a V2 series, where SPI, SPI_SIFIVE, MTD,
> and MTD_SPI_NOR will be a part of Kconfig.socs.

We had build issues in past by selecting major driver subsystems
in Kconfig.socs

I suggest to select SPI_SIFIVE from Kconfig.socs and other
platform independent options should go in defconfig and
rv32_defconfig.

The general rule of thumb is to force select only required
drivers from Kconfig.socs.

Regards,
Anup

>
> Thanks & BR,
> Sagar Kadam
>
> > >
> > > To demonstrate a bit more with linux 5.7-rc3
> > >
> > > Specify on U-boot prompt:
> > > # setenv bootargs "root=/dev/ram rw console=ttySIF0
> > mtdparts=spi0.0:1024k(loader1),4096K(loader2),26M(rootfs)"
> > >
> > > After booting linux will enumerate mtd partitions:
> > > # cat /proc/mtd
> > > dev: size erasesize name
> > > mtd0: 00100000 00001000 "loader1"
> > > mtd1: 00400000 00001000 "loader2"
> > > mtd2: 01a00000 00001000 "rootfs"
> > >
> > > # cat /proc/partitions
> > > major minor #blocks name
> > > 31 0 1024 mtdblock0
> > > 31 1 4096 mtdblock1
> > > 31 2 26624 mtdblock2
> > >
> > > #Format mtdblock2 with mkfs.ext3/4 and mount results in
> > > # mkfs.ext3 /dev/mtdblock2
> > > mke2fs 1.44.5 (15-Dec-2018)
> > > /dev/mtdblock2 contains a ext3 file system
> > > last mounted on /mnt on Thu Jan 1 00:00:14 1970
> > > Proceed anyway? (y,N) y
> > > Creating filesystem with 26624 1k blocks and 6656 inodes
> > > Filesystem UUID: 1b09252d-e313-430c-9ecb-79b0cef003ca
> > > Superblock backups stored on blocks:
> > > 8193, 24577
> > >
> > > Allocating group tables: done
> > > Writing inode tables: done
> > > Creating journal (1024 blocks): done
> > > Writing superblocks and filesystem accounting information: done
> > >
> > > # mount
> > > none on / type rootfs (rw)
> > > proc on /proc type proc (rw,relatime)
> > > devpts on /dev/pts type devpts
> > (rw,relatime,gid=5,mode=620,ptmxmode=666)
> > > tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
> > > tmpfs on /tmp type tmpfs (rw,relatime)
> > > tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
> > > sysfs on /sys type sysfs (rw,relatime)
> > > /dev/mtdblock2 on /mnt type ext3 (rw,relatime)
> > >
> > > Thanks & BR,
> > > Sagar Kadam
>

\
 
 \ /
  Last update: 2020-05-06 07:11    [W:0.259 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site