History

bus: fsl-mc: add fsl-mc userspace support

Adding userspace support for the MC (Management Complex) means exporting an ioctl capable device file representing the root resource container. This new functionality in the fsl-mc bus driver intends to provide userspace applications an interface to interact with the MC firmware. Commands that are composed in userspace are sent to the MC firmware through the FSL_MC_SEND_MC_COMMAND ioctl. By default the implicit MC I/O portal is used for this operation, but if the implicit one is busy, a dynamic portal is allocated and then freed upon execution. The command received through the ioctl interface is checked against a known whitelist of accepted MC commands. Commands that attempt a change in hardware configuration will need CAP_NET_ADMIN, while commands used in debugging do not need it.

Ioana Ciornei committed 5 years ago

Commit 2cf1e701 parent 46707987 files · +618 −0Browse files

Showing the changes to include/uapi (1 of 7 files). Show all

Unified · Split

include/uapi/linux/fsl_mc.h+9−0
@@ -16,10 +16,19 @@ · 15 unmodified lines
1616 * struct fsl_mc_command - Management Complex (MC) command structure
1717 * @header: MC command header
1818 * @params: MC command parameters
19+ *
20+ * Used by FSL_MC_SEND_MC_COMMAND
1921 */
2022 struct fsl_mc_command {
2123 __le64 header;
2224 __le64 params[MC_CMD_NUM_OF_PARAMS];
2325 };
2426
27+#define FSL_MC_SEND_CMD_IOCTL_TYPE 'R'
28+#define FSL_MC_SEND_CMD_IOCTL_SEQ 0xE0
29+
30+#define FSL_MC_SEND_MC_COMMAND \
31+ _IOWR(FSL_MC_SEND_CMD_IOCTL_TYPE, FSL_MC_SEND_CMD_IOCTL_SEQ, \
32+ struct fsl_mc_command)
33+
2534 #endif /* _UAPI_FSL_MC_H_ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t