Commit 3a94e721 authored by Henrik Nordstrom's avatar Henrik Nordstrom
Browse files

Merge branch 'master' of github.com:linux-sunxi/sunxi-tools

parents 41681510 92f1d0de
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#ifndef _SUNXI_TOOLS_SCRIPT_H #ifndef _SUNXI_TOOLS_SCRIPT_H
#define _SUNXI_TOOLS_SCRIPT_H #define _SUNXI_TOOLS_SCRIPT_H
#define GPIO_BANK_MAX 13 /* N */
/** head of the data tree */ /** head of the data tree */
struct script { struct script {
struct list_entry sections; struct list_entry sections;
......
...@@ -255,9 +255,10 @@ static int decompile_section(void *bin, size_t UNUSED(bin_size), ...@@ -255,9 +255,10 @@ static int decompile_section(void *bin, size_t UNUSED(bin_size),
filename, section->name, entry->name, words, 6); filename, section->name, entry->name, words, 6);
} else if (gpio->port == 0xffff) { } else if (gpio->port == 0xffff) {
; /* port:power */ ; /* port:power */
} else if (gpio->port < 1 || gpio->port > 10) { } else if (gpio->port < 1 || gpio->port > GPIO_BANK_MAX) {
pr_err("%s: %s.%s: unknown GPIO port type %u\n", pr_err("%s: %s.%s: unknown GPIO port bank %c (%u)\n",
filename, section->name, entry->name, gpio->port); filename, section->name, entry->name,
'A'+gpio->port, gpio->port);
goto failure; goto failure;
} }
v[0] = gpio->mul_sel; v[0] = gpio->mul_sel;
......
...@@ -261,7 +261,7 @@ int script_parse_fex(FILE *in, const char *filename, struct script *script) ...@@ -261,7 +261,7 @@ int script_parse_fex(FILE *in, const char *filename, struct script *script)
/* GPIO */ /* GPIO */
p += 5; p += 5;
if (p[0] == 'P' && if (p[0] == 'P' &&
(p[1] < 'A' || p[1] > 'I')) (p[1] < 'A' || p[1] > ('A' + GPIO_BANK_MAX)))
; ;
else if (*p != 'P' && else if (*p != 'P' &&
memcmp(p, "power", 5) != 0) memcmp(p, "power", 5) != 0)
......
...@@ -154,6 +154,7 @@ static int generate_dram_struct(FILE *out, struct script_section *sp) ...@@ -154,6 +154,7 @@ static int generate_dram_struct(FILE *out, struct script_section *sp)
return ret; return ret;
} }
#if 0
/* /*
* PMU * PMU
*/ */
...@@ -209,6 +210,7 @@ static int generate_pmu_struct(FILE *out, struct script_section *target, ...@@ -209,6 +210,7 @@ static int generate_pmu_struct(FILE *out, struct script_section *target,
(void) pmu_para; (void) pmu_para;
} }
#endif
int script_generate_uboot(FILE *out, const char *UNUSED(filename), int script_generate_uboot(FILE *out, const char *UNUSED(filename),
struct script *script) struct script *script)
...@@ -218,8 +220,10 @@ int script_generate_uboot(FILE *out, const char *UNUSED(filename), ...@@ -218,8 +220,10 @@ int script_generate_uboot(FILE *out, const char *UNUSED(filename),
struct script_section *sp; struct script_section *sp;
} sections[] = { } sections[] = {
{ "dram_para", NULL }, { "dram_para", NULL },
#if 0
{ "target", NULL }, { "target", NULL },
{ "pmu_para", NULL }, { "pmu_para", NULL },
#endif
}; };
for (unsigned i=0; i<ARRAY_SIZE(sections); i++) { for (unsigned i=0; i<ARRAY_SIZE(sections); i++) {
...@@ -237,12 +241,16 @@ int script_generate_uboot(FILE *out, const char *UNUSED(filename), ...@@ -237,12 +241,16 @@ int script_generate_uboot(FILE *out, const char *UNUSED(filename),
fputs("/* this file is generated, don't edit it yourself */\n\n" fputs("/* this file is generated, don't edit it yourself */\n\n"
"#include <common.h>\n" "#include <common.h>\n"
#if 0
"#include <asm/arch/pmu.h>\n" "#include <asm/arch/pmu.h>\n"
#endif
"#include <asm/arch/dram.h>\n\n", "#include <asm/arch/dram.h>\n\n",
out); out);
generate_dram_struct(out, sections[0].sp); generate_dram_struct(out, sections[0].sp);
#if 0
generate_pmu_struct(out, sections[1].sp, sections[2].sp); generate_pmu_struct(out, sections[1].sp, sections[2].sp);
#endif
return 1; return 1;
} }
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