#endif /* CONFIG_LCD_INFO */
#endif /* CONFIG_LCD */
-#ifdef CONFIG_KS8851_MLL
-void at91sam9n12ek_ks8851_hw_init(void)
-{
- struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
-
- writel(AT91_SMC_SETUP_NWE(2) | AT91_SMC_SETUP_NCS_WR(0) |
- AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
- &smc->cs[2].setup);
- writel(AT91_SMC_PULSE_NWE(7) | AT91_SMC_PULSE_NCS_WR(7) |
- AT91_SMC_PULSE_NRD(7) | AT91_SMC_PULSE_NCS_RD(7),
- &smc->cs[2].pulse);
- writel(AT91_SMC_CYCLE_NWE(9) | AT91_SMC_CYCLE_NRD(9),
- &smc->cs[2].cycle);
- writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
- AT91_SMC_MODE_EXNW_DISABLE |
- AT91_SMC_MODE_BAT | AT91_SMC_MODE_DBW_16 |
- AT91_SMC_MODE_TDF_CYCLE(1),
- &smc->cs[2].mode);
-
- /* Configure NCS2 PIN */
- at91_pio3_set_b_periph(AT91_PIO_PORTD, 19, 0);
-}
-#endif
-
#ifdef CONFIG_USB_ATMEL
void at91sam9n12ek_usb_hw_init(void)
{
at91_lcd_hw_init();
#endif
-#ifdef CONFIG_KS8851_MLL
- at91sam9n12ek_ks8851_hw_init();
-#endif
-
#ifdef CONFIG_USB_ATMEL
at91sam9n12ek_usb_hw_init();
#endif
return 0;
}
-#ifdef CONFIG_KS8851_MLL
-int board_eth_init(struct bd_info *bis)
-{
- return ks8851_mll_initialize(0, CONFIG_KS8851_MLL_BASEADDR);
-}
-#endif
-
int dram_init(void)
{
gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
* @extra_byte : number of extra byte prepended rx pkt.
*/
struct ks_net {
-#ifndef CONFIG_DM_ETH
- struct eth_device dev;
-#endif
phys_addr_t iobase;
int bus_width;
u16 sharedbus;
ks_wrreg16(ks, KS_MARL, addrl);
}
-#ifndef CONFIG_DM_ETH
-static int ks8851_mll_init(struct eth_device *dev, struct bd_info *bd)
-{
- struct ks_net *ks = container_of(dev, struct ks_net, dev);
-
- return ks8851_mll_init_common(ks);
-}
-
-static void ks8851_mll_halt(struct eth_device *dev)
-{
- struct ks_net *ks = container_of(dev, struct ks_net, dev);
-
- ks8851_mll_halt_common(ks);
-}
-
-static int ks8851_mll_send(struct eth_device *dev, void *packet, int length)
-{
- struct ks_net *ks = container_of(dev, struct ks_net, dev);
-
- return ks8851_mll_send_common(ks, packet, length);
-}
-
-static int ks8851_mll_recv(struct eth_device *dev)
-{
- struct ks_net *ks = container_of(dev, struct ks_net, dev);
- int ret;
-
- ret = ks8851_mll_recv_common(ks, net_rx_packets[0]);
- if (ret)
- net_process_received_packet(net_rx_packets[0], ret);
-
- return ret;
-}
-
-static int ks8851_mll_write_hwaddr(struct eth_device *dev)
-{
- struct ks_net *ks = container_of(dev, struct ks_net, dev);
-
- ks8851_mll_write_hwaddr_common(ks, ks->dev.enetaddr);
-
- return 0;
-}
-
-int ks8851_mll_initialize(u8 dev_num, int base_addr)
-{
- struct ks_net *ks;
-
- ks = calloc(1, sizeof(*ks));
- if (!ks)
- return -ENOMEM;
-
- ks->iobase = base_addr;
-
- /* Try to detect chip. Will fail if not present. */
- if (ks8851_mll_detect_chip(ks)) {
- free(ks);
- return -1;
- }
-
- ks->dev.init = ks8851_mll_init;
- ks->dev.halt = ks8851_mll_halt;
- ks->dev.send = ks8851_mll_send;
- ks->dev.recv = ks8851_mll_recv;
- ks->dev.write_hwaddr = ks8851_mll_write_hwaddr;
- sprintf(ks->dev.name, "%s-%hu", DRIVERNAME, dev_num);
-
- eth_register(&ks->dev);
-
- return 0;
-}
-#else /* ifdef CONFIG_DM_ETH */
static int ks8851_start(struct udevice *dev)
{
struct ks_net *ks = dev_get_priv(dev);
.plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
-#endif