qemu-patch-raspberry4/hw
Xuzhou Cheng 1f4b2ec701 hw/arm: sabrelite: Connect SPI flash CS line to GPIO3_19
The Linux spi-imx driver does not work on QEMU. The reason is that the
state of m25p80 loops in STATE_READING_DATA state after receiving
RDSR command, the new command is ignored. Before sending a new command,
CS line should be pulled high to make the state of m25p80 back to IDLE.

Currently the SPI flash CS line is connected to the SPI controller, but
on the real board, it's connected to GPIO3_19. This matches the ecspi1
device node in the board dts.

ecspi1 node in imx6qdl-sabrelite.dtsi:
  &ecspi1 {
          cs-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
          pinctrl-names = "default";
          pinctrl-0 = <&pinctrl_ecspi1>;
          status = "okay";

          flash: m25p80@0 {
                  compatible = "sst,sst25vf016b", "jedec,spi-nor";
                  spi-max-frequency = <20000000>;
                  reg = <0>;
          };
  };

Should connect the SSI_GPIO_CS to GPIO3_19 when adding a spi-nor to
spi1 on sabrelite machine.

Verified this patch on Linux v5.14.

Logs:
  # echo "01234567899876543210" > test
  # mtd_debug erase /dev/mtd0 0x0 0x1000
  Erased 4096 bytes from address 0x00000000 in flash
  # mtd_debug write /dev/mtdblock0 0x0 20 test
  Copied 20 bytes from test to address 0x00000000 in flash
  # mtd_debug read /dev/mtdblock0 0x0 20 test_out
  Copied 20 bytes from address 0x00000000 in flash to test_out
  # cat test_out
  01234567899876543210#

Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210927142825.491-1-xchengl.cn@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-09-30 13:44:13 +01:00
..
9pfs 9pfs: fix crash in v9fs_walk() 2021-09-02 13:26:22 +02:00
acpi hw/acpi: use existing references to pci device struct within functions 2021-09-04 17:34:05 -04:00
adc adc: Move the max111x driver to the adc directory 2021-06-17 07:10:32 -05:00
alpha hw/alpha: Provide a PCI-ISA bridge device node 2021-06-28 07:27:32 -07:00
arm hw/arm: sabrelite: Connect SPI flash CS line to GPIO3_19 2021-09-30 13:44:13 +01:00
audio qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
avr hw/avr/atmega.c: use the avr51 cpu for atmega1280 2021-05-13 19:11:42 +02:00
block qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
char qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
core qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
cpu cpu/core: Fix "help" of CPU core device types 2021-04-09 16:05:16 -04:00
cris Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
display macfb: don't register declaration ROM 2021-09-29 10:45:19 +02:00
dma hw/dma: sifive_pdma: don't set Control.error if 0 bytes to transfer 2021-09-21 07:56:49 +10:00
gpio qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
hppa docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
hyperv qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
i2c qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
i386 hw/loader: Restrict PC_ROM_* definitions to hw/i386/pc 2021-09-27 10:57:21 +02:00
ide ide: Rename ide_bus_new() to ide_bus_init() 2021-09-30 13:44:13 +01:00
input ps2: migration support for command reply queue 2021-09-10 07:32:32 +02:00
intc Second RISC-V PR for QEMU 6.2 2021-09-21 10:57:48 -07:00
ipack qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
ipmi ipmi/sim: fix watchdog_expired data type error in IPMIBmcSim struct 2021-07-08 14:15:01 -05:00
isa qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
m68k q800: configure nubus available slots for Quadra 800 2021-09-29 10:45:19 +02:00
mem docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
microblaze Do not include sysemu/sysemu.h if it's not really necessary 2021-05-02 17:24:50 +02:00
mips arch_init.h: Don't include arch_init.h unnecessarily 2021-08-26 17:02:00 +01:00
misc qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
net virtio-net: fix use after unmap/free for sg 2021-09-17 16:07:52 +08:00
nios2 Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
nubus qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
nvme qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
nvram hw/nvram: Introduce Xilinx battery-backed ram 2021-09-30 13:42:10 +01:00
openrisc Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
pci qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
pci-bridge hw/pcie-root-port: Fix hotplug for PCI devices requiring IO 2021-08-03 16:31:07 -04:00
pci-host pci: Rename pci_root_bus_new_inplace() to pci_root_bus_init() 2021-09-30 13:42:10 +01:00
pcmcia hw/pcmcia: Do not register PCMCIA type if not required 2021-05-02 17:24:50 +02:00
ppc qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
rdma pvrdma: Fix the ring init error flow (CVE-2021-3608) 2021-07-04 22:47:51 +03:00
remote Remove superfluous ERRP_GUARD() 2021-08-26 17:15:28 +02:00
riscv hw/riscv: opentitan: Correct the USB Dev address 2021-09-21 12:10:47 +10:00
rtc docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
rx hw/rx/rx-gdbsim: Do not accept invalid memory size 2021-05-03 10:07:41 +02:00
s390x qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
scsi qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
sd qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
sensor hw/misc: Add Infineon DPS310 sensor model 2021-09-20 08:50:59 +02:00
sh4 Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
smbios hw/smbios: support for type 41 (onboard devices extended information) 2021-05-14 10:26:18 -04:00
sparc sun4m: fix setting CPU id when more than one CPU is present 2021-09-08 11:09:45 +01:00
sparc64 hw/block/fdc: Extract ISA floppy controllers to fdc-isa.c 2021-06-25 08:53:28 -04:00
ssi qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
timer hw/timer: Add SiFive PWM support 2021-09-21 07:56:49 +10:00
tpm docs: fix references to docs/specs/tpm.rst 2021-06-02 06:51:09 +02:00
tricore hw/tricore: fix inclusion of tricore_testboard 2021-07-20 20:10:21 +02:00
usb qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
vfio hw/vfio: Fix typo in comments 2021-09-16 11:57:01 +02:00
virtio qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
watchdog watchdog: aspeed: Fix sequential control writes 2021-09-20 08:50:59 +02:00
xen qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
xenpv meson: convert hw/arch* 2020-08-21 06:30:33 -04:00
xtensa Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
Kconfig hw/arm: xlnx-zcu102: Add Xilinx eFUSE device 2021-09-30 13:42:10 +01:00
meson.build sensor: Move hardware sensors from misc to a sensor directory 2021-06-17 07:10:32 -05:00