15df53927SLuiz Otavio O Souza#- 25df53927SLuiz Otavio O Souza# Copyright (c) 2015 Luiz Otavio O Souza <loos@FreeBSD.org> 35df53927SLuiz Otavio O Souza# Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> 45df53927SLuiz Otavio O Souza# 55df53927SLuiz Otavio O Souza# Redistribution and use in source and binary forms, with or without 65df53927SLuiz Otavio O Souza# modification, are permitted provided that the following conditions 75df53927SLuiz Otavio O Souza# are met: 85df53927SLuiz Otavio O Souza# 1. Redistributions of source code must retain the above copyright 95df53927SLuiz Otavio O Souza# notice, this list of conditions and the following disclaimer. 105df53927SLuiz Otavio O Souza# 2. Redistributions in binary form must reproduce the above copyright 115df53927SLuiz Otavio O Souza# notice, this list of conditions and the following disclaimer in the 125df53927SLuiz Otavio O Souza# documentation and/or other materials provided with the distribution. 135df53927SLuiz Otavio O Souza# 145df53927SLuiz Otavio O Souza# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 155df53927SLuiz Otavio O Souza# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 165df53927SLuiz Otavio O Souza# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 175df53927SLuiz Otavio O Souza# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 185df53927SLuiz Otavio O Souza# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 195df53927SLuiz Otavio O Souza# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 205df53927SLuiz Otavio O Souza# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 215df53927SLuiz Otavio O Souza# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 225df53927SLuiz Otavio O Souza# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 235df53927SLuiz Otavio O Souza# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 245df53927SLuiz Otavio O Souza# SUCH DAMAGE. 255df53927SLuiz Otavio O Souza# 265df53927SLuiz Otavio O Souza# 275df53927SLuiz Otavio O Souza 285df53927SLuiz Otavio O SouzaINTERFACE if_dwc; 295df53927SLuiz Otavio O Souza 30*c36125f6SEmmanuel Vadot#include <dev/dwc/dwc1000_reg.h> 315df53927SLuiz Otavio O Souza 325df53927SLuiz Otavio O SouzaCODE { 335df53927SLuiz Otavio O Souza static int 345df53927SLuiz Otavio O Souza if_dwc_default_init(device_t dev) 355df53927SLuiz Otavio O Souza { 365df53927SLuiz Otavio O Souza return (0); 375df53927SLuiz Otavio O Souza } 385df53927SLuiz Otavio O Souza 395df53927SLuiz Otavio O Souza static int 405df53927SLuiz Otavio O Souza if_dwc_default_mii_clk(device_t dev) 415df53927SLuiz Otavio O Souza { 425df53927SLuiz Otavio O Souza return (GMAC_MII_CLK_25_35M_DIV16); 435df53927SLuiz Otavio O Souza } 44824cfb47SOleksandr Tymoshenko 45824cfb47SOleksandr Tymoshenko static int 46824cfb47SOleksandr Tymoshenko if_dwc_default_set_speed(device_t dev, int speed) 47824cfb47SOleksandr Tymoshenko { 48824cfb47SOleksandr Tymoshenko return (0); 49824cfb47SOleksandr Tymoshenko } 505df53927SLuiz Otavio O Souza}; 515df53927SLuiz Otavio O Souza 525df53927SLuiz Otavio O SouzaHEADER { 535df53927SLuiz Otavio O Souza}; 545df53927SLuiz Otavio O Souza 555df53927SLuiz Otavio O Souza# 565df53927SLuiz Otavio O Souza# Initialize the SoC specific registers. 575df53927SLuiz Otavio O Souza# 585df53927SLuiz Otavio O SouzaMETHOD int init { 595df53927SLuiz Otavio O Souza device_t dev; 605df53927SLuiz Otavio O Souza} DEFAULT if_dwc_default_init; 615df53927SLuiz Otavio O Souza 625df53927SLuiz Otavio O Souza# 635df53927SLuiz Otavio O Souza# Return the DWC MII clock for a specific hardware. 645df53927SLuiz Otavio O Souza# 655df53927SLuiz Otavio O SouzaMETHOD int mii_clk { 665df53927SLuiz Otavio O Souza device_t dev; 675df53927SLuiz Otavio O Souza} DEFAULT if_dwc_default_mii_clk; 68824cfb47SOleksandr Tymoshenko 69824cfb47SOleksandr Tymoshenko# 70824cfb47SOleksandr Tymoshenko# Signal media change to a specific hardware 71824cfb47SOleksandr Tymoshenko# 72824cfb47SOleksandr TymoshenkoMETHOD int set_speed { 73824cfb47SOleksandr Tymoshenko device_t dev; 74824cfb47SOleksandr Tymoshenko int speed; 75824cfb47SOleksandr Tymoshenko} DEFAULT if_dwc_default_set_speed; 76