summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-layerscape/errata.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2024-01-04 15:17:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-01-08 11:00:59 +0100
commit16bfdffa730598f9a7dca7781faf2e3976bd46a5 (patch)
tree5f9038ee541db5bbc60cd4a25045a6479415139c /arch/arm/mach-layerscape/errata.c
parentcb984daf2ed3171e9f01ec87dea830b21a4c6b42 (diff)
downloadbarebox-16bfdffa730598f9a7dca7781faf2e3976bd46a5.tar.gz
barebox-16bfdffa730598f9a7dca7781faf2e3976bd46a5.tar.xz
ARM: layerscape: cleanup erratum_a009007
Drop the generic erratum_a009007_layerscape() function and move the code into its SoC specific pendants to make the way free for additional SoCs. While at it remove the USB_PHY_RX_EQ_VAL_x defines from immap_lsch2.h to get rid of conflicting defines in that file. Link: https://lore.barebox.org/20240104141746.165014-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-layerscape/errata.c')
-rw-r--r--arch/arm/mach-layerscape/errata.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/arch/arm/mach-layerscape/errata.c b/arch/arm/mach-layerscape/errata.c
index e3793b3bcd..8feb98b0f7 100644
--- a/arch/arm/mach-layerscape/errata.c
+++ b/arch/arm/mach-layerscape/errata.c
@@ -30,27 +30,24 @@ static void erratum_a008997_ls1046a(void)
set_usb_pcstxswingfull(scfg, SCFG_USB3PRM2CR_USB3);
}
-#define PROGRAM_USB_PHY_RX_OVRD_IN_HI(phy) \
- out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_1); \
- out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_2); \
- out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_3); \
- out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_4)
-
-static void erratum_a009007_layerscape(void)
+static void erratum_a009007(void __iomem *phy, u16 val1, u16 val2, u16 val3, u16 val4)
{
- void __iomem *usb_phy = IOMEM(SCFG_USB_PHY1);
-
- usb_phy = (void __iomem *)SCFG_USB_PHY3;
- PROGRAM_USB_PHY_RX_OVRD_IN_HI(usb_phy);
+ scfg_out16(phy + SCFG_USB_PHY_RX_OVRD_IN_HI, val1);
+ scfg_out16(phy + SCFG_USB_PHY_RX_OVRD_IN_HI, val2);
+ scfg_out16(phy + SCFG_USB_PHY_RX_OVRD_IN_HI, val3);
+ scfg_out16(phy + SCFG_USB_PHY_RX_OVRD_IN_HI, val4);
}
static void erratum_a009007_ls1046a(void)
{
- void __iomem *usb_phy = IOMEM(SCFG_USB_PHY1);
+ erratum_a009007(IOMEM(SCFG_USB_PHY1), 0x0000, 0x0080, 0x0380, 0x0b80);
+ erratum_a009007(IOMEM(SCFG_USB_PHY2), 0x0000, 0x0080, 0x0380, 0x0b80);
+ erratum_a009007(IOMEM(SCFG_USB_PHY3), 0x0000, 0x0080, 0x0380, 0x0b80);
+}
- PROGRAM_USB_PHY_RX_OVRD_IN_HI(usb_phy);
- usb_phy = (void __iomem *)SCFG_USB_PHY2;
- PROGRAM_USB_PHY_RX_OVRD_IN_HI(usb_phy);
+static void erratum_a009007_ls1021a(void)
+{
+ erratum_a009007(IOMEM(SCFG_USB_PHY1), 0x0000, 0x8000, 0x8004, 0x800C);
}
static inline void set_usb_txvreftune(u32 __iomem *scfg, u32 offset)
@@ -125,7 +122,6 @@ static void layerscape_errata(void)
erratum_a009008_layerscape();
erratum_a009798_layerscape();
erratum_a008997_layerscape();
- erratum_a009007_layerscape();
}
void ls1046a_errata(void)
@@ -140,6 +136,7 @@ void ls1046a_errata(void)
void ls1021a_errata(void)
{
layerscape_errata();
+ erratum_a009007_ls1021a();
erratum_a009008_ls1021a();
}