From patchwork Fri Apr 23 08:47:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Wegner X-Patchwork-Id: 71775 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id 795BDC08F5D for ; Fri, 23 Apr 2010 10:48:40 +0200 (CEST) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id 69C63C912DD7 for ; Fri, 23 Apr 2010 10:48:40 +0200 (CEST) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.9) for (single-drop); Fri, 23 Apr 2010 10:48:40 +0200 (CEST) Received: from murder (svr19.m-online.net [192.168.3.147]) by backend2 (Cyrus v2.2.12) with LMTPA; Fri, 23 Apr 2010 10:47:57 +0200 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend3.pop.m-online.net (Cyrus v2.2.13) with LMTPA; Fri, 23 Apr 2010 10:47:57 +0200 Received: from scanner-1.m-online.net (unknown [192.168.8.165]) by mail.m-online.net (Postfix) with ESMTP id 93B992000A7; Fri, 23 Apr 2010 10:47:57 +0200 (CEST) Received: from mxin-1.m-online.net ([192.168.6.164]) by scanner-1.m-online.net (scanner-1.m-online.net [192.168.8.165]) (amavisd-new, port 10026) with ESMTP id 07383-02-17; Fri, 23 Apr 2010 10:47:56 +0200 (CEST) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-1.m-online.net (Postfix) with ESMTP id AF8BC46C0B5; Fri, 23 Apr 2010 10:47:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C60E028226; Fri, 23 Apr 2010 10:47:52 +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 qK30Qc+-KANh; Fri, 23 Apr 2010 10:47:52 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B4C5C28227; Fri, 23 Apr 2010 10:47:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1209C28222 for ; Fri, 23 Apr 2010 10:47:44 +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 FnN6YIvS4P2s for ; Fri, 23 Apr 2010 10:47:42 +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 mrbusi3.netcologne.de (mrbusi3.netcologne.de [195.14.230.4]) by theia.denx.de (Postfix) with ESMTP id 058B928217 for ; Fri, 23 Apr 2010 10:47:39 +0200 (CEST) X-NetCologne-SenderNetwork: netcologne X-NetCologne-SenderNetwork: netcologne Received: from labor2.local (unknown [213.196.222.82]) by mrbusi3.netcologne.de (Postfix) with ESMTP id 6B1E5C019C; Fri, 23 Apr 2010 10:47:39 +0200 (CEST) From: Wolfgang Wegner To: u-boot@lists.denx.de Date: Fri, 23 Apr 2010 10:47:37 +0200 Message-Id: <1272012457-32140-1-git-send-email-w.wegner@astro-kom.de> Cc: Wolfgang Wegner Subject: [U-Boot] [PATCH] add SPI_CS_HIGH option to cf_spi.c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Virus-Scanned: by amavisd-new at m-online.net Signed-off-by: Wolfgang Wegner --- I tested this patch on a MCF54455. The basic intention was to make using DSPI for MMC/SD-Card possible. drivers/spi/cf_spi.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/spi/cf_spi.c b/drivers/spi/cf_spi.c index 722aafc..8cc1d03 100644 --- a/drivers/spi/cf_spi.c +++ b/drivers/spi/cf_spi.c @@ -256,6 +256,11 @@ struct spi_slave *cfspi_setup_slave(struct cf_spi_slave *cfslave, uint mode) } else bus_setup |= (dspi->ctar[cfslave->slave.bus] & 0x78FCFFF0); + if (mode & SPI_CS_HIGH) + dspi->mcr &= ~(1 << (16 + cfslave->slave.cs)); + else + dspi->mcr |= (1 << (16 + cfslave->slave.cs)); + cfslave->charbit = ((dspi->ctar[cfslave->slave.bus] & 0x78000000) == 0x78000000) ? 16 : 8;