All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency
@ 2021-08-07  5:00 Bin Meng
  2021-08-07  5:00 ` [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t Bin Meng
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Bin Meng @ 2021-08-07  5:00 UTC (permalink / raw)
  To: Stefan Roese, u-boot

The DM version CFI flash driver is in driver/mtd/cfi_flash.c, which
only gets built when FLASH_CFI_DRIVER is on. If CFI_FLASH is on but
FLASH_CFI_DRIVER is not, nothing is enabled at all.

Fix this dependency by selecting FLASH_CFI_DRIVER when CFI_FLASH is
enabled.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/mtd/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index ad50c5e870..b303fabe0f 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -42,6 +42,7 @@ config FLASH_CFI_DRIVER
 config CFI_FLASH
 	bool "Enable Driver Model for CFI Flash driver"
 	depends on DM_MTD
+	select FLASH_CFI_DRIVER
 	help
 	  The Common Flash Interface specification was developed by Intel,
 	  AMD and other flash manufactures. It provides a universal method
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t
  2021-08-07  5:00 [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency Bin Meng
@ 2021-08-07  5:00 ` Bin Meng
  2021-08-11  8:34   ` Stefan Roese
  2021-08-11 10:45   ` Stefan Roese
  2021-08-07  5:00 ` [PATCH 3/3] riscv: qemu: Enable MTD NOR flash support Bin Meng
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Bin Meng @ 2021-08-07  5:00 UTC (permalink / raw)
  To: Stefan Roese, u-boot

Those embers wrapped with CONFIG_SYS_FLASH_CFI in struct flash_info_t
are unconditionally used in the cfi_flash.c driver.

Drop the #ifdefs in the definition of flash_info_t.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 include/flash.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/flash.h b/include/flash.h
index 42b18a6047..f3959f5012 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -21,7 +21,6 @@ typedef struct {
 	ulong	flash_id;		/* combined device & manufacturer code	*/
 	ulong	start[CONFIG_SYS_MAX_FLASH_SECT];   /* virtual sector start address */
 	uchar	protect[CONFIG_SYS_MAX_FLASH_SECT]; /* sector protection status	*/
-#ifdef CONFIG_SYS_FLASH_CFI
 	uchar	portwidth;		/* the width of the port		*/
 	uchar	chipwidth;		/* the width of the chip		*/
 	uchar	chip_lsb;		/* extra Least Significant Bit in the */
@@ -45,7 +44,6 @@ typedef struct {
 	ulong   addr_unlock2;		/* unlock address 2 for AMD flash roms  */
 	uchar   sr_supported;		/* status register supported            */
 	const char *name;		/* human-readable name	                */
-#endif
 #ifdef CONFIG_DM_MTD
 	struct mtd_info *mtd;
 #endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] riscv: qemu: Enable MTD NOR flash support
  2021-08-07  5:00 [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency Bin Meng
  2021-08-07  5:00 ` [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t Bin Meng
@ 2021-08-07  5:00 ` Bin Meng
  2021-08-11  8:34   ` Stefan Roese
  2021-08-11 10:45   ` Stefan Roese
  2021-08-11  8:33 ` [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency Stefan Roese
  2021-08-11 10:44 ` Stefan Roese
  3 siblings, 2 replies; 9+ messages in thread
From: Bin Meng @ 2021-08-07  5:00 UTC (permalink / raw)
  To: Stefan Roese, u-boot

Enable support to the 2 NOR flashes on the QEMU RISC-V virt machine.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 board/emulation/qemu-riscv/Kconfig | 2 ++
 include/configs/qemu-riscv.h       | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
index 0818048ba6..a7de82d3bf 100644
--- a/board/emulation/qemu-riscv/Kconfig
+++ b/board/emulation/qemu-riscv/Kconfig
@@ -64,5 +64,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	imply VIRTIO_PCI
 	imply VIRTIO_NET
 	imply VIRTIO_BLK
+	imply MTD_NOR_FLASH
+	imply CFI_FLASH
 
 endif
diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
index 5291de83f8..bbeea96e27 100644
--- a/include/configs/qemu-riscv.h
+++ b/include/configs/qemu-riscv.h
@@ -29,6 +29,8 @@
 
 #define CONFIG_STANDALONE_LOAD_ADDR	0x80200000
 
+#define CONFIG_SYS_MAX_FLASH_BANKS	2
+
 #define RISCV_MMODE_TIMERBASE		0x2000000
 #define RISCV_MMODE_TIMER_FREQ		1000000
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency
  2021-08-07  5:00 [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency Bin Meng
  2021-08-07  5:00 ` [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t Bin Meng
  2021-08-07  5:00 ` [PATCH 3/3] riscv: qemu: Enable MTD NOR flash support Bin Meng
@ 2021-08-11  8:33 ` Stefan Roese
  2021-08-11 10:44 ` Stefan Roese
  3 siblings, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2021-08-11  8:33 UTC (permalink / raw)
  To: Bin Meng, u-boot

On 07.08.21 07:00, Bin Meng wrote:
> The DM version CFI flash driver is in driver/mtd/cfi_flash.c, which
> only gets built when FLASH_CFI_DRIVER is on. If CFI_FLASH is on but
> FLASH_CFI_DRIVER is not, nothing is enabled at all.
> 
> Fix this dependency by selecting FLASH_CFI_DRIVER when CFI_FLASH is
> enabled.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
> 
>   drivers/mtd/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
> index ad50c5e870..b303fabe0f 100644
> --- a/drivers/mtd/Kconfig
> +++ b/drivers/mtd/Kconfig
> @@ -42,6 +42,7 @@ config FLASH_CFI_DRIVER
>   config CFI_FLASH
>   	bool "Enable Driver Model for CFI Flash driver"
>   	depends on DM_MTD
> +	select FLASH_CFI_DRIVER
>   	help
>   	  The Common Flash Interface specification was developed by Intel,
>   	  AMD and other flash manufactures. It provides a universal method
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t
  2021-08-07  5:00 ` [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t Bin Meng
@ 2021-08-11  8:34   ` Stefan Roese
  2021-08-11 10:45   ` Stefan Roese
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2021-08-11  8:34 UTC (permalink / raw)
  To: Bin Meng, u-boot

On 07.08.21 07:00, Bin Meng wrote:
> Those embers wrapped with CONFIG_SYS_FLASH_CFI in struct flash_info_t
> are unconditionally used in the cfi_flash.c driver.
> 
> Drop the #ifdefs in the definition of flash_info_t.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
> 
>   include/flash.h | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/include/flash.h b/include/flash.h
> index 42b18a6047..f3959f5012 100644
> --- a/include/flash.h
> +++ b/include/flash.h
> @@ -21,7 +21,6 @@ typedef struct {
>   	ulong	flash_id;		/* combined device & manufacturer code	*/
>   	ulong	start[CONFIG_SYS_MAX_FLASH_SECT];   /* virtual sector start address */
>   	uchar	protect[CONFIG_SYS_MAX_FLASH_SECT]; /* sector protection status	*/
> -#ifdef CONFIG_SYS_FLASH_CFI
>   	uchar	portwidth;		/* the width of the port		*/
>   	uchar	chipwidth;		/* the width of the chip		*/
>   	uchar	chip_lsb;		/* extra Least Significant Bit in the */
> @@ -45,7 +44,6 @@ typedef struct {
>   	ulong   addr_unlock2;		/* unlock address 2 for AMD flash roms  */
>   	uchar   sr_supported;		/* status register supported            */
>   	const char *name;		/* human-readable name	                */
> -#endif
>   #ifdef CONFIG_DM_MTD
>   	struct mtd_info *mtd;
>   #endif
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] riscv: qemu: Enable MTD NOR flash support
  2021-08-07  5:00 ` [PATCH 3/3] riscv: qemu: Enable MTD NOR flash support Bin Meng
@ 2021-08-11  8:34   ` Stefan Roese
  2021-08-11 10:45   ` Stefan Roese
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2021-08-11  8:34 UTC (permalink / raw)
  To: Bin Meng, u-boot

On 07.08.21 07:00, Bin Meng wrote:
> Enable support to the 2 NOR flashes on the QEMU RISC-V virt machine.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
> 
>   board/emulation/qemu-riscv/Kconfig | 2 ++
>   include/configs/qemu-riscv.h       | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
> index 0818048ba6..a7de82d3bf 100644
> --- a/board/emulation/qemu-riscv/Kconfig
> +++ b/board/emulation/qemu-riscv/Kconfig
> @@ -64,5 +64,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
>   	imply VIRTIO_PCI
>   	imply VIRTIO_NET
>   	imply VIRTIO_BLK
> +	imply MTD_NOR_FLASH
> +	imply CFI_FLASH
>   
>   endif
> diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
> index 5291de83f8..bbeea96e27 100644
> --- a/include/configs/qemu-riscv.h
> +++ b/include/configs/qemu-riscv.h
> @@ -29,6 +29,8 @@
>   
>   #define CONFIG_STANDALONE_LOAD_ADDR	0x80200000
>   
> +#define CONFIG_SYS_MAX_FLASH_BANKS	2
> +
>   #define RISCV_MMODE_TIMERBASE		0x2000000
>   #define RISCV_MMODE_TIMER_FREQ		1000000
>   
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency
  2021-08-07  5:00 [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency Bin Meng
                   ` (2 preceding siblings ...)
  2021-08-11  8:33 ` [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency Stefan Roese
@ 2021-08-11 10:44 ` Stefan Roese
  3 siblings, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2021-08-11 10:44 UTC (permalink / raw)
  To: Bin Meng, u-boot

On 07.08.21 07:00, Bin Meng wrote:
> The DM version CFI flash driver is in driver/mtd/cfi_flash.c, which
> only gets built when FLASH_CFI_DRIVER is on. If CFI_FLASH is on but
> FLASH_CFI_DRIVER is not, nothing is enabled at all.
> 
> Fix this dependency by selecting FLASH_CFI_DRIVER when CFI_FLASH is
> enabled.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot-cfi-flash/master

Thanks,
Stefan

> ---
> 
>   drivers/mtd/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
> index ad50c5e870..b303fabe0f 100644
> --- a/drivers/mtd/Kconfig
> +++ b/drivers/mtd/Kconfig
> @@ -42,6 +42,7 @@ config FLASH_CFI_DRIVER
>   config CFI_FLASH
>   	bool "Enable Driver Model for CFI Flash driver"
>   	depends on DM_MTD
> +	select FLASH_CFI_DRIVER
>   	help
>   	  The Common Flash Interface specification was developed by Intel,
>   	  AMD and other flash manufactures. It provides a universal method
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t
  2021-08-07  5:00 ` [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t Bin Meng
  2021-08-11  8:34   ` Stefan Roese
@ 2021-08-11 10:45   ` Stefan Roese
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2021-08-11 10:45 UTC (permalink / raw)
  To: Bin Meng, u-boot

On 07.08.21 07:00, Bin Meng wrote:
> Those embers wrapped with CONFIG_SYS_FLASH_CFI in struct flash_info_t
> are unconditionally used in the cfi_flash.c driver.
> 
> Drop the #ifdefs in the definition of flash_info_t.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot-cfi-flash/master

Thanks,
Stefan

> ---
> 
>   include/flash.h | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/include/flash.h b/include/flash.h
> index 42b18a6047..f3959f5012 100644
> --- a/include/flash.h
> +++ b/include/flash.h
> @@ -21,7 +21,6 @@ typedef struct {
>   	ulong	flash_id;		/* combined device & manufacturer code	*/
>   	ulong	start[CONFIG_SYS_MAX_FLASH_SECT];   /* virtual sector start address */
>   	uchar	protect[CONFIG_SYS_MAX_FLASH_SECT]; /* sector protection status	*/
> -#ifdef CONFIG_SYS_FLASH_CFI
>   	uchar	portwidth;		/* the width of the port		*/
>   	uchar	chipwidth;		/* the width of the chip		*/
>   	uchar	chip_lsb;		/* extra Least Significant Bit in the */
> @@ -45,7 +44,6 @@ typedef struct {
>   	ulong   addr_unlock2;		/* unlock address 2 for AMD flash roms  */
>   	uchar   sr_supported;		/* status register supported            */
>   	const char *name;		/* human-readable name	                */
> -#endif
>   #ifdef CONFIG_DM_MTD
>   	struct mtd_info *mtd;
>   #endif
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] riscv: qemu: Enable MTD NOR flash support
  2021-08-07  5:00 ` [PATCH 3/3] riscv: qemu: Enable MTD NOR flash support Bin Meng
  2021-08-11  8:34   ` Stefan Roese
@ 2021-08-11 10:45   ` Stefan Roese
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2021-08-11 10:45 UTC (permalink / raw)
  To: Bin Meng, u-boot

On 07.08.21 07:00, Bin Meng wrote:
> Enable support to the 2 NOR flashes on the QEMU RISC-V virt machine.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot-cfi-flash/master

Thanks,
Stefan

> ---
> 
>   board/emulation/qemu-riscv/Kconfig | 2 ++
>   include/configs/qemu-riscv.h       | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
> index 0818048ba6..a7de82d3bf 100644
> --- a/board/emulation/qemu-riscv/Kconfig
> +++ b/board/emulation/qemu-riscv/Kconfig
> @@ -64,5 +64,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
>   	imply VIRTIO_PCI
>   	imply VIRTIO_NET
>   	imply VIRTIO_BLK
> +	imply MTD_NOR_FLASH
> +	imply CFI_FLASH
>   
>   endif
> diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
> index 5291de83f8..bbeea96e27 100644
> --- a/include/configs/qemu-riscv.h
> +++ b/include/configs/qemu-riscv.h
> @@ -29,6 +29,8 @@
>   
>   #define CONFIG_STANDALONE_LOAD_ADDR	0x80200000
>   
> +#define CONFIG_SYS_MAX_FLASH_BANKS	2
> +
>   #define RISCV_MMODE_TIMERBASE		0x2000000
>   #define RISCV_MMODE_TIMER_FREQ		1000000
>   
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-11 10:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07  5:00 [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency Bin Meng
2021-08-07  5:00 ` [PATCH 2/3] flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t Bin Meng
2021-08-11  8:34   ` Stefan Roese
2021-08-11 10:45   ` Stefan Roese
2021-08-07  5:00 ` [PATCH 3/3] riscv: qemu: Enable MTD NOR flash support Bin Meng
2021-08-11  8:34   ` Stefan Roese
2021-08-11 10:45   ` Stefan Roese
2021-08-11  8:33 ` [PATCH 1/3] mtd: kconfig: Fix CFI_FLASH dependency Stefan Roese
2021-08-11 10:44 ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.