Commit 3152c7e3 authored by Todd Poynor's avatar Todd Poynor Committed by Tony Lindgren

[PATCH] ARM: OMAP: P2 timer/idle LEDs fix

Must... have.. blinky... LEDs... on OMAP730 P2...
Signed-off-by: default avatarTodd Poynor <tpoynor@mvista.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent c0a93f8b
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/leds.h> #include <asm/leds.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/mach-types.h>
#include <asm/arch/fpga.h> #include <asm/arch/fpga.h>
#include <asm/arch/gpio.h> #include <asm/arch/gpio.h>
...@@ -64,14 +65,19 @@ void h2p2_dbg_leds_event(led_event_t evt) ...@@ -64,14 +65,19 @@ void h2p2_dbg_leds_event(led_event_t evt)
case led_stop: case led_stop:
case led_halted: case led_halted:
/* all leds off during suspend or shutdown */ /* all leds off during suspend or shutdown */
omap_set_gpio_dataout(GPIO_TIMER, 0);
omap_set_gpio_dataout(GPIO_IDLE, 0); if (! machine_is_omap_perseus2()) {
omap_set_gpio_dataout(GPIO_TIMER, 0);
omap_set_gpio_dataout(GPIO_IDLE, 0);
}
__raw_writew(~0, &fpga->leds); __raw_writew(~0, &fpga->leds);
led_state &= ~LED_STATE_ENABLED; led_state &= ~LED_STATE_ENABLED;
if (evt == led_halted) { if (evt == led_halted) {
iounmap(fpga); iounmap(fpga);
fpga = NULL; fpga = NULL;
} }
goto done; goto done;
case led_claim: case led_claim:
...@@ -86,18 +92,37 @@ void h2p2_dbg_leds_event(led_event_t evt) ...@@ -86,18 +92,37 @@ void h2p2_dbg_leds_event(led_event_t evt)
#ifdef CONFIG_LEDS_TIMER #ifdef CONFIG_LEDS_TIMER
case led_timer: case led_timer:
led_state ^= LED_TIMER_ON; led_state ^= LED_TIMER_ON;
omap_set_gpio_dataout(GPIO_TIMER, led_state & LED_TIMER_ON);
goto done; if (machine_is_omap_perseus2())
hw_led_state ^= H2P2_DBG_FPGA_P2_LED_TIMER;
else {
omap_set_gpio_dataout(GPIO_TIMER, led_state & LED_TIMER_ON);
goto done;
}
break;
#endif #endif
#ifdef CONFIG_LEDS_CPU #ifdef CONFIG_LEDS_CPU
case led_idle_start: case led_idle_start:
omap_set_gpio_dataout(GPIO_IDLE, 1); if (machine_is_omap_perseus2())
goto done; hw_led_state |= H2P2_DBG_FPGA_P2_LED_IDLE;
else {
omap_set_gpio_dataout(GPIO_IDLE, 1);
goto done;
}
break;
case led_idle_end: case led_idle_end:
omap_set_gpio_dataout(GPIO_IDLE, 0); if (machine_is_omap_perseus2())
goto done; hw_led_state &= ~H2P2_DBG_FPGA_P2_LED_IDLE;
else {
omap_set_gpio_dataout(GPIO_IDLE, 0);
goto done;
}
break;
#endif #endif
case led_green_on: case led_green_on:
...@@ -136,7 +161,7 @@ void h2p2_dbg_leds_event(led_event_t evt) ...@@ -136,7 +161,7 @@ void h2p2_dbg_leds_event(led_event_t evt)
/* /*
* Actually burn the LEDs * Actually burn the LEDs
*/ */
if (led_state & LED_STATE_CLAIMED) if (led_state & LED_STATE_ENABLED)
__raw_writew(~hw_led_state, &fpga->leds); __raw_writew(~hw_led_state, &fpga->leds);
done: done:
......
...@@ -77,6 +77,8 @@ struct h2p2_dbg_fpga { ...@@ -77,6 +77,8 @@ struct h2p2_dbg_fpga {
#define H2P2_DBG_FPGA_LOAD_METER_SIZE 11 #define H2P2_DBG_FPGA_LOAD_METER_SIZE 11
#define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1) #define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
#define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0)
#define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1)
/* /*
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment