blob: 608eb2d1df4aeae9d51876dcf7fbbe89e9e08968 [file] [log] [blame]
zbao7d94cf92012-07-02 14:19:14 +08001/* $NoKeywords:$ */
2/**
3 * @file
4 *
5 * Config Fch USB EHCI controller
6 *
7 * Init USB EHCI features.
8 *
9 * @xrefitem bom "File Content Label" "Release Content"
10 * @e project: AGESA
11 * @e sub-project: FCH
12 * @e \$Revision: 63425 $ @e \$Date: 2011-12-22 11:24:10 -0600 (Thu, 22 Dec 2011) $
13 *
14 */
15/*;********************************************************************************
16;
Siyuan Wang641f00c2013-06-08 11:50:55 +080017 * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc.
18 * All rights reserved.
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions are met:
22 * * Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * * Redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in the
26 * documentation and/or other materials provided with the distribution.
27 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
28 * its contributors may be used to endorse or promote products derived
29 * from this software without specific prior written permission.
30 *
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
32 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
33 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
35 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
38 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
zbao7d94cf92012-07-02 14:19:14 +080041;*********************************************************************************/
42#include "FchPlatform.h"
43#include "Filecode.h"
44#define FILECODE PROC_FCH_USB_EHCIMID_FILECODE
45
46/* extern VOID FchEhciInitAfterPciInit (IN UINT32 Value, IN FCH_DATA_BLOCK* FchDataPtr); */
47//
48// Declaration of local functions
49//
50/**
51 * EhciInitAfterPciInit - Config USB controller after PCI emulation
52 *
53 * @param[in] Value Controller PCI config address (bus# + device# + function#)
54 * @param[in] FchDataPtr Fch configuration structure pointer.
55 */
56VOID EhciInitAfterPciInit (IN UINT32 Value, IN FCH_DATA_BLOCK* FchDataPtr);
57
58/**
59 * FchInitMidUsbEhci - Config USB EHCI controller after PCI
60 * emulation
61 *
62 *
63 *
64 * @param[in] FchDataPtr Fch configuration structure pointer.
65 *
66 */
67VOID
68FchInitMidUsbEhci (
69 IN VOID *FchDataPtr
70 )
71{
72 FCH_DATA_BLOCK *LocalCfgPtr;
73
74 LocalCfgPtr = (FCH_DATA_BLOCK *) FchDataPtr;
75
76 FchInitMidUsbEhci1 (LocalCfgPtr);
77 FchInitMidUsbEhci2 (LocalCfgPtr);
78 FchInitMidUsbEhci3 (LocalCfgPtr);
79}
80
81/**
82 * FchInitMidUsbEhci1 - Config USB1 EHCI controller after PCI emulation
83 *
84 *
85 *
86 * @param[in] FchDataPtr Fch configuration structure pointer.
87 *
88 */
89VOID
90FchInitMidUsbEhci1 (
91 IN FCH_DATA_BLOCK *FchDataPtr
92 )
93{
94 UINT32 DeviceId;
95
96 DeviceId = (USB1_EHCI_BUS_DEV_FUN << 16);
97 EhciInitAfterPciInit (DeviceId, FchDataPtr);
98
99}
100
101/**
102 * FchInitMidUsbEhci2 - Config USB2 EHCI controller after PCI emulation
103 *
104 *
105 *
106 * @param[in] FchDataPtr Fch configuration structure pointer.
107 *
108 */
109VOID
110FchInitMidUsbEhci2 (
111 IN FCH_DATA_BLOCK *FchDataPtr
112 )
113{
114 UINT32 DeviceId;
115
116 DeviceId = (USB2_EHCI_BUS_DEV_FUN << 16);
117 EhciInitAfterPciInit (DeviceId, FchDataPtr);
118
119}
120
121/**
122 * FchInitMidUsbEhci3 - Config USB3 EHCI controller after PCI emulation
123 *
124 *
125 *
126 * @param[in] FchDataPtr Fch configuration structure pointer.
127 *
128 */
129
130VOID
131FchInitMidUsbEhci3 (
132 IN FCH_DATA_BLOCK *FchDataPtr
133 )
134{
135 UINT32 DeviceId;
136
137 DeviceId = (USB3_EHCI_BUS_DEV_FUN << 16);
138 EhciInitAfterPciInit (DeviceId, FchDataPtr);
139
140}
141
142/**
143 * EhciInitAfterPciInit - Config EHCI controller after PCI
144 * emulation
145 *
146 *
147 * @param[in] Value EHCI Controler info.
148 * @param[in] FchDataPtr Fch configuration structure pointer.
149 *
150 */
151VOID
152EhciInitAfterPciInit (
153 IN UINT32 Value,
154 IN FCH_DATA_BLOCK *FchDataPtr
155 )
156{
157 FchEhciInitAfterPciInit ( Value, FchDataPtr);
158}
159