diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2015-11-06 09:16:27 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-10 06:54:40 -0800 |
commit | 54a2b91f3def3016936f64843b2ad96750236cea (patch) | |
tree | 9559e91ca53d46c42d6fea513c263b21a23f5af0 | |
parent | 5fd715fc3e4712100e510779a2a49f1533d36ca8 (diff) | |
download | chrome-ec-54a2b91f3def3016936f64843b2ad96750236cea.tar.gz |
util: enhance cr50_regs to generate modified base address names
Register descriptions generate by the hardware tools always use the
block index when naming the base address of the bock, but the macros
compiling addresses out of register names do not use the index if
there is just one instance of the block in the design.
The problem is addresses by aliasing these definitions in registers.h
in the chip directory. This patch automates this aliasing and ensures
that the generated file has the aliases included, no need to add them
manually to registers.h.
BRANCH=none
BUG=none
TEST=re-generated cr50_regs.h, observed proper aliases created, built
and ran cr50 with the new registers file.
Change-Id: If037e082841a1510f7cad66737fd8b775dc667ea
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311371
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rwxr-xr-x | util/cr50_regs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/cr50_regs b/util/cr50_regs index 2ac117f4a6..1351abb60b 100755 --- a/util/cr50_regs +++ b/util/cr50_regs @@ -60,7 +60,12 @@ while(<>) # irqnums must be decimal $v = 0 + hex($v); } - printf("#define %-40s %s\n", "GC_$k", $v); + $k = "GC_$k"; + printf("#define %-40s %s\n", $k, $v); + if ( $k =~ m/0_BASE_ADDR$/ ) { + $k =~ s/0_BASE_ADDR/_BASE_ADDR/; + printf("#define %-40s %s\n", $k, $v); + } next; } |