1*2764adbbSAndroid Build Coastguard Worker# About the linux-firmware project 2*2764adbbSAndroid Build Coastguard Worker 3*2764adbbSAndroid Build Coastguard WorkerPlease be aware that this project is not just a local Android project. 4*2764adbbSAndroid Build Coastguard WorkerIt is actually intended to (roughly--see NOTES below) match up with the 5*2764adbbSAndroid Build Coastguard Workerupstream git repository hosted at: 6*2764adbbSAndroid Build Coastguard Worker 7*2764adbbSAndroid Build Coastguard Worker<https://gitlab.com/kernel-firmware/linux-firmware.git> 8*2764adbbSAndroid Build Coastguard Worker 9*2764adbbSAndroid Build Coastguard WorkerMirrored at: 10*2764adbbSAndroid Build Coastguard Worker 11*2764adbbSAndroid Build Coastguard Worker<https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/> 12*2764adbbSAndroid Build Coastguard Worker 13*2764adbbSAndroid Build Coastguard WorkerSee also the [upstream README.md]. 14*2764adbbSAndroid Build Coastguard Worker 15*2764adbbSAndroid Build Coastguard WorkerThe local Android project is managed with [Copybara], though used in a 16*2764adbbSAndroid Build Coastguard Workerslightly non-standard way. In order to fit into Android's infrastructure 17*2764adbbSAndroid Build Coastguard Workerthat tracks licensing and also to let us to update each firmware 18*2764adbbSAndroid Build Coastguard Workerindividually, our [Copybara] script doesn't act on the whole repo. Instead it 19*2764adbbSAndroid Build Coastguard Workeracts on smaller groups of upstream files and keeps each group in its own 20*2764adbbSAndroid Build Coastguard Workerdirectory. 21*2764adbbSAndroid Build Coastguard Worker 22*2764adbbSAndroid Build Coastguard WorkerEach group is a logical set of files that someone may want to include in 23*2764adbbSAndroid Build Coastguard Workeran Android product. All files in a given group must share the same license. 24*2764adbbSAndroid Build Coastguard WorkerIf two files normally go together but share different licenses then they'll 25*2764adbbSAndroid Build Coastguard Workerneed separate groups and Android products will simply need to know to include 26*2764adbbSAndroid Build Coastguard Workerboth groups. 27*2764adbbSAndroid Build Coastguard Worker 28*2764adbbSAndroid Build Coastguard Worker## How to use this firmware in your Android product 29*2764adbbSAndroid Build Coastguard Worker 30*2764adbbSAndroid Build Coastguard WorkerFirst and foremost, you should **talk to the legal counsel** for your 31*2764adbbSAndroid Build Coastguard WorkerAndroid product and make sure they have no problems with you including 32*2764adbbSAndroid Build Coastguard Workerany firmware that you want. Nearly all firmware here is classified with 33*2764adbbSAndroid Build Coastguard Workera licnese that is "By Exception Only". That's normal / expected but you 34*2764adbbSAndroid Build Coastguard Workerstill need to get approval. 35*2764adbbSAndroid Build Coastguard Worker 36*2764adbbSAndroid Build Coastguard WorkerAfter you've got approval, including this firmware in your Android product 37*2764adbbSAndroid Build Coastguard Workeris as simple as adding to your `PRODUCT_PACKAGES`. For instance, if you 38*2764adbbSAndroid Build Coastguard Workerwanted to include the r8152 firmware: 39*2764adbbSAndroid Build Coastguard Worker 40*2764adbbSAndroid Build Coastguard Worker``` 41*2764adbbSAndroid Build Coastguard WorkerPRODUCT_PACKAGES += linux_firmware_r8152 42*2764adbbSAndroid Build Coastguard Worker``` 43*2764adbbSAndroid Build Coastguard Worker 44*2764adbbSAndroid Build Coastguard Worker## How to get your firmware added 45*2764adbbSAndroid Build Coastguard Worker 46*2764adbbSAndroid Build Coastguard WorkerIn order to get firmware added to this repo, the process is roughly: 47*2764adbbSAndroid Build Coastguard Worker 48*2764adbbSAndroid Build Coastguard Worker* Submit firmware to the upstream linux-firmware repo following 49*2764adbbSAndroid Build Coastguard Worker instructions in the [upstream README.md]. 50*2764adbbSAndroid Build Coastguard Worker* Add/modify a `firmware_import_workflow` to the [copy.bara.sky] file and 51*2764adbbSAndroid Build Coastguard Worker land it as an `ANDROID:` change. 52*2764adbbSAndroid Build Coastguard Worker* Run `./run_copybara.sh ${NAME}`. That will generate an `IMPORT` CL for you. 53*2764adbbSAndroid Build Coastguard Worker 54*2764adbbSAndroid Build Coastguard WorkerThe [Copybara] script should handle parsing the [upstream WHENCE] file 55*2764adbbSAndroid Build Coastguard Workerfor you to confirm that you specified the correct licenses. If it gives 56*2764adbbSAndroid Build Coastguard Workeran error it's possible that you may need to improve the [copy.bara.sky] 57*2764adbbSAndroid Build Coastguard Workerscript's license grokking logic. 58*2764adbbSAndroid Build Coastguard Worker 59*2764adbbSAndroid Build Coastguard WorkerImporting firmware files to this repo is considered a 3rd party import 60*2764adbbSAndroid Build Coastguard Workerand thus needs approval. Details in [go/android-linux-firmware-approval-flow]. 61*2764adbbSAndroid Build Coastguard Worker 62*2764adbbSAndroid Build Coastguard WorkerIf we have to (due to an urgent bugfix), there's no technical reason 63*2764adbbSAndroid Build Coastguard Workerwe couldn't make local changes to firmware here, but this is 64*2764adbbSAndroid Build Coastguard Worker**strongly discouraged** because any of your changes will be lost the 65*2764adbbSAndroid Build Coastguard Workernext time someone runs [Copybara] for your firmware. If there is no 66*2764adbbSAndroid Build Coastguard Workerchoice then special approval will be needed. 67*2764adbbSAndroid Build Coastguard Worker 68*2764adbbSAndroid Build Coastguard Worker## Try to install only firmware you need 69*2764adbbSAndroid Build Coastguard Worker 70*2764adbbSAndroid Build Coastguard WorkerWhen thinking about getting firmware installed, remember that disk space 71*2764adbbSAndroid Build Coastguard Workeris at a premium. Products should specify exactly which firmware they need. 72*2764adbbSAndroid Build Coastguard WorkerIn other words, you'll want to create a group for "Marvell 8897 SDIO WiFi" 73*2764adbbSAndroid Build Coastguard Workerpart, probably not "Marvell WiFi" or (even worse) a group of all firmare 74*2764adbbSAndroid Build Coastguard Workerfor "Marvell". 75*2764adbbSAndroid Build Coastguard Worker 76*2764adbbSAndroid Build Coastguard Worker## What about files that aren't appropriate for upstream linux-firmware? 77*2764adbbSAndroid Build Coastguard Worker 78*2764adbbSAndroid Build Coastguard WorkerIf you have firmware that is not appropriate for the upstream 79*2764adbbSAndroid Build Coastguard Workerlinux-firmware project then this isn't the repository you're looking for. 80*2764adbbSAndroid Build Coastguard WorkerIn such a case you should find another place to put your firmware. 81*2764adbbSAndroid Build Coastguard Worker 82*2764adbbSAndroid Build Coastguard WorkerBefore trying to find another place for your firmware, however, please 83*2764adbbSAndroid Build Coastguard Workerremember that there's a pretty big benefit to getting firmware landed 84*2764adbbSAndroid Build Coastguard Workerin the upstream linux-firmware project. Notably we _want_ upstream to be 85*2764adbbSAndroid Build Coastguard Workertesting / using the same firmware that Android is using. This makes it 86*2764adbbSAndroid Build Coastguard Workermore likely for our systems to keep working across kernel uprevs and also 87*2764adbbSAndroid Build Coastguard Workermore likely that someone upstream will fix a problem and we'll get the fix 88*2764adbbSAndroid Build Coastguard Workerthrough stable merges. 89*2764adbbSAndroid Build Coastguard Worker 90*2764adbbSAndroid Build Coastguard Worker[Copybara]: https://github.com/google/copybara 91*2764adbbSAndroid Build Coastguard Worker[copy.bara.sky]: ./copy.bara.sky 92*2764adbbSAndroid Build Coastguard Worker[go/android-linux-firmware-approval-flow]: https://goto.google.com/android-linux-firmware-approval-flow 93*2764adbbSAndroid Build Coastguard Worker[upstream README.md]: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/README.md 94*2764adbbSAndroid Build Coastguard Worker[upstream WHENCE]: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/WHENCE 95*2764adbbSAndroid Build Coastguard Worker[go/android-linux-firmware]: https://goto.google.com/android-linux-firmware 96