-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Werner Almesberger wrote:
> Andy Green wrote:
>> Instead of loading the full kernel size in one call, Xiangfu can make a
>> while() loop there loading 64KByte units for example, and inside the
>> loop we check for AUX press.
>
> Good idea. And we just don't care about NOR in qi, eliminating the
> "AUX still pressed from selecting NOR" case.
>
>   If seen we always abort the loop and jump

i try to test the code as Andy say, but i still don't receive new debug
board and FPC(i think it's on the way)
so i can not see the UART output,
i use a sample way, but it seems not work,
if i hold AUX first the gta02 always goto NOR uboot.
so i must press POWER first,  attach is the DIFF
when i use:
>        int i = 0;
>         for(i=0;i<40000;i++)
>         {
>             blue_on(10);
the blue led just blank then boot the kernel

then i use:
>        int i = 0;
>         for(i=0;i<60000;i++)
>         {
>             blue_on(100);
>             if(aux_key_pressed())
>             {
>                 puts("aux key pressed\n");
>                 goto unhappy;
>             }
>         }
the blue led is on, but when i pressed AUX it is not goto unhappy, all
led off and also don't boot.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBSLT3RxFuNemPXNFjAQIiUwf+IsFRMUHrv+RU2s7uZmOSuzyDCRkDIE4h
bgTDAtHp6xTOEne+ITx82FnZ0SFn0PgLsmtCxxx/OAOsG9l3vC3BNzKMha+6H7oP
FzALpctG9pqxzV+QenAjjTbKbteYpckVgP8NgNPcRd8+l+dTIAa3KjXwY2nwi9Xx
adBRHC5UTYpjpufxWioWGSv1xmlgktpbUDoPX54FP5FNevPE5BqDoOPQNQGkzxEf
VgEHUrRLScXHzOzcCwyXcRhC82OReMdm1yHNGehrYI1viyDQJ7TL+YoV4RyK3xbi
hEmnvmuyBGcoceb4+aB0uK2A36zdUCq2BAPKV4qguNA6PFeVOwMSwA==
=+RSZ
-----END PGP SIGNATURE-----
diff --git a/src/gta02/gta02.c b/src/gta02/gta02.c
index fd84329..518f158 100644
--- a/src/gta02/gta02.c
+++ b/src/gta02/gta02.c
@@ -293,6 +293,11 @@ static void putc_gta02(char c)
        serial_putc_s3c24xx(GTA02_DEBUG_UART, c);
 }
 
+int aux_key_pressed(void)
+{
+    return !!(rGPFDAT & (1 << 6));
+}
+
 /*
  * our API for bootloader on this machine
  */
diff --git a/src/start_qi.c b/src/start_qi.c
index ac7d42e..c6f260f 100644
--- a/src/start_qi.c
+++ b/src/start_qi.c
@@ -34,6 +34,7 @@
 #define stringify1(s) #s
 
 extern void bootloader_second_phase(void);
+extern int aux_key_pressed(void);
 
 const struct board_api * boards[] = {
        &board_api_gta02,
@@ -98,9 +99,21 @@ void start_qi(void)
        }
 
        /* okay, do the critical port and serial init for our board */
-
        this_board->port_init();
 
+       int i = 0;
+       for(i=0;i<60000;i++)
+       {
+           blue_on(100);
+           if(aux_key_pressed())
+            {
+               puts("aux key pressed\n");
+               goto unhappy;
+               orange_on(6000);
+               break;
+            }
+       }
+
        /* stick some hello messages on debug console */
 
        puts("\n\n\nQi Bootloader  "stringify2(BUILD_HOST)" "

Reply via email to