From b15cb636e18f7810f529ecb66f99eaf1ac1c18c9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 20 Apr 2018 13:36:14 +0200 Subject: bsps/sparc: Move network drivers to bsps This patch is a part of the BSP source reorganization. Update #3285. --- c/src/lib/libbsp/sparc/leon2/Makefile.am | 4 +- .../sparc/leon2/leon_open_eth/leon_open_eth.c | 64 -------------------- .../sparc/leon2/leon_smc91111/leon_smc91111.c | 69 ---------------------- 3 files changed, 2 insertions(+), 135 deletions(-) delete mode 100644 c/src/lib/libbsp/sparc/leon2/leon_open_eth/leon_open_eth.c delete mode 100644 c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c (limited to 'c/src/lib/libbsp/sparc/leon2') diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am index 862cc536c2..29b368f964 100644 --- a/c/src/lib/libbsp/sparc/leon2/Makefile.am +++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am @@ -157,8 +157,8 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/getcurrentprocessor endif if HAS_NETWORKING -librtemsbsp_a_SOURCES += leon_smc91111/leon_smc91111.c -librtemsbsp_a_SOURCES += leon_open_eth/leon_open_eth.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon2/net/leon_smc91111.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon2/net/leon_open_eth.c librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/net/greth.c librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/net/network_interface_add.c endif diff --git a/c/src/lib/libbsp/sparc/leon2/leon_open_eth/leon_open_eth.c b/c/src/lib/libbsp/sparc/leon2/leon_open_eth/leon_open_eth.c deleted file mode 100644 index 27b04cd386..0000000000 --- a/c/src/lib/libbsp/sparc/leon2/leon_open_eth/leon_open_eth.c +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file - * @ingroup sparc_leon2 - * @brief LEON2 Opencores Ethernet MAC Configuration Information - */ - -/* - * Copyright (c) 2004. - * Aeroflex Gaisler AB. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ - -#include -#include -#if (OPEN_ETH_DEBUG & OPEN_ETH_DEBUG_PRINT_REGISTERS) -#include -#endif - -/* - * Default sizes of transmit and receive descriptor areas - */ -#define RDA_COUNT 16 -#define TDA_COUNT 16 - -/* - * Default location of device registers - */ -#define OPEN_ETH_BASE_ADDRESS ((void *)0xb0000000) - -/* - * Default interrupt vector - */ -#define OPEN_ETH_VECTOR 0x1C - -open_eth_configuration_t leon_open_eth_configuration = { - OPEN_ETH_BASE_ADDRESS, /* base address */ - OPEN_ETH_VECTOR, /* vector number */ - TDA_COUNT, /* number of transmit descriptors */ - RDA_COUNT, /* number of receive descriptors */ - 0 /* 100 MHz operation */ -}; - -int rtems_leon_open_eth_driver_attach(struct rtems_bsdnet_ifconfig *config) -{ - - /* clear control register and reset NIC */ - *(volatile int *) OPEN_ETH_BASE_ADDRESS = 0; - *(volatile int *) OPEN_ETH_BASE_ADDRESS = 0x800; - *(volatile int *) OPEN_ETH_BASE_ADDRESS = 0; - - /* enable 100 MHz operation only if cpu frequency >= 50 MHz */ - if (LEON_REG.Scaler_Reload >= 49) leon_open_eth_configuration.en100MHz = 1; - - if (rtems_open_eth_driver_attach( config, &leon_open_eth_configuration )) { - LEON_REG.Interrupt_Clear = (1 << (OPEN_ETH_VECTOR - 0x10)); - LEON_REG.Interrupt_Mask |= (1 << (OPEN_ETH_VECTOR - 0x10)); - } - return 0; -} diff --git a/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c b/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c deleted file mode 100644 index 748ca35491..0000000000 --- a/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * @ingroup sparc_leon2 - * @brief SMC91111 Driver - */ - -/* - * Copyright (c) 2006. - * Aeroflex Gaisler AB. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - - -#define SMC91111_BASE_ADDR (void*)0x20000300 -#define SMC91111_BASE_IRQ 4 -#define SMC91111_BASE_PIO 4 - -scmv91111_configuration_t leon_scmv91111_configuration = { - SMC91111_BASE_ADDR, /* base address */ - SMC91111_BASE_IRQ, /* IRQ number (on LEON vector is irq) */ - SMC91111_BASE_PIO, /* PIO */ - 100, /* 100b */ - 1, /* fulldx */ - 1 /* autoneg */ -}; - -/* - * Attach an SMC91111 driver to the system - */ -int rtems_smc91111_driver_attach_leon2(struct rtems_bsdnet_ifconfig *config) -{ - - /* activate io area */ - printk("Activating Leon2 io port\n"); - /*configure pio */ - *((volatile unsigned int *)0x80000000) |= 0x10f80000; - *((volatile unsigned int *)0x800000A8) |= - (0xe0 | leon_scmv91111_configuration.pio) - << (8 * (leon_scmv91111_configuration.vector - 4)); /* vector = irq-no */ - - return _rtems_smc91111_driver_attach(config,&leon_scmv91111_configuration); -} -- cgit v1.2.3