drivers/net/pcs/pcs-rzn1-miic.c
Source file repositories/reference/linux-study-clean/drivers/net/pcs/pcs-rzn1-miic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/pcs/pcs-rzn1-miic.c- Extension
.c- Size
- 23524 bytes
- Lines
- 869
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/array_size.hlinux/bits.hlinux/bitops.hlinux/clk.hlinux/device.hlinux/device/devres.hlinux/mdio.hlinux/of.hlinux/of_platform.hlinux/pcs-rzn1-miic.hlinux/phylink.hlinux/platform_device.hlinux/pm_runtime.hlinux/reset.hlinux/slab.hdt-bindings/net/pcs-rzn1-miic.hdt-bindings/net/renesas,r9a09g077-pcs-miic.h
Detected Declarations
struct modctrl_matchstruct miic_phy_link_cfgstruct miicstruct miic_of_datastruct miic_portenum miic_typefunction miic_unlock_regsfunction miic_lock_regsfunction miic_reg_writel_unlockedfunction miic_reg_writel_lockedfunction miic_reg_writelfunction miic_reg_readlfunction miic_reg_rmwfunction miic_converter_enablefunction miic_configfunction miic_link_upfunction miic_pre_initfunction miic_destroyfunction miic_init_hwfunction miic_modctrl_matchfunction miic_dump_conffunction miic_match_dt_conffunction miic_configure_phy_linkfunction miic_parse_dtfunction for_each_available_child_of_nodefunction miic_reset_control_bulk_assertfunction miic_reset_control_initfunction miic_probefunction miic_removeexport miic_createexport miic_destroy
Annotated Snippet
struct modctrl_match {
u32 mode_cfg;
u8 conv[MIIC_MODCTRL_CONF_CONV_MAX];
};
static struct modctrl_match modctrl_match_table[] = {
{0x0, {MIIC_RTOS_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_SERCOS_PORTB, MIIC_SERCOS_PORTA}},
{0x1, {MIIC_RTOS_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_ETHERCAT_PORTB, MIIC_ETHERCAT_PORTA}},
{0x2, {MIIC_RTOS_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_ETHERCAT_PORTC, MIIC_ETHERCAT_PORTB, MIIC_ETHERCAT_PORTA}},
{0x3, {MIIC_RTOS_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_SWITCH_PORTB, MIIC_SWITCH_PORTA}},
{0x8, {MIIC_RTOS_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_SERCOS_PORTB, MIIC_SERCOS_PORTA}},
{0x9, {MIIC_RTOS_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_ETHERCAT_PORTB, MIIC_ETHERCAT_PORTA}},
{0xA, {MIIC_RTOS_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_ETHERCAT_PORTC, MIIC_ETHERCAT_PORTB, MIIC_ETHERCAT_PORTA}},
{0xB, {MIIC_RTOS_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_SWITCH_PORTB, MIIC_SWITCH_PORTA}},
{0x10, {MIIC_GMAC2_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_SERCOS_PORTB, MIIC_SERCOS_PORTA}},
{0x11, {MIIC_GMAC2_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_ETHERCAT_PORTB, MIIC_ETHERCAT_PORTA}},
{0x12, {MIIC_GMAC2_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_ETHERCAT_PORTC, MIIC_ETHERCAT_PORTB, MIIC_ETHERCAT_PORTA}},
{0x13, {MIIC_GMAC2_PORT, MIIC_GMAC1_PORT, MIIC_SWITCH_PORTD,
MIIC_SWITCH_PORTC, MIIC_SWITCH_PORTB, MIIC_SWITCH_PORTA}}
};
static const char * const conf_to_string[] = {
[MIIC_GMAC1_PORT] = "GMAC1_PORT",
[MIIC_GMAC2_PORT] = "GMAC2_PORT",
[MIIC_RTOS_PORT] = "RTOS_PORT",
[MIIC_SERCOS_PORTA] = "SERCOS_PORTA",
[MIIC_SERCOS_PORTB] = "SERCOS_PORTB",
[MIIC_ETHERCAT_PORTA] = "ETHERCAT_PORTA",
[MIIC_ETHERCAT_PORTB] = "ETHERCAT_PORTB",
[MIIC_ETHERCAT_PORTC] = "ETHERCAT_PORTC",
[MIIC_SWITCH_PORTA] = "SWITCH_PORTA",
[MIIC_SWITCH_PORTB] = "SWITCH_PORTB",
[MIIC_SWITCH_PORTC] = "SWITCH_PORTC",
[MIIC_SWITCH_PORTD] = "SWITCH_PORTD",
[MIIC_HSR_PORTA] = "HSR_PORTA",
[MIIC_HSR_PORTB] = "HSR_PORTB",
};
static const char * const index_to_string[] = {
"SWITCH_PORTIN",
"CONV1",
"CONV2",
"CONV3",
"CONV4",
"CONV5",
};
static struct modctrl_match rzt2h_modctrl_match_table[] = {
{0x0, {ETHSS_GMAC0_PORT, ETHSS_ETHSW_PORT0, ETHSS_ETHSW_PORT1,
ETHSS_ETHSW_PORT2, ETHSS_GMAC1_PORT}},
{0x1, {MIIC_MODCTRL_CONF_NONE, ETHSS_ESC_PORT0, ETHSS_ESC_PORT1,
ETHSS_GMAC2_PORT, ETHSS_GMAC1_PORT}},
{0x2, {ETHSS_GMAC0_PORT, ETHSS_ESC_PORT0, ETHSS_ESC_PORT1,
ETHSS_ETHSW_PORT2, ETHSS_GMAC1_PORT}},
{0x3, {MIIC_MODCTRL_CONF_NONE, ETHSS_ESC_PORT0, ETHSS_ESC_PORT1,
ETHSS_ESC_PORT2, ETHSS_GMAC1_PORT}},
{0x4, {ETHSS_GMAC0_PORT, ETHSS_ETHSW_PORT0, ETHSS_ESC_PORT1,
ETHSS_ESC_PORT2, ETHSS_GMAC1_PORT}},
{0x5, {ETHSS_GMAC0_PORT, ETHSS_ETHSW_PORT0, ETHSS_ESC_PORT1,
ETHSS_ETHSW_PORT2, ETHSS_GMAC1_PORT}},
{0x6, {ETHSS_GMAC0_PORT, ETHSS_ETHSW_PORT0, ETHSS_ETHSW_PORT1,
ETHSS_GMAC2_PORT, ETHSS_GMAC1_PORT}},
{0x7, {MIIC_MODCTRL_CONF_NONE, ETHSS_GMAC0_PORT, ETHSS_GMAC1_PORT,
ETHSS_GMAC2_PORT, MIIC_MODCTRL_CONF_NONE}}
};
static const char * const rzt2h_conf_to_string[] = {
[ETHSS_GMAC0_PORT] = "GMAC0_PORT",
[ETHSS_GMAC1_PORT] = "GMAC1_PORT",
[ETHSS_GMAC2_PORT] = "GMAC2_PORT",
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/bits.h`, `linux/bitops.h`, `linux/clk.h`, `linux/device.h`, `linux/device/devres.h`, `linux/mdio.h`, `linux/of.h`.
- Detected declarations: `struct modctrl_match`, `struct miic_phy_link_cfg`, `struct miic`, `struct miic_of_data`, `struct miic_port`, `enum miic_type`, `function miic_unlock_regs`, `function miic_lock_regs`, `function miic_reg_writel_unlocked`, `function miic_reg_writel_locked`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.