1 
2 /*******************************************************************************
3  * Copyright 2020 Microchip Corporation.
4  *
5  * SPDX-License-Identifier: MIT
6  *
7  * NULL PHY implementation.
8  *
9  * This PHY interface is used when there is a direct connection between two GEM
10  * instances which does not involve the use of a PHY device.
11  *
12  * Also used when setting up the default config so that the pointers for the
13  * PHY functions in the config always have some valid values.
14  *
15  */
16 #include "mpfs_hal/mss_hal.h"
17 
18 #include "drivers/mss_ethernet_mac/mss_ethernet_registers.h"
19 #include "drivers/mss_ethernet_mac/mss_ethernet_mac_regs.h"
20 #include "drivers/mss_ethernet_mac/mss_ethernet_mac_sw_cfg.h"
21 #include "drivers/mss_ethernet_mac/mss_ethernet_mac.h"
22 #include "drivers/mss_ethernet_mac/phy.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #if MSS_MAC_USE_PHY_NULL
29 
30 /**************************************************************************//**
31  *
32  */
MSS_MAC_NULL_phy_init(const void * v_this_mac,uint8_t phy_addr)33 void MSS_MAC_NULL_phy_init(/* mss_mac_instance_t */ const void *v_this_mac, uint8_t phy_addr)
34 {
35     /* Nothing to see here... */
36     (void)v_this_mac;
37     (void)phy_addr;
38 }
39 
40 /**************************************************************************//**
41  *
42  */
MSS_MAC_NULL_phy_set_link_speed(void * v_this_mac,uint32_t speed_duplex_select,mss_mac_speed_mode_t speed_mode)43 void MSS_MAC_NULL_phy_set_link_speed(/* mss_mac_instance_t */ void *v_this_mac, uint32_t speed_duplex_select, mss_mac_speed_mode_t speed_mode)
44 {
45     /* Nothing to see here... */
46     (void)v_this_mac;
47     (void)speed_duplex_select;
48     (void)speed_mode;
49 }
50 
51 /**************************************************************************//**
52  *
53  */
MSS_MAC_NULL_phy_autonegotiate(const void * v_this_mac)54 void MSS_MAC_NULL_phy_autonegotiate(/* mss_mac_instance_ t */ const void *v_this_mac)
55 {
56     /* Nothing to see here... */
57     (void)v_this_mac;
58 }
59 
60 /**************************************************************************//**
61  *
62  */
MSS_MAC_NULL_phy_mac_autonegotiate(const void * v_this_mac)63 void MSS_MAC_NULL_phy_mac_autonegotiate(/* mss_mac_instance_t */ const void *v_this_mac)
64 {
65     /* Nothing to see here... */
66     (void)v_this_mac;
67 }
68 
69 /**************************************************************************//**
70  *
71  */
MSS_MAC_NULL_phy_get_link_status(const void * v_this_mac,mss_mac_speed_t * speed,uint8_t * fullduplex)72 uint8_t MSS_MAC_NULL_phy_get_link_status
73 (
74         /* mss_mac_instance_t */ const void *v_this_mac,
75     mss_mac_speed_t * speed,
76     uint8_t *     fullduplex
77 )
78 {
79     uint8_t link_status;
80 
81     (void)v_this_mac;
82     /* Assume link is up. */
83     link_status = MSS_MAC_LINK_UP;
84 
85     /* Pick fastest for now... */
86 
87     *fullduplex = MSS_MAC_FULL_DUPLEX;
88     *speed = MSS_MAC_1000MBPS;
89 
90     return link_status;
91 }
92 
93 #if MSS_MAC_USE_PHY_DP83867
94 /**************************************************************************//**
95  *
96  */
NULL_ti_read_extended_regs(const void * v_this_mac,uint16_t reg)97 uint16_t NULL_ti_read_extended_regs(/* mss_mac_instance_t */ const void *v_this_mac, uint16_t reg)
98 {
99     (void)v_this_mac;
100     (void)reg;
101 
102     return(0);
103 }
104 
105 /**************************************************************************//**
106  *
107  */
NULL_ti_write_extended_regs(const void * v_this_mac,uint16_t reg,uint16_t data)108 void NULL_ti_write_extended_regs(/* mss_mac_instance_t */ const void *v_this_mac, uint16_t reg, uint16_t data)
109 {
110     (void)v_this_mac;
111     (void)reg;
112     (void)data;
113 
114     /* Nothing to see here... */
115 }
116 #endif
117 
118 #endif /* MSS_MAC_USE_PHY_NULL */
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 /******************************** END OF FILE ******************************/
124 
125 
126 
127 
128 
129 
130