aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-19 03:09:20 +0000
committerMike Frysinger <vapier@gentoo.org>2012-03-19 03:09:20 +0000
commit8dbfaed8e2ce8a5617fd09d024d5d95924750ae9 (patch)
treea1fca759125c5e3c27ecc04ae99f09883700f1e1
parent191a54be5438220dc9272b16ec171c987a26b6a1 (diff)
downloadgdb-8dbfaed8e2ce8a5617fd09d024d5d95924750ae9.zip
gdb-8dbfaed8e2ce8a5617fd09d024d5d95924750ae9.tar.gz
gdb-8dbfaed8e2ce8a5617fd09d024d5d95924750ae9.tar.bz2
sim: bfin: ebiu_amc: push down hardcoded base addresses
To make it easier to support ebiu banks at other addresses, move the base to a runtime parameter rather than structure. Future work will make this more dynamic, but I'm waiting for more details first. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--sim/bfin/ChangeLog7
-rw-r--r--sim/bfin/dv-bfin_ebiu_amc.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index 5e1c014..bac48f3 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,5 +1,12 @@
2012-03-18 Mike Frysinger <vapier@gentoo.org>
+ * dv-bfin_ebiu_amc.c (struct bfin_ebiu_amc): Add bank_base.
+ (bfin_ebiu_amc_write_amgctl): Replace BFIN_EBIU_AMC_BASE with
+ amc->bank_base.
+ (bfin_ebiu_amc_finish): Assign BFIN_EBIU_AMC_BASE to amc->bank_base.
+
+2012-03-18 Mike Frysinger <vapier@gentoo.org>
+
* dv-bfin_ebiu_amc.c (bfin_ebiu_amc_attach_address_callback): Use
ARRAY_SIZE rather than hardcoded constant.
diff --git a/sim/bfin/dv-bfin_ebiu_amc.c b/sim/bfin/dv-bfin_ebiu_amc.c
index c96caf7..280cce4 100644
--- a/sim/bfin/dv-bfin_ebiu_amc.c
+++ b/sim/bfin/dv-bfin_ebiu_amc.c
@@ -29,7 +29,7 @@ struct bfin_ebiu_amc
{
bu32 base;
int type;
- bu32 bank_size;
+ bu32 bank_base, bank_size;
unsigned (*io_write) (struct hw *, const void *, int, address_word,
unsigned, struct bfin_ebiu_amc *, bu32, bu32);
unsigned (*io_read) (struct hw *, void *, int, address_word, unsigned,
@@ -89,7 +89,7 @@ bfin_ebiu_amc_write_amgctl (struct hw *me, struct bfin_ebiu_amc *amc,
for (i = 0; i < 4; ++i)
{
- addr = BFIN_EBIU_AMC_BASE + i * amc->bank_size;
+ addr = amc->bank_base + i * amc->bank_size;
if (i < amben_old)
{
@@ -401,6 +401,7 @@ bfin_ebiu_amc_finish (struct hw *me)
reg_size = sizeof (amc->bf50x) + 4;
/* Initialize the AMC. */
+ amc->bank_base = BFIN_EBIU_AMC_BASE;
amc->bank_size = 1 * 1024 * 1024;
amgctl = 0x00F3;
amc->bf50x.ambctl0 = 0x0000FFC2;
@@ -415,6 +416,7 @@ bfin_ebiu_amc_finish (struct hw *me)
reg_size = sizeof (amc->bf54x) + 4;
/* Initialize the AMC. */
+ amc->bank_base = BFIN_EBIU_AMC_BASE;
amc->bank_size = 64 * 1024 * 1024;
amgctl = 0x0002;
amc->bf54x.ambctl0 = 0xFFC2FFC2;
@@ -435,6 +437,7 @@ bfin_ebiu_amc_finish (struct hw *me)
reg_size = sizeof (amc->bf53x) + 4;
/* Initialize the AMC. */
+ amc->bank_base = BFIN_EBIU_AMC_BASE;
if (amc->type == 561)
amc->bank_size = 64 * 1024 * 1024;
else