And my DTS file is:
diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/
sun7i-a20-cubietruck.dts
index 8da939a..1313bf7 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
@@ -56,6 +56,7 @@
aliases {
serial0 = &uart0;
+ spi1 = &spi2;
};
chosen {
@@ -192,6 +193,19 @@
allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
};
+&spi2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi2_pins_a>, <&spi2_cs0_pins_a>;
+ status = "okay";
+ spi2_0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "spidev";
+ reg = <0>;
+ spi-max-frequency = <50000000>;
+ };
+};
+
&ohci0 {
status = "okay";
};
在 2015年12月25日星期五 UTC+8上午11:31:38,Iru Cai写道:
>
> Hi,
>
> I'm trying to use flashrom on CubieTruck to flash SPI flash chips. I used
> spidev_test to test the SPI it worked. When I use flashrom to probe a chip,
> it also works, but it cannot read a flash chip.
>
> flashrom v0.9.8-r1888 on Linux 4.4.0-rc6+ (armv7l)
> flashrom is free software, get the source code at http://www.flashrom.org
>
> Calibrating delay loop... OK.
> Found Macronix flash chip "MX25L3205D/MX25L3208D" (4096 kB, SPI) on
> linux_spi.
> Reading flash... linux_spi_send_command: ioctl: Invalid argument
> Read operation failed!
> FAILED.
>
> And dmesg shows:
>
> 在此输入代码...[ 3268.276192] spidev spi1.0: setup mode 0, 8 bits/w, 50000000 Hz
> max --> 0
> [ 3268.276218] spidev spi1.0: spi mode 0
> [ 3268.276237] spidev spi1.0: setup mode 0, 8 bits/w, 50000000 Hz max -->
> 0
> [ 3268.276246] spidev spi1.0: 8 bits per word
> [ 3268.385818] spidev spi1.0: SPI transfer failed: -22
> [ 3268.391045] spi_master spi1: failed to transfer one message from queue
>
> Did anyone manage to use CubieTruck (or other board with A20 SoC) to flash
> SPI chip? I hope someone can help me.
>
> Iru
>
>
>
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.