MCPcopy Create free account
hub / github.com/F-Stack/f-stack / decode_win_eth_setup

Function decode_win_eth_setup

freebsd/arm/mv/mv_common.c:1666–1711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1664#define MV_WIN_ETH_DDR_TRGT(n) ddr_target(n)
1665
1666static void
1667decode_win_eth_setup(u_long base)
1668{
1669 uint32_t br, sz;
1670 int i, j;
1671
1672 if (pm_is_disabled(CPU_PM_CTRL_GE(eth_port)))
1673 return;
1674
1675 eth_port++;
1676
1677 /* Disable, clear and revoke protection for all ETH windows */
1678 for (i = 0; i < MV_WIN_ETH_MAX; i++) {
1679 eth_bare_write(base, i, 1);
1680 eth_epap_write(base, i, 0);
1681 win_eth_br_write(base, i, 0);
1682 win_eth_sz_write(base, i, 0);
1683 if (win_eth_can_remap(i))
1684 win_eth_har_write(base, i, 0);
1685 }
1686
1687 /* Only access to active DRAM banks is required */
1688 for (i = 0; i < MV_WIN_DDR_MAX; i++)
1689 if (ddr_is_active(i)) {
1690 br = ddr_base(i) | (ddr_attr(i) << 8) | MV_WIN_ETH_DDR_TRGT(i);
1691 sz = ((ddr_size(i) - 1) & 0xffff0000);
1692
1693 /* Set the first free ETH window */
1694 for (j = 0; j < MV_WIN_ETH_MAX; j++) {
1695 if (eth_bare_read(base, j) == 0)
1696 continue;
1697
1698 win_eth_br_write(base, j, br);
1699 win_eth_sz_write(base, j, sz);
1700
1701 /* XXX remapping ETH windows not supported */
1702
1703 /* Set protection RW */
1704 eth_epap_write(base, j, 0x3);
1705
1706 /* Enable window */
1707 eth_bare_write(base, j, 0);
1708 break;
1709 }
1710 }
1711}
1712
1713static void
1714decode_win_neta_dump(u_long base)

Callers 1

decode_win_neta_setupFunction · 0.85

Calls 9

pm_is_disabledFunction · 0.85
eth_bare_writeFunction · 0.85
eth_epap_writeFunction · 0.85
win_eth_can_remapFunction · 0.85
ddr_is_activeFunction · 0.85
ddr_baseFunction · 0.85
ddr_attrFunction · 0.85
ddr_sizeFunction · 0.85
eth_bare_readFunction · 0.85

Tested by

no test coverage detected