Loading Documentation/devicetree/bindings/net/msm-emac.txt +10 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,16 @@ Optional properties: - qcom,no-external-phy : Indicates there is no external PHY connected to EMAC. Include this only if the EMAC is directly connected to the peer end without EPHY. - qcom,emac-ptp-grandmaster : Enable the PTP (1588) grandmaster mode. Include this only if PTP (1588) is configured as grandmaster. - qcom,emac-ptp-frac-ns-adj : The vector table to adjust the fractional ns per RTC clock cycle. Include this only if there is accuracy loss of fractional ns per RTC clock cycle. For individual table entry, the first field indicates the RTC reference clock rate. The second field indicates the number of adjustment in 2 ^ -26 ns. Example: emac0: qcom,emac@feb20000 { cell-index = <0>; Loading drivers/net/ethernet/msm/emac/emac.h +5 −1 Original line number Diff line number Diff line Loading @@ -223,10 +223,14 @@ struct emac_hw { /* 1588 parameter */ enum emac_ptp_clk_mode ptp_clk_mode; u32 rtc_ref_clkrate; enum emac_ptp_mode ptp_mode; u32 ptp_intr_mask; spinlock_t ptp_lock; u32 tstamp_rx_offset; u32 tstamp_tx_offset; void *frac_ns_adj_tbl; u32 frac_ns_adj_tbl_sz; s32 frac_ns_adj; u32 irq_mod; u32 preamble; Loading drivers/net/ethernet/msm/emac/emac_defines.h +8 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ /* EMAC_INT_STATUS */ #define DIS_INT 0x80000000 #define PTP_INT 0x40000000 #define RFD4_UR_INT 0x20000000 #define TX_PKT_INT3 0x4000000 #define TX_PKT_INT2 0x2000000 Loading Loading @@ -370,6 +371,9 @@ #define REAL_TIME_1_BMSK 0xffff #define REAL_TIME_1_SHFT 0 /* EMAC_P1588_EXPANDED_INT_STATUS */ #define PPS_IN 0x20 /* EMAC_P1588_RTC_EXPANDED_CONFIG */ #define RTC_READ_MODE 0x20 #define RTC_SNAPSHOT 0x10 Loading @@ -387,6 +391,10 @@ /* EMAC_P1588_RTC_PRELOADED_1 */ #define RTC_PRELOADED_1_BMSK 0xffff /* EMAC_P1588_GRAND_MASTER_CONFIG_0 */ #define GRANDMASTER_MODE 0x40 #define GM_PPS_SYNC 0x20 /* EMAC_QSERDES_COM_SYS_CLK_CTRL */ #define SYSCLK_CM 0x10 #define SYSCLK_AC_COUPLE 0x08 Loading drivers/net/ethernet/msm/emac/emac_hw.c +4 −0 Original line number Diff line number Diff line Loading @@ -887,6 +887,10 @@ void emac_hw_enable_intr(struct emac_hw *hw) emac_reg_w32(hw, EMAC_SGMII_PHY, irq_info->mask_reg, irq_info->mask); } if (adpt->tstamp_en) emac_reg_w32(hw, EMAC_1588, EMAC_P1588_PTP_EXPANDED_INT_MASK, hw->ptp_intr_mask); wmb(); } Loading drivers/net/ethernet/msm/emac/emac_main.c +3 −3 Original line number Diff line number Diff line Loading @@ -1082,6 +1082,8 @@ static irqreturn_t emac_interrupt(int irq, void *data) break; } if (status & PTP_INT) emac_ptp_intr(hw); } while (--max_ints > 0); /* enable the interrupt */ Loading Loading @@ -2752,10 +2754,8 @@ static int emac_probe(struct platform_device *pdev) adpt->tpdesc_size = EMAC_TPDESC_SIZE; adpt->rfdesc_size = EMAC_RFDESC_SIZE; if (adpt->tstamp_en) { hw->rtc_ref_clkrate = DEFAULT_RTC_REF_CLKRATE; if (adpt->tstamp_en) SET_HW_FLAG(PTP_CAP); } /* init netdev */ netdev->netdev_ops = &emac_netdev_ops; Loading Loading
Documentation/devicetree/bindings/net/msm-emac.txt +10 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,16 @@ Optional properties: - qcom,no-external-phy : Indicates there is no external PHY connected to EMAC. Include this only if the EMAC is directly connected to the peer end without EPHY. - qcom,emac-ptp-grandmaster : Enable the PTP (1588) grandmaster mode. Include this only if PTP (1588) is configured as grandmaster. - qcom,emac-ptp-frac-ns-adj : The vector table to adjust the fractional ns per RTC clock cycle. Include this only if there is accuracy loss of fractional ns per RTC clock cycle. For individual table entry, the first field indicates the RTC reference clock rate. The second field indicates the number of adjustment in 2 ^ -26 ns. Example: emac0: qcom,emac@feb20000 { cell-index = <0>; Loading
drivers/net/ethernet/msm/emac/emac.h +5 −1 Original line number Diff line number Diff line Loading @@ -223,10 +223,14 @@ struct emac_hw { /* 1588 parameter */ enum emac_ptp_clk_mode ptp_clk_mode; u32 rtc_ref_clkrate; enum emac_ptp_mode ptp_mode; u32 ptp_intr_mask; spinlock_t ptp_lock; u32 tstamp_rx_offset; u32 tstamp_tx_offset; void *frac_ns_adj_tbl; u32 frac_ns_adj_tbl_sz; s32 frac_ns_adj; u32 irq_mod; u32 preamble; Loading
drivers/net/ethernet/msm/emac/emac_defines.h +8 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ /* EMAC_INT_STATUS */ #define DIS_INT 0x80000000 #define PTP_INT 0x40000000 #define RFD4_UR_INT 0x20000000 #define TX_PKT_INT3 0x4000000 #define TX_PKT_INT2 0x2000000 Loading Loading @@ -370,6 +371,9 @@ #define REAL_TIME_1_BMSK 0xffff #define REAL_TIME_1_SHFT 0 /* EMAC_P1588_EXPANDED_INT_STATUS */ #define PPS_IN 0x20 /* EMAC_P1588_RTC_EXPANDED_CONFIG */ #define RTC_READ_MODE 0x20 #define RTC_SNAPSHOT 0x10 Loading @@ -387,6 +391,10 @@ /* EMAC_P1588_RTC_PRELOADED_1 */ #define RTC_PRELOADED_1_BMSK 0xffff /* EMAC_P1588_GRAND_MASTER_CONFIG_0 */ #define GRANDMASTER_MODE 0x40 #define GM_PPS_SYNC 0x20 /* EMAC_QSERDES_COM_SYS_CLK_CTRL */ #define SYSCLK_CM 0x10 #define SYSCLK_AC_COUPLE 0x08 Loading
drivers/net/ethernet/msm/emac/emac_hw.c +4 −0 Original line number Diff line number Diff line Loading @@ -887,6 +887,10 @@ void emac_hw_enable_intr(struct emac_hw *hw) emac_reg_w32(hw, EMAC_SGMII_PHY, irq_info->mask_reg, irq_info->mask); } if (adpt->tstamp_en) emac_reg_w32(hw, EMAC_1588, EMAC_P1588_PTP_EXPANDED_INT_MASK, hw->ptp_intr_mask); wmb(); } Loading
drivers/net/ethernet/msm/emac/emac_main.c +3 −3 Original line number Diff line number Diff line Loading @@ -1082,6 +1082,8 @@ static irqreturn_t emac_interrupt(int irq, void *data) break; } if (status & PTP_INT) emac_ptp_intr(hw); } while (--max_ints > 0); /* enable the interrupt */ Loading Loading @@ -2752,10 +2754,8 @@ static int emac_probe(struct platform_device *pdev) adpt->tpdesc_size = EMAC_TPDESC_SIZE; adpt->rfdesc_size = EMAC_RFDESC_SIZE; if (adpt->tstamp_en) { hw->rtc_ref_clkrate = DEFAULT_RTC_REF_CLKRATE; if (adpt->tstamp_en) SET_HW_FLAG(PTP_CAP); } /* init netdev */ netdev->netdev_ops = &emac_netdev_ops; Loading