2 * Copyright 2009-2011 Freescale Semiconductor, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #include <asm/types.h>
25 #include <asm/fsl_enet.h>
56 #define CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xe1120)
57 #define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xf1000)
59 #define DEFAULT_FM_MDIO_NAME "FSL_MDIO0"
60 #define DEFAULT_FM_TGEC_MDIO_NAME "FM_TGEC_MDIO"
62 /* Fman ethernet info struct */
63 #define FM_ETH_INFO_INITIALIZER(idx, pregs) \
65 .phy_regs = (void *)pregs, \
66 .enet_if = PHY_INTERFACE_MODE_NONE, \
68 #define FM_DTSEC_INFO_INITIALIZER(idx, n) \
70 FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR) \
73 .type = FM_ETH_1G_E, \
74 .port = FM##idx##_DTSEC##n, \
75 .rx_port_id = RX_PORT_1G_BASE + n - 1, \
76 .tx_port_id = TX_PORT_1G_BASE + n - 1, \
77 .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \
78 offsetof(struct ccsr_fman, mac_1g[n-1]),\
81 #define FM_TGEC_INFO_INITIALIZER(idx, n) \
83 FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM1_TGEC_MDIO_ADDR) \
86 .type = FM_ETH_10G_E, \
87 .port = FM##idx##_10GEC##n, \
88 .rx_port_id = RX_PORT_10G_BASE + n - 1, \
89 .tx_port_id = TX_PORT_10G_BASE + n - 1, \
90 .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \
91 offsetof(struct ccsr_fman, mac_10g[n-1]),\
103 enum fm_eth_type type;
105 phy_interface_t enet_if;
110 struct tgec_mdio_info {
111 struct tgec_mdio_controller *regs;
115 int fm_tgec_mdio_init(bd_t *bis, struct tgec_mdio_info *info);
116 int fm_standard_init(bd_t *bis);
117 void fman_enet_init(void);
118 void fdt_fixup_fman_ethernet(void *fdt);
119 phy_interface_t fm_info_get_enet_if(enum fm_port port);
120 void fm_info_set_phy_address(enum fm_port port, int address);
121 int fm_info_get_phy_address(enum fm_port port);
122 void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus);
123 void fm_disable_port(enum fm_port port);