4.12. ETHTRCV Module

4.12.1. Acronyms and Definitions

Abbreviation/Term

Explanation

AUTOSAR

Automotive Open System Architecture

BSW

Basic Software

MCAL

Micro Controller Abstraction Layer

DET

Default Error Tracer

EC

Ethernet controller

Eth

Ethernet Controller Driver (AUTOSAR BSW module)

EthIf

Ethernet Interface (AUTOSAR BSW module)

EthTrcv

Ethernet Transceiver Driver (AUTOSAR BSW module)

MCG

Module Configuration Generator

MII

Media Independent Interface (standardized Interface provided by Ethernet controllers to access Ethernet transceivers)

4.12.2. Introduction

This document describes the functionality and configuration of the AUTOSAR BSW module Ethernet Transceiver. The Ethernet transceiver driver is a hardware abstraction layer with a standardized interface to the Eth Interface layer.

Supported AUTOSAR Release

4.3.1

Supported Configuration Variants

Pre-Compile time, Link-time, post-build time

Vendor ID

ETHTRCV_VENDOR_ID (44)

Module ID

ETHTRCV_MODULE_ID (73)

Supported Platform

AM263Px

4.12.3. Functional Overview

The EthTrcv module initializes and controls the Ethernet transceivers (commonly called as Ethernet PHYs). It provides services to configure all PHYs present on board to enable transfer of Ethernet frames. It uses MII APIs of Eth driver.

4.12.3.1. Driver Architecture

The following figure shows where the EthTrcv is located in the AUTOSAR architecture.

Simplified View of the EthTrcv driver Architecture

Fig. 4.59 Simplified View of the EthTrcv driver Architecture

Below figure shows EthTrcv driver in Ethernet stack module

Ethernet stack module overview

Fig. 4.60 Ethernet stack module overview

4.12.3.2. Initialization

EthTrcv_Init called to initialize the EthTrcv driver at power on, and on this the driver state will change to ETHTRCV_STATE_INIT.

The initialization covers the following steps

  1. Reset transceiver.

  2. Check link status and if link is up, configuring all transceiver configuration parameters (e.g., baud rate, duplex mode, automatic negotiation).

  3. Set loopback mode, if enabled in configuration.

4.12.3.3. States

The states and modes of the EthTrcv driver define whether the EthTrcv driver is operational or not. There are two states in which the Ethernet hardware/driver can be in.

  1. ETHTRCV_STATE_UNINIT: This is the state when the Driver is not yet configured.

  2. ETHTRCV_STATE_INIT: This is the state when the Driver is configured and initialization was successful.

4.12.3.4. ETHTRCV modes

There are 2 modes in which the EthTrcv driver can be in.

  1. ETHTRCV_MODE_DOWN: This mode can be set by the EthTrcv_SetTransceiverMode to disable the EthTrcv.

  2. ETHTRCV_MODE_ACTIVE: This is the state in which the hardware is initialized and is running.

The states and modes coexist. The modes of the driver can be changed by the API EthTrcv_SetTransceiverMode.

4.12.3.5. Auto-negotiation

In Auto negotiation Ethernet controller and Transceiver (PHY) choose common transmission parameters, such as speed, duplex mode, and flow control. They first share their capabilities regarding these parameters and then choose the highest performance transmission mode they both support.

EthTrcv driver initiates auto-negotiation process. Also, separate API EthTrcv_StartAutoNegotiation can be used. The parameters used for auto-negotiation are passed during initialization through structure EthTrcv Config.

4.12.3.6. Assumptions

The Ethernet BSW stack is intended to be used wherever high data rates are required but no hard real-time is required. Of course, it can also be used for less-demanding use cases, i.e. for low data rates.

4.12.3.7. Limitations

The Ethernet Transceiver Driver module is only able to handle a single thread of execution. The execution must not be pre-empted by itself.

4.12.3.8. Design overview

Will be updated in next release

4.12.4. Hardware Features

4.12.4.1. IP Supported Features

  • 10, 100 Mbps Full and Half Duplex.

  • 1000 Mbps Full Duplex.

  • Auto-Negotiation for all Speeds.

  • Link monitoring.

  • Loop Back Mode.

  • RGMII MAC Interface.

  • Supported PHY : DP83869HM

4.12.4.2. AUTOSAR Supported Features

  • Initialization of ETHTRCV.

  • Enable Auto-negotiation.

  • Configuration of Speed, Duplex mode, and Baud rate.

  • Link monitoring.

