mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 18:12:36 +03:00
[smsc95xx] Enable LEDs
The LED pins are configured by default as GPIO inputs. While it is conceivable that a board might actually use these pins as GPIOs, no such board is known to exist. The Linux smsc95xx driver configures these pins unconditionally as LED outputs. Assume that it is safe to do likewise. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -687,6 +687,7 @@ static int smsc95xx_dump_statistics ( struct smsc95xx_device *smsc95xx ) {
|
||||
*/
|
||||
static int smsc95xx_reset ( struct smsc95xx_device *smsc95xx ) {
|
||||
uint32_t hw_cfg;
|
||||
uint32_t led_gpio_cfg;
|
||||
int rc;
|
||||
|
||||
/* Reset device */
|
||||
@@ -706,6 +707,17 @@ static int smsc95xx_reset ( struct smsc95xx_device *smsc95xx ) {
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
/* Configure LEDs */
|
||||
led_gpio_cfg = ( SMSC95XX_LED_GPIO_CFG_GPCTL2_NSPD_LED |
|
||||
SMSC95XX_LED_GPIO_CFG_GPCTL1_NLNKA_LED |
|
||||
SMSC95XX_LED_GPIO_CFG_GPCTL0_NFDX_LED );
|
||||
if ( ( rc = smsc95xx_writel ( smsc95xx, SMSC95XX_LED_GPIO_CFG,
|
||||
led_gpio_cfg ) ) != 0 ) {
|
||||
DBGC ( smsc95xx, "SMSC95XX %p could not configure LEDs: %s\n",
|
||||
smsc95xx, strerror ( rc ) );
|
||||
/* Ignore error and continue */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user