sandbox: Add an option to display of-platdata in SPL
[oweals/u-boot.git] / arch / sandbox / cpu / spl.c
index 42c149a49815198f7e1f3357851044d3c12e9c9a..49f98644c02f80ed1e184b38a500212e5990956d 100644 (file)
@@ -44,5 +44,19 @@ SPL_LOAD_IMAGE_METHOD("sandbox", 0, BOOT_DEVICE_BOARD, spl_board_load_image);
 
 void spl_board_init(void)
 {
+       struct sandbox_state *state = state_get_current();
+       struct udevice *dev;
+
        preloader_console_init();
+       if (state->show_of_platdata) {
+               /*
+                * Scan all the devices so that we can output their platform
+                * data. See sandbox_spl_probe().
+                */
+               printf("Scanning misc devices\n");
+               for (uclass_first_device(UCLASS_MISC, &dev);
+                    dev;
+                    uclass_next_device(&dev))
+                       ;
+       }
 }