From patchwork Wed Oct 1 05:26:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 395400 X-Patchwork-Delegate: andreas.biessmann@googlemail.com 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 266C214012C for ; Wed, 1 Oct 2014 15:26:52 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 923FD4B5FD; Wed, 1 Oct 2014 07:26:50 +0200 (CEST) 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 HopoeEtobTTX; Wed, 1 Oct 2014 07:26:49 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA9374B5F5; Wed, 1 Oct 2014 07:26:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 76ED34B5F5 for ; Wed, 1 Oct 2014 07:26:45 +0200 (CEST) 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 VDqB318XcbnJ for ; Wed, 1 Oct 2014 07:26:45 +0200 (CEST) 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 3BD774B5F1 for ; Wed, 1 Oct 2014 07:26:45 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id E02D775A; Wed, 1 Oct 2014 07:26:44 +0200 (CEST) From: Heiko Schocher To: u-boot@lists.denx.de Date: Wed, 1 Oct 2014 07:26:43 +0200 Message-Id: <1412141203-30438-1-git-send-email-hs@denx.de> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Subject: [U-Boot] [PATCH] 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 Cc: Andreas Bießmann Cc: Bo Shen --- board/siemens/taurus/taurus.c | 22 ++++++++++++++++++++++ include/configs/taurus.h | 11 +++++++++++ 2 files changed, 33 insertions(+) diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index 673b302..98ce441 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,25 @@ 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); +} + +void spi_init_f(void) +{ + /* everything done in board_init */ +} int board_init(void) { /* adress of boot parameters */ @@ -139,6 +160,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..e30542d 100644 --- a/include/configs/taurus.h +++ b/include/configs/taurus.h @@ -127,6 +127,17 @@ #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 CONFIG_SYS_SPI_WRITE_TOUT (5 * CONFIG_SYS_HZ) +#define TAURUS_SPI_MASK (1 << 4) +#define TAURUS_SPI_CS_PIN AT91_PIN_PA3 + /* load address */ #define CONFIG_SYS_LOAD_ADDR 0x22000000