drivers/net/phy/bcm-cygnus.c
Source file repositories/reference/linux-study-clean/drivers/net/phy/bcm-cygnus.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/phy/bcm-cygnus.c- Extension
.c- Size
- 7033 bytes
- Lines
- 293
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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
bcm-phy-lib.hlinux/brcmphy.hlinux/module.hlinux/netdevice.hlinux/phy.h
Detected Declarations
struct bcm_omega_phy_privfunction bcm_cygnus_afe_configfunction bcm_cygnus_config_initfunction bcm_cygnus_resumefunction bcm_omega_config_initfunction bcm_omega_resumefunction bcm_omega_get_tunablefunction bcm_omega_set_tunablefunction bcm_omega_get_phy_statsfunction bcm_omega_probe
Annotated Snippet
struct bcm_omega_phy_priv {
u64 *stats;
};
/* Broadcom Cygnus Phy specific registers */
#define MII_BCM_CYGNUS_AFE_VDAC_ICTRL_0 0x91E5 /* VDAL Control register */
static int bcm_cygnus_afe_config(struct phy_device *phydev)
{
int rc;
/* ensure smdspclk is enabled */
rc = phy_write(phydev, MII_BCM54XX_AUX_CTL, 0x0c30);
if (rc < 0)
return rc;
/* AFE_VDAC_ICTRL_0 bit 7:4 Iq=1100 for 1g 10bt, normal modes */
rc = bcm_phy_write_misc(phydev, 0x39, 0x01, 0xA7C8);
if (rc < 0)
return rc;
/* AFE_HPF_TRIM_OTHERS bit11=1, short cascode enable for all modes*/
rc = bcm_phy_write_misc(phydev, 0x3A, 0x00, 0x0803);
if (rc < 0)
return rc;
/* AFE_TX_CONFIG_1 bit 7:4 Iq=1100 for test modes */
rc = bcm_phy_write_misc(phydev, 0x3A, 0x01, 0xA740);
if (rc < 0)
return rc;
/* AFE TEMPSEN_OTHERS rcal_HT, rcal_LT 10000 */
rc = bcm_phy_write_misc(phydev, 0x3A, 0x03, 0x8400);
if (rc < 0)
return rc;
/* AFE_FUTURE_RSV bit 2:0 rccal <2:0>=100 */
rc = bcm_phy_write_misc(phydev, 0x3B, 0x00, 0x0004);
if (rc < 0)
return rc;
/* Adjust bias current trim to overcome digital offSet */
rc = phy_write(phydev, MII_BRCM_CORE_BASE1E, 0x02);
if (rc < 0)
return rc;
/* make rcal=100, since rdb default is 000 */
rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB1, 0x10);
if (rc < 0)
return rc;
/* CORE_EXPB0, Reset R_CAL/RC_CAL Engine */
rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB0, 0x10);
if (rc < 0)
return rc;
/* CORE_EXPB0, Disable Reset R_CAL/RC_CAL Engine */
rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB0, 0x00);
return 0;
}
static int bcm_cygnus_config_init(struct phy_device *phydev)
{
int reg, rc;
reg = phy_read(phydev, MII_BCM54XX_ECR);
if (reg < 0)
return reg;
/* Mask interrupts globally. */
reg |= MII_BCM54XX_ECR_IM;
rc = phy_write(phydev, MII_BCM54XX_ECR, reg);
if (rc)
return rc;
/* Unmask events of interest */
reg = ~(MII_BCM54XX_INT_DUPLEX |
MII_BCM54XX_INT_SPEED |
MII_BCM54XX_INT_LINK);
rc = phy_write(phydev, MII_BCM54XX_IMR, reg);
if (rc)
return rc;
/* Apply AFE settings for the PHY */
rc = bcm_cygnus_afe_config(phydev);
if (rc)
return rc;
/* Advertise EEE */
Annotation
- Immediate include surface: `bcm-phy-lib.h`, `linux/brcmphy.h`, `linux/module.h`, `linux/netdevice.h`, `linux/phy.h`.
- Detected declarations: `struct bcm_omega_phy_priv`, `function bcm_cygnus_afe_config`, `function bcm_cygnus_config_init`, `function bcm_cygnus_resume`, `function bcm_omega_config_init`, `function bcm_omega_resume`, `function bcm_omega_get_tunable`, `function bcm_omega_set_tunable`, `function bcm_omega_get_phy_stats`, `function bcm_omega_probe`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.