forked from FreeRTOS/FreeRTOS-Plus-TCP
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Ethernet driver for Corstone-300 FVP (MPS3_AN552) (FreeRTOS#1009)
* 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]> * ci: Update spell-check dictionary Signed-off-by: Devaraj Ranganna <[email protected]> * networkinterface: Fix formatting issues Signed-off-by: Devaraj Ranganna <[email protected]> --------- Signed-off-by: Devaraj Ranganna <[email protected]>
- Loading branch information
Showing
26 changed files
with
14,753 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
source/portable/NetworkInterface/MPS3_AN552/CMSIS_Driver/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2023 Arm Limited and/or its affiliates | ||
# <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
|
||
target_sources( freertos_plus_tcp_network_if | ||
PRIVATE | ||
ETH_LAN91C111.c | ||
) | ||
|
||
target_include_directories( freertos_plus_tcp_network_if | ||
PRIVATE | ||
. | ||
) |
77 changes: 77 additions & 0 deletions
77
source/portable/NetworkInterface/MPS3_AN552/CMSIS_Driver/Driver_Common.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* *INDENT-OFF* */ | ||
|
||
/* | ||
* Copyright (c) 2013-2017 ARM Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the License); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* $Date: 2. Feb 2017 | ||
* $Revision: V2.0 | ||
* | ||
* Project: Common Driver definitions | ||
*/ | ||
|
||
/* History: | ||
* Version 2.0 | ||
* Changed prefix ARM_DRV -> ARM_DRIVER | ||
* Added General return codes definitions | ||
* Version 1.10 | ||
* Namespace prefix ARM_ added | ||
* Version 1.00 | ||
* Initial release | ||
*/ | ||
|
||
/* This file is a copy of | ||
* https://github.com/ARM-software/CMSIS_5/blob/a75f01746df18bb5b929dfb8dc6c9407fac3a0f3/CMSIS/Driver/Include/Driver_Common.h | ||
*/ | ||
|
||
#ifndef DRIVER_COMMON_H_ | ||
#define DRIVER_COMMON_H_ | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <stdbool.h> | ||
|
||
#define ARM_DRIVER_VERSION_MAJOR_MINOR(major,minor) (((major) << 8) | (minor)) | ||
|
||
/** | ||
\brief Driver Version | ||
*/ | ||
typedef struct _ARM_DRIVER_VERSION { | ||
uint16_t api; ///< API version | ||
uint16_t drv; ///< Driver version | ||
} ARM_DRIVER_VERSION; | ||
|
||
/* General return codes */ | ||
#define ARM_DRIVER_OK 0 ///< Operation succeeded | ||
#define ARM_DRIVER_ERROR -1 ///< Unspecified error | ||
#define ARM_DRIVER_ERROR_BUSY -2 ///< Driver is busy | ||
#define ARM_DRIVER_ERROR_TIMEOUT -3 ///< Timeout occurred | ||
#define ARM_DRIVER_ERROR_UNSUPPORTED -4 ///< Operation not supported | ||
#define ARM_DRIVER_ERROR_PARAMETER -5 ///< Parameter error | ||
#define ARM_DRIVER_ERROR_SPECIFIC -6 ///< Start of driver specific errors | ||
|
||
/** | ||
\brief General power states | ||
*/ | ||
typedef enum _ARM_POWER_STATE { | ||
ARM_POWER_OFF, ///< Power off: no operation possible | ||
ARM_POWER_LOW, ///< Low Power mode: retain state, detect and signal wake-up events | ||
ARM_POWER_FULL ///< Power on: full operation at maximum performance | ||
} ARM_POWER_STATE; | ||
|
||
#endif /* DRIVER_COMMON_H_ */ | ||
|
||
/* *INDENT-ON* */ |
95 changes: 95 additions & 0 deletions
95
source/portable/NetworkInterface/MPS3_AN552/CMSIS_Driver/Driver_ETH.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* *INDENT-OFF* */ | ||
|
||
/* | ||
* Copyright (c) 2013-2020 ARM Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the License); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* $Date: 24. January 2020 | ||
* $Revision: V2.2 | ||
* | ||
* Project: Ethernet PHY and MAC Driver common definitions | ||
*/ | ||
|
||
/* History: | ||
* Version 2.2 | ||
* Removed volatile from ARM_ETH_LINK_INFO | ||
* Version 2.1 | ||
* ARM_ETH_LINK_INFO made volatile | ||
* Version 2.0 | ||
* Removed ARM_ETH_STATUS enumerator | ||
* Removed ARM_ETH_MODE enumerator | ||
* Version 1.10 | ||
* Namespace prefix ARM_ added | ||
* Version 1.00 | ||
* Initial release | ||
*/ | ||
|
||
/* This file is a copy of | ||
* https://github.com/ARM-software/CMSIS_5/blob/a75f01746df18bb5b929dfb8dc6c9407fac3a0f3/CMSIS/Driver/Include/Driver_ETH.h | ||
*/ | ||
|
||
#ifndef DRIVER_ETH_H_ | ||
#define DRIVER_ETH_H_ | ||
|
||
#include "Driver_Common.h" | ||
|
||
/** | ||
\brief Ethernet Media Interface type | ||
*/ | ||
#define ARM_ETH_INTERFACE_MII (0U) ///< Media Independent Interface (MII) | ||
#define ARM_ETH_INTERFACE_RMII (1U) ///< Reduced Media Independent Interface (RMII) | ||
#define ARM_ETH_INTERFACE_SMII (2U) ///< Serial Media Independent Interface (SMII) | ||
|
||
/** | ||
\brief Ethernet link speed | ||
*/ | ||
#define ARM_ETH_SPEED_10M (0U) ///< 10 Mbps link speed | ||
#define ARM_ETH_SPEED_100M (1U) ///< 100 Mbps link speed | ||
#define ARM_ETH_SPEED_1G (2U) ///< 1 Gpbs link speed | ||
|
||
/** | ||
\brief Ethernet duplex mode | ||
*/ | ||
#define ARM_ETH_DUPLEX_HALF (0U) ///< Half duplex link | ||
#define ARM_ETH_DUPLEX_FULL (1U) ///< Full duplex link | ||
|
||
/** | ||
\brief Ethernet link state | ||
*/ | ||
typedef enum _ARM_ETH_LINK_STATE { | ||
ARM_ETH_LINK_DOWN, ///< Link is down | ||
ARM_ETH_LINK_UP ///< Link is up | ||
} ARM_ETH_LINK_STATE; | ||
|
||
/** | ||
\brief Ethernet link information | ||
*/ | ||
typedef struct _ARM_ETH_LINK_INFO { | ||
uint32_t speed : 2; ///< Link speed: 0= 10 MBit, 1= 100 MBit, 2= 1 GBit | ||
uint32_t duplex : 1; ///< Duplex mode: 0= Half, 1= Full | ||
uint32_t reserved : 29; | ||
} ARM_ETH_LINK_INFO; | ||
|
||
/** | ||
\brief Ethernet MAC Address | ||
*/ | ||
typedef struct _ARM_ETH_MAC_ADDR { | ||
uint8_t b[6]; ///< MAC Address (6 bytes), MSB first | ||
} ARM_ETH_MAC_ADDR; | ||
|
||
#endif /* DRIVER_ETH_H_ */ | ||
|
||
/* *INDENT-ON* */ |
Oops, something went wrong.