From patchwork Tue Jul 9 17:26:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 257840 X-Patchwork-Delegate: trini@ti.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 EED042C009A for ; Wed, 10 Jul 2013 03:26:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E2E784A029; Tue, 9 Jul 2013 19:26:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 ttH0oB9samFM; Tue, 9 Jul 2013 19:26:45 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EB14D4A02C; Tue, 9 Jul 2013 19:26:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5E51F4A02D for ; Tue, 9 Jul 2013 19:26:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 SO3LA6lLv4YX for ; Tue, 9 Jul 2013 19:26:30 +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 arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by theia.denx.de (Postfix) with ESMTPS id 8B0704A029 for ; Tue, 9 Jul 2013 19:26:24 +0200 (CEST) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r69HQM1X031425 for ; Tue, 9 Jul 2013 12:26:22 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r69HQMfd011596 for ; Tue, 9 Jul 2013 12:26:22 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Tue, 9 Jul 2013 12:26:21 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r69HQLCi030268; Tue, 9 Jul 2013 12:26:22 -0500 Received: from localhost (lta0272616ub.am.dhcp.ti.com [10.247.22.14]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r69HQLt13359; Tue, 9 Jul 2013 12:26:21 -0500 (CDT) From: Dan Murphy To: , Date: Tue, 9 Jul 2013 12:26:15 -0500 Message-ID: <1373390775-14758-2-git-send-email-dmurphy@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1373390775-14758-1-git-send-email-dmurphy@ti.com> References: <1373390775-14758-1-git-send-email-dmurphy@ti.com> MIME-Version: 1.0 Subject: [U-Boot] [UBOOT] [PATCH V2 2/2] gpio: omap5-uevm: Configure the tca6424 gpio expander X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Configure the tca6424 gpio expander This allows use of the debug and tri color LEDs. Signed-off-by: Dan Murphy Reviewed-by: Tom Rini --- v2 - Updated per comments- http://patchwork.ozlabs.org/patch/257603 board/ti/omap5_uevm/evm.c | 21 +++++++++++++++++++++ board/ti/omap5_uevm/mux_data.h | 2 ++ include/configs/omap5_uevm.h | 5 +++++ 3 files changed, 28 insertions(+) diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c index 90046e8..0e9a559 100644 --- a/board/ti/omap5_uevm/evm.c +++ b/board/ti/omap5_uevm/evm.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "mux_data.h" @@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = { "Board: OMAP5430 EVM\n" }; +/* @brief tca642x_init - Initial states for the GPIO expander + * input reg, output reg, polarity reg, configuration reg + */ +struct tca642x_bank_info tca642x_init[] = { + { .input_reg = 0x00, + .output_reg = 0x04, + .polarity_reg = 0x00, + .configuration_reg = 0x80 }, + { .input_reg = 0x00, + .output_reg = 0x00, + .polarity_reg = 0x00, + .configuration_reg = 0xff }, + { .input_reg = 0x00, + .output_reg = 0x00, + .polarity_reg = 0x00, + .configuration_reg = 0x40 }, +}; + /** * @brief board_init * @@ -46,6 +65,8 @@ int board_init(void) gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM; gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ + tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init); + return 0; } diff --git a/board/ti/omap5_uevm/mux_data.h b/board/ti/omap5_uevm/mux_data.h index a82795d..7e6415e 100644 --- a/board/ti/omap5_uevm/mux_data.h +++ b/board/ti/omap5_uevm/mux_data.h @@ -56,6 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = { {USBD0_HS_DP, (IEN | M0)}, /* USBD0_HS_DP */ {USBD0_HS_DM, (IEN | M0)}, /* USBD0_HS_DM */ {USBD0_SS_RX, (IEN | M0)}, /* USBD0_SS_RX */ + {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */ + {I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */ }; diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h index 46dacc2..bee1278 100644 --- a/include/configs/omap5_uevm.h +++ b/include/configs/omap5_uevm.h @@ -53,6 +53,11 @@ #define CONFIG_PARTITION_UUIDS #define CONFIG_CMD_PART +#define CONFIG_TCA642X +#define CONFIG_CMD_TCA642X +#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4 +#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22 + #define CONFIG_SYS_PROMPT "OMAP5432 uEVM # " #define CONSOLEDEV "ttyO2"