u-boot/drivers/spi
Rasmus Villemoes 10a6aa963c spi: mpc8xxx_spi.c: fix cs activate/deactivate
Somewhere between v2020.04 and v2020.07 the mpc8xxx_spi driver broke,
I'm guessing due to this hunk

@@ -559,6 +560,8 @@ int dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags)
        if (ret)
                return ret;

+       /* combine the requested flags (for IN/OUT) and the descriptor flags */
+       flags |= desc->flags;
        ret = _dm_gpio_set_dir_flags(desc, flags);

from commit 695e5fd546 ("gpio: update dir_flags management"). But
the blame is mostly on the driver itself which seems rather confused:
The chip select gpios are requested with GPIOD_ACTIVE_LOW, but then in
each activate/deactivate, dm_gpio_set_dir_flags() is called with
merely GPIOD_IS_OUT, and then the driver call set_value(0) for
activate.

That used to work, but with the above hunk, the ACTIVE_LOW setting
from the request becomes persistent, so the gpio driver ends up being
asked to set the value to 1 in mpc8xxx_spi_cs_activate().

So drop the dm_gpio_set_dir_flags() calls in the activate/deactivate
functions, and use a value of 1 to mean "logically enabled".

Ideally, I think we should also drop the GPIOD_ACTIVE_LOW from the
request and make it up to the list of gpio cs in DT to indicate
whether that CS is enabled when driven low (as is of course usually
the case), but that requires changing
arch/powerpc/dts/gdsys/gazerbeam-base.dtsi among others, and I don't
have that hardware to test on. I have, however, tested our
own (mpc8309-based) hardware with this change, and I have also tested
that removing the GPIOD_ACTIVE_LOW from the request and updating our
DT as

-                       gpios = <&spisel 0 0>;
+                       gpios = <&spisel 0 GPIO_ACTIVE_LOW>;

still works.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-09-22 11:05:32 -04:00
..
altera_spi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
atcspi200_spi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
ath79_spi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
atmel-quadspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
atmel_spi.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-25 14:46:57 -06:00
atmel_spi.h spi: atmel: Remove nondm code 2020-06-11 15:14:04 +05:30
bcm63xx_hsspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
bcm63xx_spi.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
bcmstb_spi.c board: arm: Add support for Broadcom BCM7445 2018-07-10 16:55:57 -04:00
cadence_qspi.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
cadence_qspi.h spi: cadence-qspi: Add direct mode support 2020-01-27 22:27:22 +05:30
cadence_qspi_apb.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
cf_spi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
davinci_spi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
designware_spi.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-25 14:46:57 -06:00
exynos_spi.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-25 14:46:57 -06:00
fsl_dspi.c Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq 2020-07-27 15:18:15 -04:00
fsl_espi.c dm: spi: Convert Freescale ESPI driver to driver model 2020-06-18 21:47:08 +05:30
fsl_qspi.c spi: fsl_qspi: Support to use full AHB space on i.MX 2020-07-16 11:19:43 +02:00
ich.c x86: spi: Rewrite logic for obtaining the SPI memory map 2020-06-02 09:16:13 +08:00
ich.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
Kconfig drivers: spi: Add SPI controller driver for Octeon 2020-08-03 21:14:48 +02:00
kirkwood_spi.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-25 14:46:57 -06:00
Makefile drivers: spi: Add SPI controller driver for Octeon 2020-08-03 21:14:48 +02:00
meson_spifc.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mpc8xx_spi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
mpc8xxx_spi.c spi: mpc8xxx_spi.c: fix cs activate/deactivate 2020-09-22 11:05:32 -04:00
mscc_bb_spi.c spi: Drop duplicate dm.h inclusion 2020-08-03 22:19:54 -04:00
mt7621_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mtk_snfi_spi.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-25 14:46:57 -06:00
mvebu_a3700_spi.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-25 14:46:57 -06:00
mxc_spi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
mxs_spi.c drivers: avoid using aliases on drivers when OF_PLATDATA is enabled 2020-07-28 19:30:39 -06:00
nxp_fspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
octeon_spi.c drivers: spi: Add SPI controller driver for Octeon 2020-08-03 21:14:48 +02:00
omap3_spi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
pic32_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
pl022_spi.c dm: platform_data: spi: s/pl022_spi.h/spi_pl022.h 2018-11-27 21:06:46 +05:30
renesas_rpc_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rk_spi.c drivers: spi: rk_spi: Add support for RK3328 2020-07-22 20:22:03 +08:00
rk_spi.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sandbox_spi.c dm: acpi: Enhance acpi_get_name() 2020-07-17 14:32:24 +08:00
sh_qspi.c spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* 2020-06-29 13:34:43 -04:00
soft_spi.c spi: add support for all spi modes with soft spi 2020-07-09 20:58:06 +05:30
spi-emul-uclass.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spi-mem-nodm.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spi-mem.c mtd: spi-mem: Drop dm.h header file 2020-08-03 22:19:54 -04:00
spi-sifive.c mtd: spi-mem: Drop dm.h header file 2020-08-03 22:19:54 -04:00
spi-sunxi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
spi-uclass.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spi.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
stm32_qspi.c mtd: spi-mem: Drop dm.h header file 2020-08-03 22:19:54 -04:00
stm32_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra20_sflash.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
tegra20_slink.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
tegra114_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra210_qspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra_spi.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ti_qspi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
uniphier_spi.c treewide: convert devfdt_get_addr_ptr() to dev_read_addr_ptr() 2020-08-22 08:53:37 -06:00
xilinx_spi.c spi: zynq_[q]spi: Convert config's to macro's 2020-06-24 13:11:08 +02:00
zynq_qspi.c spi: zynq_[q]spi: Convert config's to macro's 2020-06-24 13:11:08 +02:00
zynq_spi.c treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() 2020-07-25 14:46:57 -06:00
zynqmp_gqspi.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00