rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Wed, 15 Dec 2021 17:54:57 +0000 (18:54 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 16 Dec 2021 09:46:35 +0000 (10:46 +0100)
commit86559400b3ef9de93ba50523cffe767c35cd531a
tree9c44ef31cb8827743908f0a0af53568074489990
parent5c0189a8b52f76d8a061d2ec80adb11559742d78
rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U

These three consoles share a device, the MX23L4005, which contains a
clock and 64 bytes of SRAM storage, and is exposed on the EXI bus
(similar to SPI) on channel 0, device 1.  This driver allows it to be
used as a Linux RTC device, where time can be read and set.

The hardware also exposes two timers, one which shuts down the console
and one which powers it on, but these aren’t supported currently.

On the Wii U, the counter bias is stored in a XML file, /config/rtc.xml,
encrypted in the SLC (eMMC storage), using a proprietary filesystem.  In
order to avoid having to implement all that, this driver assumes a
bootloader will parse this XML file and write the bias into the SRAM, at
the same location the other two consoles have it.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211215175501.6761-2-linkmauve@linkmauve.fr
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-gamecube.c [new file with mode: 0644]