Touch key firmware binary in kernel source code (smdk4412)
I noticed that the smdk4412 kernel used by Midas devices has some firmware in binary form: https://git.replicant.us/replicant/kernel_samsung_smdk4412/tree/drivers/input/keyboard/cypress/touchkey_fw_M0.h. This should be removed as there doesn't seem to be source code for it, therefore making it non-free.
Updated by Fil Bergamo 11 months ago
Joonas Kylmälä wrote:
Simon Shields on IRC said the firmware is not needed (at least with mainline I guess) so it might be possible just to remove it also from this legacy kernel source.
Is it just enough to remove the file itself?
Do we need to update any reference in other source files?
I can test a build without this firmware for i9100, i9300, n7100 and then send a patch, if the removal is that simple.
Also, I noticed that other firmware files in the same directory that seem to be in binary form only:
Furthermore, all source files in this directory seem to have a copyright header that references a seemingly non-free license:
Use may be limited by and subject to the applicable Cypress software license agreement.
A quick search on cypress.com didn't get me anything meaningful regarding any general "Cypress software agreement".
There are some generic terms and conditions that apply to software obtained via cypress.com, and they explicitly prohibit copying and redistributing sofware..
The only file that clearly states it's free software is
Though, this one free-licensed file does reference all other files that are seemingly-non-free.
The same applies to files in https://git.replicant.us/replicant/kernel_samsung_smdk4412/tree/drivers/input/keyboard/cypressbln
While we are at it..
I took a sample look at https://git.replicant.us/replicant/kernel_samsung_smdk4412/tree/drivers/input/touchscreen
and it's full of binary-only files without a license..
What should we do about all this?
I tried to simply remove both directories:
It does build, after removing references to those directories in
drivers/input/keyboard/Kconfig, but, as expected, the "simulated hardware keys" on i9100 don't work.
I will try a less dramatic approach, by looking at specific references and try to cherry-pick files that can be safely removed..
Updated by Fil Bergamo 11 months ago
- File 0001-Remove-nonfree-binary-firmware-data.patch 0001-Remove-nonfree-binary-firmware-data.patch added
- Status changed from In Progress to Feedback
- % Done changed from 0 to 50
I carefully removed all references to binary firmware data inside source files, rebuilt the whole tree from scratch, and tested for i9100 and i9300: touch keys still seem to work flawlessly, even with those binary firmwares removed.
In facts, the only place where
firmware_data is used is in function
LoadProgramData, defined at
Reading the comments above this function's definition suggests that it is only used for testing purposes, and is irrelevant for regular operation:
// The final application should load program data from HEX file generated by
// PSoC Designer into a 64 byte host ram buffer.
// This demo program will, instead, load predetermined data into each block.
So, it seems like we can do without these binary-only files:
Attached is a patch that removes those files and all related references in the cypress source code.
It is quite big because it lists the whole content of deleted files. I'm sorry but my knowledge of git is very limited and I wasn't able to prevent this, no matter how hard I tried...
- Warning (1): I only tested it for i9100 and i9300 and only for brief operations, there's no guarantee over long-time side effects, even if they seem unlikely*
- Warning (2): this patch does NOT solve the problem with the ambiguous copyright statement found in the other cypress source files, which must be still discussed*
What shall we do about them?
Updated by Kurtis Hanna 11 months ago
I saw these links posted in the IRC from user PabloPL and figured I'd post them here since I think they are related:
PabloPL also said" probably needs change in midas dts (but there should be already patch for it on forkbomb github repo)"
Updated by Joonas Kylmälä about 2 months ago
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
I believe this is fixed with https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=160424ba716cde87e4ff213972a03388e90bf75e.