| b24e88b4 | 24-Mar-2025 |
Arnd Bergmann <arnd@arndb.de> |
platform: cznic: use ffs() instead of __bf_shf()
__bf_shf() on a 64-bit variable causes a link failure during compile-testing:
drivers-platform-cznic-turris-omnia-mcu-gpio.c:(.text):undefined-refer
platform: cznic: use ffs() instead of __bf_shf()
__bf_shf() on a 64-bit variable causes a link failure during compile-testing:
drivers-platform-cznic-turris-omnia-mcu-gpio.c:(.text):undefined-reference-to-__ffsdi2
Open-code this using ffs()-1, which has the same result but avoids the library call.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| eece1223 | 21-Mar-2025 |
Arnd Bergmann <arnd@arndb.de> |
platform: cznic: fix function parameter names
A invalid prototype made it into a previous patch, causing an clang warning:
drivers/platform/cznic/turris-signing-key.c:25:55: warning: omitting the p
platform: cznic: fix function parameter names
A invalid prototype made it into a previous patch, causing an clang warning:
drivers/platform/cznic/turris-signing-key.c:25:55: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
and a slightly different warning with gcc-11 and earlier but not gcc-12 and up:
drivers/platform/cznic/turris-signing-key.c: In function 'turris_signing_key_instantiate': drivers/platform/cznic/turris-signing-key.c:25:43: error: parameter name omitted
Add the parameters to get a clean build with all compilers.
Fixes: 0b28b7080ef5 ("platform: cznic: Add keyctl helpers for Turris platform") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202503210450.AoOpbJXC-lkp@intel.com/ Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| df94a2f1 | 04-Feb-2025 |
Marek Behún <kabel@kernel.org> |
platform: cznic: turris-omnia-mcu: Add support for digital message signing with HW private key
Add support for digital message signing with the private key stored in the MCU. Turris Omnia boards wit
platform: cznic: turris-omnia-mcu: Add support for digital message signing with HW private key
Add support for digital message signing with the private key stored in the MCU. Turris Omnia boards with MKL MCUs have a NIST256p ECDSA private key generated and burned into MCU's flash when manufactured. The private key is not readable from the MCU, but MCU allows for signing messages with it and retrieving the public key.
This is exposed to userspace via the keyctl API.
In userspace, the user can look at /proc/keys or list the keyring:
$ cat /proc/keys 0a3b7cd3 ... keyring .turris-signing-keys: 1 3caf0b1a ... turris-om Turris Omnia SN 0000000A1000023 MCU ECDSA k...
$ keyctl rlist %:.turris-signing-keys 1018104602
To get the public key:
$ keyctl read 1018104602 33 bytes of data in key: 025d9108 1fb538ae 8435c88b b4379171 d6b158a9 55751b91 1d23e6a9 d017f4b2 1c
To sign a message:
$ dd if=/dev/urandom of=msg_to_sign bs=32 count=1 $ keyctl pkey_sign 1018104602 0 msg_to_sign >signature
Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| 0b28b708 | 04-Feb-2025 |
Marek Behún <kabel@kernel.org> |
platform: cznic: Add keyctl helpers for Turris platform
Some Turris devices support signing messages with a per-device unique asymmetric key that was created on the device at manufacture time.
Add
platform: cznic: Add keyctl helpers for Turris platform
Some Turris devices support signing messages with a per-device unique asymmetric key that was created on the device at manufacture time.
Add helper module that helps to expose this ability via the keyctl() syscall.
A device-specific driver can register a signing key by calling devm_turris_signing_key_create().
Both the `.turris-signing-keys` keyring and the signing key are created with only the VIEW, READ and SEARCH permissions for userspace - it is impossible to link / unlink / move them, set their attributes, or unlink the keyring from userspace.
Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| 2de889e9 | 11-Nov-2024 |
Marek Behún <kabel@kernel.org> |
leds: turris-omnia: Inform about missing LED gamma correction feature in the MCU driver
If the LED gamma correction feature is missing in the MCU firmware, inform about this in the MCU firmware prob
leds: turris-omnia: Inform about missing LED gamma correction feature in the MCU driver
If the LED gamma correction feature is missing in the MCU firmware, inform about this in the MCU firmware probe function instead of LED driver probe function, so that all the feature checks are in one place.
Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/20241111100355.6978-10-kabel@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
show more ...
|
| 1783b766 | 11-Nov-2024 |
Marek Behún <kabel@kernel.org> |
platform: cznic: turris-omnia-mcu: Inform about missing LED panel brightness change interrupt feature
When reading MCU firmware features, check also for the LED panel brightness change interrupt fea
platform: cznic: turris-omnia-mcu: Inform about missing LED panel brightness change interrupt feature
When reading MCU firmware features, check also for the LED panel brightness change interrupt feature, and suggest upgrading the firmware if it is missing.
Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/20241111100355.6978-9-kabel@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
show more ...
|
| f335e015 | 11-Nov-2024 |
Marek Behún <kabel@kernel.org> |
platform: cznic: turris-omnia-mcu: Rename variable holding GPIO line names
Rename the `omnia_mcu_gpio_templates` variable to `omnia_mcu_gpio_names`. The array contained templates for the names durin
platform: cznic: turris-omnia-mcu: Rename variable holding GPIO line names
Rename the `omnia_mcu_gpio_templates` variable to `omnia_mcu_gpio_names`. The array contained templates for the names during the development of the driver, but the template prefix `gpio%u.` was dropped before the driver was merged, since this functionality was broken in gpiolib.
Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| af340b7a | 19-Jul-2024 |
Marek Behún <kabel@kernel.org> |
platform: cznic: turris-omnia-mcu: Make GPIO code optional
Make the GPIO part of the driver optional, under a boolean config option. Move the dependency to GPIOLIB and OF and the selection of GPIOLI
platform: cznic: turris-omnia-mcu: Make GPIO code optional
Make the GPIO part of the driver optional, under a boolean config option. Move the dependency to GPIOLIB and OF and the selection of GPIOLIB_IRQCHIP to this new option.
This makes the turris-omnia-mcu driver available for compilation even if GPIOLIB or OF are disabled.
Fixes: ed46f1f7731d ("platform: cznic: turris-omnia-mcu: fix Kconfig dependencies") Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/20240719085756.30598-5-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| 74a22fce | 19-Jul-2024 |
Marek Behún <kabel@kernel.org> |
platform: cznic: turris-omnia-mcu: Make poweroff and wakeup code optional
Make the system poweroff and RTC wakeup part of the driver optional, under a boolean config option. Move the dependency to R
platform: cznic: turris-omnia-mcu: Make poweroff and wakeup code optional
Make the system poweroff and RTC wakeup part of the driver optional, under a boolean config option. Move the dependency to RTC_CLASS to this new option.
This makes the turris-omnia-mcu driver available for compilation even if RTC_CLASS is disabled.
Fixes: ed46f1f7731d ("platform: cznic: turris-omnia-mcu: fix Kconfig dependencies") Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/20240719085756.30598-4-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| c7da0d4e | 19-Jul-2024 |
Marek Behún <kabel@kernel.org> |
platform: cznic: turris-omnia-mcu: Make TRNG code optional
Make the TRNG part of the driver optional, under a boolean config option.
This makes the driver turris-omnia-mcu available for compilation
platform: cznic: turris-omnia-mcu: Make TRNG code optional
Make the TRNG part of the driver optional, under a boolean config option.
This makes the driver turris-omnia-mcu available for compilation even if HW_RANDOM is disabled.
Fixes: ed46f1f7731d ("platform: cznic: turris-omnia-mcu: fix Kconfig dependencies") Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/20240719085756.30598-3-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| dc3c836f | 08-Jul-2024 |
Marek Behún <kabel@kernel.org> |
platform: cznic: turris-omnia-mcu: Depend on WATCHDOG
Add depend on WATCHDOG, otherwise modpost fails with ERROR: modpost: "watchdog_init_timeout" [drivers/platform/cznic/turris-omnia-mcu.ko] unde
platform: cznic: turris-omnia-mcu: Depend on WATCHDOG
Add depend on WATCHDOG, otherwise modpost fails with ERROR: modpost: "watchdog_init_timeout" [drivers/platform/cznic/turris-omnia-mcu.ko] undefined! ERROR: modpost: "devm_watchdog_register_device" [drivers/platform/cznic/turris-omnia-mcu.ko] undefined!
Fixes: ab89fb5fb92c ("platform: cznic: turris-omnia-mcu: Add support for MCU watchdog") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202407040711.g19y3cWq-lkp@intel.com/ Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/20240708114002.4285-3-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|