From 8f15d4addd49c956412e1e3bfc764a0c8b1f3184 Mon Sep 17 00:00:00 2001 From: Yuri Tikhonov Date: Mon, 4 Feb 2008 14:10:42 +0100 Subject: The patch adds new POST tests for the Lwmon5 board. These are: * External Watchdog test; * dsPIC tests; * FPGA test; * GDC test; * Sysmon tests. Signed-off-by: Dmitry Rakhchev Signed-off-by: Yuri Tikhonov --- board/lwmon5/lwmon5.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'board') diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c index 815c01f..73d5de5 100644 --- a/board/lwmon5/lwmon5.c +++ b/board/lwmon5/lwmon5.c @@ -96,6 +96,25 @@ int board_early_init_f(void) gpio_write_bit(CFG_GPIO_FLASH_WP, 1); +#if CONFIG_POST & CFG_POST_BSPEC1 + gpio_write_bit(CFG_GPIO_HIGHSIDE, 1); + + reg = 0; /* reuse as counter */ + out_be32((void *)CFG_DSPIC_TEST_ADDR, + in_be32((void *)CFG_DSPIC_TEST_ADDR) + & ~CFG_DSPIC_TEST_MASK); + while (!gpio_read_in_bit(CFG_GPIO_DSPIC_READY) && reg++ < 1000) { + udelay(1000); + } + gpio_write_bit(CFG_GPIO_HIGHSIDE, 0); + if (gpio_read_in_bit(CFG_GPIO_DSPIC_READY)) { + /* set "boot error" flag */ + out_be32((void *)CFG_DSPIC_TEST_ADDR, + in_be32((void *)CFG_DSPIC_TEST_ADDR) | + CFG_DSPIC_TEST_MASK); + } +#endif + /* * Reset PHY's: * The PHY's need a 2nd reset pulse, since the MDIO address is latched -- cgit v1.1 From 0f009f781b5b88f25769e154ea4d42db13baf0c6 Mon Sep 17 00:00:00 2001 From: Yuri Tikhonov Date: Mon, 4 Feb 2008 17:11:53 +0100 Subject: Add support for the lwmon5 board reset via GPIO58. Signed-off-by: Dmitry Rakhchev Signed-off-by: Yuri Tikhonov --- board/lwmon5/lwmon5.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board') diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c index 73d5de5..7c5f6cc 100644 --- a/board/lwmon5/lwmon5.c +++ b/board/lwmon5/lwmon5.c @@ -594,3 +594,8 @@ void video_get_info_str (int line_number, char *info) } #endif #endif /* CONFIG_VIDEO */ + +void board_reset(void) +{ + gpio_write_bit(CFG_GPIO_BOARD_RESET, 1); +} -- cgit v1.1 From 46bc0a938779aa1d664b847d36b08aa00f22e539 Mon Sep 17 00:00:00 2001 From: Yuri Tikhonov Date: Tue, 18 Mar 2008 13:27:57 +0100 Subject: Fix backlight in the lwmon5 POST. Backlight was switched on even when temperature was too low. Signed-off-by: Dmitry Rakhchev Signed-off-by: Yuri Tikhonov --- board/lwmon5/lwmon5.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c index 7c5f6cc..e5fa259 100644 --- a/board/lwmon5/lwmon5.c +++ b/board/lwmon5/lwmon5.c @@ -567,11 +567,13 @@ unsigned int board_video_init (void) return CFG_LIME_BASE_0; } -void board_backlight_switch (int flag) +#define DEFAULT_BRIGHTNESS 0x64 + +static void board_backlight_brightness(int brightness) { - if (flag) { + if (brightness > 0) { /* pwm duty, lamp on */ - out_be32((void *)(CFG_FPGA_BASE_0 + 0x00000024), 0x64); + out_be32((void *)(CFG_FPGA_BASE_0 + 0x00000024), brightness); out_be32((void *)(CFG_FPGA_BASE_0 + 0x00000020), 0x701); } else { /* lamp off */ @@ -580,6 +582,22 @@ void board_backlight_switch (int flag) } } +void board_backlight_switch (int flag) +{ + char * param; + int rc; + + if (flag) { + param = getenv("brightness"); + rc = param ? simple_strtol(param, NULL, 10) : -1; + if (rc < 0) + rc = DEFAULT_BRIGHTNESS; + } else { + rc = 0; + } + board_backlight_brightness(rc); +} + #if defined(CONFIG_CONSOLE_EXTRA_INFO) /* * Return text to be printed besides the logo. -- cgit v1.1 From b73a19e1609d0f705cbab8014ca17aefe89e4c76 Mon Sep 17 00:00:00 2001 From: Yuri Tikhonov Date: Thu, 20 Mar 2008 17:56:04 +0300 Subject: LWMON5: POST RTC fix Modify the RTC API to provide one a status for the time reported by the rtc_get() function: 0 - a reliable time is guaranteed, < 0 - a reliable time isn't guaranteed (power fault, clock issues, and so on). The RTC chip drivers are responsible for providing this info if the corresponding chip supports such functionality. If not - always report that the time is reliable. The POST RTC test was modified to detect the RTC faults utilizing this new rtc_get() feature. Signed-off-by: Yuri Tikhonov --- board/bmw/m48t59y.c | 4 +++- board/cray/L1/L1.c | 4 ++-- board/etin/debris/phantom.c | 4 +++- board/mousse/m48t59y.c | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) (limited to 'board') diff --git a/board/bmw/m48t59y.c b/board/bmw/m48t59y.c index d72c861..a1a85d0 100644 --- a/board/bmw/m48t59y.c +++ b/board/bmw/m48t59y.c @@ -278,7 +278,7 @@ void m48_watchdog_arm(int usec) /* * U-Boot RTC support. */ -void +int rtc_get( struct rtc_time *tmp ) { m48_tod_get(&tmp->tm_year, @@ -295,6 +295,8 @@ rtc_get( struct rtc_time *tmp ) tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, tmp->tm_hour, tmp->tm_min, tmp->tm_sec ); #endif + + return 0; } void diff --git a/board/cray/L1/L1.c b/board/cray/L1/L1.c index a0fac7f..5264baf 100644 --- a/board/cray/L1/L1.c +++ b/board/cray/L1/L1.c @@ -170,9 +170,9 @@ long int initdram (int board_type) /* ------------------------------------------------------------------------- */ /* stubs so we can print dates w/o any nvram RTC.*/ -void rtc_get (struct rtc_time *tmp) +int rtc_get (struct rtc_time *tmp) { - return; + return 0; } void rtc_set (struct rtc_time *tmp) { diff --git a/board/etin/debris/phantom.c b/board/etin/debris/phantom.c index 18ab500..263da6b 100644 --- a/board/etin/debris/phantom.c +++ b/board/etin/debris/phantom.c @@ -182,7 +182,7 @@ static int get_century_flag(void) return flag; } -void rtc_get( struct rtc_time *tmp) +int rtc_get( struct rtc_time *tmp) { if (phantom_flag < 0) phantom_flag = get_phantom_flag(); @@ -250,6 +250,8 @@ void rtc_get( struct rtc_time *tmp) tmp->tm_yday = 0; tmp->tm_isdst= 0; } + + return 0; } void rtc_set( struct rtc_time *tmp ) diff --git a/board/mousse/m48t59y.c b/board/mousse/m48t59y.c index 37a6244..2c1e6cf 100644 --- a/board/mousse/m48t59y.c +++ b/board/mousse/m48t59y.c @@ -278,7 +278,7 @@ void m48_watchdog_arm(int usec) /* * U-Boot RTC support. */ -void +int rtc_get( struct rtc_time *tmp ) { m48_tod_get(&tmp->tm_year, @@ -295,6 +295,8 @@ rtc_get( struct rtc_time *tmp ) tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, tmp->tm_hour, tmp->tm_min, tmp->tm_sec ); #endif + + return 0; } void -- cgit v1.1