Unverified Commit 992f1a3d authored by Marek Behún's avatar Marek Behún Committed by Arnd Bergmann
Browse files

platform: cznic: Add preliminary support for Turris Omnia MCU



Add the basic skeleton for a new platform driver for the microcontroller
found on the Turris Omnia board.

Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Acked-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20240701113010.16447-3-kabel@kernel.org


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent f5e6f47f
Loading
Loading
Loading
Loading
+81 −0
Original line number Diff line number Diff line
What:		/sys/bus/i2c/devices/<mcu_device>/board_revision
Date:		September 2024
KernelVersion:	6.11
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RO) Contains board revision number.

		Only available if board information is burned in the MCU (older
		revisions have board information burned in the ATSHA204-A chip).

		Format: %u.

What:		/sys/bus/i2c/devices/<mcu_device>/first_mac_address
Date:		September 2024
KernelVersion:	6.11
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RO) Contains device first MAC address. Each Turris Omnia is
		allocated 3 MAC addresses. The two additional addresses are
		computed from the first one by incrementing it.

		Only available if board information is burned in the MCU (older
		revisions have board information burned in the ATSHA204-A chip).

		Format: %pM.

What:		/sys/bus/i2c/devices/<mcu_device>/fw_features
Date:		September 2024
KernelVersion:	6.11
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RO) Newer versions of the microcontroller firmware report the
		features they support. These can be read from this file. If the
		MCU firmware is too old, this file reads 0x0.

		Format: 0x%x.

What:		/sys/bus/i2c/devices/<mcu_device>/fw_version_hash_application
Date:		September 2024
KernelVersion:	6.11
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RO) Contains the version hash (commit hash) of the application
		part of the microcontroller firmware.

		Format: %s.

What:		/sys/bus/i2c/devices/<mcu_device>/fw_version_hash_bootloader
Date:		September 2024
KernelVersion:	6.11
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RO) Contains the version hash (commit hash) of the bootloader
		part of the microcontroller firmware.

		Format: %s.

What:		/sys/bus/i2c/devices/<mcu_device>/mcu_type
Date:		September 2024
KernelVersion:	6.11
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RO) Contains the microcontroller type (STM32, GD32, MKL).

		Format: %s.

What:		/sys/bus/i2c/devices/<mcu_device>/reset_selector
Date:		September 2024
KernelVersion:	6.11
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RO) Contains the selected factory reset level, determined by
		how long the rear reset button was held by the user during board
		reset.

		Format: %i.

What:		/sys/bus/i2c/devices/<mcu_device>/serial_number
Date:		September 2024
KernelVersion:	6.11
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RO) Contains the 64-bit board serial number in hexadecimal
		format.

		Only available if board information is burned in the MCU (older
		revisions have board information burned in the ATSHA204-A chip).

		Format: %016X.
+3 −0
Original line number Diff line number Diff line
@@ -2206,6 +2206,7 @@ M: Marek Behún <kabel@kernel.org>
S:	Maintained
W:	https://www.turris.cz/
F:	Documentation/ABI/testing/debugfs-moxtet
F:	Documentation/ABI/testing/sysfs-bus-i2c-devices-turris-omnia-mcu
F:	Documentation/ABI/testing/sysfs-bus-moxtet-devices
F:	Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm
F:	Documentation/devicetree/bindings/bus/moxtet.txt
@@ -2219,10 +2220,12 @@ F: drivers/firmware/turris-mox-rwtm.c
F:	drivers/gpio/gpio-moxtet.c
F:	drivers/leds/leds-turris-omnia.c
F:	drivers/mailbox/armada-37xx-rwtm-mailbox.c
F:	drivers/platform/cznic/
F:	drivers/watchdog/armada_37xx_wdt.c
F:	include/dt-bindings/bus/moxtet.h
F:	include/linux/armada-37xx-rwtm-mailbox.h
F:	include/linux/moxtet.h
F:	include/linux/turris-omnia-mcu-interface.h
ARM/FARADAY FA526 PORT
M:	Hans Ulli Kroll <ulli.kroll@googlemail.com>
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ source "drivers/platform/goldfish/Kconfig"

source "drivers/platform/chrome/Kconfig"

source "drivers/platform/cznic/Kconfig"

source "drivers/platform/mellanox/Kconfig"

source "drivers/platform/olpc/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -10,5 +10,6 @@ obj-$(CONFIG_MIPS) += mips/
obj-$(CONFIG_OLPC_EC)		+= olpc/
obj-$(CONFIG_GOLDFISH)		+= goldfish/
obj-$(CONFIG_CHROME_PLATFORMS)	+= chrome/
obj-$(CONFIG_CZNIC_PLATFORMS)	+= cznic/
obj-$(CONFIG_SURFACE_PLATFORMS)	+= surface/
obj-$(CONFIG_ARM64)		+= arm64/
+25 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.rst.
#

menuconfig CZNIC_PLATFORMS
	bool "Platform support for CZ.NIC's Turris hardware"
	help
	  Say Y here to be able to choose driver support for CZ.NIC's Turris
	  devices. This option alone does not add any kernel code.

if CZNIC_PLATFORMS

config TURRIS_OMNIA_MCU
	tristate "Turris Omnia MCU driver"
	depends on MACH_ARMADA_38X || COMPILE_TEST
	depends on I2C
	help
	  Say Y here to add support for the features implemented by the
	  microcontroller on the CZ.NIC's Turris Omnia SOHO router.
	  To compile this driver as a module, choose M here; the module will be
	  called turris-omnia-mcu.

endif # CZNIC_PLATFORMS
Loading