summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorWei Fang <wei.fang@nxp.com>2024-10-30 12:39:15 +0300
committerDavid S. Miller <davem@davemloft.net>2024-11-04 13:03:50 +0300
commitfe5ba6bf91b3e30118c59fe51048cda101de6542 (patch)
tree7ce047280c22948ca7af1a134eeb40415f057063 /include/linux
parentf70384e53b091f02180443663c52c9dadc6a9208 (diff)
downloadlinux-fe5ba6bf91b3e30118c59fe51048cda101de6542.tar.xz
net: enetc: add initial netc-blk-ctrl driver support
The netc-blk-ctrl driver is used to configure Integrated Endpoint Register Block (IERB) and Privileged Register Block (PRB) of NETC. For i.MX platforms, it is also used to configure the NETCMIX block. The IERB contains registers that are used for pre-boot initialization, debug, and non-customer configuration. The PRB controls global reset and global error handling for NETC. The NETCMIX block is mainly used to set MII protocol and PCS protocol of the links, it also contains settings for some other functions. Note the IERB configuration registers can only be written after being unlocked by PRB, otherwise, all write operations are inhibited. A warm reset is performed when the IERB is unlocked, and it results in an FLR to all NETC devices. Therefore, all NETC device drivers must be probed or initialized after the warm reset is finished. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fsl/netc_global.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/fsl/netc_global.h b/include/linux/fsl/netc_global.h
new file mode 100644
index 000000000000..fdecca8c90f0
--- /dev/null
+++ b/include/linux/fsl/netc_global.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/* Copyright 2024 NXP
+ */
+#ifndef __NETC_GLOBAL_H
+#define __NETC_GLOBAL_H
+
+#include <linux/io.h>
+
+static inline u32 netc_read(void __iomem *reg)
+{
+ return ioread32(reg);
+}
+
+static inline void netc_write(void __iomem *reg, u32 val)
+{
+ iowrite32(val, reg);
+}
+
+#endif