|
110 | 110 | #define ETH_XLNX_GEM_CKSUM_NOT_TCP_OR_UDP_ERROR 0x00000006
|
111 | 111 | #define ETH_XLNX_GEM_CKSUM_PREMATURE_END_ERROR 0x00000007
|
112 | 112 |
|
| 113 | +#if defined(CONFIG_SOC_SERIES_XILINX_ZYNQ7000) |
113 | 114 | /*
|
114 |
| - * TX clock configuration: comp. |
| 115 | + * Zynq-7000 TX clock configuration: |
| 116 | + * |
| 117 | + * SLCR unlock & lock registers, magic words: |
| 118 | + * comp. Zynq-7000 TRM, chapter B.28, registers SLCR_LOCK and SLCR_UNLOCK, |
| 119 | + * p. 1576f. |
| 120 | + * |
| 121 | + * GEMx_CLK_CTRL (SLCR) registers: |
| 122 | + * [25 .. 20] Reference clock divisor 1 |
| 123 | + * [13 .. 08] Reference clock divisor 0 |
| 124 | + * [00] Clock active bit |
| 125 | + */ |
| 126 | +#define ETH_XLNX_SLCR_LOCK_REGISTER_ADDRESS 0xF8000004 |
| 127 | +#define ETH_XLNX_SLCR_UNLOCK_REGISTER_ADDRESS 0xF8000008 |
| 128 | +#define ETH_XLNX_SLCR_LOCK_KEY 0x767B |
| 129 | +#define ETH_XLNX_SLCR_UNLOCK_KEY 0xDF0D |
| 130 | +#define ETH_XLNX_SLCR_GEMX_CLK_CTRL_DIVISOR_MASK 0x0000003F |
| 131 | +#define ETH_XLNX_SLCR_GEMX_CLK_CTRL_DIVISOR1_SHIFT 20 |
| 132 | +#define ETH_XLNX_SLCR_GEMX_CLK_CTRL_DIVISOR0_SHIFT 8 |
| 133 | +#define ETH_XLNX_CRL_APB_GEMX_REF_CTRL_CLKACT_BIT 0x02000000 |
| 134 | +#elif defined(CONFIG_SOC_XILINX_ZYNQMP) |
| 135 | +/* |
| 136 | + * UltraScale TX clock configuration: comp. |
115 | 137 | * https://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascale-registers.html
|
116 | 138 | *
|
117 | 139 | * CRL_WPROT (CRL_APB) register:
|
|
130 | 152 | #define ETH_XLNX_CRL_APB_GEMX_REF_CTRL_DIVISOR0_SHIFT 8
|
131 | 153 | #define ETH_XLNX_CRL_APB_GEMX_REF_CTRL_RX_CLKACT_BIT 0x04000000
|
132 | 154 | #define ETH_XLNX_CRL_APB_GEMX_REF_CTRL_CLKACT_BIT 0x02000000
|
| 155 | +#endif /* CONFIG_SOC_SERIES_XILINX_ZYNQ7000 || CONFIG_SOC_XILINX_ZYNQMP */ |
133 | 156 |
|
134 | 157 | /*
|
135 | 158 | * Register offsets within the respective GEM's address space:
|
@@ -495,9 +518,15 @@ struct eth_xlnx_dma_area_gem##port {\
|
495 | 518 | };
|
496 | 519 |
|
497 | 520 | /* DMA memory area instantiation macro */
|
| 521 | +#ifdef CONFIG_SOC_SERIES_XILINX_ZYNQ7000 |
| 522 | +#define ETH_XLNX_GEM_DMA_AREA_INST(port) \ |
| 523 | +static struct eth_xlnx_dma_area_gem##port eth_xlnx_gem##port##_dma_area\ |
| 524 | + __ocm_bss_section __aligned(4096); |
| 525 | +#else |
498 | 526 | #define ETH_XLNX_GEM_DMA_AREA_INST(port) \
|
499 |
| -static struct eth_xlnx_dma_area_gem##port eth_xlnx_gem##port##_dma_area \ |
| 527 | +static struct eth_xlnx_dma_area_gem##port eth_xlnx_gem##port##_dma_area\ |
500 | 528 | __aligned(4096);
|
| 529 | +#endif |
501 | 530 |
|
502 | 531 | /* Interrupt configuration function macro */
|
503 | 532 | #define ETH_XLNX_GEM_CONFIG_IRQ_FUNC(port) \
|
@@ -564,16 +593,23 @@ enum eth_xlnx_amba_dbus_width {
|
564 | 593 | * @brief MDC clock divider configuration enumeration type.
|
565 | 594 | *
|
566 | 595 | * Enumeration type containing the supported clock divider values
|
567 |
| - * used to generate the MDIO interface clock (MDC) from the ZynqMP's |
568 |
| - * LPD LSBUS clock. This is a configuration item in the controller's |
569 |
| - * net_cfg register. |
| 596 | + * used to generate the MDIO interface clock (MDC) from either the |
| 597 | + * cpu_1x clock (Zynq-7000) or the LPD LSBUS clock (UltraScale). |
| 598 | + * This is a configuration item in the controller's net_cfg register. |
570 | 599 | */
|
571 | 600 | enum eth_xlnx_mdc_clock_divider {
|
572 | 601 | /* The values of this enum are consecutively numbered */
|
573 | 602 | MDC_DIVIDER_8 = 0,
|
574 | 603 | MDC_DIVIDER_16,
|
575 | 604 | MDC_DIVIDER_32,
|
576 |
| - MDC_DIVIDER_48 |
| 605 | + MDC_DIVIDER_48, |
| 606 | +#ifdef CONFIG_SOC_SERIES_XILINX_ZYNQ7000 |
| 607 | + /* Dividers > 48 are only available in the Zynq-7000 */ |
| 608 | + MDC_DIVIDER_64, |
| 609 | + MDC_DIVIDER_96, |
| 610 | + MDC_DIVIDER_128, |
| 611 | + MDC_DIVIDER_224 |
| 612 | +#endif |
577 | 613 | };
|
578 | 614 |
|
579 | 615 | /**
|
|
0 commit comments