tqma6: fix sf detection

Commit 155fa9af95 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: Markus Niebel <Markus.Niebel@tq-group.com>
This commit is contained in:
Markus Niebel 2014-10-23 15:47:05 +02:00 committed by Stefano Babic
parent ca9d817ab5
commit 1719d49c34
2 changed files with 25 additions and 4 deletions

View File

@ -138,8 +138,10 @@ static iomux_v3_cfg_t const tqma6_ecspi1_pads[] = {
NEW_PAD_CTRL(MX6_PAD_EIM_D18__ECSPI1_MOSI, SPI_PAD_CTRL),
};
#define TQMA6_SF_CS_GPIO IMX_GPIO_NR(3, 19)
static unsigned const tqma6_ecspi1_cs[] = {
IMX_GPIO_NR(3, 19),
TQMA6_SF_CS_GPIO,
};
static void tqma6_iomuxc_spi(void)
@ -152,6 +154,12 @@ static void tqma6_iomuxc_spi(void)
ARRAY_SIZE(tqma6_ecspi1_pads));
}
int board_spi_cs_gpio(unsigned bus, unsigned cs)
{
return ((bus == CONFIG_SF_DEFAULT_BUS) &&
(cs == CONFIG_SF_DEFAULT_CS)) ? TQMA6_SF_CS_GPIO : -1;
}
static struct i2c_pads_info tqma6_i2c3_pads = {
/* I2C3: on board LM75, M24C64, */
.scl = {

View File

@ -9,13 +9,26 @@
#ifndef __CONFIG_H
#define __CONFIG_H
#define CONFIG_MX6
/* SPL */
/* #if defined(CONFIG_SPL_BUILD) */
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_SPI_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_EXT_SUPPORT
/* common IMX6 SPL configuration */
#include "imx6_spl.h"
/* #endif */
#include "mx6_common.h"
#include <asm/arch/imx-regs.h>
#include <asm/imx-common/gpio.h>
#include <linux/sizes.h>
#define CONFIG_MX6
#if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
#define PHYS_SDRAM_SIZE (512u * SZ_1M)
#elif defined(CONFIG_MX6Q) || defined(CONFIG_MX6D)
@ -57,7 +70,7 @@
#define CONFIG_CMD_SF
#define CONFIG_SF_DEFAULT_BUS 0
#define CONFIG_SF_DEFAULT_CS (0 | (IMX_GPIO_NR(3, 19) << 8))
#define CONFIG_SF_DEFAULT_CS 0
#define CONFIG_SF_DEFAULT_SPEED 50000000
#define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)