Project

General

Profile

Actions

Issue #1885

closed

Touch key firmware binary in kernel source code (smdk4412)

Added by Joonas Kylmälä over 5 years ago. Updated over 3 years ago.

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

100%

Estimated time:
Resolution:
Device:
Grant:
Type of work:

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

Actions #1

Updated by Joonas Kylmälä over 5 years 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.

Actions #2

Updated by Fil Bergamo over 5 years 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..

Actions #3

Updated by Fil Bergamo over 5 years ago

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

Updated by Fil Bergamo over 5 years 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?
Actions #5

Updated by Fil Bergamo over 5 years ago

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

Updated by Kurtis Hanna about 5 years 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)"

Actions #7

Updated by Denis 'GNUtoo' Carikli almost 5 years ago

  • Status changed from Feedback to In Progress
Actions #8

Updated by Denis 'GNUtoo' Carikli almost 5 years ago

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

Updated by Joonas Kylmälä over 4 years ago

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

Updated by Kurtis Hanna over 3 years ago

Perhaps I was mistaken with my last question. Maybe this commit is the reason why the "verdict" column should be updated: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/exynos4412-n710x.dts?id=d4ec0cb050644febad4daf3d379969583f745296

Actions

Also available in: Atom PDF