Skip to content

Commit ad8f79a

Browse files
committed
networkinterface: Add Ethernet driver for Corstone-300 FVP (MPS3_AN552)
The Corstone-300 FVP models SMSC 91C111 Ethernet controller. Add a network interface based on CMSIS ethernet driver for SMSC 91C111. Signed-off-by: Devaraj Ranganna <[email protected]>
1 parent 160fa29 commit ad8f79a

25 files changed

+14226
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ set(FREERTOS_PLUS_TCP_NETWORK_IF_LIST
6262
LPC17xx LPC18xx LPC54018
6363
M487
6464
MPS2_AN385
65+
MPS3_AN552
6566
MW300_RD
6667
PIC32MZEF_ETH PIC32MZEF_WIFI
6768
POSIX WIN_PCAP # Native Linux & Windows respectively
@@ -104,6 +105,7 @@ if(NOT FREERTOS_PLUS_TCP_NETWORK_IF IN_LIST FREERTOS_PLUS_TCP_NETWORK_IF_LIST )
104105
" LPC54018 Target: LPC54018 Tested: TODO\n"
105106
" M487 Target: M487 Tested: TODO\n"
106107
" MPS2_AN385 Target: MPS2_AN385 Tested: TODO\n"
108+
" MPS3_AN552 Target: MPS3_AN552"
107109
" MW300_RD Target: mw300_rd Tested: TODO\n"
108110
" PIC32MZEF_ETH Target: pic32mzef ethernet Tested: TODO\n"
109111
" PIC32MZEF_WIFI Target: pic32mzef Wifi Tested: TODO\n"

source/portable/NetworkInterface/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ add_subdirectory(LPC18xx)
4141
add_subdirectory(LPC54018)
4242
add_subdirectory(M487)
4343
add_subdirectory(MPS2_AN385)
44+
add_subdirectory(MPS3_AN552)
4445
add_subdirectory(mw300_rd)
4546
add_subdirectory(pic32mzef)
4647
add_subdirectory(RX)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2023 Arm Limited and/or its affiliates
2+
3+
# SPDX-License-Identifier: MIT
4+
5+
target_sources( freertos_plus_tcp_network_if
6+
PRIVATE
7+
ETH_LAN91C111.c
8+
)
9+
10+
target_include_directories( freertos_plus_tcp_network_if
11+
PRIVATE
12+
.
13+
)
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* *INDENT-OFF* */
2+
3+
/*
4+
* Copyright (c) 2013-2017 ARM Limited. All rights reserved.
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the License); you may
9+
* not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
16+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*
20+
* $Date: 2. Feb 2017
21+
* $Revision: V2.0
22+
*
23+
* Project: Common Driver definitions
24+
*/
25+
26+
/* History:
27+
* Version 2.0
28+
* Changed prefix ARM_DRV -> ARM_DRIVER
29+
* Added General return codes definitions
30+
* Version 1.10
31+
* Namespace prefix ARM_ added
32+
* Version 1.00
33+
* Initial release
34+
*/
35+
36+
/* This file is a copy of
37+
* https://github.com/ARM-software/CMSIS_5/blob/a75f01746df18bb5b929dfb8dc6c9407fac3a0f3/CMSIS/Driver/Include/Driver_Common.h
38+
*/
39+
40+
#ifndef DRIVER_COMMON_H_
41+
#define DRIVER_COMMON_H_
42+
43+
#include <stddef.h>
44+
#include <stdint.h>
45+
#include <stdbool.h>
46+
47+
#define ARM_DRIVER_VERSION_MAJOR_MINOR(major,minor) (((major) << 8) | (minor))
48+
49+
/**
50+
\brief Driver Version
51+
*/
52+
typedef struct _ARM_DRIVER_VERSION {
53+
uint16_t api; ///< API version
54+
uint16_t drv; ///< Driver version
55+
} ARM_DRIVER_VERSION;
56+
57+
/* General return codes */
58+
#define ARM_DRIVER_OK 0 ///< Operation succeeded
59+
#define ARM_DRIVER_ERROR -1 ///< Unspecified error
60+
#define ARM_DRIVER_ERROR_BUSY -2 ///< Driver is busy
61+
#define ARM_DRIVER_ERROR_TIMEOUT -3 ///< Timeout occurred
62+
#define ARM_DRIVER_ERROR_UNSUPPORTED -4 ///< Operation not supported
63+
#define ARM_DRIVER_ERROR_PARAMETER -5 ///< Parameter error
64+
#define ARM_DRIVER_ERROR_SPECIFIC -6 ///< Start of driver specific errors
65+
66+
/**
67+
\brief General power states
68+
*/
69+
typedef enum _ARM_POWER_STATE {
70+
ARM_POWER_OFF, ///< Power off: no operation possible
71+
ARM_POWER_LOW, ///< Low Power mode: retain state, detect and signal wake-up events
72+
ARM_POWER_FULL ///< Power on: full operation at maximum performance
73+
} ARM_POWER_STATE;
74+
75+
#endif /* DRIVER_COMMON_H_ */
76+
77+
/* *INDENT-ON* */
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/* *INDENT-OFF* */
2+
3+
/*
4+
* Copyright (c) 2013-2020 ARM Limited. All rights reserved.
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the License); you may
9+
* not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
16+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*
20+
* $Date: 24. January 2020
21+
* $Revision: V2.2
22+
*
23+
* Project: Ethernet PHY and MAC Driver common definitions
24+
*/
25+
26+
/* History:
27+
* Version 2.2
28+
* Removed volatile from ARM_ETH_LINK_INFO
29+
* Version 2.1
30+
* ARM_ETH_LINK_INFO made volatile
31+
* Version 2.0
32+
* Removed ARM_ETH_STATUS enumerator
33+
* Removed ARM_ETH_MODE enumerator
34+
* Version 1.10
35+
* Namespace prefix ARM_ added
36+
* Version 1.00
37+
* Initial release
38+
*/
39+
40+
/* This file is a copy of
41+
* https://github.com/ARM-software/CMSIS_5/blob/a75f01746df18bb5b929dfb8dc6c9407fac3a0f3/CMSIS/Driver/Include/Driver_ETH.h
42+
*/
43+
44+
#ifndef DRIVER_ETH_H_
45+
#define DRIVER_ETH_H_
46+
47+
#include "Driver_Common.h"
48+
49+
/**
50+
\brief Ethernet Media Interface type
51+
*/
52+
#define ARM_ETH_INTERFACE_MII (0U) ///< Media Independent Interface (MII)
53+
#define ARM_ETH_INTERFACE_RMII (1U) ///< Reduced Media Independent Interface (RMII)
54+
#define ARM_ETH_INTERFACE_SMII (2U) ///< Serial Media Independent Interface (SMII)
55+
56+
/**
57+
\brief Ethernet link speed
58+
*/
59+
#define ARM_ETH_SPEED_10M (0U) ///< 10 Mbps link speed
60+
#define ARM_ETH_SPEED_100M (1U) ///< 100 Mbps link speed
61+
#define ARM_ETH_SPEED_1G (2U) ///< 1 Gpbs link speed
62+
63+
/**
64+
\brief Ethernet duplex mode
65+
*/
66+
#define ARM_ETH_DUPLEX_HALF (0U) ///< Half duplex link
67+
#define ARM_ETH_DUPLEX_FULL (1U) ///< Full duplex link
68+
69+
/**
70+
\brief Ethernet link state
71+
*/
72+
typedef enum _ARM_ETH_LINK_STATE {
73+
ARM_ETH_LINK_DOWN, ///< Link is down
74+
ARM_ETH_LINK_UP ///< Link is up
75+
} ARM_ETH_LINK_STATE;
76+
77+
/**
78+
\brief Ethernet link information
79+
*/
80+
typedef struct _ARM_ETH_LINK_INFO {
81+
uint32_t speed : 2; ///< Link speed: 0= 10 MBit, 1= 100 MBit, 2= 1 GBit
82+
uint32_t duplex : 1; ///< Duplex mode: 0= Half, 1= Full
83+
uint32_t reserved : 29;
84+
} ARM_ETH_LINK_INFO;
85+
86+
/**
87+
\brief Ethernet MAC Address
88+
*/
89+
typedef struct _ARM_ETH_MAC_ADDR {
90+
uint8_t b[6]; ///< MAC Address (6 bytes), MSB first
91+
} ARM_ETH_MAC_ADDR;
92+
93+
#endif /* DRIVER_ETH_H_ */
94+
95+
/* *INDENT-ON* */

0 commit comments

Comments
 (0)