}
DM_TEST(dm_test_led_blink, UTF_SCAN_PDATA | UTF_SCAN_FDT);
#endif
+
+/* Test LED boot */
+#ifdef CONFIG_LED_BOOT
+static int dm_test_led_boot(struct unit_test_state *uts)
+{
+ struct udevice *dev
+
+ /* options/u-boot/boot-led is set to "sandbox:green" */
+ ut_assertok(led_get_by_label("sandbox:green", &dev));
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+ ut_assertok(led_boot_on());
+ ut_asserteq(LEDST_ON, led_get_state(dev));
+ ut_assertok(led_boot_off());
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+ return 0;
+}
+
+/* Test LED boot blink fallback */
+#ifndef CONFIG_LED_BLINK
+static int dm_test_led_boot(struct unit_test_state *uts)
+{
+ struct udevice *dev
+
+ /* options/u-boot/boot-led is set to "sandbox:green" */
+ ut_assertok(led_get_by_label("sandbox:green", &dev));
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+ ut_assertok(led_boot_blink());
+ ut_asserteq(LEDST_ON, led_get_state(dev));
+ ut_assertok(led_boot_off());
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+ return 0;
+}
+#endif
+#endif
+
+/* Test LED activity */
+#ifdef CONFIG_LED_ACTIVITY
+static int dm_test_led_boot(struct unit_test_state *uts)
+{
+ struct udevice *dev
+
+ /* options/u-boot/activity-led is set to "sandbox:red" */
+ ut_assertok(led_get_by_label("sandbox:red", &dev));
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+ ut_assertok(led_activity_on());
+ ut_asserteq(LEDST_ON, led_get_state(dev));
+ ut_assertok(led_activity_off());
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+ return 0;
+}
+
+/* Test LED activity blink fallback */
+#ifndef CONFIG_LED_BLINK
+static int dm_test_led_boot(struct unit_test_state *uts)
+{
+ struct udevice *dev
+
+ /* options/u-boot/activity-led is set to "sandbox:red" */
+ ut_assertok(led_get_by_label("sandbox:red", &dev));
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+ ut_assertok(led_activity_blink());
+ ut_asserteq(LEDST_ON, led_get_state(dev));
+ ut_assertok(led_activity_off());
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+ return 0;
+}
+#endif
+#endif