arm: mvebu: a37xx: Extend mbox_do_cmd() code
Allow to specify input parameters, define all available mbox commands
supported by CZ.NIC's secure firmware and also Marvell's fuse.bin firmware
and fix parsing response from Marvell OTP commands.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
diff --git a/arch/arm/mach-mvebu/include/mach/mbox.h b/arch/arm/mach-mvebu/include/mach/mbox.h
index 9812049..f1cb55f 100644
--- a/arch/arm/mach-mvebu/include/mach/mbox.h
+++ b/arch/arm/mach-mvebu/include/mach/mbox.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2018 Marek Behun <marek.behun@nic.cz>
+ * Copyright (C) 2021 Pali Rohár <pali@kernel.org>
*/
#ifndef _MVEBU_MBOX_H
@@ -16,8 +17,24 @@
MBOX_CMD_OTP_READ,
MBOX_CMD_OTP_WRITE,
+
+ MBOX_CMD_REBOOT,
+
+ /* OTP read commands supported by Marvell fuse.bin firmware */
+ MBOX_CMD_OTP_READ_1B = 257,
+ MBOX_CMD_OTP_READ_8B,
+ MBOX_CMD_OTP_READ_32B,
+ MBOX_CMD_OTP_READ_64B,
+ MBOX_CMD_OTP_READ_256B,
+
+ /* OTP write commands supported by Marvell fuse.bin firmware */
+ MBOX_CMD_OTP_WRITE_1B = 513,
+ MBOX_CMD_OTP_WRITE_8B,
+ MBOX_CMD_OTP_WRITE_32B,
+ MBOX_CMD_OTP_WRITE_64B,
+ MBOX_CMD_OTP_WRITE_256B,
};
-int mbox_do_cmd(enum mbox_cmd cmd, u32 *in, int nout);
+int mbox_do_cmd(enum mbox_cmd cmd, u32 *in, int nin, u32 *out, int nout);
#endif