summaryrefslogtreecommitdiff
path: root/board/keymile/km82xx/km82xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/keymile/km82xx/km82xx.c')
-rw-r--r--board/keymile/km82xx/km82xx.c11
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 */