drivers/net/ethernet/ti/icssg/icssg_config.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ti/icssg/icssg_config.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ti/icssg/icssg_config.c- Extension
.c- Size
- 25149 bytes
- Lines
- 865
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/iopoll.hlinux/regmap.huapi/linux/if_ether.hicssg_config.hicssg_prueth.hicssg_switch_map.hicssg_mii_rt.h
Detected Declarations
struct mapfunction icssg_config_mii_init_fw_offloadfunction icssg_config_mii_initfunction icssg_miig_queues_initfunction icssg_config_ipgfunction emac_r30_cmd_initfunction emac_r30_is_donefunction prueth_fw_offload_buffer_setupfunction prueth_emac_buffer_setupfunction icssg_init_emac_modefunction icssg_init_fw_offload_modefunction icssg_configfunction icssg_set_port_statefunction icssg_config_half_duplexfunction icssg_config_set_speedfunction icssg_send_fdb_msgfunction icssg_fdb_setupfunction icssg_fdb_add_delfunction icssg_fdb_lookupfunction icssg_vtbl_modifyfunction VIDfunction icssg_get_pvidfunction icssg_set_pvidfunction emac_fdb_flow_id_updatedexport icssg_config_ipgexport icssg_init_emac_modeexport icssg_init_fw_offload_modeexport icssg_configexport icssg_set_port_stateexport icssg_config_half_duplexexport icssg_config_set_speedexport icssg_send_fdb_msgexport icssg_fdb_add_delexport icssg_fdb_lookupexport icssg_vtbl_modifyexport icssg_get_pvidexport icssg_set_pvidexport emac_fdb_flow_id_updated
Annotated Snippet
struct map {
int queue;
u32 pd_addr_start;
u32 flags;
bool special;
};
/* Hardware queue map for ICSSG */
static const struct map hwq_map[2][ICSSG_NUM_OTHER_QUEUES] = {
{
{ PORT_HI_Q_SLICE0, PORT_DESC0_HI, 0x200000, 0 },
{ PORT_LO_Q_SLICE0, PORT_DESC0_LO, 0, 0 },
{ HOST_HI_Q_SLICE0, HOST_DESC0_HI, 0x200000, 0 },
{ HOST_LO_Q_SLICE0, HOST_DESC0_LO, 0, 0 },
{ HOST_SPL_Q_SLICE0, HOST_SPPD0, 0x400000, 1 },
},
{
{ PORT_HI_Q_SLICE1, PORT_DESC1_HI, 0xa00000, 0 },
{ PORT_LO_Q_SLICE1, PORT_DESC1_LO, 0x800000, 0 },
{ HOST_HI_Q_SLICE1, HOST_DESC1_HI, 0xa00000, 0 },
{ HOST_LO_Q_SLICE1, HOST_DESC1_LO, 0x800000, 0 },
{ HOST_SPL_Q_SLICE1, HOST_SPPD1, 0xc00000, 1 },
},
};
static void icssg_config_mii_init_fw_offload(struct prueth_emac *emac)
{
struct prueth *prueth = emac->prueth;
int mii = prueth_emac_slice(emac);
u32 txcfg_reg, pcnt_reg, txcfg;
struct regmap *mii_rt;
mii_rt = prueth->mii_rt;
txcfg_reg = (mii == ICSS_MII0) ? PRUSS_MII_RT_TXCFG0 :
PRUSS_MII_RT_TXCFG1;
pcnt_reg = (mii == ICSS_MII0) ? PRUSS_MII_RT_RX_PCNT0 :
PRUSS_MII_RT_RX_PCNT1;
txcfg = PRUSS_MII_RT_TXCFG_TX_ENABLE |
PRUSS_MII_RT_TXCFG_TX_AUTO_PREAMBLE |
PRUSS_MII_RT_TXCFG_TX_IPG_WIRE_CLK_EN;
if (emac->phy_if == PHY_INTERFACE_MODE_MII && mii == ICSS_MII1)
txcfg |= PRUSS_MII_RT_TXCFG_TX_MUX_SEL;
else if (emac->phy_if != PHY_INTERFACE_MODE_MII && mii == ICSS_MII0)
txcfg |= PRUSS_MII_RT_TXCFG_TX_MUX_SEL;
regmap_write(mii_rt, txcfg_reg, txcfg);
regmap_write(mii_rt, pcnt_reg, 0x1);
}
static void icssg_config_mii_init(struct prueth_emac *emac)
{
struct prueth *prueth = emac->prueth;
int slice = prueth_emac_slice(emac);
u32 txcfg, txcfg_reg, pcnt_reg;
struct regmap *mii_rt;
mii_rt = prueth->mii_rt;
txcfg_reg = (slice == ICSS_MII0) ? PRUSS_MII_RT_TXCFG0 :
PRUSS_MII_RT_TXCFG1;
pcnt_reg = (slice == ICSS_MII0) ? PRUSS_MII_RT_RX_PCNT0 :
PRUSS_MII_RT_RX_PCNT1;
txcfg = MII_TXCFG_DEFAULT;
/* In MII mode TX lines swapped inside ICSSG, so TX_MUX_SEL cfg need
* to be swapped also comparing to RGMII mode.
*/
if (emac->phy_if == PHY_INTERFACE_MODE_MII && slice == ICSS_MII0)
txcfg |= PRUSS_MII_RT_TXCFG_TX_MUX_SEL;
else if (emac->phy_if != PHY_INTERFACE_MODE_MII && slice == ICSS_MII1)
txcfg |= PRUSS_MII_RT_TXCFG_TX_MUX_SEL;
regmap_write(mii_rt, txcfg_reg, txcfg);
regmap_write(mii_rt, pcnt_reg, 0x1);
}
static void icssg_miig_queues_init(struct prueth *prueth, int slice)
{
struct regmap *miig_rt = prueth->miig_rt;
void __iomem *smem = prueth->shram.va;
u8 pd[ICSSG_SPECIAL_PD_SIZE];
int queue = 0, i, j;
u32 *pdword;
/* reset hwqueues */
if (slice)
Annotation
- Immediate include surface: `linux/iopoll.h`, `linux/regmap.h`, `uapi/linux/if_ether.h`, `icssg_config.h`, `icssg_prueth.h`, `icssg_switch_map.h`, `icssg_mii_rt.h`.
- Detected declarations: `struct map`, `function icssg_config_mii_init_fw_offload`, `function icssg_config_mii_init`, `function icssg_miig_queues_init`, `function icssg_config_ipg`, `function emac_r30_cmd_init`, `function emac_r30_is_done`, `function prueth_fw_offload_buffer_setup`, `function prueth_emac_buffer_setup`, `function icssg_init_emac_mode`.
- 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.