Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lx2160a_build
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
lx2160a_build
Commits
883d28b2
Commit
883d28b2
authored
Nov 17, 2022
by
Josua Mayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uboot: lx2162-clearfog: configure retimer according to serdes
Signed-off-by:
Josua Mayer
<
josua@solid-run.com
>
parent
5bdc7de2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
172 additions
and
0 deletions
+172
-0
patches/u-boot-LSDK-21.08/0039-lx2162a-som-enable-i2c2.patch
patches/u-boot-LSDK-21.08/0039-lx2162a-som-enable-i2c2.patch
+29
-0
patches/u-boot-LSDK-21.08/0040-board-lx2160cex7-configure-retimer-on-lx2162-clearfo.patch
...oard-lx2160cex7-configure-retimer-on-lx2162-clearfo.patch
+143
-0
No files found.
patches/u-boot-LSDK-21.08/0039-lx2162a-som-enable-i2c2.patch
0 → 100644
View file @
883d28b2
From d7cb8dcf124e341c9bb074ea8d183104108180b9 Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua@solid-run.com>
Date: Thu, 17 Nov 2022 11:54:33 +0200
Subject: [PATCH 39/41] lx2162a-som: enable i2c2
Signed-off-by: Josua Mayer <josua@solid-run.com>
---
arch/arm/dts/fsl-lx2162a-som.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/dts/fsl-lx2162a-som.dtsi b/arch/arm/dts/fsl-lx2162a-som.dtsi
index 8271fad8d6..f254421fae 100644
--- a/arch/arm/dts/fsl-lx2162a-som.dtsi
+++ b/arch/arm/dts/fsl-lx2162a-som.dtsi
@@ -77,6 +77,11 @@
};
};
+&i2c2 {
+ status = "okay";
+ u-boot,dm-pre-reloc;
+};
+
&i2c5 {
status = "okay";
rtc@6f {
--
2.38.1
patches/u-boot-LSDK-21.08/0040-board-lx2160cex7-configure-retimer-on-lx2162-clearfo.patch
0 → 100644
View file @
883d28b2
From 26b4349025cbf4e70f2cad1b7d2b5bbd3603ced9 Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua@solid-run.com>
Date: Thu, 17 Nov 2022 12:13:26 +0200
Subject: [PATCH 40/41] board: lx2160cex7: configure retimer on lx2162 clearfog
Signed-off-by: Josua Mayer <josua@solid-run.com>
---
arch/arm/dts/fsl-lx2160a-cex7.dts | 5 +++++
board/solidrun/lx2160a/eth_lx2160acex7.c | 23 +++++++++++++----------
board/solidrun/lx2160a/lx2160a.c | 14 +++++++++++---
include/configs/lx2160a_common.h | 1 +
4 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/arch/arm/dts/fsl-lx2160a-cex7.dts b/arch/arm/dts/fsl-lx2160a-cex7.dts
index c8c0877e3d..f57fc87361 100644
--- a/arch/arm/dts/fsl-lx2160a-cex7.dts
+++ b/arch/arm/dts/fsl-lx2160a-cex7.dts
@@ -133,6 +133,11 @@
};
};
+&i2c2 {
+ status = "okay";
+ u-boot,dm-pre-reloc;
+};
+
&i2c4 {
status = "okay";
diff --git a/board/solidrun/lx2160a/eth_lx2160acex7.c b/board/solidrun/lx2160a/eth_lx2160acex7.c
index 6a696deafe..64ef75b27b 100644
--- a/board/solidrun/lx2160a/eth_lx2160acex7.c
+++ b/board/solidrun/lx2160a/eth_lx2160acex7.c
@@ -26,6 +26,7 @@
DECLARE_GLOBAL_DATA_PTR;
int select_i2c_ch_pca9547(u8 ch);
+int select_i2c_ch_pca9547_n(int busnum, u8 ch);
void setup_retimer_25g(int chnum)
{
@@ -115,17 +116,17 @@
void setup_retimer_25g(int chnum)
}
}
-void setup_retimer_lx2162_25g(int speed_is_25g)
+void setup_retimer_lx2162_25g(int busnum, int address, int speed_is_25g)
{
int i, ret;
u8 reg;
struct udevice *dev;
- select_i2c_ch_pca9547(0xb); /* SMB_CLK / DATA interface */
+ select_i2c_ch_pca9547_n(busnum, 0xb); /* SMB_CLK / DATA interface */
/*
* Retimer on address 0x22; first two channels are LX TX.
*/
- ret = i2c_get_chip_for_busnum(0, 0x22, 1, &dev);
+ ret = i2c_get_chip_for_busnum(busnum, address, 1, &dev);
if (ret) {
/*
* On HoneyComb and ClearFog CX ver 1.1 / 1.2 there is no retimer
@@ -329,20 +330,22 @@
int fsl_board_late_init(void) {
if (get_svr() & 0x800) { /* LX2162A SOM variants */
switch (srds_s1) {
- case 8:
- setup_retimer_lx2162_25g(0);
+ case 3:
+ case 20:
+ /* Setup retimer on lanes e,f for 10Gbps */
+ setup_retimer_lx2162_25g(0, 0x22, 0);
+ setup_retimer_lx2162_25g(1, 0x18, 0);
break;
case 15:
case 16:
case 17:
case 18:
- case 19:
- case 21:
- /* Setup 25gb retimer on lanes e,f,g,h */
- setup_retimer_lx2162_25g(1);
+ /* Setup retimer on lanes e,f for 25Gbps */
+ setup_retimer_lx2162_25g(0, 0x22, 1);
+ setup_retimer_lx2162_25g(1, 0x18, 1);
break;
default:
- printf("SerDes1 protocol 0x%x is not supported on LX2160A-SOM\n",
+ printf("SerDes1 protocol 0x%x is not supported on LX2162A-SOM\n",
srds_s1);
}
if ((srds_s1 == 18) && ((srds_s2 == 2) || (srds_s2 == 3)))
diff --git a/board/solidrun/lx2160a/lx2160a.c b/board/solidrun/lx2160a/lx2160a.c
index e078ae5c68..24930e5b6d 100644
--- a/board/solidrun/lx2160a/lx2160a.c
+++ b/board/solidrun/lx2160a/lx2160a.c
@@ -69,20 +69,28 @@
U_BOOT_DRVINFO(nxp_serial1) = {
};
int select_i2c_ch_pca9547(u8 ch)
+{
+ return select_i2c_ch_pca9547_n(0, ch);
+}
+
+int select_i2c_ch_pca9547_n(int busnum, u8 ch)
{
int ret;
#if !CONFIG_IS_ENABLED(DM_I2C)
- ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+ if (busnum)
+ printf("PCA: cannot configure on bus %i without DM_I2C!\n", busnum);
+ else
+ ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
#else
struct udevice *dev;
- ret = i2c_get_chip_for_busnum(0, I2C_MUX_PCA_ADDR_PRI, 1, &dev);
+ ret = i2c_get_chip_for_busnum(busnum, I2C_MUX_PCA_ADDR_PRI, 1, &dev);
if (!ret)
ret = dm_i2c_write(dev, 0, &ch, 1);
#endif
if (ret) {
- puts("PCA: failed to select proper channel\n");
+ printf("PCA: failed to select bus %i channel %u\n", busnum, ch);
return ret;
}
diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index 06057b7447..556879375a 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -179,6 +179,7 @@
unsigned long get_board_sys_clk(void);
unsigned long get_board_ddr_clk(void);
int select_i2c_ch_pca9547(unsigned char ch);
int select_i2c_ch_pca9547_sec(unsigned char ch);
+int select_i2c_ch_pca9547_n(int busnum, unsigned char ch);
#endif
#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
--
2.38.1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment