drivers/net/ethernet/ti/am65-cpts.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ti/am65-cpts.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ti/am65-cpts.c- Extension
.c- Size
- 37612 bytes
- Lines
- 1351
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/clk.hlinux/clk-provider.hlinux/err.hlinux/if_vlan.hlinux/interrupt.hlinux/module.hlinux/netdevice.hlinux/net_tstamp.hlinux/of.hlinux/of_irq.hlinux/platform_device.hlinux/pm_runtime.hlinux/ptp_classify.hlinux/ptp_clock_kernel.ham65-cpts.h
Detected Declarations
struct am65_genf_regsstruct am65_cpts_regsstruct am65_cpts_eventstruct am65_cptsstruct am65_cpts_skb_cb_datafunction am65_cpts_settimefunction am65_cpts_set_add_valfunction am65_cpts_disablefunction am65_cpts_purge_event_listfunction list_for_each_safefunction am65_cpts_event_get_portfunction am65_cpts_event_get_typefunction am65_cpts_purge_eventsfunction am65_cpts_fifo_pop_eventfunction __am65_cpts_fifo_readfunction am65_cpts_fifo_readfunction am65_cpts_gettimefunction am65_cpts_interruptfunction am65_cpts_ptp_adjfinefunction am65_cpts_ptp_adjtimefunction am65_cpts_ptp_gettimexfunction am65_cpts_ns_gettimefunction am65_cpts_ptp_settimefunction am65_cpts_extts_enable_hwfunction am65_cpts_extts_enablefunction am65_cpts_estf_enablefunction am65_cpts_estf_disablefunction am65_cpts_perout_enable_hwfunction am65_cpts_perout_enablefunction am65_cpts_pps_enablefunction am65_cpts_ptp_enablefunction am65_cpts_match_tx_tsfunction am65_cpts_find_tx_tsfunction list_for_each_safefunction am65_cpts_ts_workfunction am65_skb_get_mtype_seqidfunction am65_cpts_find_rx_tsfunction am65_cpts_rx_timestampfunction am65_cpts_tx_timestampfunction am65_cpts_prep_tx_timestampfunction am65_cpts_phc_indexfunction cpts_free_clk_muxfunction cpts_of_mux_clk_setupfunction am65_cpts_of_parsefunction am65_cpts_releasefunction am65_cpts_suspendfunction am65_cpts_resumefunction am65_cpts_probe
Annotated Snippet
struct am65_genf_regs {
u32 comp_lo; /* Comparison Low Value 0:31 */
u32 comp_hi; /* Comparison High Value 32:63 */
u32 control; /* control */
u32 length; /* Length */
u32 ppm_low; /* PPM Load Low Value 0:31 */
u32 ppm_hi; /* PPM Load High Value 32:63 */
u32 ts_nudge; /* Nudge value */
} __aligned(32) __packed;
#define AM65_CPTS_GENF_MAX_NUM 9
#define AM65_CPTS_ESTF_MAX_NUM 8
struct am65_cpts_regs {
u32 idver; /* Identification and version */
u32 control; /* Time sync control */
u32 rftclk_sel; /* Reference Clock Select Register */
u32 ts_push; /* Time stamp event push */
u32 ts_load_val_lo; /* Time Stamp Load Low Value 0:31 */
u32 ts_load_en; /* Time stamp load enable */
u32 ts_comp_lo; /* Time Stamp Comparison Low Value 0:31 */
u32 ts_comp_length; /* Time Stamp Comparison Length */
u32 intstat_raw; /* Time sync interrupt status raw */
u32 intstat_masked; /* Time sync interrupt status masked */
u32 int_enable; /* Time sync interrupt enable */
u32 ts_comp_nudge; /* Time Stamp Comparison Nudge Value */
u32 event_pop; /* Event interrupt pop */
u32 event_0; /* Event Time Stamp lo 0:31 */
u32 event_1; /* Event Type Fields */
u32 event_2; /* Event Type Fields domain */
u32 event_3; /* Event Time Stamp hi 32:63 */
u32 ts_load_val_hi; /* Time Stamp Load High Value 32:63 */
u32 ts_comp_hi; /* Time Stamp Comparison High Value 32:63 */
u32 ts_add_val; /* Time Stamp Add value */
u32 ts_ppm_low; /* Time Stamp PPM Load Low Value 0:31 */
u32 ts_ppm_hi; /* Time Stamp PPM Load High Value 32:63 */
u32 ts_nudge; /* Time Stamp Nudge value */
u32 reserv[33];
struct am65_genf_regs genf[AM65_CPTS_GENF_MAX_NUM];
struct am65_genf_regs estf[AM65_CPTS_ESTF_MAX_NUM];
};
/* CONTROL_REG */
#define AM65_CPTS_CONTROL_EN BIT(0)
#define AM65_CPTS_CONTROL_INT_TEST BIT(1)
#define AM65_CPTS_CONTROL_TS_COMP_POLARITY BIT(2)
#define AM65_CPTS_CONTROL_TSTAMP_EN BIT(3)
#define AM65_CPTS_CONTROL_SEQUENCE_EN BIT(4)
#define AM65_CPTS_CONTROL_64MODE BIT(5)
#define AM65_CPTS_CONTROL_TS_COMP_TOG BIT(6)
#define AM65_CPTS_CONTROL_TS_PPM_DIR BIT(7)
#define AM65_CPTS_CONTROL_HW1_TS_PUSH_EN BIT(8)
#define AM65_CPTS_CONTROL_HW2_TS_PUSH_EN BIT(9)
#define AM65_CPTS_CONTROL_HW3_TS_PUSH_EN BIT(10)
#define AM65_CPTS_CONTROL_HW4_TS_PUSH_EN BIT(11)
#define AM65_CPTS_CONTROL_HW5_TS_PUSH_EN BIT(12)
#define AM65_CPTS_CONTROL_HW6_TS_PUSH_EN BIT(13)
#define AM65_CPTS_CONTROL_HW7_TS_PUSH_EN BIT(14)
#define AM65_CPTS_CONTROL_HW8_TS_PUSH_EN BIT(15)
#define AM65_CPTS_CONTROL_HW1_TS_PUSH_OFFSET (8)
#define AM65_CPTS_CONTROL_TX_GENF_CLR_EN BIT(17)
#define AM65_CPTS_CONTROL_TS_SYNC_SEL_MASK (0xF)
#define AM65_CPTS_CONTROL_TS_SYNC_SEL_SHIFT (28)
/* RFTCLK_SEL_REG */
#define AM65_CPTS_RFTCLK_SEL_MASK (0x1F)
/* TS_PUSH_REG */
#define AM65_CPTS_TS_PUSH BIT(0)
/* TS_LOAD_EN_REG */
#define AM65_CPTS_TS_LOAD_EN BIT(0)
/* INTSTAT_RAW_REG */
#define AM65_CPTS_INTSTAT_RAW_TS_PEND BIT(0)
/* INTSTAT_MASKED_REG */
#define AM65_CPTS_INTSTAT_MASKED_TS_PEND BIT(0)
/* INT_ENABLE_REG */
#define AM65_CPTS_INT_ENABLE_TS_PEND_EN BIT(0)
/* TS_COMP_NUDGE_REG */
#define AM65_CPTS_TS_COMP_NUDGE_MASK (0xFF)
/* EVENT_POP_REG */
#define AM65_CPTS_EVENT_POP BIT(0)
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/err.h`, `linux/if_vlan.h`, `linux/interrupt.h`, `linux/module.h`, `linux/netdevice.h`, `linux/net_tstamp.h`.
- Detected declarations: `struct am65_genf_regs`, `struct am65_cpts_regs`, `struct am65_cpts_event`, `struct am65_cpts`, `struct am65_cpts_skb_cb_data`, `function am65_cpts_settime`, `function am65_cpts_set_add_val`, `function am65_cpts_disable`, `function am65_cpts_purge_event_list`, `function list_for_each_safe`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.