mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-13 05:55:02 -04:00
Motion-PRO: Add LED support.
Signed-off-by: Jan Wrobel <wrr@semihalf.com> Signed-off-by: Marian Balakowicz <m8@semihalf.com> Acked-by: Bartlomiej Sieka <tur@semihalf.com>
This commit is contained in:
parent
7d98ba770a
commit
a11c0b85dc
@ -33,6 +33,10 @@
|
|||||||
#include <ft_build.h>
|
#include <ft_build.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_STATUS_LED)
|
||||||
|
#include <status_led.h>
|
||||||
|
#endif /* CONFIG_STATUS_LED */
|
||||||
|
|
||||||
/* Kollmorgen DPR initialization data */
|
/* Kollmorgen DPR initialization data */
|
||||||
struct init_elem {
|
struct init_elem {
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
@ -180,3 +184,29 @@ void ft_board_setup(void *blob, bd_t *bd)
|
|||||||
ft_cpu_setup(blob, bd);
|
ft_cpu_setup(blob, bd);
|
||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
|
#endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(CONFIG_STATUS_LED)
|
||||||
|
void __led_init (led_id_t regaddr, int state)
|
||||||
|
{
|
||||||
|
*((vu_long *) regaddr) |= ENABLE_GPIO_OUT;
|
||||||
|
|
||||||
|
if (state == STATUS_LED_ON)
|
||||||
|
*((vu_long *) regaddr) |= LED_ON;
|
||||||
|
else
|
||||||
|
*((vu_long *) regaddr) &= ~LED_ON;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __led_set (led_id_t regaddr, int state)
|
||||||
|
{
|
||||||
|
if (state == STATUS_LED_ON)
|
||||||
|
*((vu_long *) regaddr) |= LED_ON;
|
||||||
|
else
|
||||||
|
*((vu_long *) regaddr) &= ~LED_ON;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __led_toggle (led_id_t regaddr)
|
||||||
|
{
|
||||||
|
*((vu_long *) regaddr) ^= LED_ON;
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_STATUS_LED */
|
||||||
|
@ -309,6 +309,28 @@
|
|||||||
#define CFG_I2C_RTC_ADDR 0x68
|
#define CFG_I2C_RTC_ADDR 0x68
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Status LED configuration
|
||||||
|
*/
|
||||||
|
#define CONFIG_STATUS_LED /* Status LED enabled */
|
||||||
|
#define CONFIG_BOARD_SPECIFIC_LED
|
||||||
|
|
||||||
|
#define ENABLE_GPIO_OUT 0x00000024
|
||||||
|
#define LED_ON 0x00000010
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
/*
|
||||||
|
* In case of Motion-PRO, a LED is identified by its corresponding
|
||||||
|
* GPT Enable and Mode Select Register.
|
||||||
|
*/
|
||||||
|
typedef volatile unsigned long * led_id_t;
|
||||||
|
|
||||||
|
extern void __led_init(led_id_t id, int state);
|
||||||
|
extern void __led_toggle(led_id_t id);
|
||||||
|
extern void __led_set(led_id_t id, int state);
|
||||||
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Environment settings
|
* Environment settings
|
||||||
*/
|
*/
|
||||||
|
@ -355,6 +355,18 @@ void status_led_set (int led, int state);
|
|||||||
# define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */
|
# define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */
|
||||||
# define STATUS_LED_BOOT 0 /* LED 0 used for boot status */
|
# define STATUS_LED_BOOT 0 /* LED 0 used for boot status */
|
||||||
|
|
||||||
|
#elif defined(CONFIG_MOTIONPRO)
|
||||||
|
|
||||||
|
#define STATUS_LED_BIT ((vu_long *) MPC5XXX_GPT6_ENABLE)
|
||||||
|
#define STATUS_LED_PERIOD (CFG_HZ / 10)
|
||||||
|
#define STATUS_LED_STATE STATUS_LED_BLINKING
|
||||||
|
|
||||||
|
#define STATUS_LED_BIT1 ((vu_long *) MPC5XXX_GPT7_ENABLE)
|
||||||
|
#define STATUS_LED_PERIOD1 (CFG_HZ / 10)
|
||||||
|
#define STATUS_LED_STATE1 STATUS_LED_OFF
|
||||||
|
|
||||||
|
#define STATUS_LED_BOOT 0 /* LED 0 used for boot status */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# error Status LED configuration missing
|
# error Status LED configuration missing
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user