From patchwork Mon Jan 28 15:11:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 216227 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 1A73E2C0090 for ; Tue, 29 Jan 2013 02:07:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E53104A0F7; Mon, 28 Jan 2013 16:07:18 +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 LZ-LBJ95VA26; Mon, 28 Jan 2013 16:07:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A3354A0EE; Mon, 28 Jan 2013 16:07:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F38294A0ED for ; Mon, 28 Jan 2013 16:07:13 +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 KFHmic4n2PlA for ; Mon, 28 Jan 2013 16:07:13 +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-yh0-f53.google.com (mail-yh0-f53.google.com [209.85.213.53]) by theia.denx.de (Postfix) with ESMTPS id 0DABE4A0B6 for ; Mon, 28 Jan 2013 16:07:05 +0100 (CET) Received: by mail-yh0-f53.google.com with SMTP id q3so397994yhf.26 for ; Mon, 28 Jan 2013 07:07:03 -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=VzRIJAAus7HG8yuC1Ba8319YwCM0ueTXgMHqtnvrgFk=; b=F8x+dRZ/ZyHoougw9EHepZWF2JsMQXOK5TGiC1r0RMFKi7LNyeb+WUGRZrpLzYBMX6 Cc9JnZXSv8+ePCQoCeX3sQofpZhj06Tk68SM2sIfA8CIfHLU+59wUh0uq/voCXrGdblL 35mHzAqPdvfEkyG/lCrHeXWd/W2Xpy5vJa77g0uVMt77+2OIWmbT1Ft7CxfExue4l05t g7jhYzbn4g1PxNmSDWneBIpcMP+btkDHykmarZ4KOVeljOIGI6o6AUM4WQV5gT2UnR2H QVMLrB6LEia3GMFdr0mWd2rnAoooRHfn/sIHB0lPRNFQVztblUD9BSp6scsN1IyUfWFh qC5w== X-Received: by 10.236.131.169 with SMTP id m29mr15119357yhi.114.1359385623823; Mon, 28 Jan 2013 07:07:03 -0800 (PST) Received: from nano.lab.ossystems.com.br ([177.35.66.48]) by mx.google.com with ESMTPS id h38sm8984928ani.7.2013.01.28.07.07.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jan 2013 07:07:03 -0800 (PST) From: Otavio Salvador To: u-boot@lists.denx.de Date: Mon, 28 Jan 2013 13:11:18 -0200 Message-Id: <1359385879-14979-2-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1359385879-14979-1-git-send-email-otavio@ossystems.com.br> References: <1359385879-14979-1-git-send-email-otavio@ossystems.com.br> Cc: Fabio Estevam , Marek Vasut , Otavio Salvador Subject: [U-Boot] [PATCH v3 2/2] 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 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..ef8aaae 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 0x030a /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */ +#define STATUS_LED_STATE STATUS_LED_ON +#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) + +/* * MMC Driver */ #ifdef CONFIG_CMD_MMC