OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [ecos-2.0/] [packages/] [devs/] [eth/] [powerpc/] [quicc2/] [v2_0/] [src/] [EnetPHY.h] - Diff between revs 1254 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 1254 Rev 1765
//####ECOSGPLCOPYRIGHTBEGIN####
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
// Copyright (C) 2002 Gary Thomas
// Copyright (C) 2002 Gary Thomas
//
//
// eCos is free software; you can redistribute it and/or modify it under
// 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
// 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.
// 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
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
// for more details.
//
//
// You should have received a copy of the GNU General Public License along
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
//
// As a special exception, if other files instantiate templates or use macros
// 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
// 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
// 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
// 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
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
// in accordance with section (3) of the GNU General Public License.
//
//
// This exception does not invalidate any other reasons why a work based on
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
// this file might be covered by the GNU General Public License.
//
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//####ECOSGPLCOPYRIGHTEND####
/*------------------------------------------------------------------
/*------------------------------------------------------------------
*
*
* FILE: EnetPHY.c
* FILE: EnetPHY.c
*
*
* DESCRIPTION:   LXT970a driver header file
* DESCRIPTION:   LXT970a driver header file
*
*
*
*
* Modified for MPC8260 VADS board
* Modified for MPC8260 VADS board
*-------------------------------------------------------------------*/
*-------------------------------------------------------------------*/
 
 
#ifndef _EnetPHY_H 
#ifndef _EnetPHY_H 
#define _EnetPHY_H
#define _EnetPHY_H
 
 
#include "types.h"
#include "types.h"
 
 
// Board control and status registers
// Board control and status registers
typedef struct bcsr {
typedef struct bcsr {
  UINT32  bcsr0;
  UINT32  bcsr0;
  UINT32  bcsr1;
  UINT32  bcsr1;
  UINT32  bcsr2;
  UINT32  bcsr2;
  UINT32  bcsr3;
  UINT32  bcsr3;
} t_BCSR;
} t_BCSR;
 
 
// Fast ethernet enable/reset pins on bcsr
// Fast ethernet enable/reset pins on bcsr
#define FETHIEN_ 0x08000000
#define FETHIEN_ 0x08000000
#define FETHRST_ 0x04000000
#define FETHRST_ 0x04000000
 
 
 
 
/**************************/
/**************************/
/* The API for PHY Device */
/* The API for PHY Device */
/**************************/
/**************************/
 
 
void   EnableResetPHY(volatile t_BCSR *pBCSR);
void   EnableResetPHY(volatile t_BCSR *pBCSR);
UINT16 InitEthernetPHY(VUINT32* pdir, VUINT32* pdat, UINT16 link);
UINT16 InitEthernetPHY(VUINT32* pdir, VUINT32* pdat, UINT16 link);
UINT16 EthernetPHYInterruptHandler(void);
UINT16 EthernetPHYInterruptHandler(void);
void   EnablePHYinterrupt(UINT8 enable);
void   EnablePHYinterrupt(UINT8 enable);
UINT16 LinkTestPHY(void);
UINT16 LinkTestPHY(void);
 
 
 
 
typedef enum MDIORW {READ, WRITE} MDIORW;
typedef enum MDIORW {READ, WRITE} MDIORW;
 
 
 
 
#define LINKERROR   0xFFFF
#define LINKERROR   0xFFFF
#define NOTLINKED   0x0000
#define NOTLINKED   0x0000
#define TEN_HD      0x0020
#define TEN_HD      0x0020
#define TEN_FD      0x0040
#define TEN_FD      0x0040
#define HUNDRED_HD  0x0080
#define HUNDRED_HD  0x0080
#define HUNDRED_FD  0x0100
#define HUNDRED_FD  0x0100
 
 
#define MD_TEST_FRAME 0xDEAD
#define MD_TEST_FRAME 0xDEAD
 
 
//8260 VADS Pin Connections
//8260 VADS Pin Connections
#define MDIO_PIN_MASK 0x00400000        //PC9  for 8260 VADS
#define MDIO_PIN_MASK 0x00400000        //PC9  for 8260 VADS
#define MDC_PIN_MASK  0x00200000        //PC10 for 8260 VADS
#define MDC_PIN_MASK  0x00200000        //PC10 for 8260 VADS
 
 
//#define MDIO_PIN_MASK 0x00000200        //PC9  for 8260 VADS
//#define MDIO_PIN_MASK 0x00000200        //PC9  for 8260 VADS
//#define MDC_PIN_MASK  0x00000400        //PC10 for 8260 VADS
//#define MDC_PIN_MASK  0x00000400        //PC10 for 8260 VADS
 
 
//IEEE 802.3 PHY Register Definitions
//IEEE 802.3 PHY Register Definitions
#define CONTROL_REG              0
#define CONTROL_REG              0
#define STATUS_REG               1
#define STATUS_REG               1
#define PHY_ID_REG_A             2
#define PHY_ID_REG_A             2
#define PHY_ID_REG_B             3
#define PHY_ID_REG_B             3
#define AUTONEG_AD_REG           4
#define AUTONEG_AD_REG           4
#define AUTONEG_LINKPARTNER_REG  5
#define AUTONEG_LINKPARTNER_REG  5
#define AUTONEG_EXP_REG          6
#define AUTONEG_EXP_REG          6
 
 
//LXT970a Specific Register Definitions
//LXT970a Specific Register Definitions
#define MIRROR_REG              16
#define MIRROR_REG              16
#define INT_EN_REG              17
#define INT_EN_REG              17
#define INT_STAT_REG            18
#define INT_STAT_REG            18
#define CONFIG_REG              19
#define CONFIG_REG              19
#define CHIP_STAT_REG           20
#define CHIP_STAT_REG           20
 
 
//Clock Timing Control
//Clock Timing Control
#define MDC_HOLD_TIME           50
#define MDC_HOLD_TIME           50
 
 
#endif
#endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.