Path: blob/main/sys/contrib/ncsw/Peripherals/FM/MAC/tgec_mii_acc.h
48524 views
/*1* Copyright 2008-2012 Freescale Semiconductor Inc.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233#ifndef __TGEC_MII_ACC_H34#define __TGEC_MII_ACC_H3536#include "std_ext.h"373839/* MII Management Command Register */40#define MIIMCOM_READ_POST_INCREMENT 0x0000400041#define MIIMCOM_READ_CYCLE 0x0000800042#define MIIMCOM_SCAN_CYCLE 0x0000080043#define MIIMCOM_PREAMBLE_DISABLE 0x000004004445#define MIIMCOM_MDIO_HOLD_1_REG_CLK 046#define MIIMCOM_MDIO_HOLD_2_REG_CLK 147#define MIIMCOM_MDIO_HOLD_3_REG_CLK 248#define MIIMCOM_MDIO_HOLD_4_REG_CLK 34950#define MIIMCOM_DIV_MASK 0x0000ff0051#define MIIMCOM_DIV_SHIFT 85253/* MII Management Indicator Register */54#define MIIMIND_BUSY 0x0000000155#define MIIMIND_READ_ERROR 0x000000025657#define MIIDATA_BUSY 0x800000005859#if defined(__MWERKS__) && !defined(__GNUC__)60#pragma pack(push,1)61#endif /* defined(__MWERKS__) && ... */6263/*----------------------------------------------------*/64/* MII Configuration Control Memory Map Registers */65/*----------------------------------------------------*/66typedef _Packed struct t_TgecMiiAccessMemMap67{68volatile uint32_t mdio_cfg_status; /* 0x030 */69volatile uint32_t mdio_command; /* 0x034 */70volatile uint32_t mdio_data; /* 0x038 */71volatile uint32_t mdio_regaddr; /* 0x03c */72} _PackedType t_TgecMiiAccessMemMap ;7374#if defined(__MWERKS__) && !defined(__GNUC__)75#pragma pack(pop)76#endif /* defined(__MWERKS__) && ... */777879#endif /* __TGEC_MII_ACC_H */808182