r4164 - trunk/src/target/u-boot/patches
werner at sita.openmoko.org
werner at sita.openmoko.org
Tue Mar 4 11:48:04 CET 2008
Author: werner
Date: 2008-03-04 11:48:00 +0100 (Tue, 04 Mar 2008)
New Revision: 4164
Modified:
trunk/src/target/u-boot/patches/gta02-bootmenu.patch
trunk/src/target/u-boot/patches/nor-bootmenu.patch
trunk/src/target/u-boot/patches/uboot-gta02.patch
Log:
This ports wake-up reason handling forward from GTA01. In particular, it makes
sure that we don't power up unless the POWER button is held down for a while.
The user interaction of all this still needs a bit of fine-tuning.
uboot-gta02.patch:
- board/neo1973/gta02/gta02.c (board_late_init): enabled wake-up reason
handling and updated it for the PCF50633
gta02-bootmenu.patch: updated context for above change
nor-bootmenu.patch:
- updated context
- board/neo1973/gta02/gta02.c (board_late_init): examine wakeup reason also on
NOR boot
Modified: trunk/src/target/u-boot/patches/gta02-bootmenu.patch
===================================================================
--- trunk/src/target/u-boot/patches/gta02-bootmenu.patch 2008-03-04 10:34:16 UTC (rev 4163)
+++ trunk/src/target/u-boot/patches/gta02-bootmenu.patch 2008-03-04 10:48:00 UTC (rev 4164)
@@ -2,35 +2,7 @@
===================================================================
--- u-boot.orig/board/neo1973/gta02/gta02.c
+++ u-boot/board/neo1973/gta02/gta02.c
-@@ -241,10 +241,10 @@
- gpio->GPJDAT |= 0x000000001; /* GTA02v1_GPIO_3D_RESET */
- #endif
-
--#if 0
- /* if there's no other reason, must be regular reset */
- neo1973_wakeup_cause = NEO1973_WAKEUP_RESET;
-
-+#if 0
- if (!booted_from_nand)
- goto woken_by_reset;
-
-@@ -274,6 +274,7 @@
- }
-
- woken_by_reset:
-+#endif
-
- while (neo1973_wakeup_cause == NEO1973_WAKEUP_RESET ||
- neo1973_on_key_pressed()) {
-@@ -294,7 +295,6 @@
- jbt6k74_init();
- jbt6k74_enter_state(JBT_STATE_NORMAL);
- jbt6k74_display_onoff(1);
--#endif
-
- #if 0
- {
-@@ -303,12 +303,12 @@
+@@ -306,12 +306,12 @@ continue_boot:
if (!(gpio->GPFDAT & (1 << 5)))
gpio->GPBDAT &= ~(1 << 2);
}
@@ -45,7 +17,7 @@
return 0;
}
-@@ -403,13 +403,11 @@
+@@ -408,13 +408,11 @@ int neo1973_on_key_pressed(void)
& PCF50633_OOCSTAT_ONKEY);
}
Modified: trunk/src/target/u-boot/patches/nor-bootmenu.patch
===================================================================
--- trunk/src/target/u-boot/patches/nor-bootmenu.patch 2008-03-04 10:34:16 UTC (rev 4163)
+++ trunk/src/target/u-boot/patches/nor-bootmenu.patch 2008-03-04 10:48:00 UTC (rev 4164)
@@ -21,10 +21,19 @@
+ extern unsigned char booted_from_nor;
+
+ S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
- unsigned char tmp;
+ uint8_t int1, int2;
char buf[32];
int menu_vote = 0; /* <= 0: no, > 0: yes */
-@@ -307,7 +309,7 @@ continue_boot:
+@@ -246,7 +248,7 @@ int board_late_init(void)
+ /* if there's no other reason, must be regular reset */
+ neo1973_wakeup_cause = NEO1973_WAKEUP_RESET;
+
+- if (!booted_from_nand)
++ if (!booted_from_nand && !booted_from_nor)
+ goto woken_by_reset;
+
+ /* obtain wake-up reason, save INT1 in environment */
+@@ -308,7 +310,7 @@ continue_boot:
}
#endif
Modified: trunk/src/target/u-boot/patches/uboot-gta02.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-gta02.patch 2008-03-04 10:34:16 UTC (rev 4163)
+++ trunk/src/target/u-boot/patches/uboot-gta02.patch 2008-03-04 10:48:00 UTC (rev 4164)
@@ -94,7 +94,7 @@
===================================================================
--- /dev/null
+++ u-boot/board/neo1973/gta02/gta02.c
-@@ -0,0 +1,452 @@
+@@ -0,0 +1,455 @@
+/*
+ * (C) 2006-2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -307,7 +307,7 @@
+{
+ S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
+ extern unsigned char booted_from_nand;
-+ unsigned char tmp;
++ uint8_t int1, int2;
+ char buf[32];
+ int menu_vote = 0; /* <= 0: no, > 0: yes */
+ int seconds = 0;
@@ -315,6 +315,10 @@
+ /* Initialize the Power Management Unit with a safe register set */
+ pcf50633_init();
+
++ /* obtain wake-up reason */
++ int1 = pcf50633_reg_read(PCF50633_REG_INT1);
++ int2 = pcf50633_reg_read(PCF50633_REG_INT2);
++
+ /* switch on one of the power led's */
+ neo1973_led(GTA02_LED_PWR_ORANGE, 1);
+
@@ -336,29 +340,29 @@
+ gpio->GPJDAT |= (1 << 5); /* GTA02_GPIO_3D_RESET */
+#endif
+
-+#if 0
+ /* if there's no other reason, must be regular reset */
+ neo1973_wakeup_cause = NEO1973_WAKEUP_RESET;
+
+ if (!booted_from_nand)
+ goto woken_by_reset;
+
-+ /* obtain wake-up reason, save INT1 in environment */
-+ tmp = pcf50606_reg_read(PCF50606_REG_INT1);
-+ sprintf(buf, "0x%02x", tmp);
-+ setenv("pcf50606_int1", buf);
++ /* save wake-up reason in environment */
++ sprintf(buf, "0x%02x", int1);
++ setenv("pcf50633_int1", buf);
++ sprintf(buf, "0x%02x", int2);
++ setenv("pcf50633_int2", buf);
+
-+ if (tmp & PCF50606_INT1_ALARM) {
++ if (int1 & PCF50633_INT1_ALARM) {
+ /* we've been woken up by RTC alarm, boot */
+ neo1973_wakeup_cause = NEO1973_WAKEUP_ALARM;
+ goto continue_boot;
+ }
-+ if (tmp & PCF50606_INT1_EXTONR) {
++ if (int1 & PCF50633_INT1_USBINS) {
+ /* we've been woken up by charger insert */
+ neo1973_wakeup_cause = NEO1973_WAKEUP_CHARGER;
+ }
+
-+ if (tmp & PCF50606_INT1_ONKEYF) {
++ if (int2 & PCF50633_INT2_ONKEYF) {
+ /* we've been woken up by a falling edge of the onkey */
+ neo1973_wakeup_cause = NEO1973_WAKEUP_POWER_KEY;
+ }
@@ -389,7 +393,6 @@
+ jbt6k74_init();
+ jbt6k74_enter_state(JBT_STATE_NORMAL);
+ jbt6k74_display_onoff(1);
-+#endif
+
+ /* switch on the backlight */
+ neo1973_backlight(1);
More information about the commitlog
mailing list