4.12.4.3. Not supported Features

  • 1000 Mbps half-duplex mode. (As it is not supporting in AM263Px Ethernet)

  • SGMII MAC Interface not supported by software as it is not supported in AM263Px Ethernet.

  • MII MAC Interface supported by hardware but not implemented.

  • Wakeup mode features supported by PHY but not implemented because DP83869HM is industrial PHY not an automotive PHY.

4.12.4.4. Non compliance

4.12.4.4.1. Deviations to requirements (Requirement Traceability)

4.12.4.4.1.1. Deviation of requirements against AUTOSAR specification requirements

Will be updated in next release

4.12.5. Source files

Static source C Files are defined below

📦AM263Px
┣ 📂build
┣ 📂mcal
┃ ┣ 📂EthTrcv
┃ ┃ ┣ 📂include
┃ ┃ ┃ ┣ 📜EthTrcv.h : Contains the APIs of the EthTrcv driver to be used.
┃ ┃ ┃ ┣ 📜EthTrcv_Types.h : Contains the types used in Ethernet transceiver.
┃ ┃ ┣ 📂src
┃ ┃ ┃ ┣ 📜EthTrcv.c : Contains the implementation of the APIs for EthTrcv.
┃ ┃ ┣ 📂V0
┃ ┃ ┃ ┗ 📜EthTrcv_Priv.c : Contains module private functions used by main APIs.
┃ ┃ ┃ ┣ 📜EthTrcv_Priv.h : Internal header file.
┃ ┃ ┗ 📜Makefile
┃ 📂mcal_config
┃ 📂mcal_docs
┃ 📜README.txt

Plugin files are defined below in the table.

Plugin Files

Description

EthTrcv_Cfg.h

Contains the pre-compiler switches

EthTrcv_Cfg.c

Contains the Pre compile configuration parameters

EthTrcv_Lcfg.c

Contains the Link time configuration parameters

EthTrcv_PBcfg.c

Contains the Post build configuration parameters

The below diagram shows the files structure for the ETHTRCV driver.

File Structure

Fig. 4.61 File Structure

4.12.6. Module requirements

Will be updated in next release

4.12.6.1. Memory Mapping

The objects (e.g., variables, functions, constants) are declared by compiler independent definitions – the compiler abstraction definitions. Each compiler abstraction definition is assigned to a memory section.

The following table contains the memory section names and the compiler abstraction definitions defined for the EthTrcv and illustrate their assignment among each other.

Memory Mapping Sections

ETHTRCV_CODE

ETHTRCV_VAR

ETHTRCV_VAR_NOINIT

ETHTRCV_CONST

ETHTRCV_START_SEC_VAR_INIT_UNSPECIFIED (.data)

x

ETHTRCV_STOP_SEC_VAR_INIT_UNSPECIFIED

x

ETHTRCV_START_SEC_CODE (.text)

x

ETHTRCV_STOP_SEC_CODE

x

ETHTRCV_START_SEC_VAR_NO_INIT_UNSPECIFIED (.bss)

x

ETHTRCV_STOP_SEC_VAR_NO_INIT_UNSPECIFIED

x

ETHTRCV_START_SEC_CONST_UNSPECIFIED (.const)

x

ETHTRCV_STOP_SEC_CONST_UNSPECIFIED

x

ETHTRCV_START_SEC_CODE_ISR (.text)

x

ETHTRCV_STOP_SEC_CODE_ISR

x

4.12.6.2. Scheduling

4.12.6.2.1. SchM (Optional)

Beside the OS the BSW Scheduler provides functions that module EthTrcv calls at begin and end of critical sections.

4.12.6.2.2. Critical Sections

There is only one kind of critical sections in this driver. Within these sections all read /modify/write accesses to internal EthTrcv status variables must be protected. Therefore, switching to tasks that also access EthTrcv must be avoided and all EthTrcv interrupts have to be suspended.

4.12.6.3. Error handling

4.12.6.3.1. Development Error Reporting (DET)

The errors reported to DET are described in the following table

Type of Error

Related Error code

Value (Hex)

API service called with wrong transceiver index.

ETHTRCV_E_INV_TRCV_IDX

0x01

API service called when transceiver is not initialized.

ETHTRCV_E_UNINIT

0x02

API is called with wrong pointer value (e.g., NULL pointer)

ETHTRCV_E_PARAM_POINTER

0x03

API is called with not supported mode

ETHTRCV_E_NOT_SUPPORTED

0x04

The following table shows which parameter checks are performed on which services:

Services

ETHTRCV_E_INV_TRCV_IDX

ETHTRCV_E_UNINIT

ETHTRCV_E_PARAM_POINTER

ETHTRCV_E_NOT_SUPPORTED

EthTrcv_Init

x

x

EthTrcv_SetTransceiverMode

