Convert CONFIG_SYS_NAND_ONFI_DETECTION to Kconfig
[platform/kernel/u-boot.git] / board / sandbox / sandbox.c
index 902b99e..5d9a945 100644 (file)
@@ -14,6 +14,9 @@
 #include <asm/global_data.h>
 #include <asm/test.h>
 #include <asm/u-boot-sandbox.h>
+#include <malloc.h>
+
+#include <extension_board.h>
 
 /*
  * Pointer to initial global data area
 gd_t *gd;
 
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
-/* Add a simple GPIO device */
+/*
+ * Add a simple GPIO device (don't use with of-platdata as it interferes with
+ * the auto-generated devices)
+ */
 U_BOOT_DRVINFO(gpio_sandbox) = {
        .name = "sandbox_gpio",
 };
@@ -79,6 +85,26 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
        return fdt_add_mem_rsv(fdt, 0x00d02000, 0x4000);
 }
 
+#ifdef CONFIG_CMD_EXTENSION
+int extension_board_scan(struct list_head *extension_list)
+{
+       struct extension *extension;
+       int i;
+
+       for (i = 0; i < 2; i++) {
+               extension = calloc(1, sizeof(struct extension));
+               snprintf(extension->overlay, sizeof(extension->overlay), "overlay%d.dtbo", i);
+               snprintf(extension->name, sizeof(extension->name), "extension board %d", i);
+               snprintf(extension->owner, sizeof(extension->owner), "sandbox");
+               snprintf(extension->version, sizeof(extension->version), "1.1");
+               snprintf(extension->other, sizeof(extension->other), "Fictionnal extension board");
+               list_add_tail(&extension->list, extension_list);
+       }
+
+       return i;
+}
+#endif
+
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {