summaryrefslogtreecommitdiff
path: root/post
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-07-14 22:13:32 +0000
committerwdenk <wdenk>2003-07-14 22:13:32 +0000
commit8564acf936726c5568d71e4fa93a0ae9814e0d07 (patch)
tree05fa981555adf1d333970f3d52d0683008fe3cfb /post
parent5702923e23238df6c6f62d53f73863462ae62f4e (diff)
* Patches by Yuli Barcohen, 13 Jul 2003:
- Correct flash and JFFS2 support for MPC8260ADS - fix PVR values and clock generation for PowerQUICC II family (8270/8275/8280) * Patch by Bernhard Kuhn, 08 Jul 2003: - add support for M68K targets * Patch by Ken Chou, 3 Jul: - Fix PCI config table for A3000 - Fix iobase for natsemi.c (PCI_BASE_ADDRESS_0 is the IO base register for DP83815) * Allow to enable "slow" POST routines by key press on power-on * Fix temperature dependend switching of LCD backlight on LWMON * Tweak output format for LWMON
Diffstat (limited to 'post')
-rw-r--r--post/memory.c6
-rw-r--r--post/post.c6
-rw-r--r--post/sysmon.c54
-rw-r--r--post/tests.c8
4 files changed, 43 insertions, 31 deletions
diff --git a/post/memory.c b/post/memory.c
index 6884abdb18f..8b4263161c3 100644
--- a/post/memory.c
+++ b/post/memory.c
@@ -146,7 +146,7 @@
* regions of RAM around each 1Mb boundary. For example, for 64Mb
* RAM the following areas are verified: 0x00000000-0x00000800,
* 0x000ff800-0x00100800, 0x001ff800-0x00200800, ..., 0x03fff800-
- * 0x04000000. If the test is run in power-fail mode, it verifies
+ * 0x04000000. If the test is run in slow-test mode, it verifies
* the whole RAM.
*/
@@ -460,9 +460,9 @@ int memory_post_test (int flags)
256 << 20 : bd->bi_memsize) - (1 << 20);
- if (flags & POST_POWERFAIL) {
+ if (flags & POST_SLOWTEST) {
ret = memory_post_tests (CFG_SDRAM_BASE, memsize);
- } else { /* POST_POWERNORMAL */
+ } else { /* POST_NORMAL */
unsigned long i;
diff --git a/post/post.c b/post/post.c
index 9d62f408881..323447d1b3b 100644
--- a/post/post.c
+++ b/post/post.c
@@ -68,7 +68,7 @@ void post_bootmode_init (void)
if (bootmode == 0) {
bootmode = POST_POWERON;
} else if (bootmode == POST_POWERON) {
- bootmode = POST_POWERNORMAL;
+ bootmode = POST_NORMAL;
} else {
return;
}
@@ -153,8 +153,8 @@ static void post_bootmode_test_off (void)
static void post_get_flags (int *test_flags)
{
- int flag[] = { POST_POWERON, POST_POWERNORMAL, POST_POWERFAIL };
- char *var[] = { "post_poweron", "post_normal", "post_shutdown" };
+ int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST };
+ char *var[] = { "post_poweron", "post_normal", "post_slowtest" };
int varnum = sizeof (var) / sizeof (var[0]);
char list[128]; /* long enough for POST list */
char *name;
diff --git a/post/sysmon.c b/post/sysmon.c
index c039fe136b6..e28de904844 100644
--- a/post/sysmon.c
+++ b/post/sysmon.c
@@ -98,6 +98,7 @@ struct sysmon_table_s
void (*exec_before)(sysmon_table_t *);
void (*exec_after)(sysmon_table_t *);
+ int unit_precision;
int unit_div;
int unit_min;
int unit_max;
@@ -105,31 +106,34 @@ struct sysmon_table_s
uint val_min;
uint val_max;
int val_valid;
+ uint val_min_alt;
+ uint val_max_alt;
+ int val_valid_alt;
uint addr;
};
static sysmon_table_t sysmon_table[] =
{
{"Board temperature", " C", &sysmon_lm87_sgn, NULL, sysmon_ccfl_disable,
- 1, -128, 127, 0xFF, 0x58, 0xD5, 0, 0x27},
+ 1, 1, -128, 127, 0xFF, 0x58, 0xD5, 0, 0x67, 0xC6, 0, 0x27},
{"Front temperature", " C", &sysmon_lm87, NULL, sysmon_ccfl_disable,
- 100, -27316, 8984, 0xFF, 0xA4, 0xFC, 0, 0x29},
+ 1, 100, -27316, 8984, 0xFF, 0xA4, 0xFC, 0, 0xAE, 0xF1, 0, 0x29},
{"+3.3V CPU logic", "V", &sysmon_lm87, NULL, NULL,
- 1000, 0, 4386, 0xFF, 0xB6, 0xC9, 0, 0x22},
+ 100, 1000, 0, 4386, 0xFF, 0xB6, 0xC9, 0, 0xB6, 0xC9, 0, 0x22},
- {"+5V logic", "V", &sysmon_lm87, NULL, NULL,
- 1000, 0, 6630, 0xFF, 0xB6, 0xCA, 0, 0x23},
+ {"+ 5 V logic", "V", &sysmon_lm87, NULL, NULL,
+ 100, 1000, 0, 6630, 0xFF, 0xB6, 0xCA, 0, 0xB6, 0xCA, 0, 0x23},
- {"+12V PCMCIA", "V", &sysmon_lm87, NULL, NULL,
- 1000, 0, 15460, 0xFF, 0xBC, 0xD0, 0, 0x21},
+ {"+12 V PCMCIA", "V", &sysmon_lm87, NULL, NULL,
+ 100, 1000, 0, 15460, 0xFF, 0xBC, 0xD0, 0, 0xBC, 0xD0, 0, 0x21},
- {"+12V CCFL", "V", &sysmon_lm87, NULL, sysmon_ccfl_enable,
- 1000, 0, 15900, 0xFF, 0xB6, 0xCA, 0, 0x24},
+ {"+12 V CCFL", "V", &sysmon_lm87, NULL, sysmon_ccfl_enable,
+ 100, 1000, 0, 15900, 0xFF, 0xB6, 0xCA, 0, 0xB6, 0xCA, 0, 0x24},
- {"+5V standby", "V", &sysmon_pic, NULL, NULL,
- 1000, 0, 6040, 0xFF, 0xC8, 0xDE, 0, 0x7C},
+ {"+ 5 V standby", "V", &sysmon_pic, NULL, NULL,
+ 100, 1000, 0, 6040, 0xFF, 0xC8, 0xDE, 0, 0xC8, 0xDE, 0, 0x7C},
};
static int sysmon_table_size = sizeof(sysmon_table) / sizeof(sysmon_table[0]);
@@ -176,31 +180,38 @@ void sysmon_reloc (void)
}
}
-static char * sysmon_unit_value (sysmon_table_t * s, uint val)
+static char *sysmon_unit_value (sysmon_table_t *s, uint val)
{
static char buf[32];
int unit_val =
s->unit_min + (s->unit_max - s->unit_min) * val / s->val_mask;
- char * p;
+ char *p, sign;
int dec, frac;
- sprintf(buf, "%+d", unit_val / s->unit_div);
+ if (unit_val < 0) {
+ sign = '-';
+ unit_val = -unit_val;
+ } else {
+ sign = '+';
+ }
+
+ p = buf + sprintf(buf, "%c%2d", sign, unit_val / s->unit_div);
+
- frac = (unit_val > 0 ? unit_val : -unit_val) % s->unit_div;
- p = buf + strlen(buf);
+ frac = unit_val % s->unit_div;
- dec = s->unit_div;
+ frac /= (s->unit_div / s->unit_precision);
+
+ dec = s->unit_precision;
if (dec != 1)
{
*p++ = '.';
}
-
for (dec /= 10; dec != 0; dec /= 10)
{
- *p++ = '0' + frac / dec % 10;
+ *p++ = '0' + (frac / dec) % 10;
}
-
strcpy(p, s->unit_name);
return buf;
@@ -256,7 +267,7 @@ static uint sysmon_i2c_read_sgn (sysmon_t * this, uint addr)
static void sysmon_ccfl_disable (sysmon_table_t * this)
{
- if (!this->val_valid)
+ if (!this->val_valid_alt)
{
sysmon_temp_invalid = 1;
}
@@ -300,6 +311,7 @@ int sysmon_post_test (int flags)
val = t->sysmon->read(t->sysmon, t->addr);
t->val_valid = val >= t->val_min && val <= t->val_max;
+ t->val_valid_alt = val >= t->val_min_alt && val <= t->val_max_alt;
if (t->exec_after)
{
diff --git a/post/tests.c b/post/tests.c
index 55da92706af..02506c07901 100644
--- a/post/tests.c
+++ b/post/tests.c
@@ -68,7 +68,7 @@ struct post_test post_list[] =
"Watchdog timer test",
"watchdog",
"This test checks the watchdog timer.",
- POST_RAM | POST_POWERON | POST_POWERFAIL | POST_MANUAL | POST_REBOOT,
+ POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
&watchdog_post_test,
NULL,
NULL,
@@ -92,7 +92,7 @@ struct post_test post_list[] =
"RTC test",
"rtc",
"This test verifies the RTC operation.",
- POST_RAM | POST_POWERFAIL | POST_MANUAL,
+ POST_RAM | POST_SLOWTEST | POST_MANUAL,
&rtc_post_test,
NULL,
NULL,
@@ -104,7 +104,7 @@ struct post_test post_list[] =
"Memory test",
"memory",
"This test checks RAM.",
- POST_ROM | POST_POWERON | POST_POWERFAIL | POST_PREREL,
+ POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
&memory_post_test,
NULL,
NULL,
@@ -129,7 +129,7 @@ struct post_test post_list[] =
"UART test",
"uart",
"This test verifies the UART operation.",
- POST_RAM | POST_POWERFAIL | POST_MANUAL,
+ POST_RAM | POST_SLOWTEST | POST_MANUAL,
&uart_post_test,
NULL,
NULL,