Skip to contentSkip to conversation

board/fsl/lx2160ardb: enable flexcan

PATCH Superseded Pankaj Bansal 2 participants 2 messages Jul 10, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board/fsl/lx2160ardb: enable flexcan

Flexcan in LX2160ARDB is controlled by FPGA register boardcfg4 bit 5. enable this bit so that flexcan is enabled in LX2160ARDB.

---
 board/freescale/lx2160a/lx2160a.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
board/freescale/lx2160a/lx2160a.c +14 -0
index 3b4cb86692..8eac576ab5 100644
@@ -402,6 +402,20 @@ int config_board_mux(void)
 
 	return 0;
 }
+#elif defined(CONFIG_TARGET_LX2160ARDB)
+int config_board_mux(void)
+{
+	u8 brdcfg;
+
+	// Read BRDCFG4 Register @ 0x54 offset
+	brdcfg = QIXIS_READ(brdcfg[4]);
+	// Enable CFG_CAN_EN_B bit BRDCFG4[5]
+	brdcfg |= BIT_MASK(5);
+	// Write new configuration
+	QIXIS_WRITE(brdcfg[4], brdcfg);
+
+	return 0;
+}
 #else
 int config_board_mux(void)
 {
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 board/fsl/lx2160ardb: enable flexcan

Quoted 14 lines · Pankaj Bansal

Flexcan in LX2160ARDB is controlled by FPGA register boardcfg4 bit 5. enable this bit so that flexcan is enabled in LX2160ARDB.

---
 board/freescale/lx2160a/lx2160a.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
board/freescale/lx2160a/lx2160a.c +0 -0
index 3b4cb86692..8eac576ab5 100644

board/freescale/lx2160a/lx2160a.c int config_board_mux(void) · line 410

Quoted 9 lines
board/freescale/lx2160a/lx2160a.c +6 -0
@@ -402,6 +402,20 @@ int config_board_mux(void)
 
        return 0;
 }
+#elif defined(CONFIG_TARGET_LX2160ARDB)
+int config_board_mux(void)
+{
+       u8 brdcfg;
+
+       // Read BRDCFG4 Register @ 0x54 offset

The // is not allowed

board/freescale/lx2160a/lx2160a.c int config_board_mux(void) · line 412

Quoted 2 lines
board/freescale/lx2160a/lx2160a.c +2 -0
+       brdcfg = QIXIS_READ(brdcfg[4]);
+       // Enable CFG_CAN_EN_B bit BRDCFG4[5]

ditto

board/freescale/lx2160a/lx2160a.c int config_board_mux(void) · line 414

Quoted 2 lines
board/freescale/lx2160a/lx2160a.c +2 -0
+       brdcfg |= BIT_MASK(5);
+       // Write new configuration

ditto

board/freescale/lx2160a/lx2160a.c int config_board_mux(void) · line 418

Quoted 4 lines
board/freescale/lx2160a/lx2160a.c +4 -0
+       QIXIS_WRITE(brdcfg[4], brdcfg);
+
+       return 0;
+}

Regards,
Bin