[GSoC 2019 Project Proposal] USB configFS in device tree

I was inspired by the project idea posted on the wiki about enumerating USB devices from device tree nodes during boot. I have some experience in working with embedded Linux that I would like to reinforce by working on this project. I just finished the write up on eLinux here and would appreciate feedback, particularly on the time table as my current understanding of the Linux USB subsystem is limited.

Thank you

I was inspired by the project idea posted on the wiki about enumerating USB devices from device tree nodes during boot. I have some experience in working with embedded Linux that I would like to reinforce by working on this project. I just finished the write up on eLinux here and would appreciate feedback, particularly on the time table as my current understanding of the Linux USB subsystem is limited.

Thanks for following the proposal template.

I’d like to see more learning about the device tree API up front, rather than waiting for the project to start. Your ability to talk in some detail about the types of changes required in the kernel now will make a huge difference if we think you can actually execute the task when the time comes.

Yes, the documentation is scattered, conflicting, incomplete and expansive with the only true final documentation being the kernel code itself. Still, resources like Device Tree Reference - eLinux.org and many others will give you a start.

What I most want to see reflected in the proposal is an understanding of the complications of making the required changes. It is likely the upstream developers could have some pushback and some messages out on the appropriate lists discussing what is desired to be done and how you’d plan to attack it would go a LONG way to getting the community behind you in this effort.

Thank you for taking the time to give me some constructive feedback on my proposal. I have been taking some time during the last week to do exactly what you suggested this morning. In reading more documentation on both the Linux boot process, configfs, and the device tree I have a few questions now that I was hoping could be answered here.

My first questions is that it seems the device tree is meant to be used to describe non discoverable hardware which USB devices are not. Would this be a problem in getting upstream approval of any work regarding enumerating USB devices in the device tree? Reading through the ePAPR specification it does not appear that a device tree which describes discoverable hardware is non-compliant.

My second question is that configfs, as I understand it, is meant to serve as a userspace tool for managing kernel objects. Would it be appropriate for the kernel while booting to use this tool directly to create kernel objects? If not does configfs have a way to find kernel objects that already exist and build the userspace representation for them? That seems more like a sysfs function to me. If configfs does not have a way to find kernel objects then whatever I write would have to interface with the configfs essentially as existing scripts do.

A potential solution it seems to me would be to persist the configfs ram image, or portions of it, as a file and remount it at boot. Scripts could then check for the existence of the gadgets in configs and if they are not found then enumerate them.

I am going to keep looking at the documentation and am aiming to have an updating proposal by this Friday, March 22nd.