2 Platform helper LED routines.
4 Copyright (c) 2013-2015 Intel Corporation.
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include "CommonHeader.h"
21 // Routines defined in other source modules of this component.
25 // Routines local to this source module.
29 GalileoGen2RouteOutFlashUpdateLed (
34 // For GpioNums below values 0 to 7 are for Port0 ie P0-0 - P0-7 and
35 // values 8 to 15 are for Port1 ie P1-0 - P1-7.
39 // Disable Pull-ups / pull downs on EXP0 pin for LVL_B_PU7 signal.
41 PlatformPcal9555GpioDisablePull (
42 GALILEO_GEN2_IOEXP0_7BIT_SLAVE_ADDR
, // IO Expander 0.
47 // Make LVL_B_OE7_N an output pin.
49 PlatformPcal9555GpioSetDir (
50 GALILEO_GEN2_IOEXP0_7BIT_SLAVE_ADDR
, // IO Expander 0.
56 // Set level of LVL_B_OE7_N to low.
58 PlatformPcal9555GpioSetLevel (
59 GALILEO_GEN2_IOEXP0_7BIT_SLAVE_ADDR
,
65 // Make MUX8_SEL an output pin.
67 PlatformPcal9555GpioSetDir (
68 GALILEO_GEN2_IOEXP1_7BIT_SLAVE_ADDR
, // IO Expander 1.
74 // Set level of MUX8_SEL to low to route GPIO_SUS<5> to LED.
76 PlatformPcal9555GpioSetLevel (
77 GALILEO_GEN2_IOEXP1_7BIT_SLAVE_ADDR
, // IO Expander 1.
84 // Routines exported by this source module.
88 Init platform LEDs into known state.
90 @param PlatformType Executing platform type.
91 @param I2cBus Pointer to I2c Host controller protocol.
93 @retval EFI_SUCCESS Operation success.
99 IN CONST EFI_PLATFORM_TYPE Type
102 EFI_BOOT_MODE BootMode
;
104 BootMode
= GetBootModeHob ();
107 // Init Flash update / recovery LED in OFF state.
109 if (BootMode
== BOOT_ON_FLASH_UPDATE
|| BootMode
== BOOT_IN_RECOVERY_MODE
) {
110 if (Type
== GalileoGen2
) {
111 PlatformLegacyGpioSetLevel (R_QNC_GPIO_RGLVL_RESUME_WELL
, GALILEO_GEN2_FLASH_UPDATE_LED_RESUMEWELL_GPIO
, FALSE
);
112 GalileoGen2RouteOutFlashUpdateLed ();
113 } else if (Type
== Galileo
) {
114 PlatformLegacyGpioSetLevel (R_QNC_GPIO_RGLVL_RESUME_WELL
, GALILEO_FLASH_UPDATE_LED_RESUMEWELL_GPIO
, FALSE
);
117 // These platforms have no flash update LED.
126 Turn on or off platform flash update LED.
128 @param PlatformType Executing platform type.
129 @param TurnOn If TRUE turn on else turn off.
131 @retval EFI_SUCCESS Operation success.
136 PlatformFlashUpdateLed (
137 IN CONST EFI_PLATFORM_TYPE Type
,
138 IN CONST BOOLEAN TurnOn
141 if (Type
== GalileoGen2
) {
142 PlatformLegacyGpioSetLevel (R_QNC_GPIO_RGLVL_RESUME_WELL
, GALILEO_GEN2_FLASH_UPDATE_LED_RESUMEWELL_GPIO
, TurnOn
);
143 } else if (Type
== Galileo
) {
144 PlatformLegacyGpioSetLevel (R_QNC_GPIO_RGLVL_RESUME_WELL
, GALILEO_FLASH_UPDATE_LED_RESUMEWELL_GPIO
, TurnOn
);
147 // These platforms have no flash update LED.