hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/** @file
  This file containa all erratas need to be applied on different SoCs.
 
  Copyright 2020 NXP
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
 
**/
 
#include <Base.h>
#include <Library/ArmLib.h>
#include <Library/BaseLib.h>
#include <Library/ChassisLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/PcdLib.h>
 
#include "Erratum.h"
 
/*
* A-008997   : USB3 LFPS peak-to-peak differential output
*              voltage adjustment settings
* Affects    : USB
* Description: Low Frequency Periodic Signaling (LFPS)
*              peak-to-peak differential output voltage test
*              compliance fails using default transmitter settings.
*              Software is required to change the transmitter
*              signal swings to pass compliance tests.
* Impact     : LFPS peak-to-peak differential output voltage
*              compliance test fails.
*/
VOID
ErratumA008997 (
  VOID
  )
{
  NXP_LAYERSCAPE_CHASSIS2_SUPPLEMENTAL_CONFIG *Scfg;
  UINT32 Value;
 
  Scfg = (NXP_LAYERSCAPE_CHASSIS2_SUPPLEMENTAL_CONFIG *)NXP_LAYERSCAPE_CHASSIS2_SCFG_ADDRESS;
 
  Value = ScfgRead32 ((UINTN)&Scfg->Usb1Prm2Cr);
  Value &= ~(0x7F << 9);
  ScfgWrite32 ((UINTN)&Scfg->Usb1Prm2Cr, Value | (USB_PCSTXSWINGFULL << 9));
  Value = ScfgRead32 ((UINTN)&Scfg->Usb2Prm2Cr);
  Value &= ~(0x7F << 9);
  ScfgWrite32 ((UINTN)&Scfg->Usb2Prm2Cr, Value | (USB_PCSTXSWINGFULL << 9));
  Value = ScfgRead32 ((UINTN)&Scfg->Usb3Prm2Cr);
  Value &= ~(0x7F << 9);
  ScfgWrite32 ((UINTN)&Scfg->Usb3Prm2Cr, Value | (USB_PCSTXSWINGFULL << 9));
 
  return;
}
 
/*
* A-009007   : USB3PHY observing intermittent failure in
*              receive compliance tests at higher jitter frequency
*              using default register values
* Affects    : USB
* Description: Receive compliance tests may fail intermittently at
*              high jitter frequencies using default register values.
* Impact     : Receive compliance test fails at default register setting.
*/
 
VOID
ConfigUsbLane0 (
  IN  UINTN UsbPhy
  )
{
  UINTN     RegAddress;
 
  RegAddress = UsbPhy + USB_PHY_RX_OVRD_IN_HI;
 
  ArmDataMemoryBarrier ();
  MmioWrite16 (RegAddress, USB_PHY_RX_EQ_VAL_1);
  ArmDataMemoryBarrier ();
  MmioWrite16 (RegAddress, USB_PHY_RX_EQ_VAL_2);
  ArmDataMemoryBarrier ();
  MmioWrite16 (RegAddress, USB_PHY_RX_EQ_VAL_3);
  ArmDataMemoryBarrier ();
  MmioWrite16 (RegAddress, USB_PHY_RX_EQ_VAL_4);
 
  return;
}
 
VOID
ErratumA009007 (
  VOID
  )
{
  UINTN     UsbPhy;
 
  UsbPhy = USB_PHY1_BASE_ADDRESS;
  ConfigUsbLane0 (UsbPhy);
 
  UsbPhy = USB_PHY2_BASE_ADDRESS;
  ConfigUsbLane0 (UsbPhy);
 
  UsbPhy = USB_PHY3_BASE_ADDRESS;
  ConfigUsbLane0 (UsbPhy);
 
  return;
}
 
/*
* A-009008   : USB High Speed (HS) eye height adjustment
* Affects    : USB
* Description: USB HS eye diagram fails with the default
*              value at many corners, particularly at a
*              high temperature (105°C).
* Impact     : USB HS eye diagram may fail using the default value.
*/
VOID
ErratumA009008 (
  VOID
  )
{
  NXP_LAYERSCAPE_CHASSIS2_SUPPLEMENTAL_CONFIG *Scfg;
  UINT32 Value;
 
  Scfg = (NXP_LAYERSCAPE_CHASSIS2_SUPPLEMENTAL_CONFIG *)NXP_LAYERSCAPE_CHASSIS2_SCFG_ADDRESS;
 
  Value = ScfgRead32 ((UINTN)&Scfg->Usb1Prm1Cr);
  Value &= ~(0xF << 6);
  ScfgWrite32 ((UINTN)&Scfg->Usb1Prm1Cr, Value|(USB_TXVREFTUNE << 6));
  Value = ScfgRead32 ((UINTN)&Scfg->Usb2Prm1Cr);
  Value &= ~(0xF << 6);
  ScfgWrite32 ((UINTN)&Scfg->Usb2Prm1Cr, Value|(USB_TXVREFTUNE << 6));
  Value = ScfgRead32 ((UINTN)&Scfg->Usb3Prm1Cr);
  Value &= ~(0xF << 6);
  ScfgWrite32 ((UINTN)&Scfg->Usb3Prm1Cr, Value|(USB_TXVREFTUNE << 6));
 
  return;
}
 
/*
* A-009798   : USB high speed squelch threshold adjustment
* Affects    : USB
* Description: The default setting for USB high speed
*              squelch threshold results in a threshold close
*              to or lower than 100mV. This leads to a receiver
*              compliance test failure for a 100mV threshold.
* Impact     : If the errata is not applied, only the USB high
*              speed receiver sensitivity compliance test fails,
*              however USB data continues to transfer.
*/
VOID
ErratumA009798 (
  VOID
  )
{
  NXP_LAYERSCAPE_CHASSIS2_SUPPLEMENTAL_CONFIG *Scfg;
  UINT32 Value;
 
  Scfg = (NXP_LAYERSCAPE_CHASSIS2_SUPPLEMENTAL_CONFIG *)NXP_LAYERSCAPE_CHASSIS2_SCFG_ADDRESS;
 
  Value = ScfgRead32 ((UINTN)&Scfg->Usb1Prm1Cr);
  ScfgWrite32 ((UINTN)&Scfg->Usb1Prm1Cr, Value & USB_SQRXTUNE);
  Value = ScfgRead32 ((UINTN)&Scfg->Usb2Prm1Cr);
  ScfgWrite32 ((UINTN)&Scfg->Usb2Prm1Cr, Value & USB_SQRXTUNE);
  Value = ScfgRead32 ((UINTN)&Scfg->Usb3Prm1Cr);
  ScfgWrite32 ((UINTN)&Scfg->Usb3Prm1Cr, Value & USB_SQRXTUNE);
 
  return;
}