Skip to content

Commit 593fb3a

Browse files
committed
K66F: Update to SDK 2.2
Signed-off-by: Mahadevan Mahesh <[email protected]>
1 parent 4de4481 commit 593fb3a

File tree

107 files changed

+9995
-5851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+9995
-5851
lines changed

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_Freescale/hardware_init_MK66F18.c renamed to features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_Freescale/TARGET_K66F/hardware_init_MK66F18.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void k66f_init_eth_hardware(void)
3939

4040
#ifndef FEATURE_UVISOR
4141
/* Disable MPU only when uVisor is not around. */
42-
MPU->CESR &= ~MPU_CESR_VLD_MASK;
42+
SYSMPU->CESR &= ~SYSMPU_CESR_VLD_MASK;
4343
#endif/*FEATURE_UVISOR*/
4444

4545
/* Ungate the port clock */

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/TARGET_FRDM/fsl_clock_config.c

100644100755
Lines changed: 366 additions & 187 deletions
Large diffs are not rendered by default.

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/TARGET_FRDM/fsl_clock_config.h

100644100755
Lines changed: 100 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2015, Freescale Semiconductor, Inc.
3-
* All rights reserved.
3+
* Copyright 2016-2017 NXP
44
*
55
* Redistribution and use in source and binary forms, with or without modification,
66
* are permitted provided that the following conditions are met:
@@ -12,7 +12,7 @@
1212
* list of conditions and the following disclaimer in the documentation and/or
1313
* other materials provided with the distribution.
1414
*
15-
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
15+
* o Neither the name of the copyright holder nor the names of its
1616
* contributors may be used to endorse or promote products derived from this
1717
* software without specific prior written permission.
1818
*
@@ -27,28 +27,121 @@
2727
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2828
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
30+
3031
#ifndef _CLOCK_CONFIG_H_
3132
#define _CLOCK_CONFIG_H_
3233

34+
#include "fsl_common.h"
35+
36+
/*******************************************************************************
37+
* Definitions
38+
******************************************************************************/
39+
#define BOARD_XTAL0_CLK_HZ 12000000U /*!< Board xtal0 frequency in Hz */
40+
41+
/*******************************************************************************
42+
********************* Configuration BOARD_BootClockHSRUN **********************
43+
******************************************************************************/
44+
/*******************************************************************************
45+
* Definitions for BOARD_BootClockHSRUN configuration
46+
******************************************************************************/
47+
#define BOARD_BOOTCLOCKHSRUN_CORE_CLOCK 180000000U /*!< Core clock frequency: 180000000Hz */
48+
49+
/*! @brief MCG set for BOARD_BootClockHSRUN configuration.
50+
*/
51+
extern const mcg_config_t mcgConfig_BOARD_BootClockHSRUN;
52+
/*! @brief SIM module set for BOARD_BootClockHSRUN configuration.
53+
*/
54+
extern const sim_clock_config_t simConfig_BOARD_BootClockHSRUN;
55+
/*! @brief OSC set for BOARD_BootClockHSRUN configuration.
56+
*/
57+
extern const osc_config_t oscConfig_BOARD_BootClockHSRUN;
58+
59+
/*******************************************************************************
60+
* API for BOARD_BootClockHSRUN configuration
61+
******************************************************************************/
62+
#if defined(__cplusplus)
63+
extern "C" {
64+
#endif /* __cplusplus*/
65+
66+
/*!
67+
* @brief This function executes configuration of clocks.
68+
*
69+
*/
70+
void BOARD_BootClockHSRUN(void);
71+
72+
#if defined(__cplusplus)
73+
}
74+
#endif /* __cplusplus*/
75+
76+
/*******************************************************************************
77+
********************* Configuration BOARD_BootClockVLPR ***********************
78+
******************************************************************************/
3379
/*******************************************************************************
34-
* DEFINITION
80+
* Definitions for BOARD_BootClockVLPR configuration
3581
******************************************************************************/
36-
#define BOARD_XTAL0_CLK_HZ 12000000U
37-
#define BOARD_XTAL32K_CLK_HZ 32768U
82+
#define BOARD_BOOTCLOCKVLPR_CORE_CLOCK 4000000U /*!< Core clock frequency: 4000000Hz */
83+
84+
/*! @brief MCG set for BOARD_BootClockVLPR configuration.
85+
*/
86+
extern const mcg_config_t mcgConfig_BOARD_BootClockVLPR;
87+
/*! @brief SIM module set for BOARD_BootClockVLPR configuration.
88+
*/
89+
extern const sim_clock_config_t simConfig_BOARD_BootClockVLPR;
90+
/*! @brief OSC set for BOARD_BootClockVLPR configuration.
91+
*/
92+
extern const osc_config_t oscConfig_BOARD_BootClockVLPR;
3893