x

x

EthTrcv_GetTransceiverMode

x

x

x

EthTrcv_StartAutoNegotiation

x

x

EthTrcv_GetLinkState

x

x

x

EthTrcv_GetBaudRate

x

x

x

EthTrcv_GetDuplexMode

x

x

x

EthTrcv_WriteMiiIndication

EthTrcv_ReadMiiIndication

EthTrcv_GetVersionInfo

x

EthTrcv_MainFunction

x

EthTrcv_SetPhyTestMode

x

x

x

EthTrcv_SetPhyLoopbackMode

x

x

x

EthTrcv_GetPhySignalQuality

x

x

x

EthTrcv_SetPhyTxMode

x

x

x

EthTrcv_GetCableDiagnosticsResult

x

x

x

EthTrcv_GetPhyIdentifier

x

x

x

4.12.6.3.2. Runtime Errors

There are no runtime errors.

4.12.6.3.3. DEM Errors

The errors reported to DEM are described in the following table:

DEM

Error Code

Description

Assigned by DEM

ETHTRCV_E_ACCESS

This error is raised when monitoring the access to the Ethernet Transceiver fails.

Assigned by DEM

ETHTRCV_E_HARDWARE_ERROR

This error is reference to the DemEventParameter which shall be issued when the error “Timeout on blocking API call occurs” has occurred.

4.12.7. Used resources

4.12.7.1. Interrupt Handling

EthTrcv driver does not provide any ISR, it is taken care in Ethernet.

4.12.7.2. Instance support

Will be updated in the next release

4.12.7.3. Hardware-Software Mapping

EthTrcv driver does not provide any ISR, it is taken care in Ethernet.

4.12.8. Integration description

4.12.8.1. Dependent modules

4.12.8.1.1. Eth Driver

EthTrcv driver depends on Ethernet Controller Driver (Eth) for transceiver access via Media Independent Interface (MII). Eth APIs Eth_ReadMII and Eth_WriteMII are used by EthTrcv for accessing transceiver registers.

4.12.8.1.2. MCU

The module MCU powers up the microcontroller peripherals at startup time and initializes the PLL and the internal clock domains which go to the Ethernet controller. No specific initialization needed for transceiver.

4.12.8.1.3. PORT

No specific port configuration is needed for EthTrcv driver, though to access transceiver registers we need port configuration which is done as a part of Eth driver port configuration.

4.12.8.1.4. AUTOSAR OS (Optional)

An operating system can be used for task scheduling, interrupt handling, global suspend and restore of interrupts and creating of the Interrupt Vector Table. The EthTrcv module may use OSEK/AUTOSAR OS to suspend and restore global interrupts.

4.12.8.1.5. DET

The module EthTrcv depends on the DET (by default) to report development errors. Detection and reporting of development errors can be enabled or disabled by the switch “Enable Development Error Detection” on the tab “General Settings” within the module EthTrcv.

The DET can be replaced optionally by an equivalent component which is responsible to recognize development errors, if no DET component is available.

4.12.8.1.6. DEM

By default, production code related errors are reported to the DEM using the service Dem_SetEventStatus().

4.12.8.1.7. Callback Notification

EthTrcv have two Callback Notifications:

  1. EthTrcv_ReadMiiIndication : Called when information has been read out via MII interface. Triggered by previous Eth_ReadMii call. EthTrcv_ReadMiiIndication can directly be called within Eth_ReadMii.

  2. EthTrcv_WriteMiiIndication : Called when information has been written via MII interface. Triggered by previous Eth_WriteMii call. EthTrcv_WriteMiiIndication can directly be called within Eth_WriteMii.

4.12.8.2. Multi-core and Resource allocator

Will be updated in the next release

4.12.9. Configuration

The ETHTRCV is configured through GUI in Post-Build, Pre-Compile and Link-Time Variants.

Variants

Configured Files

PostBuild

EthTrcv_PBcfg.c , EthTrcv_Cfg.h

Pre-Compile

EthTrcv_Cfg.c , EthTrcv_Cfg.h

Link-Compile

EthTrcv_Lcfg.c , EthTrcv_Cfg.h

4.12.9.1. Parameter Description

4.12.9.1.1. Standard Configuration

Standard Parameters

Description

Default Value

Range

Unit/DataType

EthTrcvAutoNegotiationEnabled

Specifies if Auto-Negotiation is enabled (TRUE) or disabled (FALSE) for determination of the Ethernet transceiver speed

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvConnNeg

Specifies the connection negotiation of the Ethernet transceiver link

TRCV_CONN_NEG_AUTO

TRCV_CONN_NEG_AUTO

