All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH RESEND v2 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access
@ 2017-11-13  5:04 Baruch Siach
  2017-11-13  5:04 ` [U-Boot] [PATCH RESEND v2 2/2] arm: mvebu: clearfog: update SPI flash DT description Baruch Siach
  2017-11-16 13:08 ` [U-Boot] [PATCH RESEND v2 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access Stefan Roese
  0 siblings, 2 replies; 4+ messages in thread
From: Baruch Siach @ 2017-11-13  5:04 UTC (permalink / raw)
  To: u-boot

From: Jon Nettleton <jon@solid-run.com>

The production variant of the SPI flash used by the clearfog
devices are based on winbond chips.  Additionally enable
SPI_FLASH_BAR since some variants will have 16MB of flash
that requires this to be enabled.

Remove the default speed and mode; these values are taken from the
device tree when CONFIG_DM_SPI_FLASH is enabled.

Add default bus, so that 'sf' detects the SPI flash by default.

Signed-off-by: Jon Nettleton <jon@solid-run.com>
[baruch: remove speed/mode; add bus; move winbond to defconfig]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
v2: Move CONFIG_SPI_FLASH_WINBOND to defconfig (Jagan)
---
 configs/clearfog_defconfig | 3 +++
 include/configs/clearfog.h | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
index 3de204346d88..5fa645a45e23 100644
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_defconfig
@@ -46,3 +46,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_MVEBU=y
 CONFIG_USB_STORAGE=y
+CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_MTD=y
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index 5061f6c6fd16..bf87bac30021 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -33,9 +33,7 @@
 #define CONFIG_SYS_I2C_SPEED		100000
 
 /* SPI NOR flash default params, used by sf commands */
-#define CONFIG_SF_DEFAULT_SPEED		1000000
-#define CONFIG_SF_DEFAULT_MODE		SPI_MODE_3
-#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_SF_DEFAULT_BUS		1
 
 /*
  * SDIO/MMC Card Configuration
-- 
2.15.0

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

* [U-Boot] [PATCH RESEND v2 2/2] arm: mvebu: clearfog: update SPI flash DT description
  2017-11-13  5:04 [U-Boot] [PATCH RESEND v2 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access Baruch Siach
@ 2017-11-13  5:04 ` Baruch Siach
  2017-11-16 13:08   ` Stefan Roese
  2017-11-16 13:08 ` [U-Boot] [PATCH RESEND v2 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access Stefan Roese
  1 sibling, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2017-11-13  5:04 UTC (permalink / raw)
  To: u-boot

All current ClearFog SOMs have the SPI flash populated. Enable SPI flash in
the device tree.

Add an alias to the SPI bus so that the 'sf' command can probe the flash on
bus 1.

Add the "spi-flash" compatible string to make the standard SPI flash driver
probe the device.

Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
v2: Add Jagan's ack
---
 arch/arm/dts/armada-388-clearfog.dts | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/dts/armada-388-clearfog.dts b/arch/arm/dts/armada-388-clearfog.dts
index b2dfd5643521..bc52bc0167d3 100644
--- a/arch/arm/dts/armada-388-clearfog.dts
+++ b/arch/arm/dts/armada-388-clearfog.dts
@@ -61,6 +61,7 @@
 		ethernet1 = &eth0;
 		ethernet2 = &eth1;
 		ethernet3 = &eth2;
+		spi1 = &spi1;
 	};
 
 	chosen {
@@ -330,11 +331,9 @@
 				status = "okay";
 			};
 
-			spi at 10680 {
+			spi1: spi at 10680 {
 				/*
-				 * We don't seem to have the W25Q32 on the
-				 * A1 Rev 2.0 boards, so disable SPI.
-				 * CS0: W25Q32 (doesn't appear to be present)
+				 * CS0: W25Q32
 				 * CS1:
 				 * CS2: mikrobus
 				 */
@@ -345,10 +344,9 @@
 				spi-flash at 0 {
 					#address-cells = <1>;
 					#size-cells = <0>;
-					compatible = "w25q32", "jedec,spi-nor";
+					compatible = "w25q32", "jedec,spi-nor", "spi-flash";
 					reg = <0>; /* Chip select 0 */
 					spi-max-frequency = <3000000>;
-					status = "disabled";
 				};
 			};
 
-- 
2.15.0

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

* [U-Boot] [PATCH RESEND v2 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access
  2017-11-13  5:04 [U-Boot] [PATCH RESEND v2 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access Baruch Siach
  2017-11-13  5:04 ` [U-Boot] [PATCH RESEND v2 2/2] arm: mvebu: clearfog: update SPI flash DT description Baruch Siach
@ 2017-11-16 13:08 ` Stefan Roese
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2017-11-16 13:08 UTC (permalink / raw)
  To: u-boot

On 13.11.2017 06:04, Baruch Siach wrote:
> From: Jon Nettleton <jon@solid-run.com>
> 
> The production variant of the SPI flash used by the clearfog
> devices are based on winbond chips.  Additionally enable
> SPI_FLASH_BAR since some variants will have 16MB of flash
> that requires this to be enabled.
> 
> Remove the default speed and mode; these values are taken from the
> device tree when CONFIG_DM_SPI_FLASH is enabled.
> 
> Add default bus, so that 'sf' detects the SPI flash by default.
> 
> Signed-off-by: Jon Nettleton <jon@solid-run.com>
> [baruch: remove speed/mode; add bus; move winbond to defconfig]
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> v2: Move CONFIG_SPI_FLASH_WINBOND to defconfig (Jagan)

Applied to u-boot-marvell/master.

Thanks,
Stefan

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

* [U-Boot] [PATCH RESEND v2 2/2] arm: mvebu: clearfog: update SPI flash DT description
  2017-11-13  5:04 ` [U-Boot] [PATCH RESEND v2 2/2] arm: mvebu: clearfog: update SPI flash DT description Baruch Siach
@ 2017-11-16 13:08   ` Stefan Roese
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2017-11-16 13:08 UTC (permalink / raw)
  To: u-boot

On 13.11.2017 06:04, Baruch Siach wrote:
> All current ClearFog SOMs have the SPI flash populated. Enable SPI flash in
> the device tree.
> 
> Add an alias to the SPI bus so that the 'sf' command can probe the flash on
> bus 1.
> 
> Add the "spi-flash" compatible string to make the standard SPI flash driver
> probe the device.
> 
> Reviewed-by: Jagan Teki <jagan@openedev.com>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> v2: Add Jagan's ack

Applied to u-boot-marvell/master.

Thanks,
Stefan

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

end of thread, other threads:[~2017-11-16 13:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13  5:04 [U-Boot] [PATCH RESEND v2 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access Baruch Siach
2017-11-13  5:04 ` [U-Boot] [PATCH RESEND v2 2/2] arm: mvebu: clearfog: update SPI flash DT description Baruch Siach
2017-11-16 13:08   ` Stefan Roese
2017-11-16 13:08 ` [U-Boot] [PATCH RESEND v2 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access 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.