3994
/*******************************************************************************
40-
* API
95+
* API for BOARD_BootClockVLPR configuration
4196
******************************************************************************/
4297
#if defined(__cplusplus)
4398
extern "C" {
4499
#endif /* __cplusplus*/
45100

101+
/*!
102+
* @brief This function executes configuration of clocks.
103+
*
104+
*/
46105
void BOARD_BootClockVLPR(void);
106+
107+
#if defined(__cplusplus)
108+
}
109+
#endif /* __cplusplus*/
110+
111+
/*******************************************************************************
112+
********************** Configuration BOARD_BootClockRUN ***********************
113+
******************************************************************************/
114+
/*******************************************************************************
115+
* Definitions for BOARD_BootClockRUN configuration
116+
******************************************************************************/
117+
#define BOARD_BOOTCLOCKRUN_CORE_CLOCK 120000000U /*!< Core clock frequency: 120000000Hz */
118+
119+
/*! @brief MCG set for BOARD_BootClockRUN configuration.
120+
*/
121+
extern const mcg_config_t mcgConfig_BOARD_BootClockRUN;
122+
/*! @brief SIM module set for BOARD_BootClockRUN configuration.
123+
*/
124+
extern const sim_clock_config_t simConfig_BOARD_BootClockRUN;
125+
/*! @brief OSC set for BOARD_BootClockRUN configuration.
126+
*/
127+
extern const osc_config_t oscConfig_BOARD_BootClockRUN;
128+
129+
/*******************************************************************************
130+
* API for BOARD_BootClockRUN configuration
131+
******************************************************************************/
132+
#if defined(__cplusplus)
133+
extern "C" {
134+
#endif /* __cplusplus*/
135+
136+
/*!
137+
* @brief This function executes configuration of clocks.
138+
*
139+
*/
47140
void BOARD_BootClockRUN(void);
48-
void BOARD_BootClockHSRUN(void);
49141

50142
#if defined(__cplusplus)
51143
}
52144
#endif /* __cplusplus*/
53145

54146
#endif /* _CLOCK_CONFIG_H_ */
147+

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/TARGET_FRDM/fsl_phy.c

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
/*
2-
* Copyright (c) 2015, Freescale Semiconductor, Inc.
3-
* All rights reserved.
4-
*
5-
* Redistribution and use in source and binary forms, with or without modification,
6-
* are permitted provided that the following conditions are met:
7-
*
8-
* o Redistributions of source code must retain the above copyright notice, this list
9-
* of conditions and the following disclaimer.
10-
*
11-
* o Redistributions in binary form must reproduce the above copyright notice, this
12-
* list of conditions and the following disclaimer in the documentation and/or
13-
* other materials provided with the distribution.
14-
*
15-
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
16-
* contributors may be used to endorse or promote products derived from this
17-
* software without specific prior written permission.
18-
*
19-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23-
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26-
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29-
*/
2+
* Copyright (c) 2015, Freescale Semiconductor, Inc.
3+
* Copyright 2016-2017 NXP
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* o Redistributions of source code must retain the above copyright notice, this list
9+
* of conditions and the following disclaimer.
10+
*
11+
* o Redistributions in binary form must reproduce the above copyright notice, this
12+
* list of conditions and the following disclaimer in the documentation and/or
13+
* other materials provided with the distribution.
14+
*
15+
* o Neither the name of the copyright holder nor the names of its
16+
* contributors may be used to endorse or promote products derived from this
17+
* software without specific prior written permission.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26+
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
3030

3131
#include "fsl_phy.h"
3232

@@ -53,8 +53,10 @@ extern uint32_t ENET_GetInstance(ENET_Type *base);
5353
* Variables
5454
******************************************************************************/
5555

56+
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
5657
/*! @brief Pointers to enet clocks for each instance. */
5758
extern clock_ip_name_t s_enetClock[FSL_FEATURE_SOC_ENET_COUNT];
59+
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
5860

5961
/*******************************************************************************
6062
* Code
@@ -64,14 +66,30 @@ status_t PHY_Init(ENET_Type *base, uint32_t phyAddr, uint32_t srcClock_Hz)
6466
{
6567
uint32_t bssReg;
6668
uint32_t counter = PHY_TIMEOUT_COUNT;
69+
uint32_t idReg = 0;
6770
status_t result = kStatus_Success;
6871
uint32_t instance = ENET_GetInstance(base);
6972

73+
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
7074
/* Set SMI first. */
7175
CLOCK_EnableClock(s_enetClock[instance]);
76+
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
7277
ENET_SetSMI(base, srcClock_Hz, false);
7378

79+
/* Initialization after PHY stars to work. */
80+
while ((idReg != PHY_CONTROL_ID1) && (counter != 0))
81+
{
82+
PHY_Read(base, phyAddr, PHY_ID1_REG, &idReg);
83+
counter --;
84+
}
85+
86+
if (!counter)
87+
{
88+
return kStatus_Fail;
89+
}
90+
7491
/* Reset PHY. */
92+
counter = PHY_TIMEOUT_COUNT;
7593
result = PHY_Write(base, phyAddr, PHY_BASICCONTROL_REG, PHY_BCTL_RESET_MASK);
7694
if (result == kStatus_Success)
7795
{

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/TARGET_FRDM/fsl_phy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2015, Freescale Semiconductor, Inc.
3-
* All rights reserved.
3+
* Copyright 2016-2017 NXP
44
*
55
* Redistribution and use in source and binary forms, with or without modification,
66
* are permitted provided that the following conditions are met:
@@ -12,7 +12,7 @@
1212
* list of conditions and the following disclaimer in the documentation and/or
1313
* other materials provided with the distribution.
1414
*
15-
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
15+
* o Neither the name of the copyright holder nor the names of its
1616
* contributors may be used to endorse or promote products derived from this
1717
* software without specific prior written permission.
1818
*

0 commit comments

Comments
 (0)