ao-tools/ao-stmload: application base moved to 0x08001000
authorKeith Packard <keithp@keithp.com>
Tue, 23 Apr 2013 01:59:12 +0000 (20:59 -0500)
committerKeith Packard <keithp@keithp.com>
Wed, 8 May 2013 04:30:26 +0000 (21:30 -0700)
And, use a symbolic name so it can be easily moved in the future

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/ao-stmload/ao-stmload.c
ao-tools/ao-stmload/ao-stmload.h

index 35d4b2990d7946078299efd20663e8f455c41cec..130f8707c75da8a0cb5c30952439c050d9403cf0 100644 (file)
 
 struct sym ao_symbols[] = {
 
-       { 0, 0x08002100,        "ao_romconfig_version", 1 },
+       { 0, AO_BOOT_APPLICATION_BASE + 0x100,  "ao_romconfig_version", 1 },
 #define AO_ROMCONFIG_VERSION   (ao_symbols[0].addr)
 
-       { 0, 0x08002102,        "ao_romconfig_check",   1 },
+       { 0, AO_BOOT_APPLICATION_BASE + 0x102,  "ao_romconfig_check",   1 },
 #define AO_ROMCONFIG_CHECK     (ao_symbols[1].addr)
 
-       { 0, 0x08002104,        "ao_serial_number", 1 },
+       { 0, AO_BOOT_APPLICATION_BASE + 0x104,  "ao_serial_number", 1 },
 #define AO_SERIAL_NUMBER       (ao_symbols[2].addr)
 
-       { 0, 0x08002108,        "ao_radio_cal", 0 },
+       { 0, AO_BOOT_APPLICATION_BASE + 0x108,  "ao_radio_cal", 0 },
 #define AO_RADIO_CAL           (ao_symbols[3].addr)
 
-       { 0, 0x0800210c,        "ao_usb_descriptors", 0 },
+       { 0, AO_BOOT_APPLICATION_BASE + 0x10c,  "ao_usb_descriptors", 0 },
 #define AO_USB_DESCRIPTORS     (ao_symbols[4].addr)
 };
 
@@ -416,7 +416,7 @@ main (int argc, char **argv)
                        uint8_t check[256];
                        int     i = 0;
 
-                       ao_self_block_read(cc, 0x08002000, check);
+                       ao_self_block_read(cc, AO_BOOT_APPLICATION_BASE, check);
                        for (;;) {
                                uint8_t block[256];
                                putchar ('.');
@@ -425,8 +425,8 @@ main (int argc, char **argv)
                                        i = 0;
                                }
                                fflush(stdout);
-                               ao_self_block_write(cc, 0x08002000, block);
-                               ao_self_block_read(cc, 0x08002000, block);
+                               ao_self_block_write(cc, AO_BOOT_APPLICATION_BASE, block);
+                               ao_self_block_read(cc, AO_BOOT_APPLICATION_BASE, block);
                                if (memcmp(block, check, 256) != 0) {
                                        fprintf (stderr, "read differed\n");
                                        exit(1);
index 2618b7f3310a931807a2877bad3ea2927757e754..754c1c5bc7cd9d46230a63ba7b8242a1d3338d1f 100644 (file)
@@ -25,6 +25,8 @@ struct sym {
        int             required;
 };
 
+#define AO_BOOT_APPLICATION_BASE       0x08001000
+
 extern struct sym ao_symbols[];
 
 extern int ao_num_symbols;