-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
i think i agree with Andy :-)
but i already write some code about read qi.conf, whatever attach is
the diff and qi.conf :( , i can not see the output so i don't know
it's work or not. very sad.
- ------------------
the QI's job is:
-boot kboot kernel
-or boot normal kernel
the kboot job is:
-all the dfu work
-boot from (SD card,NFS,...) with graph
-may be a shell can recuse normal rootfs
i read Werner's first plan again and again, but i still don't know where i
start about kboot kernel.
so i need some help about make kboot kernel work on GTA02, and make dfu
mode work on kboot.
thanks.
Andy Green wrote:
> It seems better to me we have no Qi configuration at all... it starts to
> feel it is snowballing into Grub or U-Boot on its slow long journey into
> becoming Linux :-)
>
> I didn't hear what it is people are wanting to do with this config
> language that can't be done with fix priority boot device ordering and
> Aux key to skip, maybe boot flag in partition table.
>
> -Andy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQEVAwUBSLekexFuNemPXNFjAQI5sAf/Q92GmPSKB/SJObbe3K7rYzBDPxR150Pd
apgGXyQYYGn0auyMnMUE3X5ltBlsHmqnNIM722uMzAFg0t+EOCM3a5roS8eY5Bk7
9dJ87Ti3yQRub/m9ahY9+4faMAXHT4pMNj6AQIypgVgafDBJElQ01mIrTDeOlJaY
4f/l/oR+vjf9Pwsbe79YLe5fxIK3FLpqCCefU64/AqMn1k0wRYO9A34gDyMSyJ9r
DSb4yUbsmI0QaHx/VbsmZUQ0NSBYLt9IvFKhDLesyaKvpc06SVGRrdz4PBkgxGcM
mqhVcrmXZR6dRnjgCYEb8l+ffugPhEmK1ebrvP5RgipREXIeRHxe0Q==
=hDGT
-----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/phase2.c b/src/phase2.c
index fe8b0ec..d74eefa 100644
--- a/src/phase2.c
+++ b/src/phase2.c
@@ -269,3 +269,54 @@ void bootloader_second_phase(void)
while (1)
blue_on(1);
}
+
+extern int analysis_qi_conf(char *qi_conf, int *partiton_index, char **kernel_path, char **cmdline);
+extern int sd_card_init_gta02(void);
+extern int sd_card_block_read_gta02(unsigned char * buf, unsigned long start512,int blocks512);
+
+void boot_with_qi_conf(void)
+{
+ char * qi_path= "/qi.conf";
+ char * qi_conf_buff = (char *)(TEXT_BASE - (9 * 1024 * 1024));
+
+ if (sd_card_init_gta02()){
+ /* boot from nand */
+ bootloader_second_phase();
+ }
+ if (sd_card_block_read_gta02((unsigned char *)qi_conf_buff, 0, 4) < 0){
+ /* boot from nand */
+ bootloader_second_phase();
+ }
+ if ((qi_conf_buff[0x1fe] != 0x55) || (qi_conf_buff[0x1ff] != 0xaa)) {
+ puts("partition signature missing\n");
+ /* boot from nand */
+ bootloader_second_phase();
+ }
+ if(!ext2fs_mount()) {
+ puts("Unable to mount ext2 filesystem\n");
+ /* boot from nand */
+ bootloader_second_phase();
+ }
+ if (ext2fs_open(qi_path) < 0) {
+ /* there is no qi.conf in sd card boot from nand */
+ bootloader_second_phase();
+ }
+ ext2fs_read(qi_conf_buff, 1*1024);
+
+ int p_index = -2;
+ char *kernel_path;
+ char *cmdline;
+ if(analysis_qi_conf(qi_conf_buff, &p_index, &kernel_path, &cmdline) < 0){
+ /* boot from nand */
+ bootloader_second_phase();
+ }
+ puts("\nqi.conf_kernel partition:");
+ printdec(p_index);
+ puts("\nqi.conf_kernel path: ");
+ puts(kernel_path);
+ puts("\nqi.conf_cmdline:");
+ puts(cmdline);
+ puts("\n");
+
+ bootloader_second_phase();
+}
diff --git a/src/start_qi.c b/src/start_qi.c
index ac7d42e..fb0e7d7 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 void boot_with_qi_conf(void);
const struct board_api * boards[] = {
&board_api_gta02,
@@ -120,7 +121,8 @@ void start_qi(void)
/*
* jump to bootloader_second_phase() running from DRAM copy
*/
- bootloader_second_phase();
+ /* bootloader_second_phase();*/
+ boot_with_qi_conf();
unhappy:
while(1)
1
/boot/uImage.20080827
mtdparts=physmap-flash:-(nor); neo1973-nand: 0x00040000(qi),
0x00040000(cmdline), 0x00800000(backupkernel), 0x000a0000(extra),
0x00040000(identity), 0x0f6a0000(backuprootfs) rootfstype=ext2
root=/dev/mmcblk0p1 console=ttySAC2,115200 loglevel=4 init=/sbin/init