linux/drivers/nvmem/nintendo-otp.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Nintendo Wii and Wii U OTP driver
 *
 * This is a driver exposing the OTP of a Nintendo Wii or Wii U console.
 *
 * This memory contains common and per-console keys, signatures and
 * related data required to access peripherals.
 *
 * Based on reversed documentation from https://wiiubrew.org/wiki/Hardware/OTP
 *
 * Copyright (C) 2021 Emmanuel Gil Peyrot <[email protected]>
 */

#include <linux/device.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/nvmem-provider.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>

#define HW_OTPCMD
#define HW_OTPDATA
#define OTP_READ
#define BANK_SIZE
#define WORD_SIZE

struct nintendo_otp_priv {};

struct nintendo_otp_devtype_data {};

static const struct nintendo_otp_devtype_data hollywood_otp_data =;

static const struct nintendo_otp_devtype_data latte_otp_data =;

static int nintendo_otp_reg_read(void *context,
				 unsigned int reg, void *_val, size_t bytes)
{}

static const struct of_device_id nintendo_otp_of_table[] =;
MODULE_DEVICE_TABLE(of, nintendo_otp_of_table);

static int nintendo_otp_probe(struct platform_device *pdev)
{}

static struct platform_driver nintendo_otp_driver =;
module_platform_driver();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();