TRCV_CONN_NEG_MASTER

TRCV_CONN_NEG_SLAVE

ENUMERATION

EthTrcvCtrlIdx

Specifies the controller used for MII access to the transceiver

0

0..255

INTEGER

EthTrcvDuplexMode

Specifies the duplex mode of the Ethernet transceiver link if Auto-Negotiation is disabled. This parameter is ignored if Auto-Negotiation is enabled

ETHTRCV_DUPLEX_MODE_FULL

ETHTRCV_DUPLEX_MODE_FULL

ETHTRCV_DUPLEX_MODE_HALF

ENUMERATION

EthTrcvIdx

Specifies the instance ID of the configured transceiver

0

0..255

INTEGER

EthTrcvPhysLayerType

Specifies the physical layer type of the Ethernet transceiver link

TRCV_PHYS_LAYER_TYPE_100BASE_T1

TRCV_PHYS_LAYER_TYPE_1000BASE_T

TRCV_PHYS_LAYER_TYPE_1000BASE_T1

TRCV_PHYS_LAYER_TYPE_100BASE_T1

TRCV_PHYS_LAYER_TYPE_100BASE_TX

ENUMERATION

EthTrcvPortMacLayerSpeed

Defines the baud rate of the MAC layer

ETH_MAC_LAYER_SPEED_100M

ETH_MAC_LAYER_SPEED_100M

ETH_MAC_LAYER_SPEED_10G

ETH_MAC_LAYER_SPEED_10M

ETH_MAC_LAYER_SPEED_1G

ENUMERATION

EthTrcvPortMacLayerSubType

Defines the MAC layer subtype of a switch port

REDUCED

REDUCED

REVERSED

SERIAL

STANDARD

UNIVERSAL_SERIAL

ENUMERATION

EthTrcvPortMacLayerType

Defines the MAC layer type of the ethernet transceiver

TRCV_MAC_LAYER_TYPE_XMII

TRCV_MAC_LAYER_TYPE_XGMII

TRCV_MAC_LAYER_TYPE_XMII

TRCV_MAC_LAYER_TYPE_XXGMII

ENUMERATION

EthTrcvSpeed

Specifies the speed of the Ethernet transceiver link in [MBit/s]. If AutoNegotiation is enabled this is the maximum speed advertised for Auto-Negotiation. In AM263x only TRCV_SPEED_10 and TRCV_SPEED_100 is supported

TRCV_SPEED_100

TRCV_SPEED_10

TRCV_SPEED_100

ENUMERATION

EthTrcvIcuChannelRef

Reference to the IcuChannel to enable/disable the interrupts for wakeups

Reference

Reference

REFERENCE

ETHTRCV_E_ACCESS

Reference to the DemEventParameter which shall be issued when the error “Transceiver access failed” has occurred

Reference

Reference

REFERENCE

EthTrcvMiiIdx

Specifies the transceiver index used for MII access to the transceiver

0

0..255

INTEGER

EthTrcvMiiSelection

This parameter specifies the type of transceiver / controller interface. The interface is either MII, Light-MII or RGMII

RGMII

LIGHT_MII

MII

RGMII

ENUMERATION

EthTrcvSwitchPortRef

Reference to a switch port and it’s not implementated in AM263x

Reference

Reference

REFERENCE

EthTrcvSwitchRef

Reference to a switch configuration container and it’s not implementated in AM263x

Reference

Reference

REFERENCE

EthTrcvDevErrorDetect

Switches the development error detection and notification on or off

FALSE

TRUE

FALSE

BOOLEAN

EthTrcvGetBaudRateApi

Enables / Disables EthTrcv_GetBaudRate API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvGetCableDiagnosticsResultApi

Enables / Disables EthTrcv_GetCableDiagnosticsResult API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvGetDuplexModeApi

Enables / Disables EthTrcv_GetDuplexMode API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvGetLinkStateApi

Enables / Disables EthTrcv_GetLinkState API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvGetPhyIdentifierApi

Enables / Disables EthTrcv_GetPhyIdentifier API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvGetPhySignalQualityApi

Enables / Disables EthTrcv_GetPhySignalQuality API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvGetTransceiverModeApi

Enables / Disables EthTrcv_GetTransceiverMode API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvGetTransceiverWakeupModeApi

Enables / Disables EthTrcvGetTransceiverWakeupModeApi API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvIndex

Specifies the InstanceId of this module instance. If only one instance is present it shall have the Id 0

0

0..255

INTEGER

EthTrcvMainFunctionPeriod

Specifies the period of main function EthTrcv_MainFunction in seconds

10

0.0..Infinity

FLOAT

EthTrcvMaxTrcvsSupported

