summaryrefslogtreecommitdiff
path: root/ao-tools/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ao-tools/lib')
-rw-r--r--ao-tools/lib/ao-dfu.c3
-rw-r--r--ao-tools/lib/ao-dfu.h3
-rw-r--r--ao-tools/lib/ao-editaltos.c98
-rw-r--r--ao-tools/lib/ao-editaltos.h31
-rw-r--r--ao-tools/lib/ao-elf.c3
-rw-r--r--ao-tools/lib/ao-elf.h3
-rw-r--r--ao-tools/lib/ao-hex.h3
-rw-r--r--ao-tools/lib/ao-selfload.c40
-rw-r--r--ao-tools/lib/ao-selfload.h13
-rw-r--r--ao-tools/lib/ao-verbose.c3
-rw-r--r--ao-tools/lib/ao-verbose.h3
-rw-r--r--ao-tools/lib/cc-analyse.c3
-rw-r--r--ao-tools/lib/cc-convert.c3
-rw-r--r--ao-tools/lib/cc-dsp.c3
-rw-r--r--ao-tools/lib/cc-integrate.c3
-rw-r--r--ao-tools/lib/cc-log.c3
-rw-r--r--ao-tools/lib/cc-logfile.c3
-rw-r--r--ao-tools/lib/cc-mega.c3
-rw-r--r--ao-tools/lib/cc-period.c3
-rw-r--r--ao-tools/lib/cc-process.c3
-rw-r--r--ao-tools/lib/cc-telem.c3
-rw-r--r--ao-tools/lib/cc-telemetry.c3
-rw-r--r--ao-tools/lib/cc-telemetry.h3
-rw-r--r--ao-tools/lib/cc-util.c3
-rw-r--r--ao-tools/lib/cc.h3
-rw-r--r--ao-tools/lib/cephes.h3
-rw-r--r--ao-tools/lib/i0.c3
-rw-r--r--ao-tools/lib/mconf.h3
28 files changed, 209 insertions, 45 deletions
diff --git a/ao-tools/lib/ao-dfu.c b/ao-tools/lib/ao-dfu.c
index b6778495..f8aba94b 100644
--- a/ao-tools/lib/ao-dfu.c
+++ b/ao-tools/lib/ao-dfu.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/ao-dfu.h b/ao-tools/lib/ao-dfu.h
index c3dfc496..4bed1a08 100644
--- a/ao-tools/lib/ao-dfu.h
+++ b/ao-tools/lib/ao-dfu.h
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/ao-editaltos.c b/ao-tools/lib/ao-editaltos.c
index 7547c82c..06009653 100644
--- a/ao-tools/lib/ao-editaltos.c
+++ b/ao-tools/lib/ao-editaltos.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,23 +21,23 @@
#include "ao-editaltos.h"
struct ao_sym ao_symbols[] = {
- {
+ [AO_ROMCONFIG_VERSION_INDEX] = {
.name = "ao_romconfig_version",
.required = 1
},
- {
+ [AO_ROMCONFIG_CHECK_INDEX] = {
.name = "ao_romconfig_check",
.required = 1
},
- {
+ [AO_SERIAL_NUMBER_INDEX] = {
.name = "ao_serial_number",
.required = 1
},
- {
+ [AO_RADIO_CAL_INDEX] = {
.name = "ao_radio_cal",
.required = 0
},
- {
+ [AO_USB_DESCRIPTORS_INDEX] = {
.name = "ao_usb_descriptors",
.required = 0
},
@@ -57,13 +58,6 @@ rewrite(struct ao_hex_image *load, unsigned address, uint8_t *data, int length)
if (address < load->address || load->address + load->length < address + length)
return false;
- 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);
return true;
}
@@ -165,3 +159,81 @@ ao_editaltos(struct ao_hex_image *image,
}
return true;
}
+
+static uint16_t
+read_le16(uint8_t *src)
+{
+ return (uint16_t) src[0] | ((uint16_t) src[1] << 8);
+}
+
+bool
+ao_heximage_usb_id(struct ao_hex_image *image, struct ao_usb_id *id)
+{
+ uint32_t usb_descriptors;
+
+ if (!AO_USB_DESCRIPTORS)
+ return false;
+ usb_descriptors = AO_USB_DESCRIPTORS - image->address;
+
+ while (image->data[usb_descriptors] != 0 && usb_descriptors < image->length) {
+ if (image->data[usb_descriptors+1] == AO_USB_DESC_DEVICE) {
+ break;
+ }
+ usb_descriptors += image->data[usb_descriptors];
+ }
+
+ /*
+ * check to make sure there's at least 0x12 (size of a USB
+ * device descriptor) available
+ */
+ if (usb_descriptors >= image->length || image->data[usb_descriptors] != 0x12)
+ return false;
+
+ id->vid = read_le16(image->data + usb_descriptors + 8);
+ id->pid = read_le16(image->data + usb_descriptors + 10);
+
+ return true;
+}
+
+uint16_t *
+ao_heximage_usb_product(struct ao_hex_image *image)
+{
+ uint32_t usb_descriptors;
+ int string_num;
+ uint16_t *product;
+ uint8_t product_len;
+
+ if (!AO_USB_DESCRIPTORS)
+ return NULL;
+ usb_descriptors = AO_USB_DESCRIPTORS - image->address;
+
+ string_num = 0;
+ while (image->data[usb_descriptors] != 0 && usb_descriptors < image->length) {
+ if (image->data[usb_descriptors+1] == AO_USB_DESC_STRING) {
+ ++string_num;
+ if (string_num == 3)
+ break;
+ }
+ usb_descriptors += image->data[usb_descriptors];
+ }
+
+ /*
+ * check to make sure there's at least 0x12 (size of a USB
+ * device descriptor) available
+ */
+ if (usb_descriptors >= image->length || image->data[usb_descriptors] == 0)
+ return NULL;
+
+ product_len = image->data[usb_descriptors] - 2;
+
+ if (usb_descriptors < product_len + 2)
+ return NULL;
+
+ product = malloc (product_len + 2);
+ if (!product)
+ return NULL;
+
+ memcpy(product, image->data + usb_descriptors + 2, product_len);
+ product[product_len/2] = 0;
+ return product;
+}
diff --git a/ao-tools/lib/ao-editaltos.h b/ao-tools/lib/ao-editaltos.h
index 74530435..6f2829b0 100644
--- a/ao-tools/lib/ao-editaltos.h
+++ b/ao-tools/lib/ao-editaltos.h
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -25,19 +26,31 @@
extern struct ao_sym ao_symbols[];
extern int ao_num_symbols;
+#define AO_USB_DESC_DEVICE 1
#define AO_USB_DESC_STRING 3
-#define AO_ROMCONFIG_VERSION (ao_symbols[0].addr)
-#define AO_ROMCONFIG_CHECK (ao_symbols[1].addr)
-#define AO_SERIAL_NUMBER (ao_symbols[2].addr)
-#define AO_RADIO_CAL (ao_symbols[3].addr)
-#define AO_USB_DESCRIPTORS (ao_symbols[4].addr)
+#define AO_ROMCONFIG_VERSION_INDEX 0
+#define AO_ROMCONFIG_CHECK_INDEX 1
+#define AO_SERIAL_NUMBER_INDEX 2
+#define AO_RADIO_CAL_INDEX 3
+#define AO_USB_DESCRIPTORS_INDEX 4
+
+#define AO_ROMCONFIG_VERSION (ao_symbols[AO_ROMCONFIG_VERSION_INDEX].addr)
+#define AO_ROMCONFIG_CHECK (ao_symbols[AO_ROMCONFIG_CHECK_INDEX].addr)
+#define AO_SERIAL_NUMBER (ao_symbols[AO_SERIAL_NUMBER_INDEX].addr)
+#define AO_RADIO_CAL (ao_symbols[AO_RADIO_CAL_INDEX].addr)
+#define AO_USB_DESCRIPTORS (ao_symbols[AO_USB_DESCRIPTORS_INDEX].addr)
struct ao_editaltos_funcs {
uint16_t (*get_uint16)(void *closure, uint32_t addr);
uint32_t (*get_uint32)(void *closure, uint32_t addr);
};
+struct ao_usb_id {
+ uint16_t vid;
+ uint16_t pid;
+};
+
bool
ao_editaltos_find_symbols(struct ao_sym *file_symbols, int num_file_symbols,
struct ao_sym *symbols, int num_symbols);
@@ -47,4 +60,10 @@ ao_editaltos(struct ao_hex_image *image,
uint16_t serial,
uint32_t radio_cal);
+bool
+ao_heximage_usb_id(struct ao_hex_image *image, struct ao_usb_id *id);
+
+uint16_t *
+ao_heximage_usb_product(struct ao_hex_image *image);
+
#endif /* _AO_EDITALTOS_H_ */
diff --git a/ao-tools/lib/ao-elf.c b/ao-tools/lib/ao-elf.c
index 680a80f0..c44102f8 100644
--- a/ao-tools/lib/ao-elf.c
+++ b/ao-tools/lib/ao-elf.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/ao-elf.h b/ao-tools/lib/ao-elf.h
index 0f79d142..5f4e8428 100644
--- a/ao-tools/lib/ao-elf.h
+++ b/ao-tools/lib/ao-elf.h
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/ao-hex.h b/ao-tools/lib/ao-hex.h
index a1ab490c..3cd0813b 100644
--- a/ao-tools/lib/ao-hex.h
+++ b/ao-tools/lib/ao-hex.h
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/ao-selfload.c b/ao-tools/lib/ao-selfload.c
index 41e45adc..0a23dfda 100644
--- a/ao-tools/lib/ao-selfload.c
+++ b/ao-tools/lib/ao-selfload.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -156,3 +157,40 @@ ao_self_get_uint32(struct cc_usb *cc, uint32_t addr)
free(hex);
return v;
}
+
+bool
+ao_self_get_usb_id(struct cc_usb *cc, struct ao_usb_id *id)
+{
+ struct ao_hex_image *hex;
+ bool ret;
+
+ if (!AO_USB_DESCRIPTORS)
+ return false;
+
+ hex = ao_self_read(cc, AO_USB_DESCRIPTORS, 512);
+ if (!hex)
+ return false;
+
+ ret = ao_heximage_usb_id(hex, id);
+ free(hex);
+ return ret;
+}
+
+uint16_t *
+ao_self_get_usb_product(struct cc_usb *cc)
+{
+ struct ao_hex_image *hex;
+ uint16_t *ret;
+
+ if (!AO_USB_DESCRIPTORS)
+ return NULL;
+
+ hex = ao_self_read(cc, AO_USB_DESCRIPTORS, 512);
+ if (!hex)
+ return NULL;
+
+ ret = ao_heximage_usb_product(hex);
+ free(hex);
+ return ret;
+}
+
diff --git a/ao-tools/lib/ao-selfload.h b/ao-tools/lib/ao-selfload.h
index a001a404..4aac5848 100644
--- a/ao-tools/lib/ao-selfload.h
+++ b/ao-tools/lib/ao-selfload.h
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,6 +22,7 @@
#include <stdbool.h>
#include "ao-hex.h"
#include "cc-usb.h"
+#include "ao-editaltos.h"
struct ao_hex_image *
ao_self_read(struct cc_usb *cc, uint32_t address, uint32_t length);
@@ -34,4 +36,13 @@ ao_self_get_uint16(struct cc_usb *cc, uint32_t addr);
uint32_t
ao_self_get_uint32(struct cc_usb *cc, uint32_t addr);
+bool
+ao_self_get_usb_id(struct cc_usb *cc, struct ao_usb_id *id);
+
+uint16_t *
+ao_self_get_usb_product(struct cc_usb *cc);
+
+uint16_t *
+ao_self_get_usb_product(struct cc_usb *cc);
+
#endif /* _AO_SELFLOAD_H_ */
diff --git a/ao-tools/lib/ao-verbose.c b/ao-tools/lib/ao-verbose.c
index a1678ed1..d85b524f 100644
--- a/ao-tools/lib/ao-verbose.c
+++ b/ao-tools/lib/ao-verbose.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/ao-verbose.h b/ao-tools/lib/ao-verbose.h
index 26c2fe41..d23e720c 100644
--- a/ao-tools/lib/ao-verbose.h
+++ b/ao-tools/lib/ao-verbose.h
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-analyse.c b/ao-tools/lib/cc-analyse.c
index 27c416a6..52df66e6 100644
--- a/ao-tools/lib/cc-analyse.c
+++ b/ao-tools/lib/cc-analyse.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-convert.c b/ao-tools/lib/cc-convert.c
index b82dd778..0f7fa809 100644
--- a/ao-tools/lib/cc-convert.c
+++ b/ao-tools/lib/cc-convert.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-dsp.c b/ao-tools/lib/cc-dsp.c
index 518c1a68..d44c696d 100644
--- a/ao-tools/lib/cc-dsp.c
+++ b/ao-tools/lib/cc-dsp.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-integrate.c b/ao-tools/lib/cc-integrate.c
index ba50761b..8009f0c3 100644
--- a/ao-tools/lib/cc-integrate.c
+++ b/ao-tools/lib/cc-integrate.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-log.c b/ao-tools/lib/cc-log.c
index ed51f87e..f7674359 100644
--- a/ao-tools/lib/cc-log.c
+++ b/ao-tools/lib/cc-log.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-logfile.c b/ao-tools/lib/cc-logfile.c
index 842e5c7c..88ddda58 100644
--- a/ao-tools/lib/cc-logfile.c
+++ b/ao-tools/lib/cc-logfile.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-mega.c b/ao-tools/lib/cc-mega.c
index 3aa24a6d..2e5a6061 100644
--- a/ao-tools/lib/cc-mega.c
+++ b/ao-tools/lib/cc-mega.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-period.c b/ao-tools/lib/cc-period.c
index 844ac79e..fb1c3ccd 100644
--- a/ao-tools/lib/cc-period.c
+++ b/ao-tools/lib/cc-period.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-process.c b/ao-tools/lib/cc-process.c
index c756b570..74b02a74 100644
--- a/ao-tools/lib/cc-process.c
+++ b/ao-tools/lib/cc-process.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-telem.c b/ao-tools/lib/cc-telem.c
index aa52b7c5..678c078e 100644
--- a/ao-tools/lib/cc-telem.c
+++ b/ao-tools/lib/cc-telem.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-telemetry.c b/ao-tools/lib/cc-telemetry.c
index 45c10dcb..42315128 100644
--- a/ao-tools/lib/cc-telemetry.c
+++ b/ao-tools/lib/cc-telemetry.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-telemetry.h b/ao-tools/lib/cc-telemetry.h
index d64c4b30..500de96c 100644
--- a/ao-tools/lib/cc-telemetry.h
+++ b/ao-tools/lib/cc-telemetry.h
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc-util.c b/ao-tools/lib/cc-util.c
index 65488ee9..fc617eae 100644
--- a/ao-tools/lib/cc-util.c
+++ b/ao-tools/lib/cc-util.c
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cc.h b/ao-tools/lib/cc.h
index ff95e4fc..cbeb705c 100644
--- a/ao-tools/lib/cc.h
+++ b/ao-tools/lib/cc.h
@@ -3,7 +3,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/cephes.h b/ao-tools/lib/cephes.h
index f8ec264f..7d66425b 100644
--- a/ao-tools/lib/cephes.h
+++ b/ao-tools/lib/cephes.h
@@ -10,7 +10,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/i0.c b/ao-tools/lib/i0.c
index 6f7b5a57..2156d1c1 100644
--- a/ao-tools/lib/i0.c
+++ b/ao-tools/lib/i0.c
@@ -10,7 +10,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ao-tools/lib/mconf.h b/ao-tools/lib/mconf.h
index af1ebb51..9898a2e1 100644
--- a/ao-tools/lib/mconf.h
+++ b/ao-tools/lib/mconf.h
@@ -10,7 +10,8 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of