qemu-e2k/hw/arm
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
..
allwinner-a10.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
allwinner-h3.c allwinner-h3: Switch to SMC as PSCI conduit 2021-09-30 13:42:09 +01:00
armsse.c arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
armv7m.c hw/arm/armv7m: Create input clocks 2021-09-01 11:08:19 +01:00
aspeed_ast2600.c hw/arm/aspeed: Allow machine to set UART default 2021-09-20 08:50:59 +02:00
aspeed_soc.c hw/arm/aspeed: Allow machine to set UART default 2021-09-20 08:50:59 +02:00
aspeed.c hw/arm/aspeed: Add Fuji machine type 2021-09-20 08:50:59 +02:00
bcm2835_peripherals.c hw/arm: Add basic power management to raspi. 2021-07-02 11:48:36 +01:00
bcm2836.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
boot.c hw/arm/boot: Report error if there is no fw_cfg device in the machine 2021-08-02 12:55:51 +01:00
collie.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
cubieboard.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
digic_boards.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
digic.c error: Eliminate error_propagate() with Coccinelle, part 1 2020-07-10 15:18:08 +02:00
exynos4_boards.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
exynos4210.c hw/dma/pl330: Add memory region to replace default 2021-08-25 10:48:50 +01:00
fsl-imx6.c Add the ability to change the FEC PHY MDIO device number on i.MX6 processor 2020-07-13 14:36:08 +01:00
fsl-imx6ul.c fsl-imx6ul: Instantiate SAI1/2/3 and ASRC as unimplemented devices 2021-08-25 10:48:50 +01:00
fsl-imx7.c fsl-imx7: Instantiate SAI1/2/3 as unimplemented devices 2021-08-25 10:48:51 +01:00
fsl-imx25.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
fsl-imx31.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
gumstix.c hw/arm/gumstix: Simplify since the machines are little-endian only 2020-03-05 16:09:14 +00:00
highbank.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
imx25_pdk.c hw/arm/imx25_pdk: Fix error message for invalid RAM size 2021-05-10 17:21:54 +01:00
integratorcp.c qom: simplify object_find_property / object_class_find_property 2020-09-22 16:45:16 -04:00
Kconfig hw/arm: xlnx-versal-virt: Add Xilinx eFUSE device 2021-09-30 13:42:10 +01:00
kzm.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
mainstone.c qtest: delete superfluous inclusions of qtest.h 2021-03-09 06:03:53 +01:00
mcimx6ul-evk.c arm: Consistently use "Cortex-Axx", not "Cortex Axx" 2021-06-03 16:43:25 +01:00
mcimx7d-sabre.c arm: Consistently use "Cortex-Axx", not "Cortex Axx" 2021-06-03 16:43:25 +01:00
meson.build stm32vldiscovery: Add the STM32VLDISCOVERY Machine 2021-07-09 16:09:12 +01:00
microbit.c hw/arm: Display CPU type in machine description 2021-02-03 10:15:51 +00:00
mps2-tz.c hw/arm/mps2-tz.c: Mark internal-only I2C buses as 'full' 2021-09-13 21:01:08 +01:00
mps2.c hw/arm/mps2.c: Mark internal-only I2C buses as 'full' 2021-09-13 21:01:08 +01:00
msf2-soc.c arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
msf2-som.c hw/arm/msf2: Use Clock input to MSF2_SOC instead of m3clk property 2021-09-01 11:08:20 +01:00
musca.c arm: Update infocenter.arm.com URLs 2021-02-11 11:50:14 +00:00
musicpal.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
netduino2.c arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
netduinoplus2.c arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
npcm7xx_boards.c hw/arm: Add support for kudo-bmc board. 2021-09-13 16:07:54 +01:00
npcm7xx.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
nrf51_soc.c arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
nseries.c hw/arm/nseries: Display hexadecimal value with '0x' prefix 2021-07-27 10:57:40 +01:00
omap1.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
omap2.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
omap_sx1.c hw/arm: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:46 +01:00
orangepi.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
palm.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
pxa2xx_gpio.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
pxa2xx_pic.c hw/arm: Constify VMStateDescription 2021-05-02 17:24:50 +02:00
pxa2xx.c hw/i2c: Rename i2c_set_slave_address() -> i2c_slave_set_address() 2021-07-08 14:15:01 -05:00
raspi.c hw/arm/raspi: Remove deprecated raspi2/raspi3 aliases 2021-09-01 11:08:15 +01:00
realview.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
sabrelite.c hw/arm: sabrelite: Connect SPI flash CS line to GPIO3_19 2021-09-30 13:44:13 +01:00
sbsa-ref.c sbsa-ref: Rename SBSA_GWDT enum value 2021-08-25 10:48:50 +01:00
smmu-common.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
smmu-internal.h hw/arm/smmuv3: Fix SMMU_CMD_CFGI_STE_RANGE handling 2021-03-12 12:40:10 +00:00
smmuv3-internal.h hw/arm/smmuv3: Check 31st bit to see if CD is valid 2021-07-27 10:57:39 +01:00
smmuv3.c hw/arm/smmuv3: Another range invalidation fix 2021-05-25 15:44:45 +01:00
spitz.c hw/i2c: Rename i2c_set_slave_address() -> i2c_slave_set_address() 2021-07-08 14:15:01 -05:00
stellaris.c arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
stm32f100_soc.c hw/arm/stm32f100: Wire up sysclk and refclk 2021-09-01 11:08:19 +01:00
stm32f205_soc.c hw/arm/stm32f205: Wire up sysclk and refclk 2021-09-01 11:08:19 +01:00
stm32f405_soc.c hw/arm/stm32f405: Wire up sysclk and refclk 2021-09-01 11:08:19 +01:00
stm32vldiscovery.c arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
strongarm.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
strongarm.h
sysbus-fdt.c arm: Eliminate all TPM related code if CONFIG_TPM is not set 2021-06-15 10:54:55 -04:00
tosa.c hw/ssi: Rename SSI 'slave' as 'peripheral' 2020-12-10 12:15:03 -05:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
versatilepb.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
vexpress.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
virt-acpi-build.c hw/arm/virt-acpi-build: Add IORT support to bypass SMMUv3 2021-07-16 11:10:45 -04:00
virt.c hw/arm/virt: add ITS support in virt GIC 2021-09-13 21:01:08 +01:00
xilinx_zynq.c hw/dma/pl330: Add memory region to replace default 2021-08-25 10:48:50 +01:00
xlnx-versal-virt.c hw/arm: xlnx-versal-virt: Add Xilinx eFUSE device 2021-09-30 13:42:10 +01:00
xlnx-versal.c hw/arm: xlnx-versal-virt: Add Xilinx eFUSE device 2021-09-30 13:42:10 +01:00
xlnx-zcu102.c hw/arm: xlnx-zcu102: Add Xilinx eFUSE device 2021-09-30 13:42:10 +01:00
xlnx-zynqmp.c hw/arm: xlnx-zcu102: Add Xilinx eFUSE device 2021-09-30 13:42:10 +01:00
z2.c hw/arm: Constify VMStateDescription 2021-05-02 17:24:50 +02:00