-#define AO_USB_DESC_STRING 3
-
-struct ao_sym ao_symbols[] = {
-
- { 0, AO_BOOT_APPLICATION_BASE + 0x100, "ao_romconfig_version", 1 },
-#define AO_ROMCONFIG_VERSION (ao_symbols[0].addr)
-
- { 0, AO_BOOT_APPLICATION_BASE + 0x102, "ao_romconfig_check", 1 },
-#define AO_ROMCONFIG_CHECK (ao_symbols[1].addr)
-
- { 0, AO_BOOT_APPLICATION_BASE + 0x104, "ao_serial_number", 1 },
-#define AO_SERIAL_NUMBER (ao_symbols[2].addr)
-
- { 0, AO_BOOT_APPLICATION_BASE + 0x108, "ao_radio_cal", 0 },
-#define AO_RADIO_CAL (ao_symbols[3].addr)
-
- { 0, AO_BOOT_APPLICATION_BASE + 0x10c, "ao_usb_descriptors", 0 },
-#define AO_USB_DESCRIPTORS (ao_symbols[4].addr)
-};
-
-#define NUM_SYMBOLS 5
-#define NUM_REQUIRED_SYMBOLS 3
-
-int ao_num_symbols = NUM_SYMBOLS;
-int ao_num_required_symbols = NUM_REQUIRED_SYMBOLS;
-
-/*
- * Edit the to-be-written memory block
- */
-static int
-rewrite(struct ao_hex_image *load, unsigned address, uint8_t *data, int length)
-{
- int i;
-
- if (address < load->address || load->address + load->length < address + length)
- return 0;
-
- printf("rewrite %04x:", address);
- for (i = 0; i < length; i++)
- printf (" %02x", load->data[address - load->address + i]);
- printf(" ->");
- for (i = 0; i < length; i++)
- printf (" %02x", data[i]);
- printf("\n");
- memcpy(load->data + address - load->address, data, length);
-}
-
-/*
- * Read a 16-bit value from the USB target
- */
-
-static uint16_t
-get_uint16_cc(struct cc_usb *cc, uint32_t addr)
-{
- struct ao_hex_image *hex = ao_self_read(cc, addr, 2);
- uint16_t v;
- uint8_t *data;
-
- if (!hex)
- return 0;
- data = hex->data + addr - hex->address;
- v = data[0] | (data[1] << 8);
- free(hex);
- return v;
-}
-
-static uint32_t
-get_uint32_cc(struct cc_usb *cc, uint32_t addr)
-{
- struct ao_hex_image *hex = ao_self_read(cc, addr, 4);
- uint32_t v;
- uint8_t *data;
-
- if (!hex)
- return 0;
- data = hex->data + addr - hex->address;
- v = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
- free(hex);
- return v;
-}