Project

General

Profile

Issue #1885

Touch key firmware binary in kernel source code (smdk4412)

Added by Joonas Kylmälä about 1 year ago. Updated 8 days ago.

Status:
Resolved
Priority:
Normal
Category:
Freedom
Target version:
Start date:
08/02/2018
Due date:
% Done:

100%

Estimated time:
Resolution:
Device:

Description

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.


Files

History

#1

Updated by Joonas Kylmälä about 1 year ago

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.

#2

Updated by Fil Bergamo 9 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:

- touchkey_fw_NAATT.h
- touchkey_fw_NTT.h
- touchkey_fw_Q1.h
- touchkey_fw_T0.h
- touchkey_fw_U1.h

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 cypress-touchkey.c
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?

--- EDIT:

I tried to simply remove both directories: drivers/input/keyboard/cypressbln and drivers/input/keyboard/cypress
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..

#3

Updated by Fil Bergamo 9 months ago

  • Status changed from New to In Progress
  • Assignee set to Fil Bergamo
#4

Updated by Fil Bergamo 9 months ago

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 issp_driver_routines.c
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:
touchkey_fw_Q1.h
touchkey_fw_NTT.h
touchkey_fw_NA.h
touchkey_fw_NAATT.h
touchkey_fw_U1.h

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?
#5

Updated by Fil Bergamo 9 months ago

  • Target version changed from Replicant 6.0 to Replicant 6.0 0004
#6

Updated by Kurtis Hanna 9 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:

https://patchwork.kernel.org/patch/10744537/
https://patchwork.kernel.org/patch/10751097/

PabloPL also said" probably needs change in midas dts (but there should be already patch for it on forkbomb github repo)"

#7

Updated by Denis 'GNUtoo' Carikli 5 months ago

  • Status changed from Feedback to In Progress
#8

Updated by Denis 'GNUtoo' Carikli 5 months ago

  • Assignee changed from Fil Bergamo to Denis 'GNUtoo' Carikli
#9

Updated by Joonas Kylmälä 8 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Also available in: Atom PDF