From: matthias.fuchs at esd.eu <matthias.fuchs@esd.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 6/6] 4xx: Add support for DP405 hardware variants
Date: Wed, 29 Apr 2009 09:51:01 +0200 [thread overview]
Message-ID: <124099147351-git-send-email-matthias.fuchs@esd.eu> (raw)
In-Reply-To: <12409914732884-git-send-email-matthias.fuchs@esd.eu>
From: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
---
board/esd/dp405/dp405.c | 32 ++++++++++++++++++++++++++------
1 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/board/esd/dp405/dp405.c b/board/esd/dp405/dp405.c
index 352b877..8f4b78d 100644
--- a/board/esd/dp405/dp405.c
+++ b/board/esd/dp405/dp405.c
@@ -89,20 +89,40 @@ int checkboard (void)
int i = getenv_r ("serial#", str, sizeof(str));
unsigned char trans[16] = {0x0,0x8,0x4,0xc,0x2,0xa,0x6,0xe,
0x1,0x9,0x5,0xd,0x3,0xb,0x7,0xf};
- unsigned char id1, id2;
+ unsigned char id1, id2, rev;
puts ("Board: ");
- if (i == -1) {
+ if (i == -1)
puts ("### No HW ID - assuming DP405");
- } else {
+ else
puts(str);
- }
id1 = trans[(~(in_be32((void *)GPIO0_IR) >> 5)) & 0x0000000f];
id2 = trans[(~(in_be32((void *)GPIO0_IR) >> 9)) & 0x0000000f];
- printf(" (ID=0x%1X%1X, PLD=0x%02X)\n",
- id2, id1, in_8((void *)0xf0001000));
+
+ rev = in_8((void *)0xf0001000);
+ if (rev & 0x10) /* old DP405 compatibility */
+ rev = in_8((void *)0xf0000800);
+
+ switch (rev & 0xc0) {
+ case 0x00:
+ puts(" (HW=DP405");
+ break;
+ case 0x80:
+ puts(" (HW=DP405/CO");
+ break;
+ case 0xc0:
+ puts(" (HW=DN405");
+ break;
+ }
+ printf(", ID=0x%1X%1X, PLD=0x%02X", id2, id1, rev & 0x0f);
+
+ if ((rev & 0xc0) == 0xc0) {
+ printf(", C5V=%s",
+ in_be32((void *)GPIO0_IR) & 0x40000000 ? "off" : "on");
+ }
+ puts(")\n");
return 0;
}
--
1.5.3
next prev parent reply other threads:[~2009-04-29 7:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-29 7:50 [U-Boot] [PATCH 1/6] esd/common: extend cpld command with address parameter matthias.fuchs at esd.eu
2009-04-29 7:50 ` [U-Boot] [PATCH 2/6] 4xx: Remove binary cpld bitstream from CMS700 board matthias.fuchs at esd.eu
2009-04-29 7:50 ` [U-Boot] [PATCH 3/6] 4xx: Remove binary cpld bitstream from PMC405 board matthias.fuchs at esd.eu
2009-04-29 7:50 ` [U-Boot] [PATCH 4/6] 4xx: Remove binary cpld bitstream from VOM405 board matthias.fuchs at esd.eu
2009-04-29 7:51 ` [U-Boot] [PATCH 5/6] 4xx: Remove binary cpld bitstream from DP405 board matthias.fuchs at esd.eu
2009-04-29 7:51 ` matthias.fuchs at esd.eu [this message]
2009-05-04 8:10 ` [U-Boot] [PATCH 1/6] esd/common: extend cpld command with address parameter Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=124099147351-git-send-email-matthias.fuchs@esd.eu \
--to=matthias.fuchs@esd.eu \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox