From patchwork Thu Dec 27 13:36:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 208298 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 9B0042C00D0 for ; Fri, 28 Dec 2012 00:36:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 105C94A0F6; Thu, 27 Dec 2012 14:36:33 +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 zMkUx5eQscUV; Thu, 27 Dec 2012 14:36:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1162B4A0FD; Thu, 27 Dec 2012 14:36:31 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E42FD4A0FD for ; Thu, 27 Dec 2012 14:36:28 +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 PZ4EmeRIVdMM for ; Thu, 27 Dec 2012 14:36:27 +0100 (CET) X-Greylist: delayed 123113 seconds by postgrey-1.27 at theia; Thu, 27 Dec 2012 14:36:24 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-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by theia.denx.de (Postfix) with ESMTPS id 1C3A84A0F6 for ; Thu, 27 Dec 2012 14:36:24 +0100 (CET) Received: by mail-wi0-f175.google.com with SMTP id hm11so7755720wib.14 for ; Thu, 27 Dec 2012 05:36:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=5LAgtYy5Hsj/+b+n82IXSYBlbGjr4Fo2wwadt0q1yuQ=; b=EOA9E8fuime+eHdJyfL+e4Nwe4C99wVd0wlspHbVpRfPd71S35j9QAfMDtJn5ma4gg Y8Epi6DDVwC37yKGRxfLQAeTP0+ta0RLxocAYCvo+B8lZnHJBgDD/RFjEFUyI4ci8UU7 dqBidlDq2s3f3Co+vf86lyj5NvHj2P196201w9gg1l7PYukpe0G6GxCUnWavRGYlnjaO 7wSlzCkhANDzWMPwA24e426euFPPXJM27iX8sgByFpzRGk0fcbhkeqn0XjfgckAZ18IZ 6Q9TWY3R5GCZk7eH23/7vkhjR7m5Ys2HbJG8hvkjpZH5XYD+73idrp0yPO0xSLpBjOnF 5oIg== X-Received: by 10.194.58.13 with SMTP id m13mr30561097wjq.18.1356615381968; Thu, 27 Dec 2012 05:36:21 -0800 (PST) Received: from localhost.localdomain (50.151.23.95.dynamic.jazztel.es. [95.23.151.50]) by mx.google.com with ESMTPS id df2sm48182639wib.0.2012.12.27.05.36.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Dec 2012 05:36:20 -0800 (PST) From: Javier Martinez Canillas To: Enric Balletbo i Serra Date: Thu, 27 Dec 2012 14:36:01 +0100 Message-Id: <1356615361-14849-1-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 1.7.7.6 X-Gm-Message-State: ALoCoQkNsZxB3HjLcrREjX9kMB2qy32YNqK8jN/GTnc+poHpIFU5H8KCVTUn8uPZkuJSHtLOK9sp Cc: Ezequiel Garcia , u-boot@lists.denx.de, Tom Rini , Javier Martinez Canillas Subject: [U-Boot] [PATCH v5 2/2] OMAP3: igep00x0: add boot status GPIO 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 patch adds an GPIO LED boot status for IGEP boards. The GPIO LED used is the red LED0 while the Linux kernel uses the green LED0 as the boot status. By using different GPIO LEDs, the user can know in which step of the boot process the board currently is. Signed-off-by: Javier Martinez Canillas Acked-by: Igor Grinberg --- Changes since v4: - Since gpio_direction_output() sets the value, there is no need to call gpio_set_value() as suggested by Igor Grinberg. Changes since v3: - Avoid code duplication but having a single show_boot_progress() function as suggested by Wolfgang Denk. Changes since v2: - Use show_boot_progress() instead implementing yet another boot status signalling as suggested by Wolfgang Denk. Changes since v1: - Don't set gd->bd->bi_arch_number since is done in arch/arm/lib/board.c - Use CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020 instead of check bi_arch_number as suggested by Igor Grinberg. board/isee/igep00x0/igep00x0.c | 13 +++++++++++++ board/isee/igep00x0/igep00x0.h | 8 ++++++++ include/configs/igep00x0.h | 3 +++ 3 files changed, 24 insertions(+), 0 deletions(-) diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index fe3522a..931416a 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -60,6 +60,19 @@ int board_init(void) return 0; } +#if defined(CONFIG_SHOW_BOOT_PROGRESS) && !defined(CONFIG_SPL_BUILD) +void show_boot_progress(int val) +{ + if (val < 0) { + /* something went wrong */ + return; + } + + if (!gpio_request(IGEP00X0_GPIO_LED, "")) + gpio_direction_output(IGEP00X0_GPIO_LED, 1); +} +#endif + #ifdef CONFIG_SPL_BUILD /* * Routine: omap_rev_string diff --git a/board/isee/igep00x0/igep00x0.h b/board/isee/igep00x0/igep00x0.h index 3133e41..fefdb89 100644 --- a/board/isee/igep00x0/igep00x0.h +++ b/board/isee/igep00x0/igep00x0.h @@ -23,6 +23,14 @@ #ifndef _IGEP00X0_H_ #define _IGEP00X0_H_ +#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020) +#define IGEP00X0_GPIO_LED 27 +#endif + +#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0030) +#define IGEP00X0_GPIO_LED 16 +#endif + const omap3_sysinfo sysinfo = { DDR_STACKED, #if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020) diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h index 15e233b..47f637e 100644 --- a/include/configs/igep00x0.h +++ b/include/configs/igep00x0.h @@ -82,6 +82,9 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 +/* define to enable boot progress via leds */ +#define CONFIG_SHOW_BOOT_PROGRESS + /* USB */ #define CONFIG_MUSB_UDC 1 #define CONFIG_USB_OMAP3 1