18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* Copyright (c)  2018 Intel Corporation */
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef _IGC_REGS_H_
58c2ecf20Sopenharmony_ci#define _IGC_REGS_H_
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci/* General Register Descriptions */
88c2ecf20Sopenharmony_ci#define IGC_CTRL		0x00000  /* Device Control - RW */
98c2ecf20Sopenharmony_ci#define IGC_STATUS		0x00008  /* Device Status - RO */
108c2ecf20Sopenharmony_ci#define IGC_EECD		0x00010  /* EEPROM/Flash Control - RW */
118c2ecf20Sopenharmony_ci#define IGC_CTRL_EXT		0x00018  /* Extended Device Control - RW */
128c2ecf20Sopenharmony_ci#define IGC_MDIC		0x00020  /* MDI Control - RW */
138c2ecf20Sopenharmony_ci#define IGC_MDICNFG		0x00E04  /* MDC/MDIO Configuration - RW */
148c2ecf20Sopenharmony_ci#define IGC_CONNSW		0x00034  /* Copper/Fiber switch control - RW */
158c2ecf20Sopenharmony_ci#define IGC_I225_PHPM		0x00E14  /* I225 PHY Power Management */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/* Internal Packet Buffer Size Registers */
188c2ecf20Sopenharmony_ci#define IGC_RXPBS		0x02404  /* Rx Packet Buffer Size - RW */
198c2ecf20Sopenharmony_ci#define IGC_TXPBS		0x03404  /* Tx Packet Buffer Size - RW */
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/* NVM  Register Descriptions */
228c2ecf20Sopenharmony_ci#define IGC_EERD		0x12014  /* EEprom mode read - RW */
238c2ecf20Sopenharmony_ci#define IGC_EEWR		0x12018  /* EEprom mode write - RW */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/* Flow Control Register Descriptions */
268c2ecf20Sopenharmony_ci#define IGC_FCAL		0x00028  /* FC Address Low - RW */
278c2ecf20Sopenharmony_ci#define IGC_FCAH		0x0002C  /* FC Address High - RW */
288c2ecf20Sopenharmony_ci#define IGC_FCT			0x00030  /* FC Type - RW */
298c2ecf20Sopenharmony_ci#define IGC_FCTTV		0x00170  /* FC Transmit Timer - RW */
308c2ecf20Sopenharmony_ci#define IGC_FCRTL		0x02160  /* FC Receive Threshold Low - RW */
318c2ecf20Sopenharmony_ci#define IGC_FCRTH		0x02168  /* FC Receive Threshold High - RW */
328c2ecf20Sopenharmony_ci#define IGC_FCRTV		0x02460  /* FC Refresh Timer Value - RW */
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/* Semaphore registers */
358c2ecf20Sopenharmony_ci#define IGC_SW_FW_SYNC		0x05B5C  /* SW-FW Synchronization - RW */
368c2ecf20Sopenharmony_ci#define IGC_SWSM		0x05B50  /* SW Semaphore */
378c2ecf20Sopenharmony_ci#define IGC_FWSM		0x05B54  /* FW Semaphore */
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci/* Function Active and Power State to MNG */
408c2ecf20Sopenharmony_ci#define IGC_FACTPS		0x05B30
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci/* Interrupt Register Description */
438c2ecf20Sopenharmony_ci#define IGC_EICR		0x01580  /* Ext. Interrupt Cause read - W0 */
448c2ecf20Sopenharmony_ci#define IGC_EICS		0x01520  /* Ext. Interrupt Cause Set - W0 */
458c2ecf20Sopenharmony_ci#define IGC_EIMS		0x01524  /* Ext. Interrupt Mask Set/Read - RW */
468c2ecf20Sopenharmony_ci#define IGC_EIMC		0x01528  /* Ext. Interrupt Mask Clear - WO */
478c2ecf20Sopenharmony_ci#define IGC_EIAC		0x0152C  /* Ext. Interrupt Auto Clear - RW */
488c2ecf20Sopenharmony_ci#define IGC_EIAM		0x01530  /* Ext. Interrupt Auto Mask - RW */
498c2ecf20Sopenharmony_ci#define IGC_ICR			0x01500  /* Intr Cause Read - RC/W1C */
508c2ecf20Sopenharmony_ci#define IGC_ICS			0x01504  /* Intr Cause Set - WO */
518c2ecf20Sopenharmony_ci#define IGC_IMS			0x01508  /* Intr Mask Set/Read - RW */
528c2ecf20Sopenharmony_ci#define IGC_IMC			0x0150C  /* Intr Mask Clear - WO */
538c2ecf20Sopenharmony_ci#define IGC_IAM			0x01510  /* Intr Ack Auto Mask- RW */
548c2ecf20Sopenharmony_ci/* Intr Throttle - RW */
558c2ecf20Sopenharmony_ci#define IGC_EITR(_n)		(0x01680 + (0x4 * (_n)))
568c2ecf20Sopenharmony_ci/* Interrupt Vector Allocation - RW */
578c2ecf20Sopenharmony_ci#define IGC_IVAR0		0x01700
588c2ecf20Sopenharmony_ci#define IGC_IVAR_MISC		0x01740  /* IVAR for "other" causes - RW */
598c2ecf20Sopenharmony_ci#define IGC_GPIE		0x01514  /* General Purpose Intr Enable - RW */
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci/* MSI-X Table Register Descriptions */
628c2ecf20Sopenharmony_ci#define IGC_PBACL		0x05B68  /* MSIx PBA Clear - R/W 1 to clear */
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci/* RSS registers */
658c2ecf20Sopenharmony_ci#define IGC_MRQC		0x05818 /* Multiple Receive Control - RW */
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/* Filtering Registers */
688c2ecf20Sopenharmony_ci#define IGC_ETQF(_n)		(0x05CB0 + (4 * (_n))) /* EType Queue Fltr */
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci/* ETQF register bit definitions */
718c2ecf20Sopenharmony_ci#define IGC_ETQF_FILTER_ENABLE	BIT(26)
728c2ecf20Sopenharmony_ci#define IGC_ETQF_QUEUE_ENABLE	BIT(31)
738c2ecf20Sopenharmony_ci#define IGC_ETQF_QUEUE_SHIFT	16
748c2ecf20Sopenharmony_ci#define IGC_ETQF_QUEUE_MASK	0x00070000
758c2ecf20Sopenharmony_ci#define IGC_ETQF_ETYPE_MASK	0x0000FFFF
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* Redirection Table - RW Array */
788c2ecf20Sopenharmony_ci#define IGC_RETA(_i)		(0x05C00 + ((_i) * 4))
798c2ecf20Sopenharmony_ci/* RSS Random Key - RW Array */
808c2ecf20Sopenharmony_ci#define IGC_RSSRK(_i)		(0x05C80 + ((_i) * 4))
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* Receive Register Descriptions */
838c2ecf20Sopenharmony_ci#define IGC_RCTL		0x00100  /* Rx Control - RW */
848c2ecf20Sopenharmony_ci#define IGC_SRRCTL(_n)		(0x0C00C + ((_n) * 0x40))
858c2ecf20Sopenharmony_ci#define IGC_PSRTYPE(_i)		(0x05480 + ((_i) * 4))
868c2ecf20Sopenharmony_ci#define IGC_RDBAL(_n)		(0x0C000 + ((_n) * 0x40))
878c2ecf20Sopenharmony_ci#define IGC_RDBAH(_n)		(0x0C004 + ((_n) * 0x40))
888c2ecf20Sopenharmony_ci#define IGC_RDLEN(_n)		(0x0C008 + ((_n) * 0x40))
898c2ecf20Sopenharmony_ci#define IGC_RDH(_n)		(0x0C010 + ((_n) * 0x40))
908c2ecf20Sopenharmony_ci#define IGC_RDT(_n)		(0x0C018 + ((_n) * 0x40))
918c2ecf20Sopenharmony_ci#define IGC_RXDCTL(_n)		(0x0C028 + ((_n) * 0x40))
928c2ecf20Sopenharmony_ci#define IGC_RQDPC(_n)		(0x0C030 + ((_n) * 0x40))
938c2ecf20Sopenharmony_ci#define IGC_RXCSUM		0x05000  /* Rx Checksum Control - RW */
948c2ecf20Sopenharmony_ci#define IGC_RLPML		0x05004  /* Rx Long Packet Max Length */
958c2ecf20Sopenharmony_ci#define IGC_RFCTL		0x05008  /* Receive Filter Control*/
968c2ecf20Sopenharmony_ci#define IGC_MTA			0x05200  /* Multicast Table Array - RW Array */
978c2ecf20Sopenharmony_ci#define IGC_RA			0x05400  /* Receive Address - RW Array */
988c2ecf20Sopenharmony_ci#define IGC_UTA			0x0A000  /* Unicast Table Array - RW */
998c2ecf20Sopenharmony_ci#define IGC_RAL(_n)		(0x05400 + ((_n) * 0x08))
1008c2ecf20Sopenharmony_ci#define IGC_RAH(_n)		(0x05404 + ((_n) * 0x08))
1018c2ecf20Sopenharmony_ci#define IGC_VLANPQF		0x055B0  /* VLAN Priority Queue Filter - RW */
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci/* Transmit Register Descriptions */
1048c2ecf20Sopenharmony_ci#define IGC_TCTL		0x00400  /* Tx Control - RW */
1058c2ecf20Sopenharmony_ci#define IGC_TIPG		0x00410  /* Tx Inter-packet gap - RW */
1068c2ecf20Sopenharmony_ci#define IGC_TDBAL(_n)		(0x0E000 + ((_n) * 0x40))
1078c2ecf20Sopenharmony_ci#define IGC_TDBAH(_n)		(0x0E004 + ((_n) * 0x40))
1088c2ecf20Sopenharmony_ci#define IGC_TDLEN(_n)		(0x0E008 + ((_n) * 0x40))
1098c2ecf20Sopenharmony_ci#define IGC_TDH(_n)		(0x0E010 + ((_n) * 0x40))
1108c2ecf20Sopenharmony_ci#define IGC_TDT(_n)		(0x0E018 + ((_n) * 0x40))
1118c2ecf20Sopenharmony_ci#define IGC_TXDCTL(_n)		(0x0E028 + ((_n) * 0x40))
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci/* MMD Register Descriptions */
1148c2ecf20Sopenharmony_ci#define IGC_MMDAC		13 /* MMD Access Control */
1158c2ecf20Sopenharmony_ci#define IGC_MMDAAD		14 /* MMD Access Address/Data */
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci/* Statistics Register Descriptions */
1188c2ecf20Sopenharmony_ci#define IGC_CRCERRS	0x04000  /* CRC Error Count - R/clr */
1198c2ecf20Sopenharmony_ci#define IGC_ALGNERRC	0x04004  /* Alignment Error Count - R/clr */
1208c2ecf20Sopenharmony_ci#define IGC_RXERRC	0x0400C  /* Receive Error Count - R/clr */
1218c2ecf20Sopenharmony_ci#define IGC_MPC		0x04010  /* Missed Packet Count - R/clr */
1228c2ecf20Sopenharmony_ci#define IGC_SCC		0x04014  /* Single Collision Count - R/clr */
1238c2ecf20Sopenharmony_ci#define IGC_ECOL	0x04018  /* Excessive Collision Count - R/clr */
1248c2ecf20Sopenharmony_ci#define IGC_MCC		0x0401C  /* Multiple Collision Count - R/clr */
1258c2ecf20Sopenharmony_ci#define IGC_LATECOL	0x04020  /* Late Collision Count - R/clr */
1268c2ecf20Sopenharmony_ci#define IGC_COLC	0x04028  /* Collision Count - R/clr */
1278c2ecf20Sopenharmony_ci#define IGC_RERC	0x0402C  /* Receive Error Count - R/clr */
1288c2ecf20Sopenharmony_ci#define IGC_DC		0x04030  /* Defer Count - R/clr */
1298c2ecf20Sopenharmony_ci#define IGC_TNCRS	0x04034  /* Tx-No CRS - R/clr */
1308c2ecf20Sopenharmony_ci#define IGC_HTDPMC	0x0403C  /* Host Transmit Discarded by MAC - R/clr */
1318c2ecf20Sopenharmony_ci#define IGC_RLEC	0x04040  /* Receive Length Error Count - R/clr */
1328c2ecf20Sopenharmony_ci#define IGC_XONRXC	0x04048  /* XON Rx Count - R/clr */
1338c2ecf20Sopenharmony_ci#define IGC_XONTXC	0x0404C  /* XON Tx Count - R/clr */
1348c2ecf20Sopenharmony_ci#define IGC_XOFFRXC	0x04050  /* XOFF Rx Count - R/clr */
1358c2ecf20Sopenharmony_ci#define IGC_XOFFTXC	0x04054  /* XOFF Tx Count - R/clr */
1368c2ecf20Sopenharmony_ci#define IGC_FCRUC	0x04058  /* Flow Control Rx Unsupported Count- R/clr */
1378c2ecf20Sopenharmony_ci#define IGC_PRC64	0x0405C  /* Packets Rx (64 bytes) - R/clr */
1388c2ecf20Sopenharmony_ci#define IGC_PRC127	0x04060  /* Packets Rx (65-127 bytes) - R/clr */
1398c2ecf20Sopenharmony_ci#define IGC_PRC255	0x04064  /* Packets Rx (128-255 bytes) - R/clr */
1408c2ecf20Sopenharmony_ci#define IGC_PRC511	0x04068  /* Packets Rx (255-511 bytes) - R/clr */
1418c2ecf20Sopenharmony_ci#define IGC_PRC1023	0x0406C  /* Packets Rx (512-1023 bytes) - R/clr */
1428c2ecf20Sopenharmony_ci#define IGC_PRC1522	0x04070  /* Packets Rx (1024-1522 bytes) - R/clr */
1438c2ecf20Sopenharmony_ci#define IGC_GPRC	0x04074  /* Good Packets Rx Count - R/clr */
1448c2ecf20Sopenharmony_ci#define IGC_BPRC	0x04078  /* Broadcast Packets Rx Count - R/clr */
1458c2ecf20Sopenharmony_ci#define IGC_MPRC	0x0407C  /* Multicast Packets Rx Count - R/clr */
1468c2ecf20Sopenharmony_ci#define IGC_GPTC	0x04080  /* Good Packets Tx Count - R/clr */
1478c2ecf20Sopenharmony_ci#define IGC_GORCL	0x04088  /* Good Octets Rx Count Low - R/clr */
1488c2ecf20Sopenharmony_ci#define IGC_GORCH	0x0408C  /* Good Octets Rx Count High - R/clr */
1498c2ecf20Sopenharmony_ci#define IGC_GOTCL	0x04090  /* Good Octets Tx Count Low - R/clr */
1508c2ecf20Sopenharmony_ci#define IGC_GOTCH	0x04094  /* Good Octets Tx Count High - R/clr */
1518c2ecf20Sopenharmony_ci#define IGC_RNBC	0x040A0  /* Rx No Buffers Count - R/clr */
1528c2ecf20Sopenharmony_ci#define IGC_RUC		0x040A4  /* Rx Undersize Count - R/clr */
1538c2ecf20Sopenharmony_ci#define IGC_RFC		0x040A8  /* Rx Fragment Count - R/clr */
1548c2ecf20Sopenharmony_ci#define IGC_ROC		0x040AC  /* Rx Oversize Count - R/clr */
1558c2ecf20Sopenharmony_ci#define IGC_RJC		0x040B0  /* Rx Jabber Count - R/clr */
1568c2ecf20Sopenharmony_ci#define IGC_MGTPRC	0x040B4  /* Management Packets Rx Count - R/clr */
1578c2ecf20Sopenharmony_ci#define IGC_MGTPDC	0x040B8  /* Management Packets Dropped Count - R/clr */
1588c2ecf20Sopenharmony_ci#define IGC_MGTPTC	0x040BC  /* Management Packets Tx Count - R/clr */
1598c2ecf20Sopenharmony_ci#define IGC_TORL	0x040C0  /* Total Octets Rx Low - R/clr */
1608c2ecf20Sopenharmony_ci#define IGC_TORH	0x040C4  /* Total Octets Rx High - R/clr */
1618c2ecf20Sopenharmony_ci#define IGC_TOTL	0x040C8  /* Total Octets Tx Low - R/clr */
1628c2ecf20Sopenharmony_ci#define IGC_TOTH	0x040CC  /* Total Octets Tx High - R/clr */
1638c2ecf20Sopenharmony_ci#define IGC_TPR		0x040D0  /* Total Packets Rx - R/clr */
1648c2ecf20Sopenharmony_ci#define IGC_TPT		0x040D4  /* Total Packets Tx - R/clr */
1658c2ecf20Sopenharmony_ci#define IGC_PTC64	0x040D8  /* Packets Tx (64 bytes) - R/clr */
1668c2ecf20Sopenharmony_ci#define IGC_PTC127	0x040DC  /* Packets Tx (65-127 bytes) - R/clr */
1678c2ecf20Sopenharmony_ci#define IGC_PTC255	0x040E0  /* Packets Tx (128-255 bytes) - R/clr */
1688c2ecf20Sopenharmony_ci#define IGC_PTC511	0x040E4  /* Packets Tx (256-511 bytes) - R/clr */
1698c2ecf20Sopenharmony_ci#define IGC_PTC1023	0x040E8  /* Packets Tx (512-1023 bytes) - R/clr */
1708c2ecf20Sopenharmony_ci#define IGC_PTC1522	0x040EC  /* Packets Tx (1024-1522 Bytes) - R/clr */
1718c2ecf20Sopenharmony_ci#define IGC_MPTC	0x040F0  /* Multicast Packets Tx Count - R/clr */
1728c2ecf20Sopenharmony_ci#define IGC_BPTC	0x040F4  /* Broadcast Packets Tx Count - R/clr */
1738c2ecf20Sopenharmony_ci#define IGC_TSCTC	0x040F8  /* TCP Segmentation Context Tx - R/clr */
1748c2ecf20Sopenharmony_ci#define IGC_IAC		0x04100  /* Interrupt Assertion Count */
1758c2ecf20Sopenharmony_ci#define IGC_RPTHC	0x04104  /* Rx Packets To Host */
1768c2ecf20Sopenharmony_ci#define IGC_TLPIC	0x04148  /* EEE Tx LPI Count */
1778c2ecf20Sopenharmony_ci#define IGC_RLPIC	0x0414C  /* EEE Rx LPI Count */
1788c2ecf20Sopenharmony_ci#define IGC_HGPTC	0x04118  /* Host Good Packets Tx Count */
1798c2ecf20Sopenharmony_ci#define IGC_RXDMTC	0x04120  /* Rx Descriptor Minimum Threshold Count */
1808c2ecf20Sopenharmony_ci#define IGC_HGORCL	0x04128  /* Host Good Octets Received Count Low */
1818c2ecf20Sopenharmony_ci#define IGC_HGORCH	0x0412C  /* Host Good Octets Received Count High */
1828c2ecf20Sopenharmony_ci#define IGC_HGOTCL	0x04130  /* Host Good Octets Transmit Count Low */
1838c2ecf20Sopenharmony_ci#define IGC_HGOTCH	0x04134  /* Host Good Octets Transmit Count High */
1848c2ecf20Sopenharmony_ci#define IGC_LENERRS	0x04138  /* Length Errors Count */
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci/* Time sync registers */
1878c2ecf20Sopenharmony_ci#define IGC_TSICR	0x0B66C  /* Time Sync Interrupt Cause */
1888c2ecf20Sopenharmony_ci#define IGC_TSIM	0x0B674  /* Time Sync Interrupt Mask Register */
1898c2ecf20Sopenharmony_ci#define IGC_TSAUXC	0x0B640  /* Timesync Auxiliary Control register */
1908c2ecf20Sopenharmony_ci#define IGC_TSYNCRXCTL	0x0B620  /* Rx Time Sync Control register - RW */
1918c2ecf20Sopenharmony_ci#define IGC_TSYNCTXCTL	0x0B614  /* Tx Time Sync Control register - RW */
1928c2ecf20Sopenharmony_ci#define IGC_TSYNCRXCFG	0x05F50  /* Time Sync Rx Configuration - RW */
1938c2ecf20Sopenharmony_ci#define IGC_TSSDP	0x0003C  /* Time Sync SDP Configuration Register - RW */
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci#define IGC_IMIR(_i)	(0x05A80 + ((_i) * 4))  /* Immediate Interrupt */
1968c2ecf20Sopenharmony_ci#define IGC_IMIREXT(_i)	(0x05AA0 + ((_i) * 4))  /* Immediate INTR Ext*/
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci#define IGC_FTQF(_n)	(0x059E0 + (4 * (_n)))  /* 5-tuple Queue Fltr */
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci/* Transmit Scheduling Registers */
2018c2ecf20Sopenharmony_ci#define IGC_TQAVCTRL		0x3570
2028c2ecf20Sopenharmony_ci#define IGC_TXQCTL(_n)		(0x3344 + 0x4 * (_n))
2038c2ecf20Sopenharmony_ci#define IGC_BASET_L		0x3314
2048c2ecf20Sopenharmony_ci#define IGC_BASET_H		0x3318
2058c2ecf20Sopenharmony_ci#define IGC_QBVCYCLET		0x331C
2068c2ecf20Sopenharmony_ci#define IGC_QBVCYCLET_S		0x3320
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci#define IGC_STQT(_n)		(0x3324 + 0x4 * (_n))
2098c2ecf20Sopenharmony_ci#define IGC_ENDQT(_n)		(0x3334 + 0x4 * (_n))
2108c2ecf20Sopenharmony_ci#define IGC_DTXMXPKTSZ		0x355C
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci/* System Time Registers */
2138c2ecf20Sopenharmony_ci#define IGC_SYSTIML	0x0B600  /* System time register Low - RO */
2148c2ecf20Sopenharmony_ci#define IGC_SYSTIMH	0x0B604  /* System time register High - RO */
2158c2ecf20Sopenharmony_ci#define IGC_SYSTIMR	0x0B6F8  /* System time register Residue */
2168c2ecf20Sopenharmony_ci#define IGC_TIMINCA	0x0B608  /* Increment attributes register - RW */
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci#define IGC_TXSTMPL	0x0B618  /* Tx timestamp value Low - RO */
2198c2ecf20Sopenharmony_ci#define IGC_TXSTMPH	0x0B61C  /* Tx timestamp value High - RO */
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci/* Management registers */
2228c2ecf20Sopenharmony_ci#define IGC_MANC	0x05820  /* Management Control - RW */
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci/* Shadow Ram Write Register - RW */
2258c2ecf20Sopenharmony_ci#define IGC_SRWR	0x12018
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci/* Wake Up registers */
2288c2ecf20Sopenharmony_ci#define IGC_WUC		0x05800  /* Wakeup Control - RW */
2298c2ecf20Sopenharmony_ci#define IGC_WUFC	0x05808  /* Wakeup Filter Control - RW */
2308c2ecf20Sopenharmony_ci#define IGC_WUS		0x05810  /* Wakeup Status - R/W1C */
2318c2ecf20Sopenharmony_ci#define IGC_WUPL	0x05900  /* Wakeup Packet Length - RW */
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci/* Wake Up packet memory */
2348c2ecf20Sopenharmony_ci#define IGC_WUPM_REG(_i)	(0x05A00 + ((_i) * 4))
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci/* Energy Efficient Ethernet "EEE" registers */
2378c2ecf20Sopenharmony_ci#define IGC_EEER	0x0E30 /* Energy Efficient Ethernet "EEE"*/
2388c2ecf20Sopenharmony_ci#define IGC_IPCNFG	0x0E38 /* Internal PHY Configuration */
2398c2ecf20Sopenharmony_ci#define IGC_EEE_SU	0x0E34 /* EEE Setup */
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci/* LTR registers */
2428c2ecf20Sopenharmony_ci#define IGC_LTRC	0x01A0 /* Latency Tolerance Reporting Control */
2438c2ecf20Sopenharmony_ci#define IGC_DMACR	0x02508 /* DMA Coalescing Control Register */
2448c2ecf20Sopenharmony_ci#define IGC_LTRMINV	0x5BB0 /* LTR Minimum Value */
2458c2ecf20Sopenharmony_ci#define IGC_LTRMAXV	0x5BB4 /* LTR Maximum Value */
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci/* forward declaration */
2488c2ecf20Sopenharmony_cistruct igc_hw;
2498c2ecf20Sopenharmony_ciu32 igc_rd32(struct igc_hw *hw, u32 reg);
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci/* write operations, indexed using DWORDS */
2528c2ecf20Sopenharmony_ci#define wr32(reg, val) \
2538c2ecf20Sopenharmony_cido { \
2548c2ecf20Sopenharmony_ci	u8 __iomem *hw_addr = READ_ONCE((hw)->hw_addr); \
2558c2ecf20Sopenharmony_ci	if (!IGC_REMOVED(hw_addr)) \
2568c2ecf20Sopenharmony_ci		writel((val), &hw_addr[(reg)]); \
2578c2ecf20Sopenharmony_ci} while (0)
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci#define rd32(reg) (igc_rd32(hw, reg))
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ci#define wrfl() ((void)rd32(IGC_STATUS))
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci#define array_wr32(reg, offset, value) \
2648c2ecf20Sopenharmony_ci	wr32((reg) + ((offset) << 2), (value))
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci#define array_rd32(reg, offset) (igc_rd32(hw, (reg) + ((offset) << 2)))
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_ci#define IGC_REMOVED(h) unlikely(!(h))
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci#endif
271