From patchwork Sun Dec 13 01:34:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cory Maccarrone X-Patchwork-Id: 66942 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBD1Za2I006700 for ; Sun, 13 Dec 2009 01:35:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933498AbZLMBff (ORCPT ); Sat, 12 Dec 2009 20:35:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933490AbZLMBff (ORCPT ); Sat, 12 Dec 2009 20:35:35 -0500 Received: from mail-pz0-f171.google.com ([209.85.222.171]:49729 "HELO mail-pz0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S933487AbZLMBfe (ORCPT ); Sat, 12 Dec 2009 20:35:34 -0500 Received: by mail-pz0-f171.google.com with SMTP id 1so1530960pzk.33 for ; Sat, 12 Dec 2009 17:35:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=oyni9JoWBHU488aTgbI8zadfp9R/l58X/fGvyQA837U=; b=Mw+RtKO+q5/kaKhAYnCrAtF37irv5XC6ngo40OFhrCxuFXffx5gLY1HD/yL4L92XOl SWIVU4TzvPFwVqug8n7uAkYfiJQTMEDMRZxKJTR3CewyOAkIEdwXWknNV0II7NgI9oy5 Bvzlus6X4XzYo1TLVwtKmJnjNSsWDAZ0iGUpA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=VIuXYTMaUX7aMhkQrm2VPuLnm0dlOySR7SyrcaPXHOS49vEQ0aIgdkC+tTJ2plAIoX Nxi+Uk6F+Ej9Vu94EZ3a2YtywtnIfHgTn5A+fqPl0miMuiyPvcuGJ3a/xDNREh5+qyJz wddzAL2Xt4Dbpjm8++7h9K+wPILTwUhq3OVWE= Received: by 10.115.100.4 with SMTP id c4mr2080543wam.13.1260668134384; Sat, 12 Dec 2009 17:35:34 -0800 (PST) Received: from localhost (97-126-116-159.tukw.qwest.net [97.126.116.159]) by mx.google.com with ESMTPS id 23sm3334944pzk.8.2009.12.12.17.35.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Dec 2009 17:35:33 -0800 (PST) From: Cory Maccarrone To: spi-devel-general@lists.sourceforge.net, linux-omap@vger.kernel.org Cc: Cory Maccarrone Subject: [PATCH v2 2/3] [OMAP] Add spi100k configuration to OMAP1 Date: Sat, 12 Dec 2009 17:34:47 -0800 Message-Id: <1260668088-27555-3-git-send-email-darkstar6262@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1260668088-27555-1-git-send-email-darkstar6262@gmail.com> References: <1260668088-27555-1-git-send-email-darkstar6262@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index dc8ca91..e584c0f 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c @@ -135,6 +135,10 @@ static struct omap_clk omap_clks[] = { CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX), CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX), CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX), + CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX), + CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX), + CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX), + CLK("omap1_spi100k.2", "ick", &dummy_ck, CK_7XX), CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX), CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310), diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index 23ded2d..20bc62c 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -23,6 +24,7 @@ #include #include #include +#include /*-------------------------------------------------------------------------*/ @@ -196,6 +198,37 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, /*-------------------------------------------------------------------------*/ +/* OMAP7xx SPI support */ +#if defined(CONFIG_SPI_OMAP_100K) || defined(CONFIG_SPI_OMAP_100K_MODULE) + +struct platform_device omap_spi1 = { + .name = "omap1_spi100k", + .id = 1, +}; + +struct platform_device omap_spi2 = { + .name = "omap1_spi100k", + .id = 2, +}; + +static void omap_init_spi100k(void) +{ + omap_spi1.dev.platform_data = ioremap(OMAP7XX_SPI1_BASE, 0x7ff); + BUG_ON(!omap_spi1.dev.platform_data); + + omap_spi2.dev.platform_data = ioremap(OMAP7XX_SPI2_BASE, 0x7ff); + BUG_ON(!omap_spi2.dev.platform_data); + + platform_device_register(&omap_spi1); + platform_device_register(&omap_spi2); +} + +#else +static inline void omap_init_spi100k(void) {} +#endif + +/*-------------------------------------------------------------------------*/ + #if defined(CONFIG_OMAP_STI) #define OMAP1_STI_BASE 0xfffea000 @@ -263,6 +296,7 @@ static int __init omap1_init_devices(void) omap_init_mbox(); omap_init_rtc(); + omap_init_spi100k(); omap_init_sti(); return 0; diff --git a/arch/arm/plat-omap/include/plat/omap7xx.h b/arch/arm/plat-omap/include/plat/omap7xx.h index 53f5241..48e4757 100644 --- a/arch/arm/plat-omap/include/plat/omap7xx.h +++ b/arch/arm/plat-omap/include/plat/omap7xx.h @@ -46,6 +46,9 @@ #define OMAP7XX_DSPREG_SIZE SZ_128K #define OMAP7XX_DSPREG_START 0xE1000000 +#define OMAP7XX_SPI1_BASE 0xfffc0800 +#define OMAP7XX_SPI2_BASE 0xfffc1000 + /* * ---------------------------------------------------------------------------- * OMAP7XX specific configuration registers