mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-30 08:07:59 +00:00
test: dm: Update test for LED activity and boot
Update test for LED activity and boot to follow new implementation with property set to the LED node phandle. Also update a copy-paste error in the function name for the activity tests and actually enable the test with the DM_TEST macro. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
69542d0692
commit
68312417b8
2 changed files with 15 additions and 11 deletions
|
@ -101,8 +101,8 @@
|
||||||
bootscr-ram-offset = /bits/ 64 <0x12345678>;
|
bootscr-ram-offset = /bits/ 64 <0x12345678>;
|
||||||
bootscr-flash-offset = /bits/ 64 <0>;
|
bootscr-flash-offset = /bits/ 64 <0>;
|
||||||
bootscr-flash-size = /bits/ 64 <0x2000>;
|
bootscr-flash-size = /bits/ 64 <0x2000>;
|
||||||
boot-led = "sandbox:green";
|
boot-led = <&sandbox_led_green>;
|
||||||
activity-led = "sandbox:red";
|
activity-led = <&sandbox_led_red>;
|
||||||
testing-bool;
|
testing-bool;
|
||||||
testing-int = <123>;
|
testing-int = <123>;
|
||||||
testing-str = "testing";
|
testing-str = "testing";
|
||||||
|
@ -988,12 +988,12 @@
|
||||||
leds {
|
leds {
|
||||||
compatible = "gpio-leds";
|
compatible = "gpio-leds";
|
||||||
|
|
||||||
iracibble {
|
sandbox_led_red: iracibble {
|
||||||
gpios = <&gpio_a 1 0>;
|
gpios = <&gpio_a 1 0>;
|
||||||
label = "sandbox:red";
|
label = "sandbox:red";
|
||||||
};
|
};
|
||||||
|
|
||||||
martinet {
|
sandbox_led_green: martinet {
|
||||||
gpios = <&gpio_a 2 0>;
|
gpios = <&gpio_a 2 0>;
|
||||||
label = "sandbox:green";
|
label = "sandbox:green";
|
||||||
};
|
};
|
||||||
|
|
|
@ -144,7 +144,7 @@ static int dm_test_led_boot(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
struct udevice *dev
|
struct udevice *dev
|
||||||
|
|
||||||
/* options/u-boot/boot-led is set to "sandbox:green" */
|
/* options/u-boot/boot-led is set to phandle to "sandbox:green" */
|
||||||
ut_assertok(led_get_by_label("sandbox:green", &dev));
|
ut_assertok(led_get_by_label("sandbox:green", &dev));
|
||||||
ut_asserteq(LEDST_OFF, led_get_state(dev));
|
ut_asserteq(LEDST_OFF, led_get_state(dev));
|
||||||
ut_assertok(led_boot_on());
|
ut_assertok(led_boot_on());
|
||||||
|
@ -154,14 +154,15 @@ static int dm_test_led_boot(struct unit_test_state *uts)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
DM_TEST(dm_test_led_boot, UTF_SCAN_PDATA | UTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test LED boot blink fallback */
|
/* Test LED boot blink fallback */
|
||||||
#ifndef CONFIG_LED_BLINK
|
#ifndef CONFIG_LED_BLINK
|
||||||
static int dm_test_led_boot(struct unit_test_state *uts)
|
static int dm_test_led_boot_blink(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
struct udevice *dev
|
struct udevice *dev
|
||||||
|
|
||||||
/* options/u-boot/boot-led is set to "sandbox:green" */
|
/* options/u-boot/boot-led is set to phandle to "sandbox:green" */
|
||||||
ut_assertok(led_get_by_label("sandbox:green", &dev));
|
ut_assertok(led_get_by_label("sandbox:green", &dev));
|
||||||
ut_asserteq(LEDST_OFF, led_get_state(dev));
|
ut_asserteq(LEDST_OFF, led_get_state(dev));
|
||||||
ut_assertok(led_boot_blink());
|
ut_assertok(led_boot_blink());
|
||||||
|
@ -171,16 +172,17 @@ static int dm_test_led_boot(struct unit_test_state *uts)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
DM_TEST(dm_test_led_boot_blink, UTF_SCAN_PDATA | UTF_SCAN_FDT);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Test LED activity */
|
/* Test LED activity */
|
||||||
#ifdef CONFIG_LED_ACTIVITY
|
#ifdef CONFIG_LED_ACTIVITY
|
||||||
static int dm_test_led_boot(struct unit_test_state *uts)
|
static int dm_test_led_activity(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
struct udevice *dev
|
struct udevice *dev
|
||||||
|
|
||||||
/* options/u-boot/activity-led is set to "sandbox:red" */
|
/* options/u-boot/activity-led is set to phandle to "sandbox:red" */
|
||||||
ut_assertok(led_get_by_label("sandbox:red", &dev));
|
ut_assertok(led_get_by_label("sandbox:red", &dev));
|
||||||
ut_asserteq(LEDST_OFF, led_get_state(dev));
|
ut_asserteq(LEDST_OFF, led_get_state(dev));
|
||||||
ut_assertok(led_activity_on());
|
ut_assertok(led_activity_on());
|
||||||
|
@ -190,14 +192,15 @@ static int dm_test_led_boot(struct unit_test_state *uts)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
DM_TEST(dm_test_led_activity, UTF_SCAN_PDATA | UTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test LED activity blink fallback */
|
/* Test LED activity blink fallback */
|
||||||
#ifndef CONFIG_LED_BLINK
|
#ifndef CONFIG_LED_BLINK
|
||||||
static int dm_test_led_boot(struct unit_test_state *uts)
|
static int dm_test_led_activityt_blink(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
struct udevice *dev
|
struct udevice *dev
|
||||||
|
|
||||||
/* options/u-boot/activity-led is set to "sandbox:red" */
|
/* options/u-boot/activity-led is set to phandle to "sandbox:red" */
|
||||||
ut_assertok(led_get_by_label("sandbox:red", &dev));
|
ut_assertok(led_get_by_label("sandbox:red", &dev));
|
||||||
ut_asserteq(LEDST_OFF, led_get_state(dev));
|
ut_asserteq(LEDST_OFF, led_get_state(dev));
|
||||||
ut_assertok(led_activity_blink());
|
ut_assertok(led_activity_blink());
|
||||||
|
@ -207,5 +210,6 @@ static int dm_test_led_boot(struct unit_test_state *uts)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
DM_TEST(dm_test_led_activityt_blink, UTF_SCAN_PDATA | UTF_SCAN_FDT);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue