From patchwork Wed Apr 30 11:28:10 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Przemyslaw Marczak
X-Patchwork-Id: 344090
X-Patchwork-Delegate: promsoft@gmail.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 D79F2140106
for ;
Wed, 30 Apr 2014 21:29:45 +1000 (EST)
Received: from localhost (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 33B5D4BBC5;
Wed, 30 Apr 2014 13:29:43 +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 59rnTadSBOhT; Wed, 30 Apr 2014 13:29:42 +0200 (CEST)
Received: from theia.denx.de (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 9D9254BBDB;
Wed, 30 Apr 2014 13:29:10 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 9A9664BBC5
for ; Wed, 30 Apr 2014 13:29:03 +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 P9q-vvgtm5Gc for ;
Wed, 30 Apr 2014 13:29:02 +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 mailout2.w1.samsung.com (mailout2.w1.samsung.com
[210.118.77.12]) by theia.denx.de (Postfix) with ESMTPS id 2C7AF4BBBF
for ; Wed, 30 Apr 2014 13:28:53 +0200 (CEST)
Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245])
by mailout2.w1.samsung.com
(Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit
(built Nov
17 2011)) with ESMTP id <0N4U009QYD7HSG90@mailout2.w1.samsung.com>
for u-boot@lists.denx.de; Wed, 30 Apr 2014 12:28:29 +0100 (BST)
X-AuditID: cbfec7f5-b7fae6d000004d6d-47-5360de671ddb
Received: from eusync2.samsung.com ( [203.254.199.212])
by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 62.0A.19821.76ED0635;
Wed, 30 Apr 2014 12:28:39 +0100 (BST)
Received: from AMDC1186.digital.local ([106.116.147.185])
by eusync2.samsung.com
(Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit
(built Aug
10 2011)) with ESMTPA id <0N4U008ADD7M6U30@eusync2.samsung.com>; Wed,
30 Apr 2014 12:28:39 +0100 (BST)
From: Przemyslaw Marczak
To: u-boot@lists.denx.de
Date: Wed, 30 Apr 2014 13:28:10 +0200
Message-id: <1398857290-22028-5-git-send-email-p.marczak@samsung.com>
X-Mailer: git-send-email 1.9.1
In-reply-to: <1398857290-22028-1-git-send-email-p.marczak@samsung.com>
References: <1398421254-5958-1-git-send-email-p.marczak@samsung.com>
<1398857290-22028-1-git-send-email-p.marczak@samsung.com>
X-Brightmail-Tracker:
H4sIAAAAAAAAA+NgFnrPJMWRmVeSWpSXmKPExsVy+t/xK7rp9xKCDe5sNbL4s+Mkq8Wuv/cZ
Ld483Mxo0XGkhdFix+UbLBbrnqxltXi7t5Pdgd1j3qwTLB5n7+xg9OjbsooxgDmKyyYlNSez
LLVI3y6BK2PFsYssBRPFKrZsnMfewLhBsIuRk0NCwETi86O97BC2mMSFe+vZuhi5OIQEljJK
PP61CsrpY5JYs+c4G0gVm4CBxJ5LZ5hBbBEBCYlf/VcZQYqYBV4zStzZ0s8KkhAWcJfYsGgj
E4jNIqAq0T3/CZjNK+AqMfnmYkaIdXISJ49NBqvnFHCT2LNqBzPEtgZGiSlHnrFOYORdwMiw
ilE0tTS5oDgpPddIrzgxt7g0L10vOT93EyMkkL7uYFx6zOoQowAHoxIPr8DW+GAh1sSy4src
Q4wSHMxKIryytxKChXhTEiurUovy44tKc1KLDzEycXBKNTBev/xC9ezMLt0VJ3i7tutnPdWY
1HtkdtfK3KIHj6LKd28Mc/4WvlRNSct79bQln8LzDmgGfXm3aurhy0zsNVeftLxNyKkT1Qj9
eY3f8sjZZh2nOJXLXx3yU+81HEuyXMW/sSphwm+J4J+f3fx9pH5rVLnOXVN+fll0Gf8zTdYq
nZMFTku2KOUosRRnJBpqMRcVJwIA+HvNRAICAAA=
Cc: Piotr Wilczek ,
Przemyslaw Marczak
Subject: [U-Boot] [PATCH v5 5/5] samsung: misc: remove download mode info
screen
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 change removes LCD menu download mode info screen.
Now key press timeout is checked in function download_menu()
and menu options are displayed directly after PWR + VOLUP keys.
Signed-off-by: Przemyslaw Marczak
Cc: Minkyu Kang
---
Changes v4:
- new commit
Changes v5:
- none
---
board/samsung/common/misc.c | 73 +++++++++++++++++++--------------------------
1 file changed, 31 insertions(+), 42 deletions(-)
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 2ea275e..03106fd 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -261,7 +261,7 @@ static void display_download_menu(int mode)
selection[mode] = "[=>]";
lcd_clear();
- lcd_printf("\n\t\tDownload Mode Menu\n");
+ lcd_printf("\n\n\t\tDownload Mode Menu\n\n");
for (i = 0; i <= BOOT_MODE_EXIT; i++)
lcd_printf("\t%s %s - %s\n\n", selection[i],
@@ -274,10 +274,38 @@ static void download_menu(void)
int mode = 0;
int last_mode = 0;
int run;
- int key;
+ int key = 0;
+ int timeout = 15; /* sec */
+ int i;
display_download_menu(mode);
+ lcd_puts("\n");
+
+ /* Start count if no key is pressed */
+ while (check_keys())
+ continue;
+
+ while (timeout--) {
+ lcd_printf("\r\tNormal boot will start in: %2.d seconds.",
+ timeout);
+
+ /* about 1000 ms in for loop */
+ for (i = 0; i < 10; i++) {
+ mdelay(100);
+ key = check_keys();
+ if (key)
+ break;
+ }
+ if (key)
+ break;
+ }
+
+ if (!key) {
+ lcd_clear();
+ return;
+ }
+
while (1) {
run = 0;
@@ -315,45 +343,6 @@ static void download_menu(void)
lcd_clear();
}
-static void display_mode_info(void)
-{
- lcd_position_cursor(4, 4);
- lcd_printf("%s\n", U_BOOT_VERSION);
- lcd_puts("\nDownload Mode Menu\n");
-#ifdef CONFIG_SYS_BOARD
- lcd_printf("Board name: %s\n", CONFIG_SYS_BOARD);
-#endif
- lcd_printf("Press POWER KEY to display MENU options.");
-}
-
-static int boot_menu(void)
-{
- int key = 0;
- int timeout = 10;
-
- display_mode_info();
-
- while (timeout--) {
- lcd_printf("\rNormal boot will start in: %d seconds.", timeout);
- mdelay(1000);
-
- key = key_pressed(KEY_POWER);
- if (key)
- break;
- }
-
- lcd_clear();
-
- /* If PWR pressed - show download menu */
- if (key) {
- printf("Power pressed - go to download menu\n");
- download_menu();
- printf("Download mode exit.\n");
- }
-
- return 0;
-}
-
void check_boot_mode(void)
{
int pwr_key;
@@ -366,7 +355,7 @@ void check_boot_mode(void)
power_key_pressed(KEY_PWR_INTERRUPT_REG);
if (key_pressed(KEY_VOLUMEUP))
- boot_menu();
+ download_menu();
else if (key_pressed(KEY_VOLUMEDOWN))
mode_leave_menu(BOOT_MODE_THOR);
}