Hi Experts,

The trick for changing from CONFIG_USB to CONFIG_USB_DISK did help to compile but it doesn't seem to be correct fix and not helping at run time. I have configured libpayload with CONFIG_USB support but that define is not included in the filo/build/config.h. As a result I get debug message No USB stack in libpayload. So FILO is assuming that libpayload is not configured with USB stack.

Here is a summary of problem and looking for your guidance

1. in Filo there are two configuration files (.config and lib.config)
2. When  USB stack is enabled in libpayload CONFIG_USB=y is defined in lib.config but not in .config
3. build/config.h does not have CONFIG_USB defined. As a result all the code kept under CONFIG_USB macro in FILO source tree assumes that libpayload does not have USB stack.

Can someone please let me know what is the correct procedure to include USB stack in libpayload and inform to FILO that yes libpayload really has usb stack support?



On Sat, Oct 11, 2014 at 12:14 AM, Vipin Gahlaut <gailu96@gmail.com> wrote:
Here is the patch I used to fix build error.

diff --git a/drivers/usb.c b/drivers/usb.c
index 0da6efa..a959389 100644
--- a/drivers/usb.c
+++ b/drivers/usb.c
@@ -20,7 +20,7 @@
 #include <libpayload-config.h>
 
 /* Only use this code if libpayload is compiled with USB stack */
-#ifdef CONFIG_USB
+#ifdef CONFIG_USB_DISK
 #include <fs.h>
 #include <usb/usb.h>
 #include <usb/usbmsc.h>

Please let me know if this is correct and I should submit it

On Fri, Oct 10, 2014 at 11:41 PM, Vipin Gahlaut <gailu96@gmail.com> wrote:
Hi,

We need USB support in Filo. Our Linux kernel and file system is expected to be on USB thumb driver. We have enabled USB in menuconfig; however build fails with following errors.

blockdev.c:(.text+0x18e): undefined reference to `usb_read'
/home/vgahlaut/coreboot-fsp/coreboot/payloads/filo/build/fs/blockdev.o: In function `devopen':
blockdev.c:(.text+0x91e): undefined reference to `usb_probe'

We are using latest FILO and Coreboot from git repository. These functions seems to be defined in drivers/usb.c and usb.c is getting compiled.

Problem seems to be due to the fact that CONFIG_USB=y in .config is automatically removed during make and these function are defined in usb.c under #ifdef CONFIG_USB

Can you please suggest a solution and let me know why CONFIG_USB is removed from my .config