本文整理汇总了C++中setup_iomux_enet函数的典型用法代码示例。如果您正苦于以下问题:C++ setup_iomux_enet函数的具体用法?C++ setup_iomux_enet怎么用?C++ setup_iomux_enet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setup_iomux_enet函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: board_eth_init
int board_eth_init(bd_t *bis)
{
setup_iomux_enet();
enable_enet_clk(1);
return cpu_eth_init(bis);
}
开发者ID:Digilent,项目名称:u-boot-digilent,代码行数:7,代码来源:el6x.c
示例2: board_early_init_f
int board_early_init_f(void)
{
setup_iomux_uart();
setup_iomux_enet();
return 0;
}
开发者ID:gitter-badger,项目名称:ARRR,代码行数:7,代码来源:mx6qarm2.c
示例3: board_eth_init
int board_eth_init(bd_t *bis)
{
setup_iomux_enet();
setup_pcie();
return cpu_eth_init(bis);
}
开发者ID:stevezilla,项目名称:u-boot-amherst-jethro,代码行数:7,代码来源:mx6qamherstsd.c
示例4: board_eth_init
int board_eth_init(bd_t *bis)
{
uint32_t base = IMX_FEC_BASE;
struct mii_dev *bus = NULL;
struct phy_device *phydev = NULL;
int ret;
setup_iomux_enet();
bus = fec_get_miibus(base, -1);
if (!bus)
return 0;
/* scan phy 0 and 5 */
phydev = phy_find_by_mask(bus, 0x21, PHY_INTERFACE_MODE_RGMII);
if (!phydev) {
free(bus);
return 0;
}
/* depending on the phy address we can detect our board version */
if (phydev->addr == 0)
setenv("boardver", "");
else
setenv("boardver", "mr");
printf("using phy at %d\n", phydev->addr);
ret = fec_probe(bis, -1, base, bus, phydev);
if (ret) {
printf("FEC MXC: %s:failed\n", __func__);
free(phydev);
free(bus);
}
return 0;
}
开发者ID:allanmatthew,项目名称:imx6rex_tiny_uboot_v2014_10,代码行数:35,代码来源:ot1200.c
示例5: board_eth_init
int board_eth_init(bd_t *bis)
{
#ifdef CONFIG_FEC_MXC
struct ventana_board_info *info = &ventana_info;
if (test_bit(EECONFIG_ETH0, info->config)) {
setup_iomux_enet(GP_PHY_RST);
cpu_eth_init(bis);
}
#endif
#ifdef CONFIG_E1000
e1000_initialize(bis);
#endif
#ifdef CONFIG_CI_UDC
/* For otg ethernet*/
usb_eth_initialize(bis);
#endif
/* default to the first detected enet dev */
if (!env_get("ethprime")) {
struct eth_device *dev = eth_get_dev_by_index(0);
if (dev) {
env_set("ethprime", dev->name);
printf("set ethprime to %s\n", env_get("ethprime"));
}
}
return 0;
}
开发者ID:Noltari,项目名称:u-boot,代码行数:31,代码来源:gw_ventana.c
示例6: board_eth_init
int board_eth_init(bd_t *bis)
{
uint32_t base = IMX_FEC_BASE;
struct mii_dev *bus = NULL;
struct phy_device *phydev = NULL;
int ret;
setup_iomux_enet();
#ifdef CONFIG_FEC_MXC
bus = fec_get_miibus(base, -1);
if (!bus)
return 0;
/* scan phy 4,5,6,7 */
phydev = phy_find_by_mask(bus, (0xf << 4), PHY_INTERFACE_MODE_RGMII);
if (!phydev) {
free(bus);
return 0;
}
printf("using phy at %d\n", phydev->addr);
ret = fec_probe(bis, -1, base, bus, phydev);
if (ret) {
printf("FEC MXC: %s:failed\n", __func__);
free(phydev);
free(bus);
}
#endif
return 0;
}
开发者ID:MJmichael,项目名称:u-boot-tiny210,代码行数:29,代码来源:mx6qsabrelite.c
示例7: board_early_init_f
int board_early_init_f(void)
{
clock_init();
mscm_init();
setup_iomux_uart();
setup_iomux_enet();
setup_iomux_i2c();
return 0;
}
开发者ID:AhmadQasim,项目名称:GPU-Virtualization,代码行数:11,代码来源:vf610twr.c
示例8: board_eth_init
int board_eth_init(bd_t *bis)
{
int ret;
setup_iomux_enet();
ret = cpu_eth_init(bis);
if (ret)
printf("FEC MXC: %s:failed\n", __func__);
return 0;
}
开发者ID:abrasive,项目名称:gk802-uboot,代码行数:12,代码来源:vline6x.c
示例9: setup_fec
static void setup_fec(void)
{
if (is_mx6dqp()) {
/*
* select ENET MAC0 TX clock from PLL
*/
imx_iomux_set_gpr_register(5, 9, 1, 1);
enable_fec_anatop_clock(0, ENET_125MHZ);
}
setup_iomux_enet();
}
开发者ID:analogdevicesinc,项目名称:u-boot-xlnx,代码行数:12,代码来源:mx6sabreauto.c
示例10: board_eth_init
int board_eth_init(bd_t *bis)
{
struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
int ret = enable_fec_anatop_clock(ENET_25MHZ);
if (ret)
return ret;
/* set gpr1[ENET_CLK_SEL] */
setbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_ENET_CLK_SEL_MASK);
setup_iomux_enet();
return cpu_eth_init(bis);
}
开发者ID:bigzz,项目名称:uboot,代码行数:15,代码来源:mx6cuboxi.c
示例11: board_eth_init
int board_eth_init(bd_t *bis)
{
struct iomuxc *iomuxc_regs =
(struct iomuxc *)IOMUXC_BASE_ADDR;
int ret;
/* clear gpr1[14], gpr1[18:17] to select anatop clock */
clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC_MASK, 0);
ret = enable_fec_anatop_clock(0, ENET_50MHZ);
if (ret)
return ret;
setup_iomux_enet();
return cpu_eth_init(bis);
}
开发者ID:Digilent,项目名称:u-boot-digilent,代码行数:16,代码来源:aristainetos-v1.c
示例12: board_eth_init
int board_eth_init(bd_t *bis)
{
struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
struct mii_dev *bus;
struct phy_device *phydev;
int ret = enable_fec_anatop_clock(0, ENET_25MHZ);
if (ret)
return ret;
/* set gpr1[ENET_CLK_SEL] */
setbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_ENET_CLK_SEL_MASK);
setup_iomux_enet();
bus = fec_get_miibus(IMX_FEC_BASE, -1);
if (!bus)
return -EINVAL;
phydev = phy_find_by_mask(bus, ETH_PHY_MASK, PHY_INTERFACE_MODE_RGMII);
if (!phydev) {
ret = -EINVAL;
goto free_bus;
}
debug("using phy at address %d\n", phydev->addr);
ret = fec_probe(bis, -1, IMX_FEC_BASE, bus, phydev);
if (ret)
goto free_phydev;
return 0;
free_phydev:
free(phydev);
free_bus:
free(bus);
return ret;
}
开发者ID:axxia,项目名称:axxia_u-boot,代码行数:38,代码来源:mx6cuboxi.c
示例13: board_init_f
void board_init_f(ulong dummy)
{
/* setup AIPS and disable watchdog */
arch_cpu_init();
ccgr_init();
gpr_init();
/* setup GP timer */
timer_init();
setup_iomux_boardid();
setup_iomux_gpio();
setup_iomux_enet();
setup_iomux_sd();
setup_iomux_spi();
setup_iomux_uart();
setup_iomux_usb();
/* UART clocks enabled and gd valid - init serial console */
preloader_console_init();
/* Start the DDR DRAM */
if (is_mx6dq())
mx6dq_dram_iocfg(dhcom_mem_ddr.width, &dhcom6dq_ddr_ioregs,
&dhcom6dq_grp_ioregs);
else
mx6sdl_dram_iocfg(dhcom_mem_ddr.width, &dhcom6sdl_ddr_ioregs,
&dhcom6sdl_grp_ioregs);
mx6_dram_cfg(&dhcom_ddr_info, &dhcom_mmdc_calib, &dhcom_mem_ddr);
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
/* load/boot image from boot device */
board_init_r(NULL, 0);
}
开发者ID:axxia,项目名称:axxia_u-boot,代码行数:37,代码来源:dh_imx6_spl.c
示例14: board_eth_init
int board_eth_init(bd_t *bis)
{
uint32_t base = IMX_FEC_BASE;
struct mii_dev *bus = NULL;
struct phy_device *phydev = NULL;
int ret;
setup_iomux_enet();
#ifdef CONFIG_FEC_MXC
bus = fec_get_miibus(base, -1);
if (!bus)
return -EINVAL;
/* scan phy 4,5,6,7 */
phydev = phy_find_by_mask(bus, (0xf << 4), PHY_INTERFACE_MODE_RGMII);
if (!phydev) {
ret = -EINVAL;
goto free_bus;
}
printf("using phy at %d\n", phydev->addr);
ret = fec_probe(bis, -1, base, bus, phydev);
if (ret)
goto free_phydev;
#endif
#ifdef CONFIG_CI_UDC
/* For otg ethernet*/
usb_eth_initialize(bis);
#endif
return 0;
free_phydev:
free(phydev);
free_bus:
free(bus);
return ret;
}
开发者ID:01hyang,项目名称:u-boot,代码行数:37,代码来源:nitrogen6x.c
示例15: ethif_plat_init
struct eth_driver*
ethif_plat_init(int dev_id, struct ethif_os_interface interface) {
struct enet * enet;
struct ocotp * ocotp;
struct clock* arm_clk;
struct imx6_eth_data *eth_data;
struct ldesc* ldesc;
(void)dev_id;
os_iface_init(interface);
eth_data = (struct imx6_eth_data*)os_malloc(sizeof(struct imx6_eth_data));
if (eth_data == NULL) {
cprintf(COL_IMP, "Failed to allocate dma buffers\n");
return NULL;
}
ldesc = ldesc_init(RX_DESC_COUNT, RXBUF_SIZE, TX_DESC_COUNT, TXBUF_SIZE);
assert(ldesc);
/*
* We scale up the CPU to improve benchmarking performance
* It is not the right place so should be moved later
*/
arm_clk = clk_get_clock(CLK_ARM);
clk_set_freq(arm_clk, CPU_FREQ);
CLK_DEBUG(printf("ARM clock frequency: %9d HZ\n", clk_get_freq(arm_clk)));
/* initialise the eFuse controller so we can get a MAC address */
ocotp = ocotp_init();
/* Initialise ethernet pins */
gpio_init();
setup_iomux_enet();
/* Initialise the phy library */
miiphy_init();
/* Initialise the phy */
phy_micrel_init();
/* Initialise the RGMII interface */
enet = enet_init(ldesc);
assert(enet);
/* Fetch and set the MAC address */
if(ocotp == NULL || ocotp_get_mac(ocotp, eth_data->ethaddr)){
memcpy(eth_data->ethaddr, DEFAULT_MAC, 6);
}
enet_set_mac(enet, eth_data->ethaddr);
/* Connect the phy to the ethernet controller */
if(fec_init(CONFIG_FEC_MXC_PHYMASK, enet)){
return NULL;
}
/* Start the controller */
enet_enable(enet);
/* Update book keeping */
eth_data->irq_enabled = 0;
eth_data->enet = enet;
eth_data->ldesc = ldesc;
eth_driver_set_data(&imx6_eth_driver, eth_data);
/* done */
return &imx6_eth_driver;
}
开发者ID:ahixon,项目名称:papaya,代码行数:63,代码来源:ethif_board_init.c
示例16: dram_init
int dram_init(void)
{
struct ddrmc_lvl_info lvl = {
.wrlvl_reg_en = 1,
.wrlvl_dl_0 = 0,
.wrlvl_dl_1 = 0,
.rdlvl_gt_reg_en = 1,
.rdlvl_gt_dl_0 = 4,
.rdlvl_gt_dl_1 = 4,
.rdlvl_reg_en = 1,
.rdlvl_dl_0 = 0,
.rdlvl_dl_1 = 0,
};
static const struct ddr3_jedec_timings timings = {
.tinit = 5,
.trst_pwron = 80000,
.cke_inactive = 200000,
.wrlat = 5,
.caslat_lin = 12,
.trc = 21,
.trrd = 4,
.tccd = 4,
.tfaw = 20,
.trp = 6,
.twtr = 4,
.tras_min = 15,
.tmrd = 4,
.trtp = 4,
.tras_max = 28080,
.tmod = 12,
.tckesr = 4,
.tcke = 3,
.trcd_int = 6,
.tdal = 12,
.tdll = 512,
.trp_ab = 6,
.tref = 3120,
.trfc = 44,
.tpdex = 3,
.txpdll = 10,
.txsnr = 48,
.txsr = 468,
.cksrx = 5,
.cksre = 5,
.zqcl = 256,
.zqinit = 512,
.zqcs = 64,
.ref_per_zq = 64,
.aprebit = 10,
.wlmrd = 40,
.wldqsen = 25,
};
ddrmc_setup_iomux();
ddrmc_ctrl_init_ddr3(&timings, &lvl, 1, 3);
gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
return 0;
}
static void setup_iomux_uart(void)
{
static const iomux_v3_cfg_t uart1_pads[] = {
NEW_PAD_CTRL(VF610_PAD_PTB4__UART1_TX, UART_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTB5__UART1_RX, UART_PAD_CTRL),
};
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
}
static void setup_iomux_enet(void)
{
static const iomux_v3_cfg_t enet0_pads[] = {
NEW_PAD_CTRL(VF610_PAD_PTA6__RMII0_CLKIN, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC1__RMII0_MDIO, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC0__RMII0_MDC, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC2__RMII0_CRS_DV, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC3__RMII0_RD1, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC4__RMII0_RD0, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC5__RMII0_RXER, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC6__RMII0_TD1, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC7__RMII0_TD0, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC8__RMII0_TXEN, ENET_PAD_CTRL),
};
imx_iomux_v3_setup_multiple_pads(enet0_pads, ARRAY_SIZE(enet0_pads));
}
static void setup_iomux_i2c(void)
{
static const iomux_v3_cfg_t i2c0_pads[] = {
VF610_PAD_PTB14__I2C0_SCL,
VF610_PAD_PTB15__I2C0_SDA,
};
imx_iomux_v3_setup_multiple_pads(i2c0_pads, ARRAY_SIZE(i2c0_pads));
}
//.........这里部分代码省略.........
开发者ID:CZ-NIC,项目名称:u-boot-turris,代码行数:101,代码来源:vf610twr.c
示例17: dram_init
//.........这里部分代码省略.........
PCM052_VF610_PAD_DDR_DQS0__DDR_DQS_0,
PCM052_VF610_PAD_DDR_RAS__DDR_RAS_B,
PCM052_VF610_PAD_DDR_WE__DDR_WE_B,
PCM052_VF610_PAD_DDR_ODT1__DDR_ODT_0,
PCM052_VF610_PAD_DDR_ODT0__DDR_ODT_1,
PCM052_VF610_PAD_DDR_DDRBYTE1__DDR_DDRBYTE1,
PCM052_VF610_PAD_DDR_DDRBYTE0__DDR_DDRBYTE0,
PCM052_VF610_PAD_DDR_RESETB,
};
imx_iomux_v3_setup_multiple_pads(pcm052_pads, ARRAY_SIZE(pcm052_pads));
ddrmc_ctrl_init_ddr3(&pcm052_ddr_timings, pcm052_cr_settings,
pcm052_phy_settings, 1, 2);
gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
return 0;
}
static void setup_iomux_uart(void)
{
static const iomux_v3_cfg_t uart1_pads[] = {
NEW_PAD_CTRL(VF610_PAD_PTB4__UART1_TX, VF610_UART_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTB5__UART1_RX, VF610_UART_PAD_CTRL),
};
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
}
#define ENET_PAD_CTRL (PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_HIGH | \
PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE)
static void setup_iomux_enet(void)
{
static const iomux_v3_cfg_t enet0_pads[] = {
NEW_PAD_CTRL(VF610_PAD_PTA6__RMII0_CLKIN, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC1__RMII0_MDIO, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC0__RMII0_MDC, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC2__RMII0_CRS_DV, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC3__RMII0_RD1, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC4__RMII0_RD0, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC5__RMII0_RXER, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC6__RMII0_TD1, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC7__RMII0_TD0, ENET_PAD_CTRL),
NEW_PAD_CTRL(VF610_PAD_PTC8__RMII0_TXEN, ENET_PAD_CTRL),
};
imx_iomux_v3_setup_multiple_pads(enet0_pads, ARRAY_SIZE(enet0_pads));
}
/*
* I2C2 is the only I2C used, on pads PTA22/PTA23.
*/
static void setup_iomux_i2c(void)
{
static const iomux_v3_cfg_t i2c_pads[] = {
VF610_PAD_PTA22__I2C2_SCL,
VF610_PAD_PTA23__I2C2_SDA,
};
imx_iomux_v3_setup_multiple_pads(i2c_pads, ARRAY_SIZE(i2c_pads));
}
#ifdef CONFIG_NAND_VF610_NFC
开发者ID:01hyang,项目名称:u-boot,代码行数:67,代码来源:pcm052.c
注:本文中的setup_iomux_enet函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论