From patchwork Thu Oct 30 08:14:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 404907 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3CA0E14007D for ; Thu, 30 Oct 2014 19:15:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F0554BA74; Thu, 30 Oct 2014 09:15:30 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QHgszqqemxWp; Thu, 30 Oct 2014 09:15:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2D294BA44; Thu, 30 Oct 2014 09:15:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A59B14BA2E for ; Thu, 30 Oct 2014 09:15:15 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KaQ+OXB5Ieth for ; Thu, 30 Oct 2014 09:15:15 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from pollux.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by theia.denx.de (Postfix) with ESMTP id 687CC4BA00 for ; Thu, 30 Oct 2014 09:15:13 +0100 (CET) Received: by pollux.denx.de (Postfix, from userid 515) id D006569EA; Thu, 30 Oct 2014 09:15:12 +0100 (CET) From: Heiko Schocher To: U-Boot Mailing List Date: Thu, 30 Oct 2014 09:14:56 +0100 Message-Id: <1414656906-16632-3-git-send-email-hs@denx.de> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1414656906-16632-1-git-send-email-hs@denx.de> References: <1414656906-16632-1-git-send-email-hs@denx.de> MIME-Version: 1.0 Subject: [U-Boot] [v2 PATCH 02/12] arm, at91: add spi dataflash support for the taurus board X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Heiko Schocher --- Changes in v2: - add comment from Jagan Teki: - remove spi_init_f() from board file - remove CONFIG_SYS_SPI_WRITE_TOUT from board config file instead define a default in the spi driver -> new patch for v2 board/siemens/taurus/taurus.c | 18 ++++++++++++++++++ include/configs/taurus.h | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index 673b302..76609c7 100644 --- a/board/siemens/taurus/taurus.c +++ b/board/siemens/taurus/taurus.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -127,6 +129,21 @@ int board_early_init_f(void) return 0; } +int spi_cs_is_valid(unsigned int bus, unsigned int cs) +{ + return bus == 0 && cs == 0; +} + +void spi_cs_activate(struct spi_slave *slave) +{ + at91_set_gpio_value(TAURUS_SPI_CS_PIN, 0); +} + +void spi_cs_deactivate(struct spi_slave *slave) +{ + at91_set_gpio_value(TAURUS_SPI_CS_PIN, 1); +} + int board_init(void) { /* adress of boot parameters */ @@ -139,6 +156,7 @@ int board_init(void) #ifdef CONFIG_MACB taurus_macb_hw_init(); #endif + at91_spi0_hw_init(TAURUS_SPI_MASK); return 0; } diff --git a/include/configs/taurus.h b/include/configs/taurus.h index aadf4cd..ba9496f 100644 --- a/include/configs/taurus.h +++ b/include/configs/taurus.h @@ -127,6 +127,16 @@ #define CONFIG_USB_STORAGE #endif +/* SPI EEPROM */ +#define CONFIG_SPI +#define CONFIG_CMD_SPI +#define CONFIG_CMD_SF +#define CONFIG_SPI_FLASH +#define CONFIG_ATMEL_SPI +#define CONFIG_SPI_FLASH_STMICRO +#define TAURUS_SPI_MASK (1 << 4) +#define TAURUS_SPI_CS_PIN AT91_PIN_PA3 + /* load address */ #define CONFIG_SYS_LOAD_ADDR 0x22000000