Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284706
b: refs/heads/master
c: f2711be
h: refs/heads/master
v: v3
  • Loading branch information
Manuel Lauss authored and Ralf Baechle committed Dec 8, 2011
1 parent c4cf15d commit 16bc738
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3eab8095ef1658f5cd4927a0224b1214329cb348
refs/heads/master: f2711be0f9c20115f0af8c15e52bf425774b64e8
30 changes: 22 additions & 8 deletions trunk/arch/mips/alchemy/devboards/db1200.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,33 @@ static int __init detect_board(void)
{
int bid;

/* try the PB1200 first */
/* try the DB1200 first */
bcsr_init(DB1200_BCSR_PHYS_ADDR,
DB1200_BCSR_PHYS_ADDR + DB1200_BCSR_HEXLED_OFS);
if (BCSR_WHOAMI_DB1200 == BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
unsigned short t = bcsr_read(BCSR_HEXLEDS);
bcsr_write(BCSR_HEXLEDS, ~t);
if (bcsr_read(BCSR_HEXLEDS) != t) {
bcsr_write(BCSR_HEXLEDS, t);
return 0;
}
}

/* okay, try the PB1200 then */
bcsr_init(PB1200_BCSR_PHYS_ADDR,
PB1200_BCSR_PHYS_ADDR + PB1200_BCSR_HEXLED_OFS);
bid = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
if ((bid == BCSR_WHOAMI_PB1200_DDR1) ||
(bid == BCSR_WHOAMI_PB1200_DDR2))
return 0;
(bid == BCSR_WHOAMI_PB1200_DDR2)) {
unsigned short t = bcsr_read(BCSR_HEXLEDS);
bcsr_write(BCSR_HEXLEDS, ~t);
if (bcsr_read(BCSR_HEXLEDS) != t) {
bcsr_write(BCSR_HEXLEDS, t);
return 0;
}
}

/* okay, try the DB1200 then */
bcsr_init(DB1200_BCSR_PHYS_ADDR,
DB1200_BCSR_PHYS_ADDR + DB1200_BCSR_HEXLED_OFS);
bid = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
return bid == BCSR_WHOAMI_DB1200 ? 0 : 1;
return 1; /* it's neither */
}

void __init board_setup(void)
Expand Down

0 comments on commit 16bc738

Please sign in to comment.