From patchwork Tue Jan 29 10:39:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 216495 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 91B8A2C0090 for ; Tue, 29 Jan 2013 21:35:42 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 81D734A0EF; Tue, 29 Jan 2013 11:35:29 +0100 (CET) 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 LWHsMrK6GlE6; Tue, 29 Jan 2013 11:35:29 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 770134A0F4; Tue, 29 Jan 2013 11:35:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 04FFF4A0EB for ; Tue, 29 Jan 2013 11:35:16 +0100 (CET) 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 ys9vtn-cHHez for ; Tue, 29 Jan 2013 11:35:07 +0100 (CET) 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 mail-gg0-f182.google.com (mail-gg0-f182.google.com [209.85.161.182]) by theia.denx.de (Postfix) with ESMTPS id 955CC4A132 for ; Tue, 29 Jan 2013 11:35:00 +0100 (CET) Received: by mail-gg0-f182.google.com with SMTP id d1so18660ggn.27 for ; Tue, 29 Jan 2013 02:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=G/6+vwFX942NWctWtTvi9HCBNx5YelvLaN4a0F77+gQ=; b=xfa690E9WRhohySJBx6RjLsp5Kx7zt9DAHk8h3FDh8+PweCcDCCDKcoVNeqvptVCHB T6efHFuH+NAqR6tjGb7nIW4fGw9D8RvVc68omb/3KcHN+r7QKdDRQR+FqJ5RQ+sGpT9S fApt0SOPW1R2HhiJpaXqxtgwodoAgXShc/j+GEMfBE5zUWv9TvyfK8gjI+4yKkPCksAB inVsoI2UB88GnJQ1M+zT3vMfYu/lItO3lDMcXDC1RWWOme9wJGzK1V4t5CrBdIrRpyEi CKRoeJkCTlgtfvyCnqtEvQodzG/PdraBr+yYaAsKJjsYm9YAbOtR6oxEQ5KLqUY8i9WB v1aQ== X-Received: by 10.236.152.40 with SMTP id c28mr429614yhk.79.1359455697202; Tue, 29 Jan 2013 02:34:57 -0800 (PST) Received: from nano.lab.ossystems.com.br ([177.35.66.48]) by mx.google.com with ESMTPS id c44sm13011953yhl.15.2013.01.29.02.34.54 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 02:34:56 -0800 (PST) From: Otavio Salvador To: u-boot@lists.denx.de Date: Tue, 29 Jan 2013 08:39:10 -0200 Message-Id: <1359455950-24930-3-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1359455950-24930-1-git-send-email-otavio@ossystems.com.br> References: <1359455950-24930-1-git-send-email-otavio@ossystems.com.br> Cc: Fabio Estevam , Marek Vasut , Otavio Salvador Subject: [U-Boot] [PATCH v6 3/3] mx23_olinuxino: Add support for status LED 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This allow user to know if the bootloader is running, even without a serial console. Signed-off-by: Otavio Salvador --- Changes in v6: - Use GPIO number Changes in v5: None Changes in v4: - Use MUX PIN macro Changes in v3: - Added the MUX settings back (requested by Fabio) - Added name of the PIN in the board config file Changes in v2: - Remove MUX setting - not need board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 +++++++ board/olimex/mx23_olinuxino/spl_boot.c | 4 ++++ include/configs/mx23_olinuxino.h | 12 ++++++++++++ 3 files changed, 23 insertions(+) diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index 6a6053b..2501417 100644 --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c @@ -28,6 +28,9 @@ #include #include #include +#ifdef CONFIG_STATUS_LED +#include +#endif DECLARE_GLOBAL_DATA_PTR; @@ -67,5 +70,9 @@ int board_init(void) /* Adress of boot parameters */ gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; +#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) + status_led_set(STATUS_LED_BOOT, STATUS_LED_STATE); +#endif + return 0; } diff --git a/board/olimex/mx23_olinuxino/spl_boot.c b/board/olimex/mx23_olinuxino/spl_boot.c index 7def8bc..3bbf5ad 100644 --- a/board/olimex/mx23_olinuxino/spl_boot.c +++ b/board/olimex/mx23_olinuxino/spl_boot.c @@ -84,6 +84,10 @@ const iomux_cfg_t iomux_setup[] = { MX23_PAD_EMI_RASN__EMI_RASN | MUX_CONFIG_EMI, MX23_PAD_EMI_WEN__EMI_WEN | MUX_CONFIG_EMI, + /* Green LED */ + MX23_PAD_SSP1_DETECT__GPIO_2_1 | + (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL), + /* MMC 0 */ MX23_PAD_SSP1_CMD__SSP1_CMD | MUX_CONFIG_SSP, MX23_PAD_SSP1_DATA0__SSP1_DATA0 | MUX_CONFIG_SSP, diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h index 7983c5d..968aec8 100644 --- a/include/configs/mx23_olinuxino.h +++ b/include/configs/mx23_olinuxino.h @@ -56,6 +56,7 @@ #define CONFIG_CMD_EXT2 #define CONFIG_CMD_FAT #define CONFIG_CMD_GPIO +#define CONFIG_CMD_LED #define CONFIG_CMD_MMC /* @@ -112,6 +113,17 @@ #define CONFIG_BAUDRATE 115200 /* Default baud rate */ /* + * Status LED + */ +#define CONFIG_STATUS_LED +#define CONFIG_GPIO_LED +#define CONFIG_BOARD_SPECIFIC_LED +#define STATUS_LED_BOOT 0 +#define STATUS_LED_BIT 10 +#define STATUS_LED_STATE STATUS_LED_ON +#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) + +/* * MMC Driver */ #ifdef CONFIG_CMD_MMC