Przeglądaj źródła

ot1200: fix sf detection

Commit 155fa9af95ac5be857a7327e7a968a296e60d4c8 changed the way
to define a GPIO line, which can be used to force CS high
across multiple transactions. In order to fix sf detection
change board code to make use of board_spi_cs_gpio(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
Christian Gmeiner 9 lat temu
rodzic
commit
2e3a1f4d1d
2 zmienionych plików z 6 dodań i 1 usunięć
  1. 5 0
      board/bachmann/ot1200/ot1200.c
  2. 1 1
      include/configs/ot1200.h

+ 5 - 0
board/bachmann/ot1200/ot1200.c

@@ -98,6 +98,11 @@ static void setup_iomux_spi(void)
 	imx_iomux_v3_setup_multiple_pads(ecspi1_pads, ARRAY_SIZE(ecspi1_pads));
 }
 
+int board_spi_cs_gpio(unsigned bus, unsigned cs)
+{
+	return (bus == 2 && cs == 0) ? (IMX_GPIO_NR(1, 3)) : -1;
+}
+
 int board_early_init_f(void)
 {
 	setup_iomux_uart();

+ 1 - 1
include/configs/ot1200.h

@@ -47,7 +47,7 @@
 #define CONFIG_SPI_FLASH_SST
 #define CONFIG_MXC_SPI
 #define CONFIG_SF_DEFAULT_BUS  2
-#define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(1, 3)<<8))
+#define CONFIG_SF_DEFAULT_CS   0
 #define CONFIG_SF_DEFAULT_SPEED 25000000
 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)