diff options
author | Chris Packham <judge.packham@gmail.com> | 2022-08-04 12:06:23 +0300 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2022-08-09 09:58:27 +0300 |
commit | d1471948f336be8cd754cdc2d826e47e8d3e6c2c (patch) | |
tree | 99491cce8153a34fbc1c99eaf6b5827d681fe39f /board/alliedtelesis/SBx81LIFKW | |
parent | c8ef618ae1ab00bb491c14449f44c92047ede3d7 (diff) | |
download | u-boot-d1471948f336be8cd754cdc2d826e47e8d3e6c2c.tar.xz |
ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers
Replace code that accessed the GPIO registers directly with code that
makes use of the LED_GPIO driver.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board/alliedtelesis/SBx81LIFKW')
-rw-r--r-- | board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c index d8b9fdfe35..feb8b6b83f 100644 --- a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c +++ b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c @@ -13,7 +13,7 @@ #include <linux/io.h> #include <miiphy.h> #include <netdev.h> -#include <status_led.h> +#include <led.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> @@ -41,41 +41,6 @@ DECLARE_GLOBAL_DATA_PTR; -struct led { - u32 reg; - u32 value; - u32 mask; -}; - -struct led amber_solid = { - MVEBU_GPIO0_BASE, - BIT(10), - BIT(18) | BIT(10) -}; - -struct led green_solid = { - MVEBU_GPIO0_BASE, - BIT(18) | BIT(10), - BIT(18) | BIT(10) -}; - -struct led amber_flash = { - MVEBU_GPIO0_BASE, - 0, - BIT(18) | BIT(10) -}; - -struct led green_flash = { - MVEBU_GPIO0_BASE, - BIT(18), - BIT(18) | BIT(10) -}; - -static void status_led_set(struct led *led) -{ - clrsetbits_le32(led->reg, led->mask, led->value); -} - int board_early_init_f(void) { /* @@ -165,8 +130,6 @@ int board_init(void) /* address of boot parameters */ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; - status_led_set(&amber_solid); - return 0; } @@ -196,7 +159,16 @@ int mv88e61xx_hw_reset(struct phy_device *phydev) #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { - status_led_set(&green_flash); + struct udevice *dev; + int ret; + + ret = led_get_by_label("status:ledp", &dev); + if (!ret) + led_set_state(dev, LEDST_ON); + + ret = led_get_by_label("status:ledn", &dev); + if (!ret) + led_set_state(dev, LEDST_OFF); return 0; } |