From 5029f400e62981278957f62c5f8b4e22c2faecd9 Mon Sep 17 00:00:00 2001 From: Jae Hyun Yoo Date: Fri, 26 Jun 2020 14:35:47 -0700 Subject: [PATCH] Add BMC running indicator LED control HBLED cannot be enabled due to a conflict with PWM15 pin and H/W team is not going to change board layout for supporting HBLED to keep compatibility between board revisions. Instead, we are going to use the LED connected to GPIO V5 as BMC running indicator LED. This commit adds the LED control. Signed-off-by: Jae Hyun Yoo --- board/aspeed/ast2600_intel/intel.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c index e93ef57dabed..565893777ffc 100644 --- a/board/aspeed/ast2600_intel/intel.c +++ b/board/aspeed/ast2600_intel/intel.c @@ -192,6 +192,8 @@ static void sgpio_init(void) #define GPIO_024 0x024 /* GPIO E/F/G/H Direction */ #define GPIO_070 0x070 /* GPIO I/J/K/L Value */ #define GPIO_074 0x074 /* GPIO I/J/K/L Direction */ +#define GPIO_088 0x088 /* GPIO U/V/W/X Value */ +#define GPIO_08C 0x08C /* GPIO U/V/W/X Direction */ static void set_gpio_default_state(void) { @@ -252,6 +254,20 @@ void enable_onboard_tpm(void) AST_GPIO_BASE | GPIO_000); } +void bmc_running_indicator(bool on) +{ +#define GPIO_V5 BIT(13) + + writel(readl(AST_GPIO_BASE | GPIO_08C) | GPIO_V5, + AST_GPIO_BASE | GPIO_08C); + if (on) + writel(readl(AST_GPIO_BASE | GPIO_088) & ~GPIO_V5, + AST_GPIO_BASE | GPIO_088); + else + writel(readl(AST_GPIO_BASE | GPIO_088) | GPIO_V5, + AST_GPIO_BASE | GPIO_088); +} + static void timer_callback(void *cookie) { uint timer_nr = (uint)cookie; @@ -292,6 +308,8 @@ int board_early_init_r(void) enable_onboard_tpm(); + bmc_running_indicator(true); + return 0; } -- 2.7.4