diff options
author | Michael Gielda <mgielda@antmicro.com> | 2014-04-03 14:53:04 +0200 |
---|---|---|
committer | Michael Gielda <mgielda@antmicro.com> | 2014-04-03 14:53:04 +0200 |
commit | ae1e4e08a1005a0c487f03ba189d7536e7fdcba6 (patch) | |
tree | f1c296f8a966a9a39876b0e98e16d9c5da1776dd /ecos/packages/devs/eth/sh/dreamcast | |
parent | f157da5337118d3c5cd464266796de4262ac9dbd (diff) |
Added the OS files
Diffstat (limited to 'ecos/packages/devs/eth/sh/dreamcast')
4 files changed, 315 insertions, 0 deletions
diff --git a/ecos/packages/devs/eth/sh/dreamcast/current/ChangeLog b/ecos/packages/devs/eth/sh/dreamcast/current/ChangeLog new file mode 100644 index 0000000..2772b4e --- /dev/null +++ b/ecos/packages/devs/eth/sh/dreamcast/current/ChangeLog @@ -0,0 +1,35 @@ +2005-12-02 Andrew Lunn <andrew.lunn@ascom.ch> + + * cdl/sh_dreamcast_rltk8139_eth_drivers.cdl: Add compiler + flags "-D_KERNEL -D__ECOS" so the code compiles. + +2004-04-21 Yoshinori Sato <ysato@users.sourceforge.jp> + + * src/if_dreamcast.c + * include/devs_eth_sh_dreamcast_rltk8139.inl + * cdl/sh_dreamcast_rltk_8139_eth_drivers.cdl: + New package - SEGA Dreamcast Broadband Adapter Support. + +//=========================================================================== +// ####GPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2004 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 or (at your option) any +// later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., 51 Franklin Street, +// Fifth Floor, Boston, MA 02110-1301, USA. +// ------------------------------------------- +// ####GPLCOPYRIGHTEND#### +//=========================================================================== diff --git a/ecos/packages/devs/eth/sh/dreamcast/current/cdl/sh_dreamcast_rltk8139_eth_drivers.cdl b/ecos/packages/devs/eth/sh/dreamcast/current/cdl/sh_dreamcast_rltk8139_eth_drivers.cdl new file mode 100644 index 0000000..bd2d8a6 --- /dev/null +++ b/ecos/packages/devs/eth/sh/dreamcast/current/cdl/sh_dreamcast_rltk8139_eth_drivers.cdl @@ -0,0 +1,109 @@ +# ==================================================================== +# +# sh_dreamcast_rltk8139_eth_drivers.cdl +# +# Ethernet drivers - support for Dreamcast BroadBandAdapter +# +# ==================================================================== +## ####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 2004 Free Software Foundation, Inc. +## +## eCos is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free +## Software Foundation; either version 2 or (at your option) any later +## version. +## +## eCos is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License +## along with eCos; if not, write to the Free Software Foundation, Inc., +## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +## +## As a special exception, if other files instantiate templates or use +## macros or inline functions from this file, or you compile this file +## and link it with other works to produce a work based on this file, +## this file does not by itself cause the resulting work to be covered by +## the GNU General Public License. However the source code for this file +## must still be made available in accordance with section (3) of the GNU +## General Public License v2. +## +## This exception does not invalidate any other reasons why a work based +## on this file might be covered by the GNU General Public License. +## ------------------------------------------- +## ####ECOSGPLCOPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): Yoshinori Sato +# Contributors: +# Date: 2004-04-22 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + +cdl_package CYGPKG_DEVS_ETH_SH_DREAMCAST_RLTK8139 { + display "Dreamcast BbA driver" + description "Ethernet driver for Dreamcast Broadband Adapter" + + parent CYGPKG_IO_ETH_DRIVERS + active_if CYGPKG_IO_ETH_DRIVERS + active_if CYGPKG_HAL_SH_SH7750_DREAMCAST + compile -library=libextras.a if_dreamcast.c + + include_dir cyg/io + + # FIXME: This really belongs in the RealTek_8139 package ? + cdl_interface CYGINT_DEVS_ETH_RLTK_8139_REQUIRED { + display "RealTek 8139 ethernet driver required" + } + + define_proc { + puts $::cdl_system_header "/***** ethernet driver proc output start *****/" + puts $::cdl_system_header "#define CYGDAT_DEVS_ETH_RLTK_8139_INL <cyg/io/devs_eth_sh_dreamcast_rltk8139.inl>" + puts $::cdl_system_header "#define CYGDAT_DEVS_ETH_RLTK_8139_CFG <pkgconf/devs_eth_sh_dreamcast_rltk8139.h>" + puts $::cdl_system_header "/***** ethernet driver proc output end *****/" + } + + cdl_component CYGPKG_DEVS_ETH_SH_DREAMCAST_RLTK8139_ETH0 { + display "Ethernet port 0 driver" + flavor bool + default_value 1 + + implements CYGHWR_NET_DRIVERS + implements CYGHWR_NET_DRIVER_ETH0 + implements CYGINT_DEVS_ETH_RLTK_8139_REQUIRED + + cdl_option CYGDAT_DEVS_ETH_SH_DREAMCAST_RLTK8139_ETH0_NAME { + display "Device name for the ETH0 ethernet port 0 driver" + flavor data + default_value {"\"eth0\""} + description " + This option sets the name of the ethernet device for the + RealTek 8139 ethernet port 0." + } + } + cdl_component CYGPKG_DEVS_ETH_SH_DREAMCAST_RLTK8139_OPTIONS { + display "RealTek 8139 ethernet driver build options" + flavor none + no_define + + cdl_option CYGPKG_DEVS_ETH_SH_DREAMCAST_RLTK8139_CFLAGS_ADD { + display "Additional compiler flags" + flavor data + no_define + default_value { "-D_KERNEL -D__ECOS" } + description " + This option modifies the set of compiler flags for + building the RealTek 8139 ethernet driver package. These + flags are used in addition to the set of global flags." + } + } +} + +# EOF sh_dreamcast_rltk8139_eth_drivers.cdl diff --git a/ecos/packages/devs/eth/sh/dreamcast/current/include/devs_eth_sh_dreamcast_rltk8139.inl b/ecos/packages/devs/eth/sh/dreamcast/current/include/devs_eth_sh_dreamcast_rltk8139.inl new file mode 100644 index 0000000..cb9e8b3 --- /dev/null +++ b/ecos/packages/devs/eth/sh/dreamcast/current/include/devs_eth_sh_dreamcast_rltk8139.inl @@ -0,0 +1,79 @@ +//========================================================================== +// +// devs/eth/sh/dreamcast/include/devs_eth_sh_dreamcast_rltk8139.inl +// +// SEGA Dreamcast Broadband Adapter I/O definitions. +// +//========================================================================== +// ####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2004 Free Software Foundation, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later +// version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License +// along with eCos; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// As a special exception, if other files instantiate templates or use +// macros or inline functions from this file, or you compile this file +// and link it with other works to produce a work based on this file, +// this file does not by itself cause the resulting work to be covered by +// the GNU General Public License. However the source code for this file +// must still be made available in accordance with section (3) of the GNU +// General Public License v2. +// +// This exception does not invalidate any other reasons why a work based +// on this file might be covered by the GNU General Public License. +// ------------------------------------------- +// ####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Yoshinori Sato +// Contributors: +// Date: 2004-04-22 +// Purpose: SEGA Dreamcast Broadband Adapter definitions +//####DESCRIPTIONEND#### +//========================================================================== + +#ifdef CYGPKG_DEVS_ETH_SH_DREAMCAST_RLTK8139_ETH0 + +static Rltk8139_t rltk8139_eth0_priv_data = { + 0, 0, 0 +}; + +ETH_DRV_SC(rltk8139_sc0, + &rltk8139_eth0_priv_data, + CYGDAT_DEVS_ETH_SH_DREAMCAST_RLTK8139_ETH0_NAME, + rltk8139_start, + rltk8139_stop, + rltk8139_control, + rltk8139_can_send, + rltk8139_send, + rltk8139_recv, + rltk8139_deliver, + rltk8139_poll, + rltk8139_int_vector + ); + +NETDEVTAB_ENTRY(rltk8139_netdev0, + "rltk8139_" CYGDAT_DEVS_ETH_SH_DREAMCAST_RLTK8139_ETH0_NAME, + rltk8139_init, + &rltk8139_sc0); + +void __dreamcast_bba_init(struct eth_drv_sc *sc); +#define CYGHWR_RLTK_8139_PLF_INIT(sc) __dreamcast_bba_init(sc); + +#endif // CYGPKG_DEVS_ETH_SH_DREAMCAST_RLTK8139_ETH0 + +// EOF devs_eth_sh_dreamcast_rltk8139.inl diff --git a/ecos/packages/devs/eth/sh/dreamcast/current/src/if_dreamcast.c b/ecos/packages/devs/eth/sh/dreamcast/current/src/if_dreamcast.c new file mode 100644 index 0000000..5ba7218 --- /dev/null +++ b/ecos/packages/devs/eth/sh/dreamcast/current/src/if_dreamcast.c @@ -0,0 +1,92 @@ +//========================================================================== +// +// devs/eth/sh/dreamcast/src/devs_eth_sh_dreamcast_rltk8139.c +// +// Dreamcast Broadband Adapter initialize functions. +// +//========================================================================== +// ####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2004 Free Software Foundation, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later +// version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License +// along with eCos; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// As a special exception, if other files instantiate templates or use +// macros or inline functions from this file, or you compile this file +// and link it with other works to produce a work based on this file, +// this file does not by itself cause the resulting work to be covered by +// the GNU General Public License. However the source code for this file +// must still be made available in accordance with section (3) of the GNU +// General Public License v2. +// +// This exception does not invalidate any other reasons why a work based +// on this file might be covered by the GNU General Public License. +// ------------------------------------------- +// ####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Yoshiori Sato +// Contributors: +// Date: 2004-04-21 +// Purpose: dreamcast BbA initialize functions +//####DESCRIPTIONEND#### +//========================================================================== + +#include <cyg/infra/cyg_type.h> +#include <cyg/hal/hal_arch.h> +#include <cyg/hal/drv_api.h> +#include <cyg/io/eth/eth_drv.h> +#include <cyg/io/pci.h> +#include <cyg/infra/diag.h> + +#include <cyg/devs/eth/src/if_8139.h> + +/* DMA BASE address */ +#define GAPSPCI_DMA_BASE 0x01840000 +#define GAPSPCI_DMA_SIZE 32768 +#define BBA_BASE 0x01001700 + +#define P2BASE 0xa0000000 + +static cyg_uint32 gapspci_dma_alloc(int size) +{ + static cyg_uint32 top = GAPSPCI_DMA_BASE; + cyg_uint32 r; + if ((GAPSPCI_DMA_SIZE - (top - GAPSPCI_DMA_BASE)) < size) + r = 0; + else { + r = top; + top += size; + } + return r; +} + +void __dreamcast_bba_init(struct eth_drv_sc *sc) +{ + Rltk8139_t *rltk8139_info = (Rltk8139_t *)(sc->driver_private); + int i; + + rltk8139_info->base_address = (BBA_BASE | P2BASE); + + rltk8139_info->tx_buffer = (cyg_uint8 *)(gapspci_dma_alloc(TX_BUF_TOT_LEN) | P2BASE); + rltk8139_info->rx_ring = (cyg_uint8 *)(gapspci_dma_alloc(RX_BUF_TOT_LEN) | P2BASE); + + for (i = 0; i < 6; ++i) + HAL_READ_UINT8(rltk8139_info->base_address + IDR0 + i, rltk8139_info->mac[i]); +} + +// EOF if_dreamcast.c |