• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /********************************************************************************
2 Copyright (C) 2016 Marvell International Ltd.
3 
4 Marvell BSD License Option
5 
6 If you received this File from Marvell, you may opt to use, redistribute and/or
7 modify this File under the following licensing terms.
8 Redistribution and use in source and binary forms, with or without modification,
9 are permitted provided that the following conditions are met:
10 
11   * Redistributions of source code must retain the above copyright notice,
12     this list of conditions and the following disclaimer.
13 
14   * Redistributions in binary form must reproduce the above copyright
15     notice, this list of conditions and the following disclaimer in the
16     documentation and/or other materials provided with the distribution.
17 
18   * Neither the name of Marvell nor the names of its contributors may be
19     used to endorse or promote products derived from this software without
20     specific prior written permission.
21 
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 *******************************************************************************/
34 
35 #ifndef __MV_PHY_H__
36 #define __MV_PHY_H__
37 
38 #define MARVELL_PHY_PROTOCOL_GUID { 0x32f48a43, 0x37e3, 0x4acf, { 0x93, 0xc4, 0x3e, 0x57, 0xa7, 0xb0, 0xfb, 0xdc }}
39 
40 typedef struct _MARVELL_PHY_PROTOCOL MARVELL_PHY_PROTOCOL;
41 
42 typedef enum {
43   PHY_CONNECTION_RGMII,
44   PHY_CONNECTION_RGMII_ID,
45   PHY_CONNECTION_RGMII_TXID,
46   PHY_CONNECTION_RGMII_RXID,
47   PHY_CONNECTION_SGMII,
48   PHY_CONNECTION_RTBI,
49   PHY_CONNECTION_XAUI,
50   PHY_CONNECTION_RXAUI
51 } PHY_CONNECTION;
52 
53 typedef enum {
54   NO_SPEED,
55   SPEED_10,
56   SPEED_100,
57   SPEED_1000,
58   SPEED_2500,
59   SPEED_10000
60 } PHY_SPEED;
61 
62 typedef struct {
63   UINT32          Addr;
64   BOOLEAN         LinkUp;
65   BOOLEAN         FullDuplex;
66   BOOLEAN         AutoNegotiation;
67   PHY_SPEED       Speed;
68   PHY_CONNECTION  Connection;
69 } PHY_DEVICE;
70 
71 /*
72  * Before calling MARVELL_PHY_STATUS driver should request PHY_DEVICE structure by
73  * calling MARVELL_PHY_INIT. Pointer to that needs to be provided as an argument to
74  * MARVELL_PHY_STATUS.
75  */
76 typedef
77 EFI_STATUS
78 (EFIAPI *MARVELL_PHY_STATUS) (
79   IN CONST MARVELL_PHY_PROTOCOL *This,
80   IN OUT PHY_DEVICE  *PhyDev
81   );
82 
83 /*
84  * MARVELL_PHY_INIT allocates PhyDev and provides driver with pointer via **PhyDev.
85  * After it becomes unnecessary, PhyDev should be freed by a driver (or it will
86  * get freed at ExitBootServices).
87  */
88 typedef
89 EFI_STATUS
90 (EFIAPI *MARVELL_PHY_INIT) (
91   IN CONST MARVELL_PHY_PROTOCOL *This,
92   IN UINT32 PhyAddr,
93   IN PHY_CONNECTION PhyConnection,
94   IN OUT PHY_DEVICE **PhyDev
95   );
96 
97 struct _MARVELL_PHY_PROTOCOL {
98   MARVELL_PHY_STATUS Status;
99   MARVELL_PHY_INIT Init;
100 };
101 
102 extern EFI_GUID gMarvellPhyProtocolGuid;
103 #endif
104