[PATCH 1/3] sunxi: dts: OrangePi Zero: Add SPI aliases to make bus usable with u-boot.

The u-boot code relies on aliases to assign bus number.
Signed-off-by: Michal Suchanek msuchanek@suse.de --- arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts index f19ed981da..090570148e 100644 --- a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +++ b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts @@ -59,6 +59,8 @@ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ ethernet0 = &emac; ethernet1 = &xr819; + spi0 = &spi0; + spi1 = &spi1; };
chosen {

This flash is optional but new boards do have it, and on boards that don't the pins are routed to the flash pads anyway.
Signed-off-by: Michal Suchanek msuchanek@suse.de --- arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts index 090570148e..dc3d006010 100644 --- a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +++ b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts @@ -165,8 +165,8 @@ };
&spi0 { - /* Disable SPI NOR by default: it optional on Orange Pi Zero boards */ - status = "disabled"; + /* Enable SPI NOR by default: it optional on Orange Pi Zero boards */ + status = "okay";
flash@0 { #address-cells = <1>;

On Tue, Sep 29, 2020 at 2:32 AM Michal Suchanek msuchanek@suse.de wrote:
This flash is optional but new boards do have it, and on boards that don't the pins are routed to the flash pads anyway.
Signed-off-by: Michal Suchanek msuchanek@suse.de
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts index 090570148e..dc3d006010 100644 --- a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +++ b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts @@ -165,8 +165,8 @@ };
&spi0 {
/* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
status = "disabled";
/* Enable SPI NOR by default: it optional on Orange Pi Zero boards */
status = "okay";
Sync all sun8i changes from v5.9 as a single patch and enable spi on -u-boot.dtsi.
Jagan.

Enable support for SPI flash and the sf command.
Signed-off-by: Michal Suchanek msuchanek@suse.de --- configs/orangepi_zero_defconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/configs/orangepi_zero_defconfig b/configs/orangepi_zero_defconfig index 998c95d151..1087baece1 100644 --- a/configs/orangepi_zero_defconfig +++ b/configs/orangepi_zero_defconfig @@ -8,6 +8,14 @@ CONFIG_SPL_SPI_SUNXI=y CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-zero" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_CONSOLE_MUX=y +CONFIG_CMD_SF_TEST=y +CONFIG_CMD_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_WINBOND=y CONFIG_SUN8I_EMAC=y +CONFIG_SPI=y +CONFIG_DM_SPI=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_OHCI_HCD=y

(Resend from @kernel.org address)
On Tue, Sep 29, 2020 at 5:02 AM Michal Suchanek msuchanek@suse.de wrote:
The u-boot code relies on aliases to assign bus number.
Signed-off-by: Michal Suchanek msuchanek@suse.de
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 2 ++
Anything U-boot specific should be done in the *-u-boot.dts file. And any changes you do to the U-boot copy of dts files will potentially be lost when a dts sync happens.
ChenYu
1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts index f19ed981da..090570148e 100644 --- a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +++ b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts @@ -59,6 +59,8 @@ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ ethernet0 = &emac; ethernet1 = &xr819;
spi0 = &spi0;
spi1 = &spi1; }; chosen {
-- 2.28.0

The u-boot code relies on aliases to assign bus number.
Signed-off-by: Michal Suchanek msuchanek@suse.de --- v2: move u-boot specific aliases to separate file --- arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 1 + arch/arm/dts/sunxi-spi-u-boot.dtsi | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 arch/arm/dts/sunxi-spi-u-boot.dtsi
diff --git a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts index f19ed981da..3f0d0281ba 100644 --- a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +++ b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts @@ -46,6 +46,7 @@ /dts-v1/; #include "sun8i-h3.dtsi" #include "sunxi-common-regulators.dtsi" +#include "sunxi-spi-u-boot.dtsi"
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> diff --git a/arch/arm/dts/sunxi-spi-u-boot.dtsi b/arch/arm/dts/sunxi-spi-u-boot.dtsi new file mode 100644 index 0000000000..df89d02ff2 --- /dev/null +++ b/arch/arm/dts/sunxi-spi-u-boot.dtsi @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ +/ { + + aliases { + spi0 = &spi0; + spi1 = &spi1; + }; +};
participants (3)
-
Chen-Yu Tsai
-
Jagan Teki
-
Michal Suchanek