linux/drivers/firmware/turris-mox-rwtm.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Turris Mox rWTM firmware driver
 *
 * Copyright (C) 2019, 2024 Marek Behún <[email protected]>
 */

#include <linux/armada-37xx-rwtm-mailbox.h>
#include <linux/completion.h>
#include <linux/debugfs.h>
#include <linux/dma-mapping.h>
#include <linux/hw_random.h>
#include <linux/mailbox_client.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

#define DRIVER_NAME

/*
 * The macros and constants below come from Turris Mox's rWTM firmware code.
 * This firmware is open source and it's sources can be found at
 * https://gitlab.labs.nic.cz/turris/mox-boot-builder/tree/master/wtmi.
 */

#define MBOX_STS_SUCCESS
#define MBOX_STS_FAIL
#define MBOX_STS_BADCMD
#define MBOX_STS_ERROR(s)
#define MBOX_STS_VALUE(s)
#define MBOX_STS_CMD(s)

enum mbox_cmd {};

struct mox_kobject;

struct mox_rwtm {};

struct mox_kobject {};

static inline struct kobject *rwtm_to_kobj(struct mox_rwtm *rwtm)
{}

static inline struct mox_rwtm *to_rwtm(struct kobject *kobj)
{}

static void mox_kobj_release(struct kobject *kobj)
{}

static const struct kobj_type mox_kobj_ktype =;

static int mox_kobj_create(struct mox_rwtm *rwtm)
{}

#define MOX_ATTR_RO(name, format, cat)

MOX_ATTR_RO();
MOX_ATTR_RO();
MOX_ATTR_RO();
MOX_ATTR_RO();
MOX_ATTR_RO();
MOX_ATTR_RO();

static int mox_get_status(enum mbox_cmd cmd, u32 retval)
{}

static const struct attribute *mox_rwtm_attrs[] =;

static void mox_rwtm_rx_callback(struct mbox_client *cl, void *data)
{}

static void reply_to_mac_addr(u8 *mac, u32 t1, u32 t2)
{}

static int mox_get_board_info(struct mox_rwtm *rwtm)
{}

static int check_get_random_support(struct mox_rwtm *rwtm)
{}

static int mox_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait)
{}

#ifdef CONFIG_DEBUG_FS
static int rwtm_debug_open(struct inode *inode, struct file *file)
{}

static ssize_t do_sign_read(struct file *file, char __user *buf, size_t len,
			    loff_t *ppos)
{}

static ssize_t do_sign_write(struct file *file, const char __user *buf,
			     size_t len, loff_t *ppos)
{}

static const struct file_operations do_sign_fops =;

static int rwtm_register_debugfs(struct mox_rwtm *rwtm)
{}

static void rwtm_unregister_debugfs(struct mox_rwtm *rwtm)
{}
#else
static inline int rwtm_register_debugfs(struct mox_rwtm *rwtm)
{
	return 0;
}

static inline void rwtm_unregister_debugfs(struct mox_rwtm *rwtm)
{
}
#endif

static int turris_mox_rwtm_probe(struct platform_device *pdev)
{}

static void turris_mox_rwtm_remove(struct platform_device *pdev)
{}

static const struct of_device_id turris_mox_rwtm_match[] =;

MODULE_DEVICE_TABLE(of, turris_mox_rwtm_match);

static struct platform_driver turris_mox_rwtm_driver =;
module_platform_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_AUTHOR();