コード例 #1
0
ファイル: ethoc.c プロジェクト: ARMWorks/FA_2451_Linux_Kernel
static int ethoc_reset(struct ethoc *dev)
{
	u32 mode;

	/* TODO: reset controller? */

	ethoc_disable_rx_and_tx(dev);

	/* TODO: setup registers */

	/* enable FCS generation and automatic padding */
	mode = ethoc_read(dev, MODER);
	mode |= MODER_CRC | MODER_PAD;
	ethoc_write(dev, MODER, mode);

	/* set full-duplex mode */
	mode = ethoc_read(dev, MODER);
	mode |= MODER_FULLD;
	ethoc_write(dev, MODER, mode);
	ethoc_write(dev, IPGT, 0x15);

	ethoc_ack_irq(dev, INT_MASK_ALL);
	ethoc_enable_irq(dev, INT_MASK_ALL);
	ethoc_enable_rx_and_tx(dev);
	return 0;
}
コード例 #2
0
static int ethoc_reset(struct ethoc *dev)
{
	u32 mode;

	/*                         */

	ethoc_disable_rx_and_tx(dev);

	/*                       */

	/*                                             */
	mode = ethoc_read(dev, MODER);
	mode |= MODER_CRC | MODER_PAD;
	ethoc_write(dev, MODER, mode);

	/*                      */
	mode = ethoc_read(dev, MODER);
	mode |= MODER_FULLD;
	ethoc_write(dev, MODER, mode);
	ethoc_write(dev, IPGT, 0x15);

	ethoc_ack_irq(dev, INT_MASK_ALL);
	ethoc_enable_irq(dev, INT_MASK_ALL);
	ethoc_enable_rx_and_tx(dev);
	return 0;
}
コード例 #3
0
static int ethoc_reset(struct eth_device *dev)
{
	u32 mode;

	/* todo: reset controller? */

	ethoc_disable_rx_and_tx(dev);

	/* todo: setup registers */

	/* enable fcs generation and automatic padding */
	mode = ethoc_read(dev, MODER);
	mode |= MODER_CRC | MODER_PAD;
	ethoc_write(dev, MODER, mode);

	/* set full-duplex mode */
	mode = ethoc_read(dev, MODER);
	mode |= MODER_FULLD;
	ethoc_write(dev, MODER, mode);
	ethoc_write(dev, IPGT, 0x15);
    
   	mode = ethoc_read(dev, CTRLMODER);
	mode |= (1<<2) | 1;
    ethoc_write(dev, CTRLMODER, mode); // text interrupt enable
   // ethoc_write(dev, CTRLMODER, 2); // recv interrupt enable  
	//ethoc_ack_irq(dev, int_mask_all);
	ethoc_ack_irq(dev, INT_MASK_ALL);
    ethoc_enable_rx_and_tx(dev);

    return 0;
}
コード例 #4
0
ファイル: ethoc.c プロジェクト: Noltari/u-boot
static void ethoc_stop_common(struct ethoc *priv)
{
	ethoc_disable_rx_and_tx(priv);
#ifdef CONFIG_PHYLIB
	phy_shutdown(priv->phydev);
#endif
}