[PATCH 3/4] powerpc: wii.dts: Expose the OTP on this platform

2021-05-19 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index aaa381da1906..7837c4a3f09c 100644

[PATCH 0/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
Emmanuel Gil Peyrot (4): nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support powerpc: wii.dts: Expose the OTP on this platform powerpc: wii_defconfig: Enable OTP by default .../bindings/nvmem/nintendo-otp.txt

[PATCH 4/4] powerpc: wii_defconfig: Enable OTP by default

2021-05-19 Thread Emmanuel Gil Peyrot
This selects the nintendo-otp module when building for this platform, if CONFIG_NVMEM is also selected. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs

[PATCH 2/4] dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support

2021-05-19 Thread Emmanuel Gil Peyrot
Both of these consoles use the exact same two registers, even at the same address, but the Wii U has eight banks of 128 bytes memory while the Wii only has one, hence the two compatible strings. Signed-off-by: Emmanuel Gil Peyrot --- .../devicetree/bindings/nvmem/nintendo-otp.txt | 14

[PATCH 1/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
register and reading from the other one, without any additional synchronisation. Signed-off-by: Emmanuel Gil Peyrot --- drivers/nvmem/Kconfig| 11 drivers/nvmem/Makefile | 2 + drivers/nvmem/nintendo-otp.c | 115 +++ 3 files changed, 128

[PATCH 0/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
Emmanuel Gil Peyrot (4): nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support powerpc: wii.dts: Expose the OTP on this platform powerpc: wii_defconfig: Enable OTP by default .../bindings/nvmem/nintendo-otp.txt

[PATCH 1/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
register and reading from the other one, without any additional synchronisation. Signed-off-by: Emmanuel Gil Peyrot --- drivers/nvmem/Kconfig| 11 drivers/nvmem/Makefile | 2 + drivers/nvmem/nintendo-otp.c | 115 +++ 3 files changed, 128

[PATCH 2/4] dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support

2021-05-19 Thread Emmanuel Gil Peyrot
Both of these consoles use the exact same two registers, even at the same address, but the Wii U has eight banks of 128 bytes memory while the Wii only has one, hence the two compatible strings. Signed-off-by: Emmanuel Gil Peyrot --- .../devicetree/bindings/nvmem/nintendo-otp.txt | 14

[PATCH 4/4] powerpc: wii_defconfig: Enable OTP by default

2021-05-19 Thread Emmanuel Gil Peyrot
This selects the nintendo-otp module when building for this platform, if CONFIG_NVMEM is also selected. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs

[PATCH 3/4] powerpc: wii.dts: Expose the OTP on this platform

2021-05-19 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index aaa381da1906..7837c4a3f09c 100644

[PATCH v2 0/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
Changes since v1: - Fixed the commit messages so they can be accepted by other email servers, sorry about that. Emmanuel Gil Peyrot (4): nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support powerpc: wii.dts: Expose

[PATCH v2 1/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
register and reading from the other one, without any additional synchronisation. Signed-off-by: Emmanuel Gil Peyrot --- drivers/nvmem/Kconfig| 11 drivers/nvmem/Makefile | 2 + drivers/nvmem/nintendo-otp.c | 115 +++ 3 files changed, 128

[PATCH v2 2/4] dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support

2021-05-19 Thread Emmanuel Gil Peyrot
Both of these consoles use the exact same two registers, even at the same address, but the Wii U has eight banks of 128 bytes memory while the Wii only has one, hence the two compatible strings. Signed-off-by: Emmanuel Gil Peyrot --- .../devicetree/bindings/nvmem/nintendo-otp.txt | 14

[PATCH v2 3/4] powerpc: wii.dts: Expose the OTP on this platform

2021-05-19 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index aaa381da1906..7837c4a3f09c 100644

[PATCH v2 4/4] powerpc: wii_defconfig: Enable OTP by default

2021-05-19 Thread Emmanuel Gil Peyrot
This selects the nintendo-otp module when building for this platform, if CONFIG_NVMEM is also selected. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs

Re: [PATCH v2 3/4] powerpc: wii.dts: Expose the OTP on this platform

2021-07-01 Thread Emmanuel Gil Peyrot
On Sat, Jun 26, 2021 at 11:34:01PM +, Jonathan Neuschäfer wrote: > On Wed, May 19, 2021 at 11:50:43AM +0200, Emmanuel Gil Peyrot wrote: > > This can be used by the newly-added nintendo-otp nvmem module. > > > > Signed-off-by: Emmanuel Gil Peyrot > > --- > >

[PATCH v3 1/5] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-07-01 Thread Emmanuel Gil Peyrot
register and reading from the other one, without any additional synchronisation. This driver was written based on reversed documentation, see: https://wiiubrew.org/wiki/Hardware/OTP Signed-off-by: Emmanuel Gil Peyrot Tested-by: Jonathan Neuschäfer # on Wii Tested-by: Emmanuel Gil Peyrot # on Wii

[PATCH v3 0/5] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-07-01 Thread Emmanuel Gil Peyrot
for them. - Use more #defines to make the code easier to read. - Include some links to the reversed documentation. - Avoid overlapping dt regions by changing the existing control@d800100 node to end before the OTP registers, with some bigger dt refactoring left for a future series. Emmanuel Gil

[PATCH v3 2/5] dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support

2021-07-01 Thread Emmanuel Gil Peyrot
Both of these consoles use the exact same two registers, even at the same address, but the Wii U has eight banks of 128 bytes memory while the Wii only has one, hence the two compatible strings. Signed-off-by: Emmanuel Gil Peyrot --- .../bindings/nvmem/nintendo-otp.yaml | 44

[PATCH v3 3/5] powerpc: wii.dts: Reduce the size of the control area

2021-07-01 Thread Emmanuel Gil Peyrot
and GPIO registers, amongst the ones already exposed in this device tree, which should become children of the control@d80 node. [1] https://wiibrew.org/wiki/Hardware/Hollywood_Registers Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 8 +++- 1 file changed, 7 insertions

[PATCH v3 4/5] powerpc: wii.dts: Expose the OTP on this platform

2021-07-01 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index c5fb54f8cc02

[PATCH v3 5/5] powerpc: wii_defconfig: Enable OTP by default

2021-07-01 Thread Emmanuel Gil Peyrot
This selects the nintendo-otp module when building for this platform. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs/wii_defconfig index 379c171f3ddd

Re: [PATCH] nvmem: NVMEM_NINTENDO_OTP should depend on WII

2021-09-16 Thread Emmanuel Gil Peyrot
Hi, thanks for this patch, once the Wii U platform will be added it will need an additional test for WIIU, but for now this is: Reviewed-by: Emmanuel Gil Peyrot On Tue, Sep 14, 2021 at 11:29:49AM +0200, Geert Uytterhoeven wrote: > The Nintendo Wii and Wii U OTP is only present on Nintendo

[PATCH v4 1/5] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-08-01 Thread Emmanuel Gil Peyrot
register and reading from the other one, without any additional synchronisation. This driver was written based on reversed documentation, see: https://wiiubrew.org/wiki/Hardware/OTP Signed-off-by: Emmanuel Gil Peyrot Tested-by: Jonathan Neuschäfer # on Wii Tested-by: Emmanuel Gil Peyrot # on Wii

[PATCH v4 0/5] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-08-01 Thread Emmanuel Gil Peyrot
: - Relicense the dt-binding documentation under GPLv2-only or BSD-2-clauses. Emmanuel Gil Peyrot (5): nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support powerpc: wii.dts: Reduce the size of the control area

[PATCH v4 5/5] powerpc: wii_defconfig: Enable OTP by default

2021-08-01 Thread Emmanuel Gil Peyrot
This selects the nintendo-otp module when building for this platform. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs/wii_defconfig index 379c171f3ddd

[PATCH v4 4/5] powerpc: wii.dts: Expose the OTP on this platform

2021-08-01 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index c5fb54f8cc02

[PATCH v4 2/5] dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support

2021-08-01 Thread Emmanuel Gil Peyrot
Both of these consoles use the exact same two registers, even at the same address, but the Wii U has eight banks of 128 bytes memory while the Wii only has one, hence the two compatible strings. Signed-off-by: Emmanuel Gil Peyrot --- .../bindings/nvmem/nintendo-otp.yaml | 44

[PATCH v4 3/5] powerpc: wii.dts: Reduce the size of the control area

2021-08-01 Thread Emmanuel Gil Peyrot
and GPIO registers, amongst the ones already exposed in this device tree, which should become children of the control@d80 node. [1] https://wiibrew.org/wiki/Hardware/Hollywood_Registers Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 8 +++- 1 file changed, 7 insertions

[PATCH 1/4] crypto: nintendo-aes - add a new AES driver

2021-09-21 Thread Emmanuel Gil Peyrot
MiB/s, while the aes-generic driver only reaches 30.9 MiB/s, so it is a quite welcome speedup. This driver was written based on reversed documentation, see: https://wiibrew.org/wiki/Hardware/AES Signed-off-by: Emmanuel Gil Peyrot Tested-by: Emmanuel Gil Peyrot # on Wii U --- drivers/crypto

[PATCH 0/4] crypto: nintendo-aes - add a new AES driver

2021-09-21 Thread Emmanuel Gil Peyrot
MiB/s, while the aes-generic driver only reaches 30.9 MiB/s, so it is a quite welcome speedup. This driver was written based on reversed documentation, see: https://wiibrew.org/wiki/Hardware/AES Emmanuel Gil Peyrot (4): crypto: nintendo-aes - add a new AES driver dt-bindings: nintendo-aes

[PATCH 4/4] powerpc: wii_defconfig: Enable AES by default

2021-09-21 Thread Emmanuel Gil Peyrot
This selects the nintendo-aes module when building for this platform. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs/wii_defconfig index

[PATCH 2/4] dt-bindings: nintendo-aes: Document the Wii and Wii U AES support

2021-09-21 Thread Emmanuel Gil Peyrot
Both of these consoles use the exact same AES engine, which only supports CBC mode with 128-bit keys. Signed-off-by: Emmanuel Gil Peyrot --- .../bindings/crypto/nintendo-aes.yaml | 34 +++ 1 file changed, 34 insertions(+) create mode 100644 Documentation/devicetree

[PATCH 3/4] powerpc: wii.dts: Expose the AES engine on this platform

2021-09-21 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-aes crypto module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index aaa381da1906..c5720fdd0686 100644

Re: [PATCH 0/4] crypto: nintendo-aes - add a new AES driver

2021-09-21 Thread Emmanuel Gil Peyrot
On Tue, Sep 21, 2021 at 02:59:37PM -0700, Eric Biggers wrote: > On Tue, Sep 21, 2021 at 11:39:26PM +0200, Emmanuel Gil Peyrot wrote: > > This engine implements AES in CBC mode, using 128-bit keys only. It is > > present on both the Wii and the Wii U, and is apparently identi

Re: [PATCH 1/4] crypto: nintendo-aes - add a new AES driver

2021-09-22 Thread Emmanuel Gil Peyrot
On Wed, Sep 22, 2021 at 12:10:41PM +0200, Ard Biesheuvel wrote: > On Tue, 21 Sept 2021 at 23:49, Emmanuel Gil Peyrot > wrote: > > > > This engine implements AES in CBC mode, using 128-bit keys only. It is > > present on both the Wii and the Wii U, and is apparently identi

[PATCH v2 1/5] rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U

2021-10-27 Thread Emmanuel Gil Peyrot
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 --- drivers/rtc/Kconfig| 11 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-gamecube.c | 347

[PATCH v2 2/5] rtc: gamecube: Report low battery as invalid data

2021-10-27 Thread Emmanuel Gil Peyrot
I haven’t been able to test this patch as all of my consoles have a working RTC battery, but according to the documentation it should work like that. Signed-off-by: Emmanuel Gil Peyrot --- drivers/rtc/rtc-gamecube.c | 30 ++ 1 file changed, 30 insertions(+) diff

[PATCH v2 3/5] powerpc: wii.dts: Expose HW_SRNPROT on this platform

2021-10-27 Thread Emmanuel Gil Peyrot
This Hollywood register isn’t properly understood, but can allow or reject access to the SRAM, which we need to set for RTC usage if it isn’t previously set correctly beforehand. See https://wiibrew.org/wiki/Hardware/Hollywood_Registers#HW_SRNPROT Signed-off-by: Emmanuel Gil Peyrot --- arch

[PATCH v2 4/5] powerpc: gamecube_defconfig: Enable the RTC driver

2021-10-27 Thread Emmanuel Gil Peyrot
This selects the rtc-gamecube driver, which provides a real-time clock on this platform. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/gamecube_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/configs/gamecube_defconfig b/arch/powerpc

[PATCH v2 0/5] rtc: nintendo: Add a RTC driver for the GameCube, Wii and Wii U

2021-10-27 Thread Emmanuel Gil Peyrot
this driver on the gamecube and wii platforms. Emmanuel Gil Peyrot (5): rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U rtc: gamecube: Report low battery as invalid data powerpc: wii.dts: Expose HW_SRNPROT on this platform powerpc: gamecube_defconfig: Enable the RTC driver

[PATCH v2 5/5] powerpc: wii_defconfig: Enable the RTC driver

2021-10-27 Thread Emmanuel Gil Peyrot
This selects the rtc-gamecube driver, which provides a real-time clock on this platform. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs

Re: [PATCH v3 0/5] rtc: nintendo: Add a RTC driver for the GameCube, Wii and Wii U

2021-12-16 Thread Emmanuel Gil Peyrot
On Thu, Dec 16, 2021 at 09:56:06PM +0100, Alexandre Belloni wrote: > On 16/12/2021 21:22:20+0100, Emmanuel Gil Peyrot wrote: > > On Thu, Dec 16, 2021 at 10:49:44AM +0100, Alexandre Belloni wrote: > > > On Wed, 15 Dec 2021 18:54:56 +0100, Emmanuel Gil Peyrot wrote: > >

Re: [PATCH v3 0/5] rtc: nintendo: Add a RTC driver for the GameCube, Wii and Wii U

2021-12-16 Thread Emmanuel Gil Peyrot
On Thu, Dec 16, 2021 at 10:49:44AM +0100, Alexandre Belloni wrote: > On Wed, 15 Dec 2021 18:54:56 +0100, Emmanuel Gil Peyrot wrote: > > 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 >

[PATCH v3 1/5] rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U

2021-12-15 Thread Emmanuel Gil Peyrot
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 --- drivers/rtc/Kconfig| 11 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-gamecube.c | 347

[PATCH v3 2/5] rtc: gamecube: Report low battery as invalid data

2021-12-15 Thread Emmanuel Gil Peyrot
I haven’t been able to test this patch as all of my consoles have a working RTC battery, but according to the documentation it should work like that. Signed-off-by: Emmanuel Gil Peyrot --- drivers/rtc/rtc-gamecube.c | 30 ++ 1 file changed, 30 insertions(+) diff

[PATCH v3 3/5] powerpc: wii.dts: Expose HW_SRNPROT on this platform

2021-12-15 Thread Emmanuel Gil Peyrot
This Hollywood register isn’t properly understood, but can allow or reject access to the SRAM, which we need to set for RTC usage if it isn’t previously set correctly beforehand. See https://wiibrew.org/wiki/Hardware/Hollywood_Registers#HW_SRNPROT Signed-off-by: Emmanuel Gil Peyrot --- arch

[PATCH v3 4/5] powerpc: gamecube_defconfig: Enable the RTC driver

2021-12-15 Thread Emmanuel Gil Peyrot
This selects the rtc-gamecube driver, which provides a real-time clock on this platform. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/gamecube_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/configs/gamecube_defconfig b/arch/powerpc

[PATCH v3 5/5] powerpc: wii_defconfig: Enable the RTC driver

2021-12-15 Thread Emmanuel Gil Peyrot
This selects the rtc-gamecube driver, which provides a real-time clock on this platform. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs

[PATCH v3 0/5] rtc: nintendo: Add a RTC driver for the GameCube, Wii and Wii U

2021-12-15 Thread Emmanuel Gil Peyrot
this driver on the gamecube and wii platforms. Changes since v2: - Report low battery correctly. Emmanuel Gil Peyrot (5): rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U rtc: gamecube: Report low battery as invalid data powerpc: wii.dts: Expose HW_SRNPROT on this platform

Re: [PATCH v2 2/5] rtc: gamecube: Report low battery as invalid data

2021-12-15 Thread Emmanuel Gil Peyrot
On Tue, Nov 30, 2021 at 11:45:18PM +0100, Alexandre Belloni wrote: > Hello, Hi, > > On 28/10/2021 00:35:12+0200, Emmanuel Gil Peyrot wrote: > > I haven’t been able to test this patch as all of my consoles have a > > working RTC battery, but according to the documentation it