ewew

Fork of lwip-eth by mbed official

Committer:
aookami
Date:
Wed Dec 13 20:00:53 2017 +0000
Revision:
34:149bcaa1058c
Parent:
33:9de8bd8ca1c8
wep

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 33:9de8bd8ca1c8 1 /*
mbed_official 33:9de8bd8ca1c8 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 33:9de8bd8ca1c8 3 * All rights reserved.
mbed_official 33:9de8bd8ca1c8 4 *
mbed_official 33:9de8bd8ca1c8 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 33:9de8bd8ca1c8 6 * are permitted provided that the following conditions are met:
mbed_official 33:9de8bd8ca1c8 7 *
mbed_official 33:9de8bd8ca1c8 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 33:9de8bd8ca1c8 9 * of conditions and the following disclaimer.
mbed_official 33:9de8bd8ca1c8 10 *
mbed_official 33:9de8bd8ca1c8 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 33:9de8bd8ca1c8 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 33:9de8bd8ca1c8 13 * other materials provided with the distribution.
mbed_official 33:9de8bd8ca1c8 14 *
mbed_official 33:9de8bd8ca1c8 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 33:9de8bd8ca1c8 16 * contributors may be used to endorse or promote products derived from this
mbed_official 33:9de8bd8ca1c8 17 * software without specific prior written permission.
mbed_official 33:9de8bd8ca1c8 18 *
mbed_official 33:9de8bd8ca1c8 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 33:9de8bd8ca1c8 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 33:9de8bd8ca1c8 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 33:9de8bd8ca1c8 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 33:9de8bd8ca1c8 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 33:9de8bd8ca1c8 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 33:9de8bd8ca1c8 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 33:9de8bd8ca1c8 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 33:9de8bd8ca1c8 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 33:9de8bd8ca1c8 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 33:9de8bd8ca1c8 29 */
mbed_official 33:9de8bd8ca1c8 30
mbed_official 33:9de8bd8ca1c8 31 #include "fsl_port.h"
mbed_official 33:9de8bd8ca1c8 32
mbed_official 33:9de8bd8ca1c8 33 /*******************************************************************************
mbed_official 33:9de8bd8ca1c8 34 * Code
mbed_official 33:9de8bd8ca1c8 35 ******************************************************************************/
mbed_official 33:9de8bd8ca1c8 36 void k64f_init_eth_hardware(void)
mbed_official 33:9de8bd8ca1c8 37 {
mbed_official 33:9de8bd8ca1c8 38 port_pin_config_t configENET = {0};
mbed_official 33:9de8bd8ca1c8 39
mbed_official 33:9de8bd8ca1c8 40 /* Disable MPU. */
mbed_official 33:9de8bd8ca1c8 41 MPU->CESR &= ~MPU_CESR_VLD_MASK;
mbed_official 33:9de8bd8ca1c8 42
mbed_official 33:9de8bd8ca1c8 43 CLOCK_EnableClock(kCLOCK_PortC);
mbed_official 33:9de8bd8ca1c8 44 /* Affects PORTC_PCR16 register */
mbed_official 33:9de8bd8ca1c8 45 PORT_SetPinMux(PORTC, 16u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 46 /* Affects PORTC_PCR17 register */
mbed_official 33:9de8bd8ca1c8 47 PORT_SetPinMux(PORTC, 17u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 48 /* Affects PORTC_PCR18 register */
mbed_official 33:9de8bd8ca1c8 49 PORT_SetPinMux(PORTC, 18u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 50 /* Affects PORTC_PCR19 register */
mbed_official 33:9de8bd8ca1c8 51 PORT_SetPinMux(PORTC, 19u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 52 /* Affects PORTB_PCR1 register */
mbed_official 33:9de8bd8ca1c8 53 PORT_SetPinMux(PORTB, 1u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 54
mbed_official 33:9de8bd8ca1c8 55 configENET.openDrainEnable = kPORT_OpenDrainEnable;
mbed_official 33:9de8bd8ca1c8 56 configENET.mux = kPORT_MuxAlt4;
mbed_official 33:9de8bd8ca1c8 57 configENET.pullSelect = kPORT_PullUp;
mbed_official 33:9de8bd8ca1c8 58 /* Ungate the port clock */
mbed_official 33:9de8bd8ca1c8 59 CLOCK_EnableClock(kCLOCK_PortA);
mbed_official 33:9de8bd8ca1c8 60 /* Affects PORTB_PCR0 register */
mbed_official 33:9de8bd8ca1c8 61 PORT_SetPinConfig(PORTB, 0u, &configENET);
mbed_official 33:9de8bd8ca1c8 62
mbed_official 33:9de8bd8ca1c8 63 /* Affects PORTA_PCR13 register */
mbed_official 33:9de8bd8ca1c8 64 PORT_SetPinMux(PORTA, 13u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 65 /* Affects PORTA_PCR12 register */
mbed_official 33:9de8bd8ca1c8 66 PORT_SetPinMux(PORTA, 12u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 67 /* Affects PORTA_PCR14 register */
mbed_official 33:9de8bd8ca1c8 68 PORT_SetPinMux(PORTA, 14u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 69 /* Affects PORTA_PCR5 register */
mbed_official 33:9de8bd8ca1c8 70 PORT_SetPinMux(PORTA, 5u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 71 /* Affects PORTA_PCR16 register */
mbed_official 33:9de8bd8ca1c8 72 PORT_SetPinMux(PORTA, 16u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 73 /* Affects PORTA_PCR17 register */
mbed_official 33:9de8bd8ca1c8 74 PORT_SetPinMux(PORTA, 17u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 75 /* Affects PORTA_PCR15 register */
mbed_official 33:9de8bd8ca1c8 76 PORT_SetPinMux(PORTA, 15u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 77 /* Affects PORTA_PCR28 register */
mbed_official 33:9de8bd8ca1c8 78 PORT_SetPinMux(PORTA, 28u, kPORT_MuxAlt4);
mbed_official 33:9de8bd8ca1c8 79
mbed_official 33:9de8bd8ca1c8 80 /* Select the Ethernet timestamp clock source */
mbed_official 33:9de8bd8ca1c8 81 CLOCK_SetEnetTime0Clock(0x2);
mbed_official 33:9de8bd8ca1c8 82 }
mbed_official 33:9de8bd8ca1c8 83
mbed_official 33:9de8bd8ca1c8 84 /*******************************************************************************
mbed_official 33:9de8bd8ca1c8 85 * EOF
mbed_official 33:9de8bd8ca1c8 86 ******************************************************************************/
mbed_official 33:9de8bd8ca1c8 87
mbed_official 33:9de8bd8ca1c8 88