[meta-intel] f_hid, f_mass_storage, and f_rdnis via usb_gadget_configfs for platform/intel-mid BSP w/ kernel 3.19-rc4

Chris McClimans chris at hippiehacker.org
Wed Jan 14 06:48:40 PST 2015


I'm trying to use the Intel Edison as a bootable usb gadget includes
hid, mass_storage, and network support.

My intention is to use the hid keyboard to send the right keystrokes
to select booting iPXE from the exported mass_storage which supports
USB nic booting(1).

The best route seems to compose the device using libusbg (2) and
configfs on 3.19-rc4, as it includes everything I need from the USB
gadget side.
All other approaches involve modifying the linux-yocto kernel.

The edison BSP from intel (3) provides quite a few patches (4) to
linux-yocto-3.10 that do not appear to be merged into yocto-linux or
mainline anywhere, so I've been trying to find the right place to
discuss and get feedback on various approaches. I'm not even sure what
list to discuss the Edison BSP kernel changes on. Is there any work
being done on a yocto-linux-3.19 + platform/intel-mid?

If I can't run 3.19-rc4 on the edison, one approach would be to create
a new gadget based on the src for g_multi and add hid support, which
was slightly patched by the edison-src-bsp. While this is easier than
the backport, it has the drawback that we can't dynamically
change/compose the configuration without recompiling the module.. This
is required to change the block device exported via mass_storage on
the fly.

Another would be to backport the needed usb gadget functions..
definately the hardest option, but without getting the Edison running
on 3.19 may be the most feature complete:

Other approaches or suggestions welcome.

=== functions needed for backport AKA reasons to stick with 3.19 ===

I would need f_hid, f_mass_storage, and f_rdnis which
aren't available in v3.10. Configfs f_hid is relatively recent,
f_rndis + f_mass_storage where merged into v3.11, but similar
functions actual entered the kernel in v3.10... which is what gives me
hope that the porting may be simple.

Porting the platform/intel-mid forward to a new kernel version without
communication from Intel would probably result in needless duplication
of effort. Would it be advisable for me to backport the
drivers/usb/gadget/function/* from 3.19-rc1 and compile them in
3.10.17? I doubt it would be as simple as copying them over and
modifying the Makefile, but one can hope.

https://lkml.org/lkml/2014/12/14/274 - v3.19-rc1 for f_hid

https://lkml.org/lkml/2013/7/1/388 - v3.11-rc1 for f_rndis and f_mass_storage

https://lkml.org/lkml/2013/4/29/248 - v3.10-rc1 for f_acm (which seems
to load and configure **)

**root at edison-3.10.17-withintelpatches:/# cat
/sys/kernel/config/usb_gadget/gadget/functions/acm.usb0/port_num
0

=== references ===

(1) http://www.johnwillis.com/2014/07/ipxe-support-for-usb-nic-booting.html
(2) https://github.com/libusbg/libusbg
(3) http://downloadmirror.intel.com/24389/eng/edison-src-rel1-maint-rel1-ww42-14.tgz
(4) ^^edison-src/device-software/meta-edison/recipes-kernel/linux/files/upstream_to_edison.patch


More information about the meta-intel mailing list