BeagleBoard/GSoC/2021 Proposal/usb configfs in device tree

= Proposal for Device Tree Improvement =


 * Student: Shreyas Atre
 * Mentors: Not Assigned
 * Code: [N/A]
 * Proposal : https://elinux.org/index.php?title=BeagleBoard/GSoC/2021_Proposal/usb_configfs_in_device_tree
 * Wiki: [N/A]
 * GSoC: [N/A]

= Status =
 * Pre-application phase

= Proposal =
 * Completed "Hello Wolrd" of cross compilation mentioned in the requirements list.
 * Sent a PR to the mentioned upstream #145

About You

 * IRC : satacker (@satacker:matrix.org)
 * Github: https://github.com/SAtacker/
 * School: Veermata Jijabai Technological Institute (VJTI)
 * Country: India
 * Primary language : English, Hindi, Marathi
 * Typical work hours : 10AM - 7PM Indian Standard Time
 * Experience :
 * kernel learn is a repo I had created for kernel learning purpose in which I had learned several Kernel development Basics.
 * Qt Embedded is my Qt application for sending data to esp32 uC using Boost.ASIO for Netowrking stack
 * I have realised the beauty of embedded systems after working on esp32 dev board and reading Exploring Linux with Beaglebone by Derek Molloy while in Society of Robotics and Automation as a core team member. This is the first time i am participating in GSoC

= About Your Project =


 * Project name: USB configfs in device tree

Description

 * ConfigFS which along with libcomposite allows to set up custom gadget. This can be achieved using simple, command line file system operation like mkdir, rmdir, ln -s, read and write. It is possible to configure usb gadget using only command line but each time after reboot user needs to recreate all gadgets once again. This means that after each reboot user needs to use commands. This is definitely not acceptable for those who used legacy gadgets and write only modprobe g_ether.
 * Also scripts can be edited and are obviously less secure.
 * Secondly it's really hard to modify such a script because many calls has hard-coded path where for example echo should be done. There is a lot of simple, but low level operations which can cause a lot of confusion for beginner.
 * This leads us to our solution of libusbgx which is a more recent version of libusbg which is no longer maintained.
 * It provides Light weight configuration files which describes composition of functions into gadget. They can be simply loaded using usbg_import_* and exported using usbg_export_*. This makes them easy to use equivalent of modprobe gadget_module.
 * Goal : USB configfs in device tree such that they can be configured statically in device tree ahead of boot and speed the boot process by providing configfs and using libusbgx gadget schemes
 * An example from libusbgx docs acm-ecm device

Implementation Details

 * Configure uboot with static Device trees instead of compiling it every time.
 * To compile configfs as a module with support for USB gadget creation
 * Provide libusbgx gadget schemes or configuration files
 * Add udev rules for modules
 * Implement tests for module configuration
 * Benchmark performance difference
 * Add support for gadget tools