Specifies the maximum number of transceivers supported

1

0..255

INTEGER

EthTrcvSetPhyTestModeApi

Enables / Disables EthTrcv_SetPhyTestMode API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvSetPhyTxModeApi

Enables / Disables EthTrcv_SetPhyTxMode API

FALSE

TRUE

FALSE

BOOLEAN

EthTrcvSetTransceiverModeApi

Enables / Disables EthTrcv_SetTransceiverMode API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvStartAutoNegotiationApi

Enables / Disables EthTrcv_StartAutoNegotiation API

TRUE

TRUE

FALSE

BOOLEAN

EthTrcvVersionInfoApi

Enables / Disables version info API

FALSE

TRUE

FALSE

BOOLEAN

EthTrcvVersionInfoApiMacro

Enables / Disables version info API macro implementation

FALSE

TRUE

FALSE

BOOLEAN

EthTrcvWakeUpSupport

Configures wake-up to polling or interrupt or to not used/not supported. In case no wake up is supported by the hardware, the BSWMD pre-configuration shall be set to ETHTRCV_WAKEUP_NOT_SUPPORTED

ETHTRCV_WAKEUP_NOT_SUPPORTED

ETHTRCV_WAKEUP_BY_INTERRUPT

ETHTRCV_WAKEUP_BY_POLLING

ETHTRCV_WAKEUP_NOT_SUPPORTED

ENUMERATION

4.12.9.1.2. IP Specific Configuration

IP Name

Description

EthTrcvEnableLoopback

To enable Phy loopback for Test purpose

EthTrcvGigabitCapabilityEnabled

To enable GigabitCapability for Test purpose

ETHTRCV_E_HARDWARE_ERROR

Reference to the DemEventParameter which shall be issued when the error “Timeout on blocking API call occurs” has occurred

EthTrcvCapabTypeEnum

Enumerates Advertisement configurations

EthTrcvPhyAdvertiseCapability

This parameter defines the transceiver advertise capability

EthTrcvLinkPartnerCapability

This parameter defines the transceiver Link partner capability

EthTrcvAutoNegotiationWaitCountTicks

Ethernet Transceiver delay after autonegotiation started to autonegotiation completed. Transceiver (PHY) sets auto-negotiation status bit in status register once it is complete. Depending on Transceiver type, MDIO frequency it will take different time. Change count value if transceiver detection fails in auto-negotiation. For auto-negotiation configuring wait count to 100ms.

EthTrcvLinkStatusWaitCountTicks

Wait for link status to become up after configuration

EthTrcvMaxControllersSupported

This is for Maximum Controller Supported

EthTrcvMaxTrcvConfigSupported

Maximum number of configurations supported. The config Index passed to EthTrcv APIs should be less than this value

EthTrcvDefaultOSCounterId

Default Os Counter Id if node reference to OsCounter ref EthTrcvOsCounterRef is not set

EthTrcvTimeoutDuration

ETHTRCV timeout - used in ETHTRCV busy wait

EthTrcvInternalLoopbackMode

Configures Internal Loopback mode to Analog or Digital

EthTrcvOsCounterRef

This parameter contains a reference to the OsCounter, which is used by the ETHTRCV driver

EthTrcvDeviceVariant

To Select SOC AM263Px Variant

Note: EthTrcvTimeoutDuration, EthTrcvAutoNegotiationWaitCountTicks and EthTrcvLinkStatusWaitCountTicks parameter Value should be passed as number of ticks according to clock frequency. The clock source have changed from RTI timers which used 200MHz clock frequency to R5f timers which uses 400MHz clock frequency, so the timeout values need to be configured accordingly.

4.12.9.2. Symbolic Names deviations

None

4.12.9.3. Configuration rules and constraints to enable plausibility checks

Not Applicable.

4.12.10. Examples

4.12.10.1. Overview

For Eth and EthTrcv we have common example, So please refer

Examples <AM263Px/Module_User_Guide_Eth.md#examples>

4.12.10.2. Hardware Software Setup and Tools

None

4.12.10.3. Steps to build and run example

For Eth and EthTrcv we have common example, So please refer

Examples <AM263Px/Module_User_Guide_Eth.md#examples>

4.12.10.4. Example Logs

Please refer Examples <AM263Px/Module_User_Guide_Eth.md#examples>

4.12.10.5. File Structure

Will be updated in next release

4.12.11. FAQ’s

None

4.12.12. Test Report

Please refer AM26x EthTrcv Driver Test Case Report as part of CSP provided in the release package.

4.12.13. References

AUTOSAR_SWS_EthernetTransceiverDriver
Technical Reference Manual