From patchwork Mon Jul 27 14:16:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Balister X-Patchwork-Id: 37517 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6REO6Jk030933 for ; Mon, 27 Jul 2009 14:24:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbZG0OXj (ORCPT ); Mon, 27 Jul 2009 10:23:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751356AbZG0OXj (ORCPT ); Mon, 27 Jul 2009 10:23:39 -0400 Received: from mail.geekisp.com ([216.168.135.169]:21393 "EHLO starfish.geekisp.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751318AbZG0OXi (ORCPT ); Mon, 27 Jul 2009 10:23:38 -0400 X-Greylist: delayed 441 seconds by postgrey-1.27 at vger.kernel.org; Mon, 27 Jul 2009 10:23:37 EDT Received: (qmail 13812 invoked by uid 1003); 27 Jul 2009 14:16:15 -0000 Received: from localhost (HELO localhost.localdomain) (philip@opensdr.com@127.0.0.1) by mail.geekisp.com with SMTP; 27 Jul 2009 14:16:15 -0000 Message-ID: <4A6DB6AE.5090706@balister.org> Date: Mon, 27 Jul 2009 10:16:14 -0400 From: Philip Balister User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: "linux-omap@vger.kernel.org" Subject: Kernel pinmux for OMAP3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org I've been working on setting up the kernel pinmux so we can use MCSPI3 and MCSPI4 on the Beagleboard expansion connector. I've attached the patches I use to setup the pinumux and configure it from the board file. There are some issues: 1) Kevin suggested the OMAP3_ prefix. The problem is that the same function may appear on multiple balls. Furthermore, depending on the IC package, the same ball may have completely different functions. How can we change the enum naming to account for this? Should the enum contain the ball and package ID? How about having a different mux array for each package? 2) I created subroutines to setup each function to avoid cluttering the init routine. I like this idea. These routines could be shared across different boards though. But the boards may use the same function on different pins. I'd really like to see this issues sorted out so we can start making effective use of the kernel pinmux for boards like the beagle and overo where the pinmux settings may depend on what people attach to the expansion connectors. Philip From d92bebf67d632a7e94bf6e4fc62609c943a66cea Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Wed, 22 Jul 2009 15:25:28 -0400 Subject: [PATCH 3/3] Configure pinmux for MCSPI2 and 4 for beagle. --- arch/arm/mach-omap2/board-omap3beagle.c | 41 ++++++++++++++++++------------- 1 files changed, 24 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index ba51dfe..d3850ea 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -420,6 +420,25 @@ static void __init omap3beagle_flash_init(void) } } +#ifdef CONFIG_SPI_OMAP24XX +static void __init omap3_beagle_config_mcspi3_mux(void) +{ + omap_cfg_reg(OMAP3_MCSPI3_CLK); + omap_cfg_reg(OMAP3_MCSPI3_SIMO); + omap_cfg_reg(OMAP3_MCSPI3_SOMI); + omap_cfg_reg(OMAP3_MCSPI3_CS0); + omap_cfg_reg(OMAP3_MCSPI3_CS1); +} + +static void __init omap3_beagle_config_mcspi4_mux(void) +{ + omap_cfg_reg(OMAP3_MCSPI4_CLK); + omap_cfg_reg(OMAP3_MCSPI4_SIMO); + omap_cfg_reg(OMAP3_MCSPI4_SOMI); + omap_cfg_reg(OMAP3_MCSPI4_CS0); +} +#endif + static void __init omap3_beagle_init(void) { omap3_beagle_i2c_init(); @@ -429,8 +448,13 @@ static void __init omap3_beagle_init(void) omap_board_config_size = ARRAY_SIZE(omap3_beagle_config); omap_serial_init(); +#ifdef CONFIG_SPI_OMAP24XX + omap3_beagle_config_mcspi3_mux(); + omap3_beagle_config_mcspi4_mux(); + spi_register_board_info(beagle_mcspi_board_info, ARRAY_SIZE(beagle_mcspi_board_info)); +#endif omap_cfg_reg(J25_34XX_GPIO170); gpio_request(170, "DVI_nPD"); @@ -448,23 +472,6 @@ static void __init omap3_beagle_map_io(void) omap2_map_common_io(); } -static void __init omap3_beagle_config_mcspi3_mux(void) -{ - omap_cfg_reg(OMAP3_MCSPI3_CLK); - omap_cfg_reg(OMAP3_MCSPI3_SIMO); - omap_cfg_reg(OMAP3_MCSPI3_SOMI); - omap_cfg_reg(OMAP3_MCSPI3_CS0); - omap_cfg_reg(OMAP3_MCSPI3_CS1); -} - -static void __init omap3_beagle_config_mcspi4_mux(void) -{ - omap_cfg_reg(OMAP3_MCSPI4_CLK); - omap_cfg_reg(OMAP3_MCSPI4_SIMO); - omap_cfg_reg(OMAP3_MCSPI4_SOMI); - omap_cfg_reg(OMAP3_MCSPI4_CS0); -} - MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ .phys_io = 0x48000000, -- 1.6.2.5