[U-Boot,v8,11/12] mips: bmips: enable the SPI flash on the Sagem F@ST1704

Message ID 20180111171133.22779-12-noltari@gmail.com
State New
Delegated to: Daniel Schwierzeck
Headers show
Series
  • mips: bmips: add SPI support
Related show

Commit Message

Álvaro Fernández Rojas Jan. 11, 2018, 5:11 p.m.
It's a Winbond (w25x32) 4 MB SPI flash.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
---
 v8: no changes
 v7: no changes
 v6: no changes
 v5: sync with master
 v4: switch to CONFIG_BCM63XX_SPI
 v3: rename BCM6338 SPI driver to BCM6348
 v2: remove spi alias

 arch/mips/dts/sagem,f@st1704.dts     | 12 ++++++++++++
 configs/sagem_f@st1704_ram_defconfig |  8 ++++++++
 2 files changed, 20 insertions(+)

Comments

Simon Glass Jan. 16, 2018, 2:57 p.m. | #1
On 11 January 2018 at 09:11, Álvaro Fernández Rojas <noltari@gmail.com> wrote:
> It's a Winbond (w25x32) 4 MB SPI flash.
>
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Reviewed-by: Jagan Teki <jagan@openedev.com>
> ---
>  v8: no changes
>  v7: no changes
>  v6: no changes
>  v5: sync with master
>  v4: switch to CONFIG_BCM63XX_SPI
>  v3: rename BCM6338 SPI driver to BCM6348
>  v2: remove spi alias
>
>  arch/mips/dts/sagem,f@st1704.dts     | 12 ++++++++++++
>  configs/sagem_f@st1704_ram_defconfig |  8 ++++++++
>  2 files changed, 20 insertions(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

Please see below.

> diff --git a/arch/mips/dts/sagem,f@st1704.dts b/arch/mips/dts/sagem,f@st1704.dts
> index be15fe5551..dd0e5b8b7c 100644
> --- a/arch/mips/dts/sagem,f@st1704.dts
> +++ b/arch/mips/dts/sagem,f@st1704.dts
> @@ -44,6 +44,18 @@
>         status = "okay";
>  };
>
> +&spi {
> +       status = "okay";
> +
> +       spi-flash@0 {
> +               compatible = "spi-flash";
> +               reg = <0>;
> +               #address-cells = <1>;
> +               #size-cells = <1>;
> +               spi-max-frequency = <20000000>;
> +       };
> +};
> +
>  &uart0 {
>         u-boot,dm-pre-reloc;
>         status = "okay";
> diff --git a/configs/sagem_f@st1704_ram_defconfig b/configs/sagem_f@st1704_ram_defconfig
> index cfc56cba37..5c091353e5 100644
> --- a/configs/sagem_f@st1704_ram_defconfig
> +++ b/configs/sagem_f@st1704_ram_defconfig
> @@ -39,3 +39,11 @@ CONFIG_RESET_BCM6345=y
>  # CONFIG_SPL_SERIAL_PRESENT is not set
>  CONFIG_DM_SERIAL=y
>  CONFIG_BCM6345_SERIAL=y
> +CONFIG_BCM63XX_SPI=y
> +CONFIG_CMD_SF=y
> +CONFIG_CMD_SPI=y
> +CONFIG_DM_SPI=y
> +CONFIG_DM_SPI_FLASH=y
> +CONFIG_SPI_FLASH=y
> +CONFIG_SPI_FLASH_MTD=y
> +CONFIG_SPI_FLASH_WINBOND=y

Are these definitely in the right order?

> --
> 2.11.0
>

Regards,
Simon

Patch

diff --git a/arch/mips/dts/sagem,f@st1704.dts b/arch/mips/dts/sagem,f@st1704.dts
index be15fe5551..dd0e5b8b7c 100644
--- a/arch/mips/dts/sagem,f@st1704.dts
+++ b/arch/mips/dts/sagem,f@st1704.dts
@@ -44,6 +44,18 @@ 
 	status = "okay";
 };
 
+&spi {
+	status = "okay";
+
+	spi-flash@0 {
+		compatible = "spi-flash";
+		reg = <0>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		spi-max-frequency = <20000000>;
+	};
+};
+
 &uart0 {
 	u-boot,dm-pre-reloc;
 	status = "okay";
diff --git a/configs/sagem_f@st1704_ram_defconfig b/configs/sagem_f@st1704_ram_defconfig
index cfc56cba37..5c091353e5 100644
--- a/configs/sagem_f@st1704_ram_defconfig
+++ b/configs/sagem_f@st1704_ram_defconfig
@@ -39,3 +39,11 @@  CONFIG_RESET_BCM6345=y
 # CONFIG_SPL_SERIAL_PRESENT is not set
 CONFIG_DM_SERIAL=y
 CONFIG_BCM6345_SERIAL=y
+CONFIG_BCM63XX_SPI=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_MTD=y
+CONFIG_SPI_FLASH_WINBOND=y