395// PRU issues an interrupt to ARM when packet is received or packet is transmitted. This is aligned with buffer complete flag.
396
397// Descriptor for CPM and PPM is as follows: total 16 bytes or 4 32 bit word.
398
399// CPM RTC descriptor for red and green period
400// Bit Name Description
401// 0..15 FrameReference 16 bit offset into start address pointer for triple buffer CPM (fixed address). Points into cpm triple buffer start addresses (RTC_CPM_BUFFER_ADDRESSES_OFFSET+ offset of current CPM first buffer)
402// 16..31 FrameLength 11 bits of frame length including VLAN and FCS, set by host only. PRU may verify incoming frame on length which needs to be flexible in terms of stripped VLAN tag. Bit12.15 need to be zero.
403// 0..15 FrameDataPointer 16 bit absolute address pointing to Profinet data of current index buffer. This pointer masks VLAN tag offset. Points to first byte after FID
404// 16..23 FrameIndex Current index of data source which is host on PPM and PRU on CPM.
405// CPM: Before first packet received idx indicated to host with FrameIndex is idx_2 whereas PRU is on idx_0 (not shown in register) . After first packet received by PRU FrameIndex changes to idx_0 and BufferComplete flag is reset by PRU. PRU advances to next index which is idx_1.
406//24..31 FrameFlags1 CPM: Bit 0: 1 = VLAN TAG present
407// CPM: Bit 1: 0 = CPM received on port 1 (PRU0), 1 = CPM received on port 2 (PRU1)
408// Bit 1..7: reserved
409// 24..31 Reserved
410// 0..15 FrameID FrameID as provided by engineering. Set by host and used only for CPM. Not used for PPM. MRPD?
411// 16..23 FrameFlags2 CPM: Bit 0: 0 = received in red, 1 = received in green
412// Bit 1..7: reserved
413// 24..31 Reserved
414// 0..15 RR Reduction Ratio for red period which is max 16.
415// Send in GREEN period: reduction ratio (max 512) set by host and used by PRU to find out whether current phase matches.
422// 0..15 FrameReference bytes address offset into RTCx - PPM buffer which has fixed base address.
423// 16..31 FrameLength 11 bits of frame length, set by host only. PRU may verify incoming frame on length.
424// 0..31 FrameSendOffset PPM: Send in RED period: FSO as provided by engineering and limited to 22 bits, i.e. 4.1ms. Set by host only.
425// 0..15 FrameID FrameID as provided by engineering. Set by host and used only for CPM. Not used for PPM. MRPD?
426// 16..23 FrameFlags1 PPM: Bit 0: 1 = RTC3 frame in red period, note: first RTC3 will come in green and is handled with additional descriptor for legacy start-up
427// Bit 1..7: reserved
428// 24..31 FrameIndex Current index of data source which is host on PPM and PRU on CPM.
429// CPM: Before first packet received idx indicated to host with FrameIndex is idx_2 whereas PRU is on idx_0 (not shown in register) . After first packet received by PRU FrameIndex changes to idx_0 and BufferComplete flag is reset by PRU. PRU advances to next index which is idx_1.
430// 0..15 RR Reduction Ratio for red period which is max 16.
431// Send in GREEN period: reduction ratio (max 512) set by host and used by PRU to find out whether current phase matches.
432// 16..31 Phase PPM: used for sendlist generation.
433#ifdef PRU
434 .struct struct_rtc_cpm_desc
435 .u16 FrameReference
436 .u16 FrameLength
437 .u16 FrameDataPointer
438 .u8 FrameIndex
439 .u8 FrameFlags1
440 .u16 FrameID
441 .u8 FrameFlags2
442 .u8 Reserved
443 .u16 RR
444 .u16 Phase
445 .ends
446
447 .struct struct_rtc_ppm_desc
448 .u16 FrameReference
449 .u16 FrameLength
450 .u32 FrameSendOffset
451 .u16 FrameID
452 .u8 Reserved
453 .u8 FrameIndex
454 .u16 RR
455 .u16 Phase
456 .ends
457
458// cpm FrameFlags
459#define VLAN_TAG t0
460// cpm/ppm FrameFlags
461#define RED_GREEN_FLAG t0
462// FW ARM descriptor structure hard coded in driver