diff options
author | Huber, Andreas <Andreas.Huber@keymile.com> | 2011-05-02 22:56:54 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-05-10 22:48:45 +0200 |
commit | f30c62bbe8988a8341970cbb7e14bb7a99abb157 (patch) | |
tree | 13134f96cb17a2d67a19d21df5cbc271dd620dd7 /board/keymile/km82xx | |
parent | 0278236c38a7fcde95dadc493b26ad612e88ac05 (diff) | |
download | u-boot-f30c62bbe8988a8341970cbb7e14bb7a99abb157.zip u-boot-f30c62bbe8988a8341970cbb7e14bb7a99abb157.tar.gz u-boot-f30c62bbe8988a8341970cbb7e14bb7a99abb157.tar.bz2 |
powerpc/km82xx: rework DIP switch detection
Introduce a struct for the BFTICU FPGA to increase the readability of
the code. And the define CONFIG_SYS_BFTICU_BASE was removed because
the CONFIG_SYS_FPGA_BASE is already the base value for BFTICU registers.
Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
Diffstat (limited to 'board/keymile/km82xx')
-rw-r--r-- | board/keymile/km82xx/km82xx.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c index 6c511a6..01c0bfd 100644 --- a/board/keymile/km82xx/km82xx.c +++ b/board/keymile/km82xx/km82xx.c @@ -296,15 +296,14 @@ int checkboard(void) return 0; } -#define DIPSWITCH_OFFSET 0x89 -#define DIPSWITCH_MASK 0x0f - int last_stage_init(void) { + struct bfticu_iomap *base = + (struct bfticu_iomap *)CONFIG_SYS_FPGA_BASE; u8 dip_switch; - /* Dip switch */ - dip_switch = readb(CONFIG_SYS_BFTICU_BASE + DIPSWITCH_OFFSET); - dip_switch &= DIPSWITCH_MASK; + + dip_switch = in_8(&base->mswitch); + dip_switch &= BFTICU_DIPSWITCH_MASK; /* dip switch 'full reset' or 'db erase' */ if (dip_switch & 0x1 || dip_switch & 0x2) { /* start bootloader */ |