changtimwu / changtimwu.github.com

Tim's testing/practice notes
7 stars 2 forks source link

PTP/1588 and PHY #23

Open changtimwu opened 9 years ago

changtimwu commented 9 years ago

ordinary clock master and ordinary slave can be done in this way. http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00030825.pdf

changtimwu commented 9 years ago

1548P

Ingress

Egress

Others

changtimwu commented 9 years ago

2015-09-01 8 58 08

changtimwu commented 9 years ago

page 269 PTP memory. Each register is 32-bit wide

@ptpreg_read = ( phy_no, ptpreg)->
  p = (port for port in devinfo().ports when port.phy_no is phy_no)[0]
  org_page = set_page( p, PHYPAGE_PTP)
  sw.smi_register_write p.phy_if, p.phy_id, PTPREG_ADREAD, ptpreg
  datalo = sw.smi_register_read(p.phy_if, p.phy_id, PTPREG_DATA_LO).value
  datahi = sw.smi_register_read(p.phy_if, p.phy_id, PTPREG_DATA_HI).value 
  sw.smi_register_write p.phy_if, p.phy_id, 0x16, org_page
  datahi<<16 | datalo

@ptpreg_write = ( phy_no, ptpreg, ptpval)->
  p = (port for port in devinfo().ports when port.phy_no is phy_no)[0]
  org_page = set_page( p, PHYPAGE_PTP)
  sw.smi_register_write p.phy_if, p.phy_id, PTPREG_ADWRITE, ptpreg
  sw.smi_register_write p.phy_if, p.phy_id, PTPREG_DATA_LO, ptpval & 0xffff
  sw.smi_register_write p.phy_if, p.phy_id, PTPREG_DATA_HI, ptpval >> 16
  sw.smi_register_write p.phy_if, p.phy_id, 0x16, org_page
  null
changtimwu commented 9 years ago

marvell phy pin bootstrap configuration

2015-09-02 9 16 27 2015-09-02 9 16 39

共有4根config pin, CONFIG[3:0], 每根PIN 藉由接到不同LED 就代表 4bit得值 所以共有 4*16 = 64 個 bool 值可調整,

CONFIG[1] 可以當 PTPinput, 被拿來當PTP使用時, CONFIG[1] 就自動失去4bit值得決定能力 CONFIG[2] 可以當 PTPclock, 被拿來當PTP使用時 CONFIG[4] 就自動失去4bit值得決定能力 CONFIG[0] & CONFIG[3] 跟 PTP 無關, PTP透過 software 調成enable or disable, 都不會影響他, 所以PTP_EN 那欄 always 秀 X

changtimwu commented 9 years ago

For one-step PTP, the messages Sync, pdelay_req, Delay_req need to insert the time stamp into PTP-frame by hardware.

changtimwu commented 8 years ago

MV-S107695-00_88E1548P_Datasheet_20150325.pdf

Page 52

changtimwu commented 8 years ago
2016-01-27 5 47 03 2016-01-27 5 58 13

需要P4R27b{0,1} register 來對跳?

changtimwu commented 8 years ago

yes, set P4R27 to 0x7f83 is the solution. What a pity you didn't insist trying it.