diff options
author | Dirk Eibach <eibach@gdsys.de> | 2013-06-26 16:04:26 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2013-07-25 19:35:42 +0200 |
commit | aba27acf6711dce0ef1507f2f9f02a80d70a45da (patch) | |
tree | f77350104f847ab46c990c7119cb705f51089a09 /board/gdsys/405ex/405ex.c | |
parent | aaf5e825606a70ddc8fca8e366d8c16a6fd3cc7c (diff) | |
download | u-boot-imx-aba27acf6711dce0ef1507f2f9f02a80d70a45da.zip u-boot-imx-aba27acf6711dce0ef1507f2f9f02a80d70a45da.tar.gz u-boot-imx-aba27acf6711dce0ef1507f2f9f02a80d70a45da.tar.bz2 |
powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA
A set of accessor functions was added to be able to access not only
memory mapped FPGA in a generic way.
Thanks to Wolfgang Denk for getting this sorted properly.
Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board/gdsys/405ex/405ex.c')
-rw-r--r-- | board/gdsys/405ex/405ex.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/board/gdsys/405ex/405ex.c b/board/gdsys/405ex/405ex.c index 32e24c0..c1a583f 100644 --- a/board/gdsys/405ex/405ex.c +++ b/board/gdsys/405ex/405ex.c @@ -11,6 +11,12 @@ #define REFLECTION_TESTPATTERN 0xdede #define REFLECTION_TESTPATTERN_INV (~REFLECTION_TESTPATTERN & 0xffff) +#ifdef CONFIG_SYS_FPGA_NO_RFL_HI +#define REFLECTION_TESTREG reflection_low +#else +#define REFLECTION_TESTREG reflection_high +#endif + DECLARE_GLOBAL_DATA_PTR; int get_fpga_state(unsigned dev) @@ -220,23 +226,17 @@ int board_early_init_r(void) gd405ex_set_fpga_reset(0); for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k) { - struct ihs_fpga *fpga = - (struct ihs_fpga *)CONFIG_SYS_FPGA_BASE(k); -#ifdef CONFIG_SYS_FPGA_NO_RFL_HI - u16 *reflection_target = &fpga->reflection_low; -#else - u16 *reflection_target = &fpga->reflection_high; -#endif /* * wait for fpga out of reset */ ctr = 0; while (1) { - out_le16(&fpga->reflection_low, - REFLECTION_TESTPATTERN); + u16 val; + + FPGA_SET_REG(k, reflection_low, REFLECTION_TESTPATTERN); - if (in_le16(reflection_target) == - REFLECTION_TESTPATTERN_INV) + FPGA_GET_REG(k, REFLECTION_TESTREG, &val); + if (val == REFLECTION_TESTPATTERN_INV) break; udelay(100000); |