Commit dbc4515e authored by Alejandro Mery's avatar Alejandro Mery
Browse files

fexc: add port:power support

parent 81569121
...@@ -253,8 +253,10 @@ static int decompile_section(void *bin, size_t UNUSED(bin_size), ...@@ -253,8 +253,10 @@ static int decompile_section(void *bin, size_t UNUSED(bin_size),
if (words != 6) { if (words != 6) {
pr_err("%s: %s.%s: invalid length %d (assuming %d)\n", pr_err("%s: %s.%s: invalid length %d (assuming %d)\n",
filename, section->name, entry->name, words, 6); filename, section->name, entry->name, words, 6);
} else if (gpio->port == 0xffff) {
; /* port:power */
} else if (gpio->port < 1 || gpio->port > 10) { } else if (gpio->port < 1 || gpio->port > 10) {
pr_err("%s: %s.%s: unknown GPIO port type %d\n", pr_err("%s: %s.%s: unknown GPIO port type %u\n",
filename, section->name, entry->name, gpio->port); filename, section->name, entry->name, gpio->port);
goto failure; goto failure;
} }
......
...@@ -125,8 +125,14 @@ int script_generate_fex(FILE *out, const char *UNUSED(filename), ...@@ -125,8 +125,14 @@ int script_generate_fex(FILE *out, const char *UNUSED(filename),
struct script_gpio_entry *gpio; struct script_gpio_entry *gpio;
gpio = container_of(entry, struct script_gpio_entry, entry); gpio = container_of(entry, struct script_gpio_entry, entry);
port += gpio->port; if (gpio->port == 0xffff) {
fprintf(out, "%s = port:P%c%02d", entry->name, port, gpio->port_num); fprintf(out, "%s = port:power%u", entry->name,
gpio->port_num);
} else {
port += gpio->port;
fprintf(out, "%s = port:P%c%02u", entry->name,
port, gpio->port_num);
}
for (const int *p = gpio->data, *pe = p+4; p != pe; p++) { for (const int *p = gpio->data, *pe = p+4; p != pe; p++) {
if (*p == -1) if (*p == -1)
fputs("<default>", out); fputs("<default>", out);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment