From patchwork Wed Dec 26 03:24: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: 208140 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 ED0672C00A7 for ; Wed, 26 Dec 2012 14:29:48 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B5A64A02F; Wed, 26 Dec 2012 04:29:47 +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 zW7l-A61HjGG; Wed, 26 Dec 2012 04:29:47 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC5F54A028; Wed, 26 Dec 2012 04:29:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 789084A028 for ; Wed, 26 Dec 2012 04:29: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 pvg8HM-Tbway for ; Wed, 26 Dec 2012 04:29:32 +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-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by theia.denx.de (Postfix) with ESMTPS id AEA844A025 for ; Wed, 26 Dec 2012 04:29:30 +0100 (CET) Received: by mail-we0-f172.google.com with SMTP id r3so3870418wey.17 for ; Tue, 25 Dec 2012 19:29:30 -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:in-reply-to :references:x-gm-message-state; bh=3GJO1ELBChBqg1G12r8RVe3zccvCLduw+/fd8xpOHGk=; b=XZhqvXtxm6S4v1pQgQNE04WJE4qcQfkOsOKgBeMYqrcw6TJBkXrjjmTIcAGiOzjB6h NkbVSNaJKu4XZZd+lF+JV9Rpcw5AWxzC43i6ooUjfY04kRMOs0hMW/7C8E0qp5jMtxg+ YfJqY6qsc540UgX77T+CrpvN+9vItzRl8wm+H3ZNBFETBc1TsYPlJOYhirDxn6s3oxPK IW6xCByQ1BCuHh+6HtxDb6kIKU6sPcE9fKvsjVBoNQyhOyIJ643xXLoFq/l6w7r1lqTZ ky7Lt72nNoP0ArkFL03/7JaF6jH8zuxxoxzxbuSTTHv0o5DumLQzvHAR3NIbW+dXlKmh lVsg== X-Received: by 10.180.39.143 with SMTP id p15mr40204548wik.14.1356492268288; Tue, 25 Dec 2012 19:24:28 -0800 (PST) Received: from localhost.localdomain (125.213.77.188.dynamic.jazztel.es. [188.77.213.125]) by mx.google.com with ESMTPS id bd6sm19551980wib.10.2012.12.25.19.24.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Dec 2012 19:24:27 -0800 (PST) From: Javier Martinez Canillas To: Enric Balletbo i Serra Date: Wed, 26 Dec 2012 04:24:01 +0100 Message-Id: <1356492241-14015-2-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1356492241-14015-1-git-send-email-javier.martinez@collabora.co.uk> References: <1356492241-14015-1-git-send-email-javier.martinez@collabora.co.uk> X-Gm-Message-State: ALoCoQltSTDTgHE8nri/PphHLnE5RK4DgFy7CsTDSE85NGMgpfbzrcqqhHUfY92K1BftnHXnhjcM Cc: Ezequiel Garcia , u-boot@lists.denx.de, Tom Rini , Javier Martinez Canillas Subject: [U-Boot] [PATCH v4 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 --- 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 | 15 +++++++++++++++ board/isee/igep00x0/igep00x0.h | 8 ++++++++ include/configs/igep00x0.h | 3 +++ 3 files changed, 26 insertions(+), 0 deletions(-) diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index c8b2fbf..c432129 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -62,6 +62,21 @@ 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, 0); + gpio_set_value(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 83822d2..4b81960 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 be7937d..07b1d3a 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