18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef BCM63XX_REGS_H_
38c2ecf20Sopenharmony_ci#define BCM63XX_REGS_H_
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*************************************************************************
68c2ecf20Sopenharmony_ci * _REG relative to RSET_PERF
78c2ecf20Sopenharmony_ci *************************************************************************/
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci/* Chip Identifier / Revision register */
108c2ecf20Sopenharmony_ci#define PERF_REV_REG			0x0
118c2ecf20Sopenharmony_ci#define REV_CHIPID_SHIFT		16
128c2ecf20Sopenharmony_ci#define REV_CHIPID_MASK			(0xffff << REV_CHIPID_SHIFT)
138c2ecf20Sopenharmony_ci#define REV_REVID_SHIFT			0
148c2ecf20Sopenharmony_ci#define REV_REVID_MASK			(0xff << REV_REVID_SHIFT)
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/* Clock Control register */
178c2ecf20Sopenharmony_ci#define PERF_CKCTL_REG			0x4
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define CKCTL_3368_MAC_EN		(1 << 3)
208c2ecf20Sopenharmony_ci#define CKCTL_3368_TC_EN		(1 << 5)
218c2ecf20Sopenharmony_ci#define CKCTL_3368_US_TOP_EN		(1 << 6)
228c2ecf20Sopenharmony_ci#define CKCTL_3368_DS_TOP_EN		(1 << 7)
238c2ecf20Sopenharmony_ci#define CKCTL_3368_APM_EN		(1 << 8)
248c2ecf20Sopenharmony_ci#define CKCTL_3368_SPI_EN		(1 << 9)
258c2ecf20Sopenharmony_ci#define CKCTL_3368_USBS_EN		(1 << 10)
268c2ecf20Sopenharmony_ci#define CKCTL_3368_BMU_EN		(1 << 11)
278c2ecf20Sopenharmony_ci#define CKCTL_3368_PCM_EN		(1 << 12)
288c2ecf20Sopenharmony_ci#define CKCTL_3368_NTP_EN		(1 << 13)
298c2ecf20Sopenharmony_ci#define CKCTL_3368_ACP_B_EN		(1 << 14)
308c2ecf20Sopenharmony_ci#define CKCTL_3368_ACP_A_EN		(1 << 15)
318c2ecf20Sopenharmony_ci#define CKCTL_3368_EMUSB_EN		(1 << 17)
328c2ecf20Sopenharmony_ci#define CKCTL_3368_ENET0_EN		(1 << 18)
338c2ecf20Sopenharmony_ci#define CKCTL_3368_ENET1_EN		(1 << 19)
348c2ecf20Sopenharmony_ci#define CKCTL_3368_USBU_EN		(1 << 20)
358c2ecf20Sopenharmony_ci#define CKCTL_3368_EPHY_EN		(1 << 21)
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define CKCTL_3368_ALL_SAFE_EN		(CKCTL_3368_MAC_EN | \
388c2ecf20Sopenharmony_ci					 CKCTL_3368_TC_EN | \
398c2ecf20Sopenharmony_ci					 CKCTL_3368_US_TOP_EN | \
408c2ecf20Sopenharmony_ci					 CKCTL_3368_DS_TOP_EN | \
418c2ecf20Sopenharmony_ci					 CKCTL_3368_APM_EN | \
428c2ecf20Sopenharmony_ci					 CKCTL_3368_SPI_EN | \
438c2ecf20Sopenharmony_ci					 CKCTL_3368_USBS_EN | \
448c2ecf20Sopenharmony_ci					 CKCTL_3368_BMU_EN | \
458c2ecf20Sopenharmony_ci					 CKCTL_3368_PCM_EN | \
468c2ecf20Sopenharmony_ci					 CKCTL_3368_NTP_EN | \
478c2ecf20Sopenharmony_ci					 CKCTL_3368_ACP_B_EN | \
488c2ecf20Sopenharmony_ci					 CKCTL_3368_ACP_A_EN | \
498c2ecf20Sopenharmony_ci					 CKCTL_3368_EMUSB_EN | \
508c2ecf20Sopenharmony_ci					 CKCTL_3368_USBU_EN)
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define CKCTL_6328_PHYMIPS_EN		(1 << 0)
538c2ecf20Sopenharmony_ci#define CKCTL_6328_ADSL_QPROC_EN	(1 << 1)
548c2ecf20Sopenharmony_ci#define CKCTL_6328_ADSL_AFE_EN		(1 << 2)
558c2ecf20Sopenharmony_ci#define CKCTL_6328_ADSL_EN		(1 << 3)
568c2ecf20Sopenharmony_ci#define CKCTL_6328_MIPS_EN		(1 << 4)
578c2ecf20Sopenharmony_ci#define CKCTL_6328_SAR_EN		(1 << 5)
588c2ecf20Sopenharmony_ci#define CKCTL_6328_PCM_EN		(1 << 6)
598c2ecf20Sopenharmony_ci#define CKCTL_6328_USBD_EN		(1 << 7)
608c2ecf20Sopenharmony_ci#define CKCTL_6328_USBH_EN		(1 << 8)
618c2ecf20Sopenharmony_ci#define CKCTL_6328_HSSPI_EN		(1 << 9)
628c2ecf20Sopenharmony_ci#define CKCTL_6328_PCIE_EN		(1 << 10)
638c2ecf20Sopenharmony_ci#define CKCTL_6328_ROBOSW_EN		(1 << 11)
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define CKCTL_6328_ALL_SAFE_EN		(CKCTL_6328_PHYMIPS_EN |	\
668c2ecf20Sopenharmony_ci					CKCTL_6328_ADSL_QPROC_EN |	\
678c2ecf20Sopenharmony_ci					CKCTL_6328_ADSL_AFE_EN |	\
688c2ecf20Sopenharmony_ci					CKCTL_6328_ADSL_EN |		\
698c2ecf20Sopenharmony_ci					CKCTL_6328_SAR_EN  |		\
708c2ecf20Sopenharmony_ci					CKCTL_6328_PCM_EN  |		\
718c2ecf20Sopenharmony_ci					CKCTL_6328_USBD_EN |		\
728c2ecf20Sopenharmony_ci					CKCTL_6328_USBH_EN |		\
738c2ecf20Sopenharmony_ci					CKCTL_6328_ROBOSW_EN |		\
748c2ecf20Sopenharmony_ci					CKCTL_6328_PCIE_EN)
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define CKCTL_6338_ADSLPHY_EN		(1 << 0)
778c2ecf20Sopenharmony_ci#define CKCTL_6338_MPI_EN		(1 << 1)
788c2ecf20Sopenharmony_ci#define CKCTL_6338_DRAM_EN		(1 << 2)
798c2ecf20Sopenharmony_ci#define CKCTL_6338_ENET_EN		(1 << 4)
808c2ecf20Sopenharmony_ci#define CKCTL_6338_USBS_EN		(1 << 4)
818c2ecf20Sopenharmony_ci#define CKCTL_6338_SAR_EN		(1 << 5)
828c2ecf20Sopenharmony_ci#define CKCTL_6338_SPI_EN		(1 << 9)
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci#define CKCTL_6338_ALL_SAFE_EN		(CKCTL_6338_ADSLPHY_EN |	\
858c2ecf20Sopenharmony_ci					CKCTL_6338_MPI_EN |		\
868c2ecf20Sopenharmony_ci					CKCTL_6338_ENET_EN |		\
878c2ecf20Sopenharmony_ci					CKCTL_6338_SAR_EN |		\
888c2ecf20Sopenharmony_ci					CKCTL_6338_SPI_EN)
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci/* BCM6345 clock bits are shifted by 16 on the left, because of the test
918c2ecf20Sopenharmony_ci * control register which is 16-bits wide. That way we do not have any
928c2ecf20Sopenharmony_ci * specific BCM6345 code for handling clocks, and writing 0 to the test
938c2ecf20Sopenharmony_ci * control register is fine.
948c2ecf20Sopenharmony_ci */
958c2ecf20Sopenharmony_ci#define CKCTL_6345_CPU_EN		(1 << 16)
968c2ecf20Sopenharmony_ci#define CKCTL_6345_BUS_EN		(1 << 17)
978c2ecf20Sopenharmony_ci#define CKCTL_6345_EBI_EN		(1 << 18)
988c2ecf20Sopenharmony_ci#define CKCTL_6345_UART_EN		(1 << 19)
998c2ecf20Sopenharmony_ci#define CKCTL_6345_ADSLPHY_EN		(1 << 20)
1008c2ecf20Sopenharmony_ci#define CKCTL_6345_ENET_EN		(1 << 23)
1018c2ecf20Sopenharmony_ci#define CKCTL_6345_USBH_EN		(1 << 24)
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define CKCTL_6345_ALL_SAFE_EN		(CKCTL_6345_ENET_EN |	\
1048c2ecf20Sopenharmony_ci					CKCTL_6345_USBH_EN |	\
1058c2ecf20Sopenharmony_ci					CKCTL_6345_ADSLPHY_EN)
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci#define CKCTL_6348_ADSLPHY_EN		(1 << 0)
1088c2ecf20Sopenharmony_ci#define CKCTL_6348_MPI_EN		(1 << 1)
1098c2ecf20Sopenharmony_ci#define CKCTL_6348_SDRAM_EN		(1 << 2)
1108c2ecf20Sopenharmony_ci#define CKCTL_6348_M2M_EN		(1 << 3)
1118c2ecf20Sopenharmony_ci#define CKCTL_6348_ENET_EN		(1 << 4)
1128c2ecf20Sopenharmony_ci#define CKCTL_6348_SAR_EN		(1 << 5)
1138c2ecf20Sopenharmony_ci#define CKCTL_6348_USBS_EN		(1 << 6)
1148c2ecf20Sopenharmony_ci#define CKCTL_6348_USBH_EN		(1 << 8)
1158c2ecf20Sopenharmony_ci#define CKCTL_6348_SPI_EN		(1 << 9)
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci#define CKCTL_6348_ALL_SAFE_EN		(CKCTL_6348_ADSLPHY_EN |	\
1188c2ecf20Sopenharmony_ci					CKCTL_6348_M2M_EN |		\
1198c2ecf20Sopenharmony_ci					CKCTL_6348_ENET_EN |		\
1208c2ecf20Sopenharmony_ci					CKCTL_6348_SAR_EN |		\
1218c2ecf20Sopenharmony_ci					CKCTL_6348_USBS_EN |		\
1228c2ecf20Sopenharmony_ci					CKCTL_6348_USBH_EN |		\
1238c2ecf20Sopenharmony_ci					CKCTL_6348_SPI_EN)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define CKCTL_6358_ENET_EN		(1 << 4)
1268c2ecf20Sopenharmony_ci#define CKCTL_6358_ADSLPHY_EN		(1 << 5)
1278c2ecf20Sopenharmony_ci#define CKCTL_6358_PCM_EN		(1 << 8)
1288c2ecf20Sopenharmony_ci#define CKCTL_6358_SPI_EN		(1 << 9)
1298c2ecf20Sopenharmony_ci#define CKCTL_6358_USBS_EN		(1 << 10)
1308c2ecf20Sopenharmony_ci#define CKCTL_6358_SAR_EN		(1 << 11)
1318c2ecf20Sopenharmony_ci#define CKCTL_6358_EMUSB_EN		(1 << 17)
1328c2ecf20Sopenharmony_ci#define CKCTL_6358_ENET0_EN		(1 << 18)
1338c2ecf20Sopenharmony_ci#define CKCTL_6358_ENET1_EN		(1 << 19)
1348c2ecf20Sopenharmony_ci#define CKCTL_6358_USBSU_EN		(1 << 20)
1358c2ecf20Sopenharmony_ci#define CKCTL_6358_EPHY_EN		(1 << 21)
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci#define CKCTL_6358_ALL_SAFE_EN		(CKCTL_6358_ENET_EN |		\
1388c2ecf20Sopenharmony_ci					CKCTL_6358_ADSLPHY_EN |		\
1398c2ecf20Sopenharmony_ci					CKCTL_6358_PCM_EN |		\
1408c2ecf20Sopenharmony_ci					CKCTL_6358_SPI_EN |		\
1418c2ecf20Sopenharmony_ci					CKCTL_6358_USBS_EN |		\
1428c2ecf20Sopenharmony_ci					CKCTL_6358_SAR_EN |		\
1438c2ecf20Sopenharmony_ci					CKCTL_6358_EMUSB_EN |		\
1448c2ecf20Sopenharmony_ci					CKCTL_6358_ENET0_EN |		\
1458c2ecf20Sopenharmony_ci					CKCTL_6358_ENET1_EN |		\
1468c2ecf20Sopenharmony_ci					CKCTL_6358_USBSU_EN |		\
1478c2ecf20Sopenharmony_ci					CKCTL_6358_EPHY_EN)
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci#define CKCTL_6362_ADSL_QPROC_EN	(1 << 1)
1508c2ecf20Sopenharmony_ci#define CKCTL_6362_ADSL_AFE_EN		(1 << 2)
1518c2ecf20Sopenharmony_ci#define CKCTL_6362_ADSL_EN		(1 << 3)
1528c2ecf20Sopenharmony_ci#define CKCTL_6362_MIPS_EN		(1 << 4)
1538c2ecf20Sopenharmony_ci#define CKCTL_6362_WLAN_OCP_EN		(1 << 5)
1548c2ecf20Sopenharmony_ci#define CKCTL_6362_SWPKT_USB_EN		(1 << 7)
1558c2ecf20Sopenharmony_ci#define CKCTL_6362_SWPKT_SAR_EN		(1 << 8)
1568c2ecf20Sopenharmony_ci#define CKCTL_6362_SAR_EN		(1 << 9)
1578c2ecf20Sopenharmony_ci#define CKCTL_6362_ROBOSW_EN		(1 << 10)
1588c2ecf20Sopenharmony_ci#define CKCTL_6362_PCM_EN		(1 << 11)
1598c2ecf20Sopenharmony_ci#define CKCTL_6362_USBD_EN		(1 << 12)
1608c2ecf20Sopenharmony_ci#define CKCTL_6362_USBH_EN		(1 << 13)
1618c2ecf20Sopenharmony_ci#define CKCTL_6362_IPSEC_EN		(1 << 14)
1628c2ecf20Sopenharmony_ci#define CKCTL_6362_SPI_EN		(1 << 15)
1638c2ecf20Sopenharmony_ci#define CKCTL_6362_HSSPI_EN		(1 << 16)
1648c2ecf20Sopenharmony_ci#define CKCTL_6362_PCIE_EN		(1 << 17)
1658c2ecf20Sopenharmony_ci#define CKCTL_6362_FAP_EN		(1 << 18)
1668c2ecf20Sopenharmony_ci#define CKCTL_6362_PHYMIPS_EN		(1 << 19)
1678c2ecf20Sopenharmony_ci#define CKCTL_6362_NAND_EN		(1 << 20)
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci#define CKCTL_6362_ALL_SAFE_EN		(CKCTL_6362_PHYMIPS_EN |	\
1708c2ecf20Sopenharmony_ci					CKCTL_6362_ADSL_QPROC_EN |	\
1718c2ecf20Sopenharmony_ci					CKCTL_6362_ADSL_AFE_EN |	\
1728c2ecf20Sopenharmony_ci					CKCTL_6362_ADSL_EN |		\
1738c2ecf20Sopenharmony_ci					CKCTL_6362_SAR_EN  |		\
1748c2ecf20Sopenharmony_ci					CKCTL_6362_PCM_EN  |		\
1758c2ecf20Sopenharmony_ci					CKCTL_6362_IPSEC_EN |		\
1768c2ecf20Sopenharmony_ci					CKCTL_6362_USBD_EN |		\
1778c2ecf20Sopenharmony_ci					CKCTL_6362_USBH_EN |		\
1788c2ecf20Sopenharmony_ci					CKCTL_6362_ROBOSW_EN |		\
1798c2ecf20Sopenharmony_ci					CKCTL_6362_PCIE_EN)
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define CKCTL_6368_VDSL_QPROC_EN	(1 << 2)
1838c2ecf20Sopenharmony_ci#define CKCTL_6368_VDSL_AFE_EN		(1 << 3)
1848c2ecf20Sopenharmony_ci#define CKCTL_6368_VDSL_BONDING_EN	(1 << 4)
1858c2ecf20Sopenharmony_ci#define CKCTL_6368_VDSL_EN		(1 << 5)
1868c2ecf20Sopenharmony_ci#define CKCTL_6368_PHYMIPS_EN		(1 << 6)
1878c2ecf20Sopenharmony_ci#define CKCTL_6368_SWPKT_USB_EN		(1 << 7)
1888c2ecf20Sopenharmony_ci#define CKCTL_6368_SWPKT_SAR_EN		(1 << 8)
1898c2ecf20Sopenharmony_ci#define CKCTL_6368_SPI_EN		(1 << 9)
1908c2ecf20Sopenharmony_ci#define CKCTL_6368_USBD_EN		(1 << 10)
1918c2ecf20Sopenharmony_ci#define CKCTL_6368_SAR_EN		(1 << 11)
1928c2ecf20Sopenharmony_ci#define CKCTL_6368_ROBOSW_EN		(1 << 12)
1938c2ecf20Sopenharmony_ci#define CKCTL_6368_UTOPIA_EN		(1 << 13)
1948c2ecf20Sopenharmony_ci#define CKCTL_6368_PCM_EN		(1 << 14)
1958c2ecf20Sopenharmony_ci#define CKCTL_6368_USBH_EN		(1 << 15)
1968c2ecf20Sopenharmony_ci#define CKCTL_6368_DISABLE_GLESS_EN	(1 << 16)
1978c2ecf20Sopenharmony_ci#define CKCTL_6368_NAND_EN		(1 << 17)
1988c2ecf20Sopenharmony_ci#define CKCTL_6368_IPSEC_EN		(1 << 18)
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci#define CKCTL_6368_ALL_SAFE_EN		(CKCTL_6368_SWPKT_USB_EN |	\
2018c2ecf20Sopenharmony_ci					CKCTL_6368_SWPKT_SAR_EN |	\
2028c2ecf20Sopenharmony_ci					CKCTL_6368_SPI_EN |		\
2038c2ecf20Sopenharmony_ci					CKCTL_6368_USBD_EN |		\
2048c2ecf20Sopenharmony_ci					CKCTL_6368_SAR_EN |		\
2058c2ecf20Sopenharmony_ci					CKCTL_6368_ROBOSW_EN |		\
2068c2ecf20Sopenharmony_ci					CKCTL_6368_UTOPIA_EN |		\
2078c2ecf20Sopenharmony_ci					CKCTL_6368_PCM_EN |		\
2088c2ecf20Sopenharmony_ci					CKCTL_6368_USBH_EN |		\
2098c2ecf20Sopenharmony_ci					CKCTL_6368_DISABLE_GLESS_EN |	\
2108c2ecf20Sopenharmony_ci					CKCTL_6368_NAND_EN |		\
2118c2ecf20Sopenharmony_ci					CKCTL_6368_IPSEC_EN)
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci/* System PLL Control register	*/
2148c2ecf20Sopenharmony_ci#define PERF_SYS_PLL_CTL_REG		0x8
2158c2ecf20Sopenharmony_ci#define SYS_PLL_SOFT_RESET		0x1
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci/* Interrupt Mask register */
2188c2ecf20Sopenharmony_ci#define PERF_IRQMASK_3368_REG		0xc
2198c2ecf20Sopenharmony_ci#define PERF_IRQMASK_6328_REG(x)	(0x20 + (x) * 0x10)
2208c2ecf20Sopenharmony_ci#define PERF_IRQMASK_6338_REG		0xc
2218c2ecf20Sopenharmony_ci#define PERF_IRQMASK_6345_REG		0xc
2228c2ecf20Sopenharmony_ci#define PERF_IRQMASK_6348_REG		0xc
2238c2ecf20Sopenharmony_ci#define PERF_IRQMASK_6358_REG(x)	(0xc + (x) * 0x2c)
2248c2ecf20Sopenharmony_ci#define PERF_IRQMASK_6362_REG(x)	(0x20 + (x) * 0x10)
2258c2ecf20Sopenharmony_ci#define PERF_IRQMASK_6368_REG(x)	(0x20 + (x) * 0x10)
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci/* Interrupt Status register */
2288c2ecf20Sopenharmony_ci#define PERF_IRQSTAT_3368_REG		0x10
2298c2ecf20Sopenharmony_ci#define PERF_IRQSTAT_6328_REG(x)	(0x28 + (x) * 0x10)
2308c2ecf20Sopenharmony_ci#define PERF_IRQSTAT_6338_REG		0x10
2318c2ecf20Sopenharmony_ci#define PERF_IRQSTAT_6345_REG		0x10
2328c2ecf20Sopenharmony_ci#define PERF_IRQSTAT_6348_REG		0x10
2338c2ecf20Sopenharmony_ci#define PERF_IRQSTAT_6358_REG(x)	(0x10 + (x) * 0x2c)
2348c2ecf20Sopenharmony_ci#define PERF_IRQSTAT_6362_REG(x)	(0x28 + (x) * 0x10)
2358c2ecf20Sopenharmony_ci#define PERF_IRQSTAT_6368_REG(x)	(0x28 + (x) * 0x10)
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci/* External Interrupt Configuration register */
2388c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG_3368	0x14
2398c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG_6328	0x18
2408c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG_6338	0x14
2418c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG_6345	0x14
2428c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG_6348	0x14
2438c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG_6358	0x14
2448c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG_6362	0x18
2458c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG_6368	0x18
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci#define PERF_EXTIRQ_CFG_REG2_6368	0x1c
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci/* for 6348 only */
2508c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_SENSE_6348(x)	(1 << (x))
2518c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_STAT_6348(x)		(1 << (x + 5))
2528c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_CLEAR_6348(x)	(1 << (x + 10))
2538c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_MASK_6348(x)		(1 << (x + 15))
2548c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_BOTHEDGE_6348(x)	(1 << (x + 20))
2558c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_LEVELSENSE_6348(x)	(1 << (x + 25))
2568c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_CLEAR_ALL_6348	(0xf << 10)
2578c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_MASK_ALL_6348	(0xf << 15)
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci/* for all others */
2608c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_SENSE(x)		(1 << (x))
2618c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_STAT(x)		(1 << (x + 4))
2628c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_CLEAR(x)		(1 << (x + 8))
2638c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_MASK(x)		(1 << (x + 12))
2648c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_BOTHEDGE(x)		(1 << (x + 16))
2658c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_LEVELSENSE(x)	(1 << (x + 20))
2668c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_CLEAR_ALL		(0xf << 8)
2678c2ecf20Sopenharmony_ci#define EXTIRQ_CFG_MASK_ALL		(0xf << 12)
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci/* Soft Reset register */
2708c2ecf20Sopenharmony_ci#define PERF_SOFTRESET_REG		0x28
2718c2ecf20Sopenharmony_ci#define PERF_SOFTRESET_6328_REG		0x10
2728c2ecf20Sopenharmony_ci#define PERF_SOFTRESET_6358_REG		0x34
2738c2ecf20Sopenharmony_ci#define PERF_SOFTRESET_6362_REG		0x10
2748c2ecf20Sopenharmony_ci#define PERF_SOFTRESET_6368_REG		0x10
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci#define SOFTRESET_3368_SPI_MASK		(1 << 0)
2778c2ecf20Sopenharmony_ci#define SOFTRESET_3368_ENET_MASK	(1 << 2)
2788c2ecf20Sopenharmony_ci#define SOFTRESET_3368_MPI_MASK		(1 << 3)
2798c2ecf20Sopenharmony_ci#define SOFTRESET_3368_EPHY_MASK	(1 << 6)
2808c2ecf20Sopenharmony_ci#define SOFTRESET_3368_USBS_MASK	(1 << 11)
2818c2ecf20Sopenharmony_ci#define SOFTRESET_3368_PCM_MASK		(1 << 13)
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci#define SOFTRESET_6328_SPI_MASK		(1 << 0)
2848c2ecf20Sopenharmony_ci#define SOFTRESET_6328_EPHY_MASK	(1 << 1)
2858c2ecf20Sopenharmony_ci#define SOFTRESET_6328_SAR_MASK		(1 << 2)
2868c2ecf20Sopenharmony_ci#define SOFTRESET_6328_ENETSW_MASK	(1 << 3)
2878c2ecf20Sopenharmony_ci#define SOFTRESET_6328_USBS_MASK	(1 << 4)
2888c2ecf20Sopenharmony_ci#define SOFTRESET_6328_USBH_MASK	(1 << 5)
2898c2ecf20Sopenharmony_ci#define SOFTRESET_6328_PCM_MASK		(1 << 6)
2908c2ecf20Sopenharmony_ci#define SOFTRESET_6328_PCIE_CORE_MASK	(1 << 7)
2918c2ecf20Sopenharmony_ci#define SOFTRESET_6328_PCIE_MASK	(1 << 8)
2928c2ecf20Sopenharmony_ci#define SOFTRESET_6328_PCIE_EXT_MASK	(1 << 9)
2938c2ecf20Sopenharmony_ci#define SOFTRESET_6328_PCIE_HARD_MASK	(1 << 10)
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci#define SOFTRESET_6338_SPI_MASK		(1 << 0)
2968c2ecf20Sopenharmony_ci#define SOFTRESET_6338_ENET_MASK	(1 << 2)
2978c2ecf20Sopenharmony_ci#define SOFTRESET_6338_USBH_MASK	(1 << 3)
2988c2ecf20Sopenharmony_ci#define SOFTRESET_6338_USBS_MASK	(1 << 4)
2998c2ecf20Sopenharmony_ci#define SOFTRESET_6338_ADSL_MASK	(1 << 5)
3008c2ecf20Sopenharmony_ci#define SOFTRESET_6338_DMAMEM_MASK	(1 << 6)
3018c2ecf20Sopenharmony_ci#define SOFTRESET_6338_SAR_MASK		(1 << 7)
3028c2ecf20Sopenharmony_ci#define SOFTRESET_6338_ACLC_MASK	(1 << 8)
3038c2ecf20Sopenharmony_ci#define SOFTRESET_6338_ADSLMIPSPLL_MASK (1 << 10)
3048c2ecf20Sopenharmony_ci#define SOFTRESET_6338_ALL	 (SOFTRESET_6338_SPI_MASK |		\
3058c2ecf20Sopenharmony_ci				  SOFTRESET_6338_ENET_MASK |		\
3068c2ecf20Sopenharmony_ci				  SOFTRESET_6338_USBH_MASK |		\
3078c2ecf20Sopenharmony_ci				  SOFTRESET_6338_USBS_MASK |		\
3088c2ecf20Sopenharmony_ci				  SOFTRESET_6338_ADSL_MASK |		\
3098c2ecf20Sopenharmony_ci				  SOFTRESET_6338_DMAMEM_MASK |		\
3108c2ecf20Sopenharmony_ci				  SOFTRESET_6338_SAR_MASK |		\
3118c2ecf20Sopenharmony_ci				  SOFTRESET_6338_ACLC_MASK |		\
3128c2ecf20Sopenharmony_ci				  SOFTRESET_6338_ADSLMIPSPLL_MASK)
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_ci#define SOFTRESET_6348_SPI_MASK		(1 << 0)
3158c2ecf20Sopenharmony_ci#define SOFTRESET_6348_ENET_MASK	(1 << 2)
3168c2ecf20Sopenharmony_ci#define SOFTRESET_6348_USBH_MASK	(1 << 3)
3178c2ecf20Sopenharmony_ci#define SOFTRESET_6348_USBS_MASK	(1 << 4)
3188c2ecf20Sopenharmony_ci#define SOFTRESET_6348_ADSL_MASK	(1 << 5)
3198c2ecf20Sopenharmony_ci#define SOFTRESET_6348_DMAMEM_MASK	(1 << 6)
3208c2ecf20Sopenharmony_ci#define SOFTRESET_6348_SAR_MASK		(1 << 7)
3218c2ecf20Sopenharmony_ci#define SOFTRESET_6348_ACLC_MASK	(1 << 8)
3228c2ecf20Sopenharmony_ci#define SOFTRESET_6348_ADSLMIPSPLL_MASK (1 << 10)
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci#define SOFTRESET_6348_ALL	 (SOFTRESET_6348_SPI_MASK |		\
3258c2ecf20Sopenharmony_ci				  SOFTRESET_6348_ENET_MASK |		\
3268c2ecf20Sopenharmony_ci				  SOFTRESET_6348_USBH_MASK |		\
3278c2ecf20Sopenharmony_ci				  SOFTRESET_6348_USBS_MASK |		\
3288c2ecf20Sopenharmony_ci				  SOFTRESET_6348_ADSL_MASK |		\
3298c2ecf20Sopenharmony_ci				  SOFTRESET_6348_DMAMEM_MASK |		\
3308c2ecf20Sopenharmony_ci				  SOFTRESET_6348_SAR_MASK |		\
3318c2ecf20Sopenharmony_ci				  SOFTRESET_6348_ACLC_MASK |		\
3328c2ecf20Sopenharmony_ci				  SOFTRESET_6348_ADSLMIPSPLL_MASK)
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_ci#define SOFTRESET_6358_SPI_MASK		(1 << 0)
3358c2ecf20Sopenharmony_ci#define SOFTRESET_6358_ENET_MASK	(1 << 2)
3368c2ecf20Sopenharmony_ci#define SOFTRESET_6358_MPI_MASK		(1 << 3)
3378c2ecf20Sopenharmony_ci#define SOFTRESET_6358_EPHY_MASK	(1 << 6)
3388c2ecf20Sopenharmony_ci#define SOFTRESET_6358_SAR_MASK		(1 << 7)
3398c2ecf20Sopenharmony_ci#define SOFTRESET_6358_USBH_MASK	(1 << 12)
3408c2ecf20Sopenharmony_ci#define SOFTRESET_6358_PCM_MASK		(1 << 13)
3418c2ecf20Sopenharmony_ci#define SOFTRESET_6358_ADSL_MASK	(1 << 14)
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci#define SOFTRESET_6362_SPI_MASK		(1 << 0)
3448c2ecf20Sopenharmony_ci#define SOFTRESET_6362_IPSEC_MASK	(1 << 1)
3458c2ecf20Sopenharmony_ci#define SOFTRESET_6362_EPHY_MASK	(1 << 2)
3468c2ecf20Sopenharmony_ci#define SOFTRESET_6362_SAR_MASK		(1 << 3)
3478c2ecf20Sopenharmony_ci#define SOFTRESET_6362_ENETSW_MASK	(1 << 4)
3488c2ecf20Sopenharmony_ci#define SOFTRESET_6362_USBS_MASK	(1 << 5)
3498c2ecf20Sopenharmony_ci#define SOFTRESET_6362_USBH_MASK	(1 << 6)
3508c2ecf20Sopenharmony_ci#define SOFTRESET_6362_PCM_MASK		(1 << 7)
3518c2ecf20Sopenharmony_ci#define SOFTRESET_6362_PCIE_CORE_MASK	(1 << 8)
3528c2ecf20Sopenharmony_ci#define SOFTRESET_6362_PCIE_MASK	(1 << 9)
3538c2ecf20Sopenharmony_ci#define SOFTRESET_6362_PCIE_EXT_MASK	(1 << 10)
3548c2ecf20Sopenharmony_ci#define SOFTRESET_6362_WLAN_SHIM_MASK	(1 << 11)
3558c2ecf20Sopenharmony_ci#define SOFTRESET_6362_DDR_PHY_MASK	(1 << 12)
3568c2ecf20Sopenharmony_ci#define SOFTRESET_6362_FAP_MASK		(1 << 13)
3578c2ecf20Sopenharmony_ci#define SOFTRESET_6362_WLAN_UBUS_MASK	(1 << 14)
3588c2ecf20Sopenharmony_ci
3598c2ecf20Sopenharmony_ci#define SOFTRESET_6368_SPI_MASK		(1 << 0)
3608c2ecf20Sopenharmony_ci#define SOFTRESET_6368_MPI_MASK		(1 << 3)
3618c2ecf20Sopenharmony_ci#define SOFTRESET_6368_EPHY_MASK	(1 << 6)
3628c2ecf20Sopenharmony_ci#define SOFTRESET_6368_SAR_MASK		(1 << 7)
3638c2ecf20Sopenharmony_ci#define SOFTRESET_6368_ENETSW_MASK	(1 << 10)
3648c2ecf20Sopenharmony_ci#define SOFTRESET_6368_USBS_MASK	(1 << 11)
3658c2ecf20Sopenharmony_ci#define SOFTRESET_6368_USBH_MASK	(1 << 12)
3668c2ecf20Sopenharmony_ci#define SOFTRESET_6368_PCM_MASK		(1 << 13)
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci/* MIPS PLL control register */
3698c2ecf20Sopenharmony_ci#define PERF_MIPSPLLCTL_REG		0x34
3708c2ecf20Sopenharmony_ci#define MIPSPLLCTL_N1_SHIFT		20
3718c2ecf20Sopenharmony_ci#define MIPSPLLCTL_N1_MASK		(0x7 << MIPSPLLCTL_N1_SHIFT)
3728c2ecf20Sopenharmony_ci#define MIPSPLLCTL_N2_SHIFT		15
3738c2ecf20Sopenharmony_ci#define MIPSPLLCTL_N2_MASK		(0x1f << MIPSPLLCTL_N2_SHIFT)
3748c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M1REF_SHIFT		12
3758c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M1REF_MASK		(0x7 << MIPSPLLCTL_M1REF_SHIFT)
3768c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M2REF_SHIFT		9
3778c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M2REF_MASK		(0x7 << MIPSPLLCTL_M2REF_SHIFT)
3788c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M1CPU_SHIFT		6
3798c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M1CPU_MASK		(0x7 << MIPSPLLCTL_M1CPU_SHIFT)
3808c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M1BUS_SHIFT		3
3818c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M1BUS_MASK		(0x7 << MIPSPLLCTL_M1BUS_SHIFT)
3828c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M2BUS_SHIFT		0
3838c2ecf20Sopenharmony_ci#define MIPSPLLCTL_M2BUS_MASK		(0x7 << MIPSPLLCTL_M2BUS_SHIFT)
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_ci/* ADSL PHY PLL Control register */
3868c2ecf20Sopenharmony_ci#define PERF_ADSLPLLCTL_REG		0x38
3878c2ecf20Sopenharmony_ci#define ADSLPLLCTL_N1_SHIFT		20
3888c2ecf20Sopenharmony_ci#define ADSLPLLCTL_N1_MASK		(0x7 << ADSLPLLCTL_N1_SHIFT)
3898c2ecf20Sopenharmony_ci#define ADSLPLLCTL_N2_SHIFT		15
3908c2ecf20Sopenharmony_ci#define ADSLPLLCTL_N2_MASK		(0x1f << ADSLPLLCTL_N2_SHIFT)
3918c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M1REF_SHIFT		12
3928c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M1REF_MASK		(0x7 << ADSLPLLCTL_M1REF_SHIFT)
3938c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M2REF_SHIFT		9
3948c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M2REF_MASK		(0x7 << ADSLPLLCTL_M2REF_SHIFT)
3958c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M1CPU_SHIFT		6
3968c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M1CPU_MASK		(0x7 << ADSLPLLCTL_M1CPU_SHIFT)
3978c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M1BUS_SHIFT		3
3988c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M1BUS_MASK		(0x7 << ADSLPLLCTL_M1BUS_SHIFT)
3998c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M2BUS_SHIFT		0
4008c2ecf20Sopenharmony_ci#define ADSLPLLCTL_M2BUS_MASK		(0x7 << ADSLPLLCTL_M2BUS_SHIFT)
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci#define ADSLPLLCTL_VAL(n1, n2, m1ref, m2ref, m1cpu, m1bus, m2bus)	\
4038c2ecf20Sopenharmony_ci				(((n1) << ADSLPLLCTL_N1_SHIFT) |	\
4048c2ecf20Sopenharmony_ci				((n2) << ADSLPLLCTL_N2_SHIFT) |		\
4058c2ecf20Sopenharmony_ci				((m1ref) << ADSLPLLCTL_M1REF_SHIFT) |	\
4068c2ecf20Sopenharmony_ci				((m2ref) << ADSLPLLCTL_M2REF_SHIFT) |	\
4078c2ecf20Sopenharmony_ci				((m1cpu) << ADSLPLLCTL_M1CPU_SHIFT) |	\
4088c2ecf20Sopenharmony_ci				((m1bus) << ADSLPLLCTL_M1BUS_SHIFT) |	\
4098c2ecf20Sopenharmony_ci				((m2bus) << ADSLPLLCTL_M2BUS_SHIFT))
4108c2ecf20Sopenharmony_ci
4118c2ecf20Sopenharmony_ci
4128c2ecf20Sopenharmony_ci/*************************************************************************
4138c2ecf20Sopenharmony_ci * _REG relative to RSET_TIMER
4148c2ecf20Sopenharmony_ci *************************************************************************/
4158c2ecf20Sopenharmony_ci
4168c2ecf20Sopenharmony_ci#define BCM63XX_TIMER_COUNT		4
4178c2ecf20Sopenharmony_ci#define TIMER_T0_ID			0
4188c2ecf20Sopenharmony_ci#define TIMER_T1_ID			1
4198c2ecf20Sopenharmony_ci#define TIMER_T2_ID			2
4208c2ecf20Sopenharmony_ci#define TIMER_WDT_ID			3
4218c2ecf20Sopenharmony_ci
4228c2ecf20Sopenharmony_ci/* Timer irqstat register */
4238c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_REG		0
4248c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_TIMER_CAUSE(x)	(1 << (x))
4258c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_TIMER0_CAUSE	(1 << 0)
4268c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_TIMER1_CAUSE	(1 << 1)
4278c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_TIMER2_CAUSE	(1 << 2)
4288c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_WDT_CAUSE		(1 << 3)
4298c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_TIMER_IR_EN(x)	(1 << ((x) + 8))
4308c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_TIMER0_IR_EN	(1 << 8)
4318c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_TIMER1_IR_EN	(1 << 9)
4328c2ecf20Sopenharmony_ci#define TIMER_IRQSTAT_TIMER2_IR_EN	(1 << 10)
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci/* Timer control register */
4358c2ecf20Sopenharmony_ci#define TIMER_CTLx_REG(x)		(0x4 + (x * 4))
4368c2ecf20Sopenharmony_ci#define TIMER_CTL0_REG			0x4
4378c2ecf20Sopenharmony_ci#define TIMER_CTL1_REG			0x8
4388c2ecf20Sopenharmony_ci#define TIMER_CTL2_REG			0xC
4398c2ecf20Sopenharmony_ci#define TIMER_CTL_COUNTDOWN_MASK	(0x3fffffff)
4408c2ecf20Sopenharmony_ci#define TIMER_CTL_MONOTONIC_MASK	(1 << 30)
4418c2ecf20Sopenharmony_ci#define TIMER_CTL_ENABLE_MASK		(1 << 31)
4428c2ecf20Sopenharmony_ci
4438c2ecf20Sopenharmony_ci
4448c2ecf20Sopenharmony_ci/*************************************************************************
4458c2ecf20Sopenharmony_ci * _REG relative to RSET_WDT
4468c2ecf20Sopenharmony_ci *************************************************************************/
4478c2ecf20Sopenharmony_ci
4488c2ecf20Sopenharmony_ci/* Watchdog default count register */
4498c2ecf20Sopenharmony_ci#define WDT_DEFVAL_REG			0x0
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_ci/* Watchdog control register */
4528c2ecf20Sopenharmony_ci#define WDT_CTL_REG			0x4
4538c2ecf20Sopenharmony_ci
4548c2ecf20Sopenharmony_ci/* Watchdog control register constants */
4558c2ecf20Sopenharmony_ci#define WDT_START_1			(0xff00)
4568c2ecf20Sopenharmony_ci#define WDT_START_2			(0x00ff)
4578c2ecf20Sopenharmony_ci#define WDT_STOP_1			(0xee00)
4588c2ecf20Sopenharmony_ci#define WDT_STOP_2			(0x00ee)
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ci/* Watchdog reset length register */
4618c2ecf20Sopenharmony_ci#define WDT_RSTLEN_REG			0x8
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ci/* Watchdog soft reset register (BCM6328 only) */
4648c2ecf20Sopenharmony_ci#define WDT_SOFTRESET_REG		0xc
4658c2ecf20Sopenharmony_ci
4668c2ecf20Sopenharmony_ci/*************************************************************************
4678c2ecf20Sopenharmony_ci * _REG relative to RSET_GPIO
4688c2ecf20Sopenharmony_ci *************************************************************************/
4698c2ecf20Sopenharmony_ci
4708c2ecf20Sopenharmony_ci/* GPIO registers */
4718c2ecf20Sopenharmony_ci#define GPIO_CTL_HI_REG			0x0
4728c2ecf20Sopenharmony_ci#define GPIO_CTL_LO_REG			0x4
4738c2ecf20Sopenharmony_ci#define GPIO_DATA_HI_REG		0x8
4748c2ecf20Sopenharmony_ci#define GPIO_DATA_LO_REG		0xC
4758c2ecf20Sopenharmony_ci#define GPIO_DATA_LO_REG_6345		0x8
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ci/* GPIO mux registers and constants */
4788c2ecf20Sopenharmony_ci#define GPIO_MODE_REG			0x18
4798c2ecf20Sopenharmony_ci
4808c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G4_DIAG		0x00090000
4818c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G4_UTOPIA	0x00080000
4828c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G4_LEGACY_LED	0x00030000
4838c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G4_MII_SNOOP	0x00020000
4848c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G4_EXT_EPHY	0x00010000
4858c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G3_DIAG		0x00009000
4868c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G3_UTOPIA	0x00008000
4878c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G3_EXT_MII	0x00007000
4888c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G2_DIAG		0x00000900
4898c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G2_PCI		0x00000500
4908c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G1_DIAG		0x00000090
4918c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G1_UTOPIA	0x00000080
4928c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G1_SPI_UART	0x00000060
4938c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G1_SPI_MASTER	0x00000060
4948c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G1_MII_PCCARD	0x00000040
4958c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G1_MII_SNOOP	0x00000020
4968c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G1_EXT_EPHY	0x00000010
4978c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G0_DIAG		0x00000009
4988c2ecf20Sopenharmony_ci#define GPIO_MODE_6348_G0_EXT_MII	0x00000007
4998c2ecf20Sopenharmony_ci
5008c2ecf20Sopenharmony_ci#define GPIO_MODE_6358_EXTRACS		(1 << 5)
5018c2ecf20Sopenharmony_ci#define GPIO_MODE_6358_UART1		(1 << 6)
5028c2ecf20Sopenharmony_ci#define GPIO_MODE_6358_EXTRA_SPI_SS	(1 << 7)
5038c2ecf20Sopenharmony_ci#define GPIO_MODE_6358_SERIAL_LED	(1 << 10)
5048c2ecf20Sopenharmony_ci#define GPIO_MODE_6358_UTOPIA		(1 << 12)
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_ANALOG_AFE_0	(1 << 0)
5078c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_ANALOG_AFE_1	(1 << 1)
5088c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_SYS_IRQ		(1 << 2)
5098c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_SERIAL_LED_DATA	(1 << 3)
5108c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_SERIAL_LED_CLK	(1 << 4)
5118c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_INET_LED		(1 << 5)
5128c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_EPHY0_LED	(1 << 6)
5138c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_EPHY1_LED	(1 << 7)
5148c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_EPHY2_LED	(1 << 8)
5158c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_EPHY3_LED	(1 << 9)
5168c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_ROBOSW_LED_DAT	(1 << 10)
5178c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_ROBOSW_LED_CLK	(1 << 11)
5188c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_ROBOSW_LED0	(1 << 12)
5198c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_ROBOSW_LED1	(1 << 13)
5208c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_USBD_LED		(1 << 14)
5218c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_NTR_PULSE	(1 << 15)
5228c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCI_REQ1		(1 << 16)
5238c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCI_GNT1		(1 << 17)
5248c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCI_INTB		(1 << 18)
5258c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCI_REQ0		(1 << 19)
5268c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCI_GNT0		(1 << 20)
5278c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCMCIA_CD1	(1 << 22)
5288c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCMCIA_CD2	(1 << 23)
5298c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCMCIA_VS1	(1 << 24)
5308c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_PCMCIA_VS2	(1 << 25)
5318c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_EBI_CS2		(1 << 26)
5328c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_EBI_CS3		(1 << 27)
5338c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_SPI_SSN2		(1 << 28)
5348c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_SPI_SSN3		(1 << 29)
5358c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_SPI_SSN4		(1 << 30)
5368c2ecf20Sopenharmony_ci#define GPIO_MODE_6368_SPI_SSN5		(1 << 31)
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci
5398c2ecf20Sopenharmony_ci#define GPIO_PINMUX_OTHR_REG		0x24
5408c2ecf20Sopenharmony_ci#define GPIO_PINMUX_OTHR_6328_USB_SHIFT 12
5418c2ecf20Sopenharmony_ci#define GPIO_PINMUX_OTHR_6328_USB_MASK	(3 << GPIO_PINMUX_OTHR_6328_USB_SHIFT)
5428c2ecf20Sopenharmony_ci#define GPIO_PINMUX_OTHR_6328_USB_HOST	(1 << GPIO_PINMUX_OTHR_6328_USB_SHIFT)
5438c2ecf20Sopenharmony_ci#define GPIO_PINMUX_OTHR_6328_USB_DEV	(2 << GPIO_PINMUX_OTHR_6328_USB_SHIFT)
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_ci#define GPIO_BASEMODE_6368_REG		0x38
5468c2ecf20Sopenharmony_ci#define GPIO_BASEMODE_6368_UART2	0x1
5478c2ecf20Sopenharmony_ci#define GPIO_BASEMODE_6368_GPIO		0x0
5488c2ecf20Sopenharmony_ci#define GPIO_BASEMODE_6368_MASK		0x7
5498c2ecf20Sopenharmony_ci/* those bits must be kept as read in gpio basemode register*/
5508c2ecf20Sopenharmony_ci
5518c2ecf20Sopenharmony_ci#define GPIO_STRAPBUS_REG		0x40
5528c2ecf20Sopenharmony_ci#define STRAPBUS_6358_BOOT_SEL_PARALLEL (1 << 1)
5538c2ecf20Sopenharmony_ci#define STRAPBUS_6358_BOOT_SEL_SERIAL	(0 << 1)
5548c2ecf20Sopenharmony_ci#define STRAPBUS_6368_BOOT_SEL_MASK	0x3
5558c2ecf20Sopenharmony_ci#define STRAPBUS_6368_BOOT_SEL_NAND	0
5568c2ecf20Sopenharmony_ci#define STRAPBUS_6368_BOOT_SEL_SERIAL	1
5578c2ecf20Sopenharmony_ci#define STRAPBUS_6368_BOOT_SEL_PARALLEL 3
5588c2ecf20Sopenharmony_ci
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_ci/*************************************************************************
5618c2ecf20Sopenharmony_ci * _REG relative to RSET_ENET
5628c2ecf20Sopenharmony_ci *************************************************************************/
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_ci/* Receiver Configuration register */
5658c2ecf20Sopenharmony_ci#define ENET_RXCFG_REG			0x0
5668c2ecf20Sopenharmony_ci#define ENET_RXCFG_ALLMCAST_SHIFT	1
5678c2ecf20Sopenharmony_ci#define ENET_RXCFG_ALLMCAST_MASK	(1 << ENET_RXCFG_ALLMCAST_SHIFT)
5688c2ecf20Sopenharmony_ci#define ENET_RXCFG_PROMISC_SHIFT	3
5698c2ecf20Sopenharmony_ci#define ENET_RXCFG_PROMISC_MASK		(1 << ENET_RXCFG_PROMISC_SHIFT)
5708c2ecf20Sopenharmony_ci#define ENET_RXCFG_LOOPBACK_SHIFT	4
5718c2ecf20Sopenharmony_ci#define ENET_RXCFG_LOOPBACK_MASK	(1 << ENET_RXCFG_LOOPBACK_SHIFT)
5728c2ecf20Sopenharmony_ci#define ENET_RXCFG_ENFLOW_SHIFT		5
5738c2ecf20Sopenharmony_ci#define ENET_RXCFG_ENFLOW_MASK		(1 << ENET_RXCFG_ENFLOW_SHIFT)
5748c2ecf20Sopenharmony_ci
5758c2ecf20Sopenharmony_ci/* Receive Maximum Length register */
5768c2ecf20Sopenharmony_ci#define ENET_RXMAXLEN_REG		0x4
5778c2ecf20Sopenharmony_ci#define ENET_RXMAXLEN_SHIFT		0
5788c2ecf20Sopenharmony_ci#define ENET_RXMAXLEN_MASK		(0x7ff << ENET_RXMAXLEN_SHIFT)
5798c2ecf20Sopenharmony_ci
5808c2ecf20Sopenharmony_ci/* Transmit Maximum Length register */
5818c2ecf20Sopenharmony_ci#define ENET_TXMAXLEN_REG		0x8
5828c2ecf20Sopenharmony_ci#define ENET_TXMAXLEN_SHIFT		0
5838c2ecf20Sopenharmony_ci#define ENET_TXMAXLEN_MASK		(0x7ff << ENET_TXMAXLEN_SHIFT)
5848c2ecf20Sopenharmony_ci
5858c2ecf20Sopenharmony_ci/* MII Status/Control register */
5868c2ecf20Sopenharmony_ci#define ENET_MIISC_REG			0x10
5878c2ecf20Sopenharmony_ci#define ENET_MIISC_MDCFREQDIV_SHIFT	0
5888c2ecf20Sopenharmony_ci#define ENET_MIISC_MDCFREQDIV_MASK	(0x7f << ENET_MIISC_MDCFREQDIV_SHIFT)
5898c2ecf20Sopenharmony_ci#define ENET_MIISC_PREAMBLEEN_SHIFT	7
5908c2ecf20Sopenharmony_ci#define ENET_MIISC_PREAMBLEEN_MASK	(1 << ENET_MIISC_PREAMBLEEN_SHIFT)
5918c2ecf20Sopenharmony_ci
5928c2ecf20Sopenharmony_ci/* MII Data register */
5938c2ecf20Sopenharmony_ci#define ENET_MIIDATA_REG		0x14
5948c2ecf20Sopenharmony_ci#define ENET_MIIDATA_DATA_SHIFT		0
5958c2ecf20Sopenharmony_ci#define ENET_MIIDATA_DATA_MASK		(0xffff << ENET_MIIDATA_DATA_SHIFT)
5968c2ecf20Sopenharmony_ci#define ENET_MIIDATA_TA_SHIFT		16
5978c2ecf20Sopenharmony_ci#define ENET_MIIDATA_TA_MASK		(0x3 << ENET_MIIDATA_TA_SHIFT)
5988c2ecf20Sopenharmony_ci#define ENET_MIIDATA_REG_SHIFT		18
5998c2ecf20Sopenharmony_ci#define ENET_MIIDATA_REG_MASK		(0x1f << ENET_MIIDATA_REG_SHIFT)
6008c2ecf20Sopenharmony_ci#define ENET_MIIDATA_PHYID_SHIFT	23
6018c2ecf20Sopenharmony_ci#define ENET_MIIDATA_PHYID_MASK		(0x1f << ENET_MIIDATA_PHYID_SHIFT)
6028c2ecf20Sopenharmony_ci#define ENET_MIIDATA_OP_READ_MASK	(0x6 << 28)
6038c2ecf20Sopenharmony_ci#define ENET_MIIDATA_OP_WRITE_MASK	(0x5 << 28)
6048c2ecf20Sopenharmony_ci
6058c2ecf20Sopenharmony_ci/* Ethernet Interrupt Mask register */
6068c2ecf20Sopenharmony_ci#define ENET_IRMASK_REG			0x18
6078c2ecf20Sopenharmony_ci
6088c2ecf20Sopenharmony_ci/* Ethernet Interrupt register */
6098c2ecf20Sopenharmony_ci#define ENET_IR_REG			0x1c
6108c2ecf20Sopenharmony_ci#define ENET_IR_MII			(1 << 0)
6118c2ecf20Sopenharmony_ci#define ENET_IR_MIB			(1 << 1)
6128c2ecf20Sopenharmony_ci#define ENET_IR_FLOWC			(1 << 2)
6138c2ecf20Sopenharmony_ci
6148c2ecf20Sopenharmony_ci/* Ethernet Control register */
6158c2ecf20Sopenharmony_ci#define ENET_CTL_REG			0x2c
6168c2ecf20Sopenharmony_ci#define ENET_CTL_ENABLE_SHIFT		0
6178c2ecf20Sopenharmony_ci#define ENET_CTL_ENABLE_MASK		(1 << ENET_CTL_ENABLE_SHIFT)
6188c2ecf20Sopenharmony_ci#define ENET_CTL_DISABLE_SHIFT		1
6198c2ecf20Sopenharmony_ci#define ENET_CTL_DISABLE_MASK		(1 << ENET_CTL_DISABLE_SHIFT)
6208c2ecf20Sopenharmony_ci#define ENET_CTL_SRESET_SHIFT		2
6218c2ecf20Sopenharmony_ci#define ENET_CTL_SRESET_MASK		(1 << ENET_CTL_SRESET_SHIFT)
6228c2ecf20Sopenharmony_ci#define ENET_CTL_EPHYSEL_SHIFT		3
6238c2ecf20Sopenharmony_ci#define ENET_CTL_EPHYSEL_MASK		(1 << ENET_CTL_EPHYSEL_SHIFT)
6248c2ecf20Sopenharmony_ci
6258c2ecf20Sopenharmony_ci/* Transmit Control register */
6268c2ecf20Sopenharmony_ci#define ENET_TXCTL_REG			0x30
6278c2ecf20Sopenharmony_ci#define ENET_TXCTL_FD_SHIFT		0
6288c2ecf20Sopenharmony_ci#define ENET_TXCTL_FD_MASK		(1 << ENET_TXCTL_FD_SHIFT)
6298c2ecf20Sopenharmony_ci
6308c2ecf20Sopenharmony_ci/* Transmit Watermask register */
6318c2ecf20Sopenharmony_ci#define ENET_TXWMARK_REG		0x34
6328c2ecf20Sopenharmony_ci#define ENET_TXWMARK_WM_SHIFT		0
6338c2ecf20Sopenharmony_ci#define ENET_TXWMARK_WM_MASK		(0x3f << ENET_TXWMARK_WM_SHIFT)
6348c2ecf20Sopenharmony_ci
6358c2ecf20Sopenharmony_ci/* MIB Control register */
6368c2ecf20Sopenharmony_ci#define ENET_MIBCTL_REG			0x38
6378c2ecf20Sopenharmony_ci#define ENET_MIBCTL_RDCLEAR_SHIFT	0
6388c2ecf20Sopenharmony_ci#define ENET_MIBCTL_RDCLEAR_MASK	(1 << ENET_MIBCTL_RDCLEAR_SHIFT)
6398c2ecf20Sopenharmony_ci
6408c2ecf20Sopenharmony_ci/* Perfect Match Data Low register */
6418c2ecf20Sopenharmony_ci#define ENET_PML_REG(x)			(0x58 + (x) * 8)
6428c2ecf20Sopenharmony_ci#define ENET_PMH_REG(x)			(0x5c + (x) * 8)
6438c2ecf20Sopenharmony_ci#define ENET_PMH_DATAVALID_SHIFT	16
6448c2ecf20Sopenharmony_ci#define ENET_PMH_DATAVALID_MASK		(1 << ENET_PMH_DATAVALID_SHIFT)
6458c2ecf20Sopenharmony_ci
6468c2ecf20Sopenharmony_ci/* MIB register */
6478c2ecf20Sopenharmony_ci#define ENET_MIB_REG(x)			(0x200 + (x) * 4)
6488c2ecf20Sopenharmony_ci#define ENET_MIB_REG_COUNT		55
6498c2ecf20Sopenharmony_ci
6508c2ecf20Sopenharmony_ci
6518c2ecf20Sopenharmony_ci/*************************************************************************
6528c2ecf20Sopenharmony_ci * _REG relative to RSET_ENETDMA
6538c2ecf20Sopenharmony_ci *************************************************************************/
6548c2ecf20Sopenharmony_ci#define ENETDMA_CHAN_WIDTH		0x10
6558c2ecf20Sopenharmony_ci#define ENETDMA_6345_CHAN_WIDTH		0x40
6568c2ecf20Sopenharmony_ci
6578c2ecf20Sopenharmony_ci/* Controller Configuration Register */
6588c2ecf20Sopenharmony_ci#define ENETDMA_CFG_REG			(0x0)
6598c2ecf20Sopenharmony_ci#define ENETDMA_CFG_EN_SHIFT		0
6608c2ecf20Sopenharmony_ci#define ENETDMA_CFG_EN_MASK		(1 << ENETDMA_CFG_EN_SHIFT)
6618c2ecf20Sopenharmony_ci#define ENETDMA_CFG_FLOWCH_MASK(x)	(1 << ((x >> 1) + 1))
6628c2ecf20Sopenharmony_ci
6638c2ecf20Sopenharmony_ci/* Flow Control Descriptor Low Threshold register */
6648c2ecf20Sopenharmony_ci#define ENETDMA_FLOWCL_REG(x)		(0x4 + (x) * 6)
6658c2ecf20Sopenharmony_ci
6668c2ecf20Sopenharmony_ci/* Flow Control Descriptor High Threshold register */
6678c2ecf20Sopenharmony_ci#define ENETDMA_FLOWCH_REG(x)		(0x8 + (x) * 6)
6688c2ecf20Sopenharmony_ci
6698c2ecf20Sopenharmony_ci/* Flow Control Descriptor Buffer Alloca Threshold register */
6708c2ecf20Sopenharmony_ci#define ENETDMA_BUFALLOC_REG(x)		(0xc + (x) * 6)
6718c2ecf20Sopenharmony_ci#define ENETDMA_BUFALLOC_FORCE_SHIFT	31
6728c2ecf20Sopenharmony_ci#define ENETDMA_BUFALLOC_FORCE_MASK	(1 << ENETDMA_BUFALLOC_FORCE_SHIFT)
6738c2ecf20Sopenharmony_ci
6748c2ecf20Sopenharmony_ci/* Global interrupt status */
6758c2ecf20Sopenharmony_ci#define ENETDMA_GLB_IRQSTAT_REG		(0x40)
6768c2ecf20Sopenharmony_ci
6778c2ecf20Sopenharmony_ci/* Global interrupt mask */
6788c2ecf20Sopenharmony_ci#define ENETDMA_GLB_IRQMASK_REG		(0x44)
6798c2ecf20Sopenharmony_ci
6808c2ecf20Sopenharmony_ci/* Channel Configuration register */
6818c2ecf20Sopenharmony_ci#define ENETDMA_CHANCFG_REG(x)		(0x100 + (x) * 0x10)
6828c2ecf20Sopenharmony_ci#define ENETDMA_CHANCFG_EN_SHIFT	0
6838c2ecf20Sopenharmony_ci#define ENETDMA_CHANCFG_EN_MASK		(1 << ENETDMA_CHANCFG_EN_SHIFT)
6848c2ecf20Sopenharmony_ci#define ENETDMA_CHANCFG_PKTHALT_SHIFT	1
6858c2ecf20Sopenharmony_ci#define ENETDMA_CHANCFG_PKTHALT_MASK	(1 << ENETDMA_CHANCFG_PKTHALT_SHIFT)
6868c2ecf20Sopenharmony_ci
6878c2ecf20Sopenharmony_ci/* Interrupt Control/Status register */
6888c2ecf20Sopenharmony_ci#define ENETDMA_IR_REG(x)		(0x104 + (x) * 0x10)
6898c2ecf20Sopenharmony_ci#define ENETDMA_IR_BUFDONE_MASK		(1 << 0)
6908c2ecf20Sopenharmony_ci#define ENETDMA_IR_PKTDONE_MASK		(1 << 1)
6918c2ecf20Sopenharmony_ci#define ENETDMA_IR_NOTOWNER_MASK	(1 << 2)
6928c2ecf20Sopenharmony_ci
6938c2ecf20Sopenharmony_ci/* Interrupt Mask register */
6948c2ecf20Sopenharmony_ci#define ENETDMA_IRMASK_REG(x)		(0x108 + (x) * 0x10)
6958c2ecf20Sopenharmony_ci
6968c2ecf20Sopenharmony_ci/* Maximum Burst Length */
6978c2ecf20Sopenharmony_ci#define ENETDMA_MAXBURST_REG(x)		(0x10C + (x) * 0x10)
6988c2ecf20Sopenharmony_ci
6998c2ecf20Sopenharmony_ci/* Ring Start Address register */
7008c2ecf20Sopenharmony_ci#define ENETDMA_RSTART_REG(x)		(0x200 + (x) * 0x10)
7018c2ecf20Sopenharmony_ci
7028c2ecf20Sopenharmony_ci/* State Ram Word 2 */
7038c2ecf20Sopenharmony_ci#define ENETDMA_SRAM2_REG(x)		(0x204 + (x) * 0x10)
7048c2ecf20Sopenharmony_ci
7058c2ecf20Sopenharmony_ci/* State Ram Word 3 */
7068c2ecf20Sopenharmony_ci#define ENETDMA_SRAM3_REG(x)		(0x208 + (x) * 0x10)
7078c2ecf20Sopenharmony_ci
7088c2ecf20Sopenharmony_ci/* State Ram Word 4 */
7098c2ecf20Sopenharmony_ci#define ENETDMA_SRAM4_REG(x)		(0x20c + (x) * 0x10)
7108c2ecf20Sopenharmony_ci
7118c2ecf20Sopenharmony_ci/* Broadcom 6345 ENET DMA definitions */
7128c2ecf20Sopenharmony_ci#define ENETDMA_6345_CHANCFG_REG	(0x00)
7138c2ecf20Sopenharmony_ci
7148c2ecf20Sopenharmony_ci#define ENETDMA_6345_MAXBURST_REG	(0x04)
7158c2ecf20Sopenharmony_ci
7168c2ecf20Sopenharmony_ci#define ENETDMA_6345_RSTART_REG		(0x08)
7178c2ecf20Sopenharmony_ci
7188c2ecf20Sopenharmony_ci#define ENETDMA_6345_LEN_REG		(0x0C)
7198c2ecf20Sopenharmony_ci
7208c2ecf20Sopenharmony_ci#define ENETDMA_6345_IR_REG		(0x14)
7218c2ecf20Sopenharmony_ci
7228c2ecf20Sopenharmony_ci#define ENETDMA_6345_IRMASK_REG		(0x18)
7238c2ecf20Sopenharmony_ci
7248c2ecf20Sopenharmony_ci#define ENETDMA_6345_FC_REG		(0x1C)
7258c2ecf20Sopenharmony_ci
7268c2ecf20Sopenharmony_ci#define ENETDMA_6345_BUFALLOC_REG	(0x20)
7278c2ecf20Sopenharmony_ci
7288c2ecf20Sopenharmony_ci/* Shift down for EOP, SOP and WRAP bits */
7298c2ecf20Sopenharmony_ci#define ENETDMA_6345_DESC_SHIFT		(3)
7308c2ecf20Sopenharmony_ci
7318c2ecf20Sopenharmony_ci/*************************************************************************
7328c2ecf20Sopenharmony_ci * _REG relative to RSET_ENETDMAC
7338c2ecf20Sopenharmony_ci *************************************************************************/
7348c2ecf20Sopenharmony_ci
7358c2ecf20Sopenharmony_ci/* Channel Configuration register */
7368c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_REG		(0x0)
7378c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_EN_SHIFT	0
7388c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_EN_MASK	(1 << ENETDMAC_CHANCFG_EN_SHIFT)
7398c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_PKTHALT_SHIFT	1
7408c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_PKTHALT_MASK	(1 << ENETDMAC_CHANCFG_PKTHALT_SHIFT)
7418c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_BUFHALT_SHIFT	2
7428c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_BUFHALT_MASK	(1 << ENETDMAC_CHANCFG_BUFHALT_SHIFT)
7438c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_CHAINING_SHIFT	2
7448c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_CHAINING_MASK	(1 << ENETDMAC_CHANCFG_CHAINING_SHIFT)
7458c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_WRAP_EN_SHIFT	3
7468c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_WRAP_EN_MASK	(1 << ENETDMAC_CHANCFG_WRAP_EN_SHIFT)
7478c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_FLOWC_EN_SHIFT	4
7488c2ecf20Sopenharmony_ci#define ENETDMAC_CHANCFG_FLOWC_EN_MASK	(1 << ENETDMAC_CHANCFG_FLOWC_EN_SHIFT)
7498c2ecf20Sopenharmony_ci
7508c2ecf20Sopenharmony_ci/* Interrupt Control/Status register */
7518c2ecf20Sopenharmony_ci#define ENETDMAC_IR_REG			(0x4)
7528c2ecf20Sopenharmony_ci#define ENETDMAC_IR_BUFDONE_MASK	(1 << 0)
7538c2ecf20Sopenharmony_ci#define ENETDMAC_IR_PKTDONE_MASK	(1 << 1)
7548c2ecf20Sopenharmony_ci#define ENETDMAC_IR_NOTOWNER_MASK	(1 << 2)
7558c2ecf20Sopenharmony_ci
7568c2ecf20Sopenharmony_ci/* Interrupt Mask register */
7578c2ecf20Sopenharmony_ci#define ENETDMAC_IRMASK_REG		(0x8)
7588c2ecf20Sopenharmony_ci
7598c2ecf20Sopenharmony_ci/* Maximum Burst Length */
7608c2ecf20Sopenharmony_ci#define ENETDMAC_MAXBURST_REG		(0xc)
7618c2ecf20Sopenharmony_ci
7628c2ecf20Sopenharmony_ci
7638c2ecf20Sopenharmony_ci/*************************************************************************
7648c2ecf20Sopenharmony_ci * _REG relative to RSET_ENETDMAS
7658c2ecf20Sopenharmony_ci *************************************************************************/
7668c2ecf20Sopenharmony_ci
7678c2ecf20Sopenharmony_ci/* Ring Start Address register */
7688c2ecf20Sopenharmony_ci#define ENETDMAS_RSTART_REG		(0x0)
7698c2ecf20Sopenharmony_ci
7708c2ecf20Sopenharmony_ci/* State Ram Word 2 */
7718c2ecf20Sopenharmony_ci#define ENETDMAS_SRAM2_REG		(0x4)
7728c2ecf20Sopenharmony_ci
7738c2ecf20Sopenharmony_ci/* State Ram Word 3 */
7748c2ecf20Sopenharmony_ci#define ENETDMAS_SRAM3_REG		(0x8)
7758c2ecf20Sopenharmony_ci
7768c2ecf20Sopenharmony_ci/* State Ram Word 4 */
7778c2ecf20Sopenharmony_ci#define ENETDMAS_SRAM4_REG		(0xc)
7788c2ecf20Sopenharmony_ci
7798c2ecf20Sopenharmony_ci
7808c2ecf20Sopenharmony_ci/*************************************************************************
7818c2ecf20Sopenharmony_ci * _REG relative to RSET_ENETSW
7828c2ecf20Sopenharmony_ci *************************************************************************/
7838c2ecf20Sopenharmony_ci
7848c2ecf20Sopenharmony_ci/* Port traffic control */
7858c2ecf20Sopenharmony_ci#define ENETSW_PTCTRL_REG(x)		(0x0 + (x))
7868c2ecf20Sopenharmony_ci#define ENETSW_PTCTRL_RXDIS_MASK	(1 << 0)
7878c2ecf20Sopenharmony_ci#define ENETSW_PTCTRL_TXDIS_MASK	(1 << 1)
7888c2ecf20Sopenharmony_ci
7898c2ecf20Sopenharmony_ci/* Switch mode register */
7908c2ecf20Sopenharmony_ci#define ENETSW_SWMODE_REG		(0xb)
7918c2ecf20Sopenharmony_ci#define ENETSW_SWMODE_FWD_EN_MASK	(1 << 1)
7928c2ecf20Sopenharmony_ci
7938c2ecf20Sopenharmony_ci/* IMP override Register */
7948c2ecf20Sopenharmony_ci#define ENETSW_IMPOV_REG		(0xe)
7958c2ecf20Sopenharmony_ci#define ENETSW_IMPOV_FORCE_MASK		(1 << 7)
7968c2ecf20Sopenharmony_ci#define ENETSW_IMPOV_TXFLOW_MASK	(1 << 5)
7978c2ecf20Sopenharmony_ci#define ENETSW_IMPOV_RXFLOW_MASK	(1 << 4)
7988c2ecf20Sopenharmony_ci#define ENETSW_IMPOV_1000_MASK		(1 << 3)
7998c2ecf20Sopenharmony_ci#define ENETSW_IMPOV_100_MASK		(1 << 2)
8008c2ecf20Sopenharmony_ci#define ENETSW_IMPOV_FDX_MASK		(1 << 1)
8018c2ecf20Sopenharmony_ci#define ENETSW_IMPOV_LINKUP_MASK	(1 << 0)
8028c2ecf20Sopenharmony_ci
8038c2ecf20Sopenharmony_ci/* Port override Register */
8048c2ecf20Sopenharmony_ci#define ENETSW_PORTOV_REG(x)		(0x58 + (x))
8058c2ecf20Sopenharmony_ci#define ENETSW_PORTOV_ENABLE_MASK	(1 << 6)
8068c2ecf20Sopenharmony_ci#define ENETSW_PORTOV_TXFLOW_MASK	(1 << 5)
8078c2ecf20Sopenharmony_ci#define ENETSW_PORTOV_RXFLOW_MASK	(1 << 4)
8088c2ecf20Sopenharmony_ci#define ENETSW_PORTOV_1000_MASK		(1 << 3)
8098c2ecf20Sopenharmony_ci#define ENETSW_PORTOV_100_MASK		(1 << 2)
8108c2ecf20Sopenharmony_ci#define ENETSW_PORTOV_FDX_MASK		(1 << 1)
8118c2ecf20Sopenharmony_ci#define ENETSW_PORTOV_LINKUP_MASK	(1 << 0)
8128c2ecf20Sopenharmony_ci
8138c2ecf20Sopenharmony_ci/* MDIO control register */
8148c2ecf20Sopenharmony_ci#define ENETSW_MDIOC_REG		(0xb0)
8158c2ecf20Sopenharmony_ci#define ENETSW_MDIOC_EXT_MASK		(1 << 16)
8168c2ecf20Sopenharmony_ci#define ENETSW_MDIOC_REG_SHIFT		20
8178c2ecf20Sopenharmony_ci#define ENETSW_MDIOC_PHYID_SHIFT	25
8188c2ecf20Sopenharmony_ci#define ENETSW_MDIOC_RD_MASK		(1 << 30)
8198c2ecf20Sopenharmony_ci#define ENETSW_MDIOC_WR_MASK		(1 << 31)
8208c2ecf20Sopenharmony_ci
8218c2ecf20Sopenharmony_ci/* MDIO data register */
8228c2ecf20Sopenharmony_ci#define ENETSW_MDIOD_REG		(0xb4)
8238c2ecf20Sopenharmony_ci
8248c2ecf20Sopenharmony_ci/* Global Management Configuration Register */
8258c2ecf20Sopenharmony_ci#define ENETSW_GMCR_REG			(0x200)
8268c2ecf20Sopenharmony_ci#define ENETSW_GMCR_RST_MIB_MASK	(1 << 0)
8278c2ecf20Sopenharmony_ci
8288c2ecf20Sopenharmony_ci/* MIB register */
8298c2ecf20Sopenharmony_ci#define ENETSW_MIB_REG(x)		(0x2800 + (x) * 4)
8308c2ecf20Sopenharmony_ci#define ENETSW_MIB_REG_COUNT		47
8318c2ecf20Sopenharmony_ci
8328c2ecf20Sopenharmony_ci/* Jumbo control register port mask register */
8338c2ecf20Sopenharmony_ci#define ENETSW_JMBCTL_PORT_REG		(0x4004)
8348c2ecf20Sopenharmony_ci
8358c2ecf20Sopenharmony_ci/* Jumbo control mib good frame register */
8368c2ecf20Sopenharmony_ci#define ENETSW_JMBCTL_MAXSIZE_REG	(0x4008)
8378c2ecf20Sopenharmony_ci
8388c2ecf20Sopenharmony_ci
8398c2ecf20Sopenharmony_ci/*************************************************************************
8408c2ecf20Sopenharmony_ci * _REG relative to RSET_OHCI_PRIV
8418c2ecf20Sopenharmony_ci *************************************************************************/
8428c2ecf20Sopenharmony_ci
8438c2ecf20Sopenharmony_ci#define OHCI_PRIV_REG			0x0
8448c2ecf20Sopenharmony_ci#define OHCI_PRIV_PORT1_HOST_SHIFT	0
8458c2ecf20Sopenharmony_ci#define OHCI_PRIV_PORT1_HOST_MASK	(1 << OHCI_PRIV_PORT1_HOST_SHIFT)
8468c2ecf20Sopenharmony_ci#define OHCI_PRIV_REG_SWAP_SHIFT	3
8478c2ecf20Sopenharmony_ci#define OHCI_PRIV_REG_SWAP_MASK		(1 << OHCI_PRIV_REG_SWAP_SHIFT)
8488c2ecf20Sopenharmony_ci
8498c2ecf20Sopenharmony_ci
8508c2ecf20Sopenharmony_ci/*************************************************************************
8518c2ecf20Sopenharmony_ci * _REG relative to RSET_USBH_PRIV
8528c2ecf20Sopenharmony_ci *************************************************************************/
8538c2ecf20Sopenharmony_ci
8548c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_6358_REG		0x0
8558c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_6368_REG		0x1c
8568c2ecf20Sopenharmony_ci
8578c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_USBD_SHIFT	6
8588c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_USBD_MASK	(1 << USBH_PRIV_SWAP_USBD_SHIFT)
8598c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_EHCI_ENDN_SHIFT	4
8608c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_EHCI_ENDN_MASK	(1 << USBH_PRIV_SWAP_EHCI_ENDN_SHIFT)
8618c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_EHCI_DATA_SHIFT	3
8628c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_EHCI_DATA_MASK	(1 << USBH_PRIV_SWAP_EHCI_DATA_SHIFT)
8638c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_OHCI_ENDN_SHIFT	1
8648c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_OHCI_ENDN_MASK	(1 << USBH_PRIV_SWAP_OHCI_ENDN_SHIFT)
8658c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_OHCI_DATA_SHIFT	0
8668c2ecf20Sopenharmony_ci#define USBH_PRIV_SWAP_OHCI_DATA_MASK	(1 << USBH_PRIV_SWAP_OHCI_DATA_SHIFT)
8678c2ecf20Sopenharmony_ci
8688c2ecf20Sopenharmony_ci#define USBH_PRIV_UTMI_CTL_6368_REG	0x10
8698c2ecf20Sopenharmony_ci#define USBH_PRIV_UTMI_CTL_NODRIV_SHIFT 12
8708c2ecf20Sopenharmony_ci#define USBH_PRIV_UTMI_CTL_NODRIV_MASK	(0xf << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT)
8718c2ecf20Sopenharmony_ci#define USBH_PRIV_UTMI_CTL_HOSTB_SHIFT	0
8728c2ecf20Sopenharmony_ci#define USBH_PRIV_UTMI_CTL_HOSTB_MASK	(0xf << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT)
8738c2ecf20Sopenharmony_ci
8748c2ecf20Sopenharmony_ci#define USBH_PRIV_TEST_6358_REG		0x24
8758c2ecf20Sopenharmony_ci#define USBH_PRIV_TEST_6368_REG		0x14
8768c2ecf20Sopenharmony_ci
8778c2ecf20Sopenharmony_ci#define USBH_PRIV_SETUP_6368_REG	0x28
8788c2ecf20Sopenharmony_ci#define USBH_PRIV_SETUP_IOC_SHIFT	4
8798c2ecf20Sopenharmony_ci#define USBH_PRIV_SETUP_IOC_MASK	(1 << USBH_PRIV_SETUP_IOC_SHIFT)
8808c2ecf20Sopenharmony_ci
8818c2ecf20Sopenharmony_ci
8828c2ecf20Sopenharmony_ci/*************************************************************************
8838c2ecf20Sopenharmony_ci * _REG relative to RSET_USBD
8848c2ecf20Sopenharmony_ci *************************************************************************/
8858c2ecf20Sopenharmony_ci
8868c2ecf20Sopenharmony_ci/* General control */
8878c2ecf20Sopenharmony_ci#define USBD_CONTROL_REG		0x00
8888c2ecf20Sopenharmony_ci#define USBD_CONTROL_TXZLENINS_SHIFT	14
8898c2ecf20Sopenharmony_ci#define USBD_CONTROL_TXZLENINS_MASK	(1 << USBD_CONTROL_TXZLENINS_SHIFT)
8908c2ecf20Sopenharmony_ci#define USBD_CONTROL_AUTO_CSRS_SHIFT	13
8918c2ecf20Sopenharmony_ci#define USBD_CONTROL_AUTO_CSRS_MASK	(1 << USBD_CONTROL_AUTO_CSRS_SHIFT)
8928c2ecf20Sopenharmony_ci#define USBD_CONTROL_RXZSCFG_SHIFT	12
8938c2ecf20Sopenharmony_ci#define USBD_CONTROL_RXZSCFG_MASK	(1 << USBD_CONTROL_RXZSCFG_SHIFT)
8948c2ecf20Sopenharmony_ci#define USBD_CONTROL_INIT_SEL_SHIFT	8
8958c2ecf20Sopenharmony_ci#define USBD_CONTROL_INIT_SEL_MASK	(0xf << USBD_CONTROL_INIT_SEL_SHIFT)
8968c2ecf20Sopenharmony_ci#define USBD_CONTROL_FIFO_RESET_SHIFT	6
8978c2ecf20Sopenharmony_ci#define USBD_CONTROL_FIFO_RESET_MASK	(3 << USBD_CONTROL_FIFO_RESET_SHIFT)
8988c2ecf20Sopenharmony_ci#define USBD_CONTROL_SETUPERRLOCK_SHIFT 5
8998c2ecf20Sopenharmony_ci#define USBD_CONTROL_SETUPERRLOCK_MASK	(1 << USBD_CONTROL_SETUPERRLOCK_SHIFT)
9008c2ecf20Sopenharmony_ci#define USBD_CONTROL_DONE_CSRS_SHIFT	0
9018c2ecf20Sopenharmony_ci#define USBD_CONTROL_DONE_CSRS_MASK	(1 << USBD_CONTROL_DONE_CSRS_SHIFT)
9028c2ecf20Sopenharmony_ci
9038c2ecf20Sopenharmony_ci/* Strap options */
9048c2ecf20Sopenharmony_ci#define USBD_STRAPS_REG			0x04
9058c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_SELF_PWR_SHIFT	10
9068c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_SELF_PWR_MASK	(1 << USBD_STRAPS_APP_SELF_PWR_SHIFT)
9078c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_DISCON_SHIFT	9
9088c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_DISCON_MASK	(1 << USBD_STRAPS_APP_DISCON_SHIFT)
9098c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_CSRPRGSUP_SHIFT 8
9108c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_CSRPRGSUP_MASK	(1 << USBD_STRAPS_APP_CSRPRGSUP_SHIFT)
9118c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_RMTWKUP_SHIFT	6
9128c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_RMTWKUP_MASK	(1 << USBD_STRAPS_APP_RMTWKUP_SHIFT)
9138c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_RAM_IF_SHIFT	7
9148c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_RAM_IF_MASK	(1 << USBD_STRAPS_APP_RAM_IF_SHIFT)
9158c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_8BITPHY_SHIFT	2
9168c2ecf20Sopenharmony_ci#define USBD_STRAPS_APP_8BITPHY_MASK	(1 << USBD_STRAPS_APP_8BITPHY_SHIFT)
9178c2ecf20Sopenharmony_ci#define USBD_STRAPS_SPEED_SHIFT		0
9188c2ecf20Sopenharmony_ci#define USBD_STRAPS_SPEED_MASK		(3 << USBD_STRAPS_SPEED_SHIFT)
9198c2ecf20Sopenharmony_ci
9208c2ecf20Sopenharmony_ci/* Stall control */
9218c2ecf20Sopenharmony_ci#define USBD_STALL_REG			0x08
9228c2ecf20Sopenharmony_ci#define USBD_STALL_UPDATE_SHIFT		7
9238c2ecf20Sopenharmony_ci#define USBD_STALL_UPDATE_MASK		(1 << USBD_STALL_UPDATE_SHIFT)
9248c2ecf20Sopenharmony_ci#define USBD_STALL_ENABLE_SHIFT		6
9258c2ecf20Sopenharmony_ci#define USBD_STALL_ENABLE_MASK		(1 << USBD_STALL_ENABLE_SHIFT)
9268c2ecf20Sopenharmony_ci#define USBD_STALL_EPNUM_SHIFT		0
9278c2ecf20Sopenharmony_ci#define USBD_STALL_EPNUM_MASK		(0xf << USBD_STALL_EPNUM_SHIFT)
9288c2ecf20Sopenharmony_ci
9298c2ecf20Sopenharmony_ci/* General status */
9308c2ecf20Sopenharmony_ci#define USBD_STATUS_REG			0x0c
9318c2ecf20Sopenharmony_ci#define USBD_STATUS_SOF_SHIFT		16
9328c2ecf20Sopenharmony_ci#define USBD_STATUS_SOF_MASK		(0x7ff << USBD_STATUS_SOF_SHIFT)
9338c2ecf20Sopenharmony_ci#define USBD_STATUS_SPD_SHIFT		12
9348c2ecf20Sopenharmony_ci#define USBD_STATUS_SPD_MASK		(3 << USBD_STATUS_SPD_SHIFT)
9358c2ecf20Sopenharmony_ci#define USBD_STATUS_ALTINTF_SHIFT	8
9368c2ecf20Sopenharmony_ci#define USBD_STATUS_ALTINTF_MASK	(0xf << USBD_STATUS_ALTINTF_SHIFT)
9378c2ecf20Sopenharmony_ci#define USBD_STATUS_INTF_SHIFT		4
9388c2ecf20Sopenharmony_ci#define USBD_STATUS_INTF_MASK		(0xf << USBD_STATUS_INTF_SHIFT)
9398c2ecf20Sopenharmony_ci#define USBD_STATUS_CFG_SHIFT		0
9408c2ecf20Sopenharmony_ci#define USBD_STATUS_CFG_MASK		(0xf << USBD_STATUS_CFG_SHIFT)
9418c2ecf20Sopenharmony_ci
9428c2ecf20Sopenharmony_ci/* Other events */
9438c2ecf20Sopenharmony_ci#define USBD_EVENTS_REG			0x10
9448c2ecf20Sopenharmony_ci#define USBD_EVENTS_USB_LINK_SHIFT	10
9458c2ecf20Sopenharmony_ci#define USBD_EVENTS_USB_LINK_MASK	(1 << USBD_EVENTS_USB_LINK_SHIFT)
9468c2ecf20Sopenharmony_ci
9478c2ecf20Sopenharmony_ci/* IRQ status */
9488c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_STATUS_REG	0x14
9498c2ecf20Sopenharmony_ci
9508c2ecf20Sopenharmony_ci/* IRQ level (2 bits per IRQ event) */
9518c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_CFG_HI_REG	0x18
9528c2ecf20Sopenharmony_ci
9538c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_CFG_LO_REG	0x1c
9548c2ecf20Sopenharmony_ci
9558c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_CFG_SHIFT(x)	((x & 0xf) << 1)
9568c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_CFG_MASK(x)	(3 << USBD_EVENT_IRQ_CFG_SHIFT(x))
9578c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_CFG_RISING(x)	(0 << USBD_EVENT_IRQ_CFG_SHIFT(x))
9588c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_CFG_FALLING(x)	(1 << USBD_EVENT_IRQ_CFG_SHIFT(x))
9598c2ecf20Sopenharmony_ci
9608c2ecf20Sopenharmony_ci/* IRQ mask (1=unmasked) */
9618c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_MASK_REG		0x20
9628c2ecf20Sopenharmony_ci
9638c2ecf20Sopenharmony_ci/* IRQ bits */
9648c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_USB_LINK		10
9658c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_SETCFG		9
9668c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_SETINTF		8
9678c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_ERRATIC_ERR	7
9688c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_SET_CSRS		6
9698c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_SUSPEND		5
9708c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_EARLY_SUSPEND	4
9718c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_SOF		3
9728c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_ENUM_ON		2
9738c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_SETUP		1
9748c2ecf20Sopenharmony_ci#define USBD_EVENT_IRQ_USB_RESET	0
9758c2ecf20Sopenharmony_ci
9768c2ecf20Sopenharmony_ci/* TX FIFO partitioning */
9778c2ecf20Sopenharmony_ci#define USBD_TXFIFO_CONFIG_REG		0x40
9788c2ecf20Sopenharmony_ci#define USBD_TXFIFO_CONFIG_END_SHIFT	16
9798c2ecf20Sopenharmony_ci#define USBD_TXFIFO_CONFIG_END_MASK	(0xff << USBD_TXFIFO_CONFIG_END_SHIFT)
9808c2ecf20Sopenharmony_ci#define USBD_TXFIFO_CONFIG_START_SHIFT	0
9818c2ecf20Sopenharmony_ci#define USBD_TXFIFO_CONFIG_START_MASK	(0xff << USBD_TXFIFO_CONFIG_START_SHIFT)
9828c2ecf20Sopenharmony_ci
9838c2ecf20Sopenharmony_ci/* RX FIFO partitioning */
9848c2ecf20Sopenharmony_ci#define USBD_RXFIFO_CONFIG_REG		0x44
9858c2ecf20Sopenharmony_ci#define USBD_RXFIFO_CONFIG_END_SHIFT	16
9868c2ecf20Sopenharmony_ci#define USBD_RXFIFO_CONFIG_END_MASK	(0xff << USBD_TXFIFO_CONFIG_END_SHIFT)
9878c2ecf20Sopenharmony_ci#define USBD_RXFIFO_CONFIG_START_SHIFT	0
9888c2ecf20Sopenharmony_ci#define USBD_RXFIFO_CONFIG_START_MASK	(0xff << USBD_TXFIFO_CONFIG_START_SHIFT)
9898c2ecf20Sopenharmony_ci
9908c2ecf20Sopenharmony_ci/* TX FIFO/endpoint configuration */
9918c2ecf20Sopenharmony_ci#define USBD_TXFIFO_EPSIZE_REG		0x48
9928c2ecf20Sopenharmony_ci
9938c2ecf20Sopenharmony_ci/* RX FIFO/endpoint configuration */
9948c2ecf20Sopenharmony_ci#define USBD_RXFIFO_EPSIZE_REG		0x4c
9958c2ecf20Sopenharmony_ci
9968c2ecf20Sopenharmony_ci/* Endpoint<->DMA mappings */
9978c2ecf20Sopenharmony_ci#define USBD_EPNUM_TYPEMAP_REG		0x50
9988c2ecf20Sopenharmony_ci#define USBD_EPNUM_TYPEMAP_TYPE_SHIFT	8
9998c2ecf20Sopenharmony_ci#define USBD_EPNUM_TYPEMAP_TYPE_MASK	(0x3 << USBD_EPNUM_TYPEMAP_TYPE_SHIFT)
10008c2ecf20Sopenharmony_ci#define USBD_EPNUM_TYPEMAP_DMA_CH_SHIFT 0
10018c2ecf20Sopenharmony_ci#define USBD_EPNUM_TYPEMAP_DMA_CH_MASK	(0xf << USBD_EPNUM_TYPEMAP_DMACH_SHIFT)
10028c2ecf20Sopenharmony_ci
10038c2ecf20Sopenharmony_ci/* Misc per-endpoint settings */
10048c2ecf20Sopenharmony_ci#define USBD_CSR_SETUPADDR_REG		0x80
10058c2ecf20Sopenharmony_ci#define USBD_CSR_SETUPADDR_DEF		0xb550
10068c2ecf20Sopenharmony_ci
10078c2ecf20Sopenharmony_ci#define USBD_CSR_EP_REG(x)		(0x84 + (x) * 4)
10088c2ecf20Sopenharmony_ci#define USBD_CSR_EP_MAXPKT_SHIFT	19
10098c2ecf20Sopenharmony_ci#define USBD_CSR_EP_MAXPKT_MASK		(0x7ff << USBD_CSR_EP_MAXPKT_SHIFT)
10108c2ecf20Sopenharmony_ci#define USBD_CSR_EP_ALTIFACE_SHIFT	15
10118c2ecf20Sopenharmony_ci#define USBD_CSR_EP_ALTIFACE_MASK	(0xf << USBD_CSR_EP_ALTIFACE_SHIFT)
10128c2ecf20Sopenharmony_ci#define USBD_CSR_EP_IFACE_SHIFT		11
10138c2ecf20Sopenharmony_ci#define USBD_CSR_EP_IFACE_MASK		(0xf << USBD_CSR_EP_IFACE_SHIFT)
10148c2ecf20Sopenharmony_ci#define USBD_CSR_EP_CFG_SHIFT		7
10158c2ecf20Sopenharmony_ci#define USBD_CSR_EP_CFG_MASK		(0xf << USBD_CSR_EP_CFG_SHIFT)
10168c2ecf20Sopenharmony_ci#define USBD_CSR_EP_TYPE_SHIFT		5
10178c2ecf20Sopenharmony_ci#define USBD_CSR_EP_TYPE_MASK		(3 << USBD_CSR_EP_TYPE_SHIFT)
10188c2ecf20Sopenharmony_ci#define USBD_CSR_EP_DIR_SHIFT		4
10198c2ecf20Sopenharmony_ci#define USBD_CSR_EP_DIR_MASK		(1 << USBD_CSR_EP_DIR_SHIFT)
10208c2ecf20Sopenharmony_ci#define USBD_CSR_EP_LOG_SHIFT		0
10218c2ecf20Sopenharmony_ci#define USBD_CSR_EP_LOG_MASK		(0xf << USBD_CSR_EP_LOG_SHIFT)
10228c2ecf20Sopenharmony_ci
10238c2ecf20Sopenharmony_ci
10248c2ecf20Sopenharmony_ci/*************************************************************************
10258c2ecf20Sopenharmony_ci * _REG relative to RSET_MPI
10268c2ecf20Sopenharmony_ci *************************************************************************/
10278c2ecf20Sopenharmony_ci
10288c2ecf20Sopenharmony_ci/* well known (hard wired) chip select */
10298c2ecf20Sopenharmony_ci#define MPI_CS_PCMCIA_COMMON		4
10308c2ecf20Sopenharmony_ci#define MPI_CS_PCMCIA_ATTR		5
10318c2ecf20Sopenharmony_ci#define MPI_CS_PCMCIA_IO		6
10328c2ecf20Sopenharmony_ci
10338c2ecf20Sopenharmony_ci/* Chip select base register */
10348c2ecf20Sopenharmony_ci#define MPI_CSBASE_REG(x)		(0x0 + (x) * 8)
10358c2ecf20Sopenharmony_ci#define MPI_CSBASE_BASE_SHIFT		13
10368c2ecf20Sopenharmony_ci#define MPI_CSBASE_BASE_MASK		(0x1ffff << MPI_CSBASE_BASE_SHIFT)
10378c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_SHIFT		0
10388c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_MASK		(0xf << MPI_CSBASE_SIZE_SHIFT)
10398c2ecf20Sopenharmony_ci
10408c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_8K		0
10418c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_16K		1
10428c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_32K		2
10438c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_64K		3
10448c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_128K		4
10458c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_256K		5
10468c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_512K		6
10478c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_1M		7
10488c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_2M		8
10498c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_4M		9
10508c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_8M		10
10518c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_16M		11
10528c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_32M		12
10538c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_64M		13
10548c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_128M		14
10558c2ecf20Sopenharmony_ci#define MPI_CSBASE_SIZE_256M		15
10568c2ecf20Sopenharmony_ci
10578c2ecf20Sopenharmony_ci/* Chip select control register */
10588c2ecf20Sopenharmony_ci#define MPI_CSCTL_REG(x)		(0x4 + (x) * 8)
10598c2ecf20Sopenharmony_ci#define MPI_CSCTL_ENABLE_MASK		(1 << 0)
10608c2ecf20Sopenharmony_ci#define MPI_CSCTL_WAIT_SHIFT		1
10618c2ecf20Sopenharmony_ci#define MPI_CSCTL_WAIT_MASK		(0x7 << MPI_CSCTL_WAIT_SHIFT)
10628c2ecf20Sopenharmony_ci#define MPI_CSCTL_DATA16_MASK		(1 << 4)
10638c2ecf20Sopenharmony_ci#define MPI_CSCTL_SYNCMODE_MASK		(1 << 7)
10648c2ecf20Sopenharmony_ci#define MPI_CSCTL_TSIZE_MASK		(1 << 8)
10658c2ecf20Sopenharmony_ci#define MPI_CSCTL_ENDIANSWAP_MASK	(1 << 10)
10668c2ecf20Sopenharmony_ci#define MPI_CSCTL_SETUP_SHIFT		16
10678c2ecf20Sopenharmony_ci#define MPI_CSCTL_SETUP_MASK		(0xf << MPI_CSCTL_SETUP_SHIFT)
10688c2ecf20Sopenharmony_ci#define MPI_CSCTL_HOLD_SHIFT		20
10698c2ecf20Sopenharmony_ci#define MPI_CSCTL_HOLD_MASK		(0xf << MPI_CSCTL_HOLD_SHIFT)
10708c2ecf20Sopenharmony_ci
10718c2ecf20Sopenharmony_ci/* PCI registers */
10728c2ecf20Sopenharmony_ci#define MPI_SP0_RANGE_REG		0x100
10738c2ecf20Sopenharmony_ci#define MPI_SP0_REMAP_REG		0x104
10748c2ecf20Sopenharmony_ci#define MPI_SP0_REMAP_ENABLE_MASK	(1 << 0)
10758c2ecf20Sopenharmony_ci#define MPI_SP1_RANGE_REG		0x10C
10768c2ecf20Sopenharmony_ci#define MPI_SP1_REMAP_REG		0x110
10778c2ecf20Sopenharmony_ci#define MPI_SP1_REMAP_ENABLE_MASK	(1 << 0)
10788c2ecf20Sopenharmony_ci
10798c2ecf20Sopenharmony_ci#define MPI_L2PCFG_REG			0x11C
10808c2ecf20Sopenharmony_ci#define MPI_L2PCFG_CFG_TYPE_SHIFT	0
10818c2ecf20Sopenharmony_ci#define MPI_L2PCFG_CFG_TYPE_MASK	(0x3 << MPI_L2PCFG_CFG_TYPE_SHIFT)
10828c2ecf20Sopenharmony_ci#define MPI_L2PCFG_REG_SHIFT		2
10838c2ecf20Sopenharmony_ci#define MPI_L2PCFG_REG_MASK		(0x3f << MPI_L2PCFG_REG_SHIFT)
10848c2ecf20Sopenharmony_ci#define MPI_L2PCFG_FUNC_SHIFT		8
10858c2ecf20Sopenharmony_ci#define MPI_L2PCFG_FUNC_MASK		(0x7 << MPI_L2PCFG_FUNC_SHIFT)
10868c2ecf20Sopenharmony_ci#define MPI_L2PCFG_DEVNUM_SHIFT		11
10878c2ecf20Sopenharmony_ci#define MPI_L2PCFG_DEVNUM_MASK		(0x1f << MPI_L2PCFG_DEVNUM_SHIFT)
10888c2ecf20Sopenharmony_ci#define MPI_L2PCFG_CFG_USEREG_MASK	(1 << 30)
10898c2ecf20Sopenharmony_ci#define MPI_L2PCFG_CFG_SEL_MASK		(1 << 31)
10908c2ecf20Sopenharmony_ci
10918c2ecf20Sopenharmony_ci#define MPI_L2PMEMRANGE1_REG		0x120
10928c2ecf20Sopenharmony_ci#define MPI_L2PMEMBASE1_REG		0x124
10938c2ecf20Sopenharmony_ci#define MPI_L2PMEMREMAP1_REG		0x128
10948c2ecf20Sopenharmony_ci#define MPI_L2PMEMRANGE2_REG		0x12C
10958c2ecf20Sopenharmony_ci#define MPI_L2PMEMBASE2_REG		0x130
10968c2ecf20Sopenharmony_ci#define MPI_L2PMEMREMAP2_REG		0x134
10978c2ecf20Sopenharmony_ci#define MPI_L2PIORANGE_REG		0x138
10988c2ecf20Sopenharmony_ci#define MPI_L2PIOBASE_REG		0x13C
10998c2ecf20Sopenharmony_ci#define MPI_L2PIOREMAP_REG		0x140
11008c2ecf20Sopenharmony_ci#define MPI_L2P_BASE_MASK		(0xffff8000)
11018c2ecf20Sopenharmony_ci#define MPI_L2PREMAP_ENABLED_MASK	(1 << 0)
11028c2ecf20Sopenharmony_ci#define MPI_L2PREMAP_IS_CARDBUS_MASK	(1 << 2)
11038c2ecf20Sopenharmony_ci
11048c2ecf20Sopenharmony_ci#define MPI_PCIMODESEL_REG		0x144
11058c2ecf20Sopenharmony_ci#define MPI_PCIMODESEL_BAR1_NOSWAP_MASK (1 << 0)
11068c2ecf20Sopenharmony_ci#define MPI_PCIMODESEL_BAR2_NOSWAP_MASK (1 << 1)
11078c2ecf20Sopenharmony_ci#define MPI_PCIMODESEL_EXT_ARB_MASK	(1 << 2)
11088c2ecf20Sopenharmony_ci#define MPI_PCIMODESEL_PREFETCH_SHIFT	4
11098c2ecf20Sopenharmony_ci#define MPI_PCIMODESEL_PREFETCH_MASK	(0xf << MPI_PCIMODESEL_PREFETCH_SHIFT)
11108c2ecf20Sopenharmony_ci
11118c2ecf20Sopenharmony_ci#define MPI_LOCBUSCTL_REG		0x14C
11128c2ecf20Sopenharmony_ci#define MPI_LOCBUSCTL_EN_PCI_GPIO_MASK	(1 << 0)
11138c2ecf20Sopenharmony_ci#define MPI_LOCBUSCTL_U2P_NOSWAP_MASK	(1 << 1)
11148c2ecf20Sopenharmony_ci
11158c2ecf20Sopenharmony_ci#define MPI_LOCINT_REG			0x150
11168c2ecf20Sopenharmony_ci#define MPI_LOCINT_MASK(x)		(1 << (x + 16))
11178c2ecf20Sopenharmony_ci#define MPI_LOCINT_STAT(x)		(1 << (x))
11188c2ecf20Sopenharmony_ci#define MPI_LOCINT_DIR_FAILED		6
11198c2ecf20Sopenharmony_ci#define MPI_LOCINT_EXT_PCI_INT		7
11208c2ecf20Sopenharmony_ci#define MPI_LOCINT_SERR			8
11218c2ecf20Sopenharmony_ci#define MPI_LOCINT_CSERR		9
11228c2ecf20Sopenharmony_ci
11238c2ecf20Sopenharmony_ci#define MPI_PCICFGCTL_REG		0x178
11248c2ecf20Sopenharmony_ci#define MPI_PCICFGCTL_CFGADDR_SHIFT	2
11258c2ecf20Sopenharmony_ci#define MPI_PCICFGCTL_CFGADDR_MASK	(0x1f << MPI_PCICFGCTL_CFGADDR_SHIFT)
11268c2ecf20Sopenharmony_ci#define MPI_PCICFGCTL_WRITEEN_MASK	(1 << 7)
11278c2ecf20Sopenharmony_ci
11288c2ecf20Sopenharmony_ci#define MPI_PCICFGDATA_REG		0x17C
11298c2ecf20Sopenharmony_ci
11308c2ecf20Sopenharmony_ci/* PCI host bridge custom register */
11318c2ecf20Sopenharmony_ci#define BCMPCI_REG_TIMERS		0x40
11328c2ecf20Sopenharmony_ci#define REG_TIMER_TRDY_SHIFT		0
11338c2ecf20Sopenharmony_ci#define REG_TIMER_TRDY_MASK		(0xff << REG_TIMER_TRDY_SHIFT)
11348c2ecf20Sopenharmony_ci#define REG_TIMER_RETRY_SHIFT		8
11358c2ecf20Sopenharmony_ci#define REG_TIMER_RETRY_MASK		(0xff << REG_TIMER_RETRY_SHIFT)
11368c2ecf20Sopenharmony_ci
11378c2ecf20Sopenharmony_ci
11388c2ecf20Sopenharmony_ci/*************************************************************************
11398c2ecf20Sopenharmony_ci * _REG relative to RSET_PCMCIA
11408c2ecf20Sopenharmony_ci *************************************************************************/
11418c2ecf20Sopenharmony_ci
11428c2ecf20Sopenharmony_ci#define PCMCIA_C1_REG			0x0
11438c2ecf20Sopenharmony_ci#define PCMCIA_C1_CD1_MASK		(1 << 0)
11448c2ecf20Sopenharmony_ci#define PCMCIA_C1_CD2_MASK		(1 << 1)
11458c2ecf20Sopenharmony_ci#define PCMCIA_C1_VS1_MASK		(1 << 2)
11468c2ecf20Sopenharmony_ci#define PCMCIA_C1_VS2_MASK		(1 << 3)
11478c2ecf20Sopenharmony_ci#define PCMCIA_C1_VS1OE_MASK		(1 << 6)
11488c2ecf20Sopenharmony_ci#define PCMCIA_C1_VS2OE_MASK		(1 << 7)
11498c2ecf20Sopenharmony_ci#define PCMCIA_C1_CBIDSEL_SHIFT		(8)
11508c2ecf20Sopenharmony_ci#define PCMCIA_C1_CBIDSEL_MASK		(0x1f << PCMCIA_C1_CBIDSEL_SHIFT)
11518c2ecf20Sopenharmony_ci#define PCMCIA_C1_EN_PCMCIA_GPIO_MASK	(1 << 13)
11528c2ecf20Sopenharmony_ci#define PCMCIA_C1_EN_PCMCIA_MASK	(1 << 14)
11538c2ecf20Sopenharmony_ci#define PCMCIA_C1_EN_CARDBUS_MASK	(1 << 15)
11548c2ecf20Sopenharmony_ci#define PCMCIA_C1_RESET_MASK		(1 << 18)
11558c2ecf20Sopenharmony_ci
11568c2ecf20Sopenharmony_ci#define PCMCIA_C2_REG			0x8
11578c2ecf20Sopenharmony_ci#define PCMCIA_C2_DATA16_MASK		(1 << 0)
11588c2ecf20Sopenharmony_ci#define PCMCIA_C2_BYTESWAP_MASK		(1 << 1)
11598c2ecf20Sopenharmony_ci#define PCMCIA_C2_RWCOUNT_SHIFT		2
11608c2ecf20Sopenharmony_ci#define PCMCIA_C2_RWCOUNT_MASK		(0x3f << PCMCIA_C2_RWCOUNT_SHIFT)
11618c2ecf20Sopenharmony_ci#define PCMCIA_C2_INACTIVE_SHIFT	8
11628c2ecf20Sopenharmony_ci#define PCMCIA_C2_INACTIVE_MASK		(0x3f << PCMCIA_C2_INACTIVE_SHIFT)
11638c2ecf20Sopenharmony_ci#define PCMCIA_C2_SETUP_SHIFT		16
11648c2ecf20Sopenharmony_ci#define PCMCIA_C2_SETUP_MASK		(0x3f << PCMCIA_C2_SETUP_SHIFT)
11658c2ecf20Sopenharmony_ci#define PCMCIA_C2_HOLD_SHIFT		24
11668c2ecf20Sopenharmony_ci#define PCMCIA_C2_HOLD_MASK		(0x3f << PCMCIA_C2_HOLD_SHIFT)
11678c2ecf20Sopenharmony_ci
11688c2ecf20Sopenharmony_ci
11698c2ecf20Sopenharmony_ci/*************************************************************************
11708c2ecf20Sopenharmony_ci * _REG relative to RSET_SDRAM
11718c2ecf20Sopenharmony_ci *************************************************************************/
11728c2ecf20Sopenharmony_ci
11738c2ecf20Sopenharmony_ci#define SDRAM_CFG_REG			0x0
11748c2ecf20Sopenharmony_ci#define SDRAM_CFG_ROW_SHIFT		4
11758c2ecf20Sopenharmony_ci#define SDRAM_CFG_ROW_MASK		(0x3 << SDRAM_CFG_ROW_SHIFT)
11768c2ecf20Sopenharmony_ci#define SDRAM_CFG_COL_SHIFT		6
11778c2ecf20Sopenharmony_ci#define SDRAM_CFG_COL_MASK		(0x3 << SDRAM_CFG_COL_SHIFT)
11788c2ecf20Sopenharmony_ci#define SDRAM_CFG_32B_SHIFT		10
11798c2ecf20Sopenharmony_ci#define SDRAM_CFG_32B_MASK		(1 << SDRAM_CFG_32B_SHIFT)
11808c2ecf20Sopenharmony_ci#define SDRAM_CFG_BANK_SHIFT		13
11818c2ecf20Sopenharmony_ci#define SDRAM_CFG_BANK_MASK		(1 << SDRAM_CFG_BANK_SHIFT)
11828c2ecf20Sopenharmony_ci
11838c2ecf20Sopenharmony_ci#define SDRAM_MBASE_REG			0xc
11848c2ecf20Sopenharmony_ci
11858c2ecf20Sopenharmony_ci#define SDRAM_PRIO_REG			0x2C
11868c2ecf20Sopenharmony_ci#define SDRAM_PRIO_MIPS_SHIFT		29
11878c2ecf20Sopenharmony_ci#define SDRAM_PRIO_MIPS_MASK		(1 << SDRAM_PRIO_MIPS_SHIFT)
11888c2ecf20Sopenharmony_ci#define SDRAM_PRIO_ADSL_SHIFT		30
11898c2ecf20Sopenharmony_ci#define SDRAM_PRIO_ADSL_MASK		(1 << SDRAM_PRIO_ADSL_SHIFT)
11908c2ecf20Sopenharmony_ci#define SDRAM_PRIO_EN_SHIFT		31
11918c2ecf20Sopenharmony_ci#define SDRAM_PRIO_EN_MASK		(1 << SDRAM_PRIO_EN_SHIFT)
11928c2ecf20Sopenharmony_ci
11938c2ecf20Sopenharmony_ci
11948c2ecf20Sopenharmony_ci/*************************************************************************
11958c2ecf20Sopenharmony_ci * _REG relative to RSET_MEMC
11968c2ecf20Sopenharmony_ci *************************************************************************/
11978c2ecf20Sopenharmony_ci
11988c2ecf20Sopenharmony_ci#define MEMC_CFG_REG			0x4
11998c2ecf20Sopenharmony_ci#define MEMC_CFG_32B_SHIFT		1
12008c2ecf20Sopenharmony_ci#define MEMC_CFG_32B_MASK		(1 << MEMC_CFG_32B_SHIFT)
12018c2ecf20Sopenharmony_ci#define MEMC_CFG_COL_SHIFT		3
12028c2ecf20Sopenharmony_ci#define MEMC_CFG_COL_MASK		(0x3 << MEMC_CFG_COL_SHIFT)
12038c2ecf20Sopenharmony_ci#define MEMC_CFG_ROW_SHIFT		6
12048c2ecf20Sopenharmony_ci#define MEMC_CFG_ROW_MASK		(0x3 << MEMC_CFG_ROW_SHIFT)
12058c2ecf20Sopenharmony_ci
12068c2ecf20Sopenharmony_ci
12078c2ecf20Sopenharmony_ci/*************************************************************************
12088c2ecf20Sopenharmony_ci * _REG relative to RSET_DDR
12098c2ecf20Sopenharmony_ci *************************************************************************/
12108c2ecf20Sopenharmony_ci
12118c2ecf20Sopenharmony_ci#define DDR_CSEND_REG			0x8
12128c2ecf20Sopenharmony_ci
12138c2ecf20Sopenharmony_ci#define DDR_DMIPSPLLCFG_REG		0x18
12148c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_M1_SHIFT		0
12158c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_M1_MASK		(0xff << DMIPSPLLCFG_M1_SHIFT)
12168c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_N1_SHIFT		23
12178c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_N1_MASK		(0x3f << DMIPSPLLCFG_N1_SHIFT)
12188c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_N2_SHIFT		29
12198c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_N2_MASK		(0x7 << DMIPSPLLCFG_N2_SHIFT)
12208c2ecf20Sopenharmony_ci
12218c2ecf20Sopenharmony_ci#define DDR_DMIPSPLLCFG_6368_REG	0x20
12228c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_6368_P1_SHIFT	0
12238c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_6368_P1_MASK	(0xf << DMIPSPLLCFG_6368_P1_SHIFT)
12248c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_6368_P2_SHIFT	4
12258c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_6368_P2_MASK	(0xf << DMIPSPLLCFG_6368_P2_SHIFT)
12268c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_6368_NDIV_SHIFT	16
12278c2ecf20Sopenharmony_ci#define DMIPSPLLCFG_6368_NDIV_MASK	(0x1ff << DMIPSPLLCFG_6368_NDIV_SHIFT)
12288c2ecf20Sopenharmony_ci
12298c2ecf20Sopenharmony_ci#define DDR_DMIPSPLLDIV_6368_REG	0x24
12308c2ecf20Sopenharmony_ci#define DMIPSPLLDIV_6368_MDIV_SHIFT	0
12318c2ecf20Sopenharmony_ci#define DMIPSPLLDIV_6368_MDIV_MASK	(0xff << DMIPSPLLDIV_6368_MDIV_SHIFT)
12328c2ecf20Sopenharmony_ci
12338c2ecf20Sopenharmony_ci
12348c2ecf20Sopenharmony_ci/*************************************************************************
12358c2ecf20Sopenharmony_ci * _REG relative to RSET_M2M
12368c2ecf20Sopenharmony_ci *************************************************************************/
12378c2ecf20Sopenharmony_ci
12388c2ecf20Sopenharmony_ci#define M2M_RX				0
12398c2ecf20Sopenharmony_ci#define M2M_TX				1
12408c2ecf20Sopenharmony_ci
12418c2ecf20Sopenharmony_ci#define M2M_SRC_REG(x)			((x) * 0x40 + 0x00)
12428c2ecf20Sopenharmony_ci#define M2M_DST_REG(x)			((x) * 0x40 + 0x04)
12438c2ecf20Sopenharmony_ci#define M2M_SIZE_REG(x)			((x) * 0x40 + 0x08)
12448c2ecf20Sopenharmony_ci
12458c2ecf20Sopenharmony_ci#define M2M_CTRL_REG(x)			((x) * 0x40 + 0x0c)
12468c2ecf20Sopenharmony_ci#define M2M_CTRL_ENABLE_MASK		(1 << 0)
12478c2ecf20Sopenharmony_ci#define M2M_CTRL_IRQEN_MASK		(1 << 1)
12488c2ecf20Sopenharmony_ci#define M2M_CTRL_ERROR_CLR_MASK		(1 << 6)
12498c2ecf20Sopenharmony_ci#define M2M_CTRL_DONE_CLR_MASK		(1 << 7)
12508c2ecf20Sopenharmony_ci#define M2M_CTRL_NOINC_MASK		(1 << 8)
12518c2ecf20Sopenharmony_ci#define M2M_CTRL_PCMCIASWAP_MASK	(1 << 9)
12528c2ecf20Sopenharmony_ci#define M2M_CTRL_SWAPBYTE_MASK		(1 << 10)
12538c2ecf20Sopenharmony_ci#define M2M_CTRL_ENDIAN_MASK		(1 << 11)
12548c2ecf20Sopenharmony_ci
12558c2ecf20Sopenharmony_ci#define M2M_STAT_REG(x)			((x) * 0x40 + 0x10)
12568c2ecf20Sopenharmony_ci#define M2M_STAT_DONE			(1 << 0)
12578c2ecf20Sopenharmony_ci#define M2M_STAT_ERROR			(1 << 1)
12588c2ecf20Sopenharmony_ci
12598c2ecf20Sopenharmony_ci#define M2M_SRCID_REG(x)		((x) * 0x40 + 0x14)
12608c2ecf20Sopenharmony_ci#define M2M_DSTID_REG(x)		((x) * 0x40 + 0x18)
12618c2ecf20Sopenharmony_ci
12628c2ecf20Sopenharmony_ci/*************************************************************************
12638c2ecf20Sopenharmony_ci * _REG relative to RSET_SPI
12648c2ecf20Sopenharmony_ci *************************************************************************/
12658c2ecf20Sopenharmony_ci
12668c2ecf20Sopenharmony_ci/* BCM 6338/6348 SPI core */
12678c2ecf20Sopenharmony_ci#define SPI_6348_CMD			0x00	/* 16-bits register */
12688c2ecf20Sopenharmony_ci#define SPI_6348_INT_STATUS		0x02
12698c2ecf20Sopenharmony_ci#define SPI_6348_INT_MASK_ST		0x03
12708c2ecf20Sopenharmony_ci#define SPI_6348_INT_MASK		0x04
12718c2ecf20Sopenharmony_ci#define SPI_6348_ST			0x05
12728c2ecf20Sopenharmony_ci#define SPI_6348_CLK_CFG		0x06
12738c2ecf20Sopenharmony_ci#define SPI_6348_FILL_BYTE		0x07
12748c2ecf20Sopenharmony_ci#define SPI_6348_MSG_TAIL		0x09
12758c2ecf20Sopenharmony_ci#define SPI_6348_RX_TAIL		0x0b
12768c2ecf20Sopenharmony_ci#define SPI_6348_MSG_CTL		0x40	/* 8-bits register */
12778c2ecf20Sopenharmony_ci#define SPI_6348_MSG_CTL_WIDTH		8
12788c2ecf20Sopenharmony_ci#define SPI_6348_MSG_DATA		0x41
12798c2ecf20Sopenharmony_ci#define SPI_6348_MSG_DATA_SIZE		0x3f
12808c2ecf20Sopenharmony_ci#define SPI_6348_RX_DATA		0x80
12818c2ecf20Sopenharmony_ci#define SPI_6348_RX_DATA_SIZE		0x3f
12828c2ecf20Sopenharmony_ci
12838c2ecf20Sopenharmony_ci/* BCM 3368/6358/6262/6368 SPI core */
12848c2ecf20Sopenharmony_ci#define SPI_6358_MSG_CTL		0x00	/* 16-bits register */
12858c2ecf20Sopenharmony_ci#define SPI_6358_MSG_CTL_WIDTH		16
12868c2ecf20Sopenharmony_ci#define SPI_6358_MSG_DATA		0x02
12878c2ecf20Sopenharmony_ci#define SPI_6358_MSG_DATA_SIZE		0x21e
12888c2ecf20Sopenharmony_ci#define SPI_6358_RX_DATA		0x400
12898c2ecf20Sopenharmony_ci#define SPI_6358_RX_DATA_SIZE		0x220
12908c2ecf20Sopenharmony_ci#define SPI_6358_CMD			0x700	/* 16-bits register */
12918c2ecf20Sopenharmony_ci#define SPI_6358_INT_STATUS		0x702
12928c2ecf20Sopenharmony_ci#define SPI_6358_INT_MASK_ST		0x703
12938c2ecf20Sopenharmony_ci#define SPI_6358_INT_MASK		0x704
12948c2ecf20Sopenharmony_ci#define SPI_6358_ST			0x705
12958c2ecf20Sopenharmony_ci#define SPI_6358_CLK_CFG		0x706
12968c2ecf20Sopenharmony_ci#define SPI_6358_FILL_BYTE		0x707
12978c2ecf20Sopenharmony_ci#define SPI_6358_MSG_TAIL		0x709
12988c2ecf20Sopenharmony_ci#define SPI_6358_RX_TAIL		0x70B
12998c2ecf20Sopenharmony_ci
13008c2ecf20Sopenharmony_ci/* Shared SPI definitions */
13018c2ecf20Sopenharmony_ci
13028c2ecf20Sopenharmony_ci/* Message configuration */
13038c2ecf20Sopenharmony_ci#define SPI_FD_RW			0x00
13048c2ecf20Sopenharmony_ci#define SPI_HD_W			0x01
13058c2ecf20Sopenharmony_ci#define SPI_HD_R			0x02
13068c2ecf20Sopenharmony_ci#define SPI_BYTE_CNT_SHIFT		0
13078c2ecf20Sopenharmony_ci#define SPI_6348_MSG_TYPE_SHIFT		6
13088c2ecf20Sopenharmony_ci#define SPI_6358_MSG_TYPE_SHIFT		14
13098c2ecf20Sopenharmony_ci
13108c2ecf20Sopenharmony_ci/* Command */
13118c2ecf20Sopenharmony_ci#define SPI_CMD_NOOP			0x00
13128c2ecf20Sopenharmony_ci#define SPI_CMD_SOFT_RESET		0x01
13138c2ecf20Sopenharmony_ci#define SPI_CMD_HARD_RESET		0x02
13148c2ecf20Sopenharmony_ci#define SPI_CMD_START_IMMEDIATE		0x03
13158c2ecf20Sopenharmony_ci#define SPI_CMD_COMMAND_SHIFT		0
13168c2ecf20Sopenharmony_ci#define SPI_CMD_COMMAND_MASK		0x000f
13178c2ecf20Sopenharmony_ci#define SPI_CMD_DEVICE_ID_SHIFT		4
13188c2ecf20Sopenharmony_ci#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT	8
13198c2ecf20Sopenharmony_ci#define SPI_CMD_ONE_BYTE_SHIFT		11
13208c2ecf20Sopenharmony_ci#define SPI_CMD_ONE_WIRE_SHIFT		12
13218c2ecf20Sopenharmony_ci#define SPI_DEV_ID_0			0
13228c2ecf20Sopenharmony_ci#define SPI_DEV_ID_1			1
13238c2ecf20Sopenharmony_ci#define SPI_DEV_ID_2			2
13248c2ecf20Sopenharmony_ci#define SPI_DEV_ID_3			3
13258c2ecf20Sopenharmony_ci
13268c2ecf20Sopenharmony_ci/* Interrupt mask */
13278c2ecf20Sopenharmony_ci#define SPI_INTR_CMD_DONE		0x01
13288c2ecf20Sopenharmony_ci#define SPI_INTR_RX_OVERFLOW		0x02
13298c2ecf20Sopenharmony_ci#define SPI_INTR_TX_UNDERFLOW		0x04
13308c2ecf20Sopenharmony_ci#define SPI_INTR_TX_OVERFLOW		0x08
13318c2ecf20Sopenharmony_ci#define SPI_INTR_RX_UNDERFLOW		0x10
13328c2ecf20Sopenharmony_ci#define SPI_INTR_CLEAR_ALL		0x1f
13338c2ecf20Sopenharmony_ci
13348c2ecf20Sopenharmony_ci/* Status */
13358c2ecf20Sopenharmony_ci#define SPI_RX_EMPTY			0x02
13368c2ecf20Sopenharmony_ci#define SPI_CMD_BUSY			0x04
13378c2ecf20Sopenharmony_ci#define SPI_SERIAL_BUSY			0x08
13388c2ecf20Sopenharmony_ci
13398c2ecf20Sopenharmony_ci/* Clock configuration */
13408c2ecf20Sopenharmony_ci#define SPI_CLK_20MHZ			0x00
13418c2ecf20Sopenharmony_ci#define SPI_CLK_0_391MHZ		0x01
13428c2ecf20Sopenharmony_ci#define SPI_CLK_0_781MHZ		0x02 /* default */
13438c2ecf20Sopenharmony_ci#define SPI_CLK_1_563MHZ		0x03
13448c2ecf20Sopenharmony_ci#define SPI_CLK_3_125MHZ		0x04
13458c2ecf20Sopenharmony_ci#define SPI_CLK_6_250MHZ		0x05
13468c2ecf20Sopenharmony_ci#define SPI_CLK_12_50MHZ		0x06
13478c2ecf20Sopenharmony_ci#define SPI_CLK_MASK			0x07
13488c2ecf20Sopenharmony_ci#define SPI_SSOFFTIME_MASK		0x38
13498c2ecf20Sopenharmony_ci#define SPI_SSOFFTIME_SHIFT		3
13508c2ecf20Sopenharmony_ci#define SPI_BYTE_SWAP			0x80
13518c2ecf20Sopenharmony_ci
13528c2ecf20Sopenharmony_ci/*************************************************************************
13538c2ecf20Sopenharmony_ci * _REG relative to RSET_MISC
13548c2ecf20Sopenharmony_ci *************************************************************************/
13558c2ecf20Sopenharmony_ci#define MISC_SERDES_CTRL_6328_REG	0x0
13568c2ecf20Sopenharmony_ci#define MISC_SERDES_CTRL_6362_REG	0x4
13578c2ecf20Sopenharmony_ci#define SERDES_PCIE_EN			(1 << 0)
13588c2ecf20Sopenharmony_ci#define SERDES_PCIE_EXD_EN		(1 << 15)
13598c2ecf20Sopenharmony_ci
13608c2ecf20Sopenharmony_ci#define MISC_STRAPBUS_6362_REG		0x14
13618c2ecf20Sopenharmony_ci#define STRAPBUS_6362_FCVO_SHIFT	1
13628c2ecf20Sopenharmony_ci#define STRAPBUS_6362_HSSPI_CLK_FAST	(1 << 13)
13638c2ecf20Sopenharmony_ci#define STRAPBUS_6362_FCVO_MASK		(0x1f << STRAPBUS_6362_FCVO_SHIFT)
13648c2ecf20Sopenharmony_ci#define STRAPBUS_6362_BOOT_SEL_SERIAL	(1 << 15)
13658c2ecf20Sopenharmony_ci#define STRAPBUS_6362_BOOT_SEL_NAND	(0 << 15)
13668c2ecf20Sopenharmony_ci
13678c2ecf20Sopenharmony_ci#define MISC_STRAPBUS_6328_REG		0x240
13688c2ecf20Sopenharmony_ci#define STRAPBUS_6328_FCVO_SHIFT	7
13698c2ecf20Sopenharmony_ci#define STRAPBUS_6328_FCVO_MASK		(0x1f << STRAPBUS_6328_FCVO_SHIFT)
13708c2ecf20Sopenharmony_ci#define STRAPBUS_6328_BOOT_SEL_SERIAL	(1 << 18)
13718c2ecf20Sopenharmony_ci#define STRAPBUS_6328_BOOT_SEL_NAND	(0 << 18)
13728c2ecf20Sopenharmony_ci
13738c2ecf20Sopenharmony_ci/*************************************************************************
13748c2ecf20Sopenharmony_ci * _REG relative to RSET_PCIE
13758c2ecf20Sopenharmony_ci *************************************************************************/
13768c2ecf20Sopenharmony_ci
13778c2ecf20Sopenharmony_ci#define PCIE_CONFIG2_REG		0x408
13788c2ecf20Sopenharmony_ci#define CONFIG2_BAR1_SIZE_EN		1
13798c2ecf20Sopenharmony_ci#define CONFIG2_BAR1_SIZE_MASK		0xf
13808c2ecf20Sopenharmony_ci
13818c2ecf20Sopenharmony_ci#define PCIE_IDVAL3_REG			0x43c
13828c2ecf20Sopenharmony_ci#define IDVAL3_CLASS_CODE_MASK		0xffffff
13838c2ecf20Sopenharmony_ci#define IDVAL3_SUBCLASS_SHIFT		8
13848c2ecf20Sopenharmony_ci#define IDVAL3_CLASS_SHIFT		16
13858c2ecf20Sopenharmony_ci
13868c2ecf20Sopenharmony_ci#define PCIE_DLSTATUS_REG		0x1048
13878c2ecf20Sopenharmony_ci#define DLSTATUS_PHYLINKUP		(1 << 13)
13888c2ecf20Sopenharmony_ci
13898c2ecf20Sopenharmony_ci#define PCIE_BRIDGE_OPT1_REG		0x2820
13908c2ecf20Sopenharmony_ci#define OPT1_RD_BE_OPT_EN		(1 << 7)
13918c2ecf20Sopenharmony_ci#define OPT1_RD_REPLY_BE_FIX_EN		(1 << 9)
13928c2ecf20Sopenharmony_ci#define OPT1_PCIE_BRIDGE_HOLE_DET_EN	(1 << 11)
13938c2ecf20Sopenharmony_ci#define OPT1_L1_INT_STATUS_MASK_POL	(1 << 12)
13948c2ecf20Sopenharmony_ci
13958c2ecf20Sopenharmony_ci#define PCIE_BRIDGE_OPT2_REG		0x2824
13968c2ecf20Sopenharmony_ci#define OPT2_UBUS_UR_DECODE_DIS		(1 << 2)
13978c2ecf20Sopenharmony_ci#define OPT2_TX_CREDIT_CHK_EN		(1 << 4)
13988c2ecf20Sopenharmony_ci#define OPT2_CFG_TYPE1_BD_SEL		(1 << 7)
13998c2ecf20Sopenharmony_ci#define OPT2_CFG_TYPE1_BUS_NO_SHIFT	16
14008c2ecf20Sopenharmony_ci#define OPT2_CFG_TYPE1_BUS_NO_MASK	(0xff << OPT2_CFG_TYPE1_BUS_NO_SHIFT)
14018c2ecf20Sopenharmony_ci
14028c2ecf20Sopenharmony_ci#define PCIE_BRIDGE_BAR0_BASEMASK_REG	0x2828
14038c2ecf20Sopenharmony_ci#define PCIE_BRIDGE_BAR1_BASEMASK_REG	0x2830
14048c2ecf20Sopenharmony_ci#define BASEMASK_REMAP_EN		(1 << 0)
14058c2ecf20Sopenharmony_ci#define BASEMASK_SWAP_EN		(1 << 1)
14068c2ecf20Sopenharmony_ci#define BASEMASK_MASK_SHIFT		4
14078c2ecf20Sopenharmony_ci#define BASEMASK_MASK_MASK		(0xfff << BASEMASK_MASK_SHIFT)
14088c2ecf20Sopenharmony_ci#define BASEMASK_BASE_SHIFT		20
14098c2ecf20Sopenharmony_ci#define BASEMASK_BASE_MASK		(0xfff << BASEMASK_BASE_SHIFT)
14108c2ecf20Sopenharmony_ci
14118c2ecf20Sopenharmony_ci#define PCIE_BRIDGE_BAR0_REBASE_ADDR_REG 0x282c
14128c2ecf20Sopenharmony_ci#define PCIE_BRIDGE_BAR1_REBASE_ADDR_REG 0x2834
14138c2ecf20Sopenharmony_ci#define REBASE_ADDR_BASE_SHIFT		20
14148c2ecf20Sopenharmony_ci#define REBASE_ADDR_BASE_MASK		(0xfff << REBASE_ADDR_BASE_SHIFT)
14158c2ecf20Sopenharmony_ci
14168c2ecf20Sopenharmony_ci#define PCIE_BRIDGE_RC_INT_MASK_REG	0x2854
14178c2ecf20Sopenharmony_ci#define PCIE_RC_INT_A			(1 << 0)
14188c2ecf20Sopenharmony_ci#define PCIE_RC_INT_B			(1 << 1)
14198c2ecf20Sopenharmony_ci#define PCIE_RC_INT_C			(1 << 2)
14208c2ecf20Sopenharmony_ci#define PCIE_RC_INT_D			(1 << 3)
14218c2ecf20Sopenharmony_ci
14228c2ecf20Sopenharmony_ci#define PCIE_DEVICE_OFFSET		0x8000
14238c2ecf20Sopenharmony_ci
14248c2ecf20Sopenharmony_ci/*************************************************************************
14258c2ecf20Sopenharmony_ci * _REG relative to RSET_OTP
14268c2ecf20Sopenharmony_ci *************************************************************************/
14278c2ecf20Sopenharmony_ci
14288c2ecf20Sopenharmony_ci#define OTP_USER_BITS_6328_REG(i)	(0x20 + (i) * 4)
14298c2ecf20Sopenharmony_ci#define   OTP_6328_REG3_TP1_DISABLED	BIT(9)
14308c2ecf20Sopenharmony_ci
14318c2ecf20Sopenharmony_ci#endif /* BCM63XX_REGS_H_ */
1432