From 65b20dcefc89618193fa51947968dada91e4c778 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 ff818b21b069f4bc9cb73373cc5a16014be101b7 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 0f855a1f056a8c22116a2103a3900cbfb669df0b 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 switcehd 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 d32a874b9b4c1e949ee38be7790f6bf6d6143451 Mon Sep 17 00:00:00 2001 From: Yuri Tikhonov Date: Sun, 6 Apr 2008 19:19:14 +0200 Subject: lwmon5 watchdog: limit trigger rate Limit the rate of h/w watch-dog triggering on the LWMON5 board by the CONFIG_WD_MAX_RATE value. Note that an earlier version of this patch which used microseconds instead of ticks dis not work. The problem was that we used usec2ticks() to convert microseconds into ticks. usec2ticks() uses get_tbclk(), which in turn calls get_sys_info(). It turns out that this function does a lot of prolonged operations (like divisions) which take too much time so we do not trigger the watchdog in time, and it resets the system. Signed-off-by: Yuri Tikhonov --- board/lwmon5/lwmon5.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'board') diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c index e5fa259..b63fbdc 100644 --- a/board/lwmon5/lwmon5.c +++ b/board/lwmon5/lwmon5.c @@ -476,6 +476,24 @@ int is_pci_host(struct pci_controller *hose) void hw_watchdog_reset(void) { int val; +#if defined(CONFIG_WD_MAX_RATE) + unsigned long long ct = get_ticks(); + + /* + * Don't allow watch-dog triggering more frequently than + * the predefined value CONFIG_WD_MAX_RATE [ticks]. + */ + if (ct >= gd->wdt_last) { + if ((ct - gd->wdt_last) < CONFIG_WD_MAX_RATE) + return; + } else { + /* Time base counter had been reset */ + if (((unsigned long long)(-1) - gd->wdt_last + ct) < + CONFIG_WD_MAX_RATE) + return; + } + gd->wdt_last = get_ticks(); +#endif /* * Toggle watchdog output -- cgit v1.1