[U-Boot] [PATCH v3 2/2] Enable test case with A20-OLinuXino-Lime2

Jagan Teki jagannadh.teki at gmail.com
Tue Dec 26 09:47:51 UTC 2017


On Fri, Dec 22, 2017 at 3:30 PM, Stefan Mavrodiev <stefan at olimex.com> wrote:
> Driver testing is done with A20-OLinuXino-Lime2. Testing
> requirements are:
>   - Exposing spi0 alternative pins in the dts file
>   - Add alias node, enabling driver probing
>   - Enable spi flash related options in the defconfig file
>
> The testing log is:
>   U-Boot SPL 2018.01-rc2-00023-gfa13cb3-dirty (Dec 22 2017 - 11:39:48)
>   DRAM: 1024 MiB
>   CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
>   Trying to boot from sunxi SPI
>
>
>   U-Boot 2018.01-rc2-00023-gfa13cb3-dirty (Dec 22 2017 - 11:39:48 +0200) Allwinner Technology
>
>   CPU:   Allwinner A20 (SUN7I)
>   Model: Olimex A20-OLinuXino-LIME2

Lime2 doen't have in-built spi-nor is it?

>   I2C:   ready
>   DRAM:  1 GiB
>   MMC:   SUNXI SD/MMC: 0
>   MMC: no card present
>   mmc_init: -123, time 1
>   *** Warning - MMC init failed, using default environment

you lost the env? since it's spi-nor better to use flash env.

>
>   In:    serial
>   Out:   serial
>   Err:   serial
>   Allwinner mUSB OTG (Peripheral)
>   SCSI:  SATA link 0 timeout.
>   AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
>   flags: ncq stag pm led clo only pmp pio slum part ccc apst
>   Net:   No ethernet found.
>   starting USB...
>   USB0:   USB EHCI 1.00
>   USB1:   USB OHCI 1.0
>   USB2:   USB EHCI 1.00
>   USB3:   USB OHCI 1.0
>   scanning bus 0 for devices... 1 USB Device(s) found
>   scanning bus 2 for devices... 1 USB Device(s) found
>          scanning usb for storage devices... 0 Storage Device(s) found
>   Hit any key to stop autoboot:  0
>   => sspi
>
>   => sf probe
>   SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB

try to use erase/write and read commands to verify

>   => sf test 0 100000
>   SPI flash test:
>   0 erase: 11407 ticks, 89 KiB/s 0.712 Mbps
>   1 check: 8881 ticks, 115 KiB/s 0.920 Mbps
>   2 write: 10824 ticks, 94 KiB/s 0.752 Mbps
>   3 read: 8872 ticks, 115 KiB/s 0.920 Mbps
>   Test passed
>   0 erase: 11407 ticks, 89 KiB/s 0.712 Mbps
>   1 check: 8881 ticks, 115 KiB/s 0.920 Mbps
>   2 write: 10824 ticks, 94 KiB/s 0.752 Mbps
>   3 read: 8872 ticks, 115 KiB/s 0.920 Mbps
>   =>
>
> Signed-off-by: Stefan Mavrodiev <stefan at olimex.com>
> ---
>  arch/arm/dts/sun7i-a20-olinuxino-lime2.dts | 21 +++++++++++++++++++++
>  configs/A20-OLinuXino-Lime2_defconfig      |  8 ++++++++
>  2 files changed, 29 insertions(+)
>
> diff --git a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
> index d5c796c..3c708da 100644
> --- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
> +++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
> @@ -54,6 +54,7 @@
>
>         aliases {
>                 serial0 = &uart0;
> +               spi0 = &spi0;
>         };
>
>         chosen {
> @@ -215,6 +216,20 @@
>                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>         };
>
> +       spi0_pins_b: spi0 at 1 {
> +               allwinner,pins = "PC0", "PC1", "PC2";
> +               allwinner,function = "spi0";
> +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
> +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
> +       };
> +
> +       spi0_cs0_pins_b: spi0_cs0 at 1 {
> +               allwinner,pins = "PC23";
> +               allwinner,function = "spi0";
> +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
> +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
> +       };
> +
>         usb0_id_detect_pin: usb0_id_detect_pin at 0 {
>                 allwinner,pins = "PH4";
>                 allwinner,function = "gpio_in";
> @@ -257,6 +272,12 @@
>         status = "okay";
>  };
>
> +&spi0 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&spi0_pins_b>, <&spi0_cs0_pins_b>;
> +       status = "okay";
> +};
> +
>  &uart0 {
>         pinctrl-names = "default";
>         pinctrl-0 = <&uart0_pins_a>;
> diff --git a/configs/A20-OLinuXino-Lime2_defconfig b/configs/A20-OLinuXino-Lime2_defconfig
> index 1edc844..c499e3d 100644
> --- a/configs/A20-OLinuXino-Lime2_defconfig
> +++ b/configs/A20-OLinuXino-Lime2_defconfig
> @@ -30,3 +30,11 @@ CONFIG_SCSI=y
>  CONFIG_USB_EHCI_HCD=y
>  CONFIG_USB_MUSB_GADGET=y
>  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
> +CONFIG_CMD_SF=y
> +CONFIG_CMD_SF_TEST=y

Ok, but not useful to include in config's

> +CONFIG_CMD_SPI=y

this command is not needed, since the current usage on your board as
spi-nor flash


More information about the U-Boot mailing list