Skip to content

Commit c4cfcc2

Browse files
andynxpJagdish Gediya
authored and
Jagdish Gediya
committed
board: freescale: ls1028a: mux changes for lpuart
mux changes in board file to enable lpuart1 and macro define for lpuart1 used for mux changes in board configuation register 13 Signed-off-by: Vabhav Sharma <[email protected]> Signed-off-by: Yuantian Tang <[email protected]>
1 parent 3cd9bc3 commit c4cfcc2

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

board/freescale/ls1028a/ls1028a.c

+32
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
3131

3232
int config_board_mux(void)
3333
{
34+
#ifndef CONFIG_LPUART
3435
#if defined(CONFIG_TARGET_LS1028AQDS) && defined(CONFIG_FSL_QIXIS)
3536
u8 reg;
3637

@@ -55,9 +56,18 @@ int config_board_mux(void)
5556
reg &= ~(0xc0);
5657
QIXIS_WRITE(brdcfg[15], reg);
5758
#endif
59+
#endif
60+
5861
return 0;
5962
}
6063

64+
#ifdef CONFIG_LPUART
65+
u32 get_lpuart_clk(void)
66+
{
67+
return gd->bus_clk / CONFIG_SYS_FSL_LPUART_CLK_DIV;
68+
}
69+
#endif
70+
6171
int board_init(void)
6272
{
6373
#ifdef CONFIG_ENV_IS_NOWHERE
@@ -120,11 +130,33 @@ int arch_misc_init(void)
120130

121131
int board_early_init_f(void)
122132
{
133+
#ifdef CONFIG_LPUART
134+
u8 uart;
135+
#endif
136+
123137
#ifdef CONFIG_SYS_I2C_EARLY_INIT
124138
i2c_early_init_f();
125139
#endif
126140

127141
fsl_lsch3_early_init_f();
142+
143+
#ifdef CONFIG_LPUART
144+
/*
145+
* Field| Function
146+
* --------------------------------------------------------------
147+
* 7-6 | Controls I2C3 routing (net CFG_MUX_I2C3):
148+
* I2C3 | 11= Routes {SCL, SDA} to LPUART1 header as {SOUT, SIN}.
149+
* --------------------------------------------------------------
150+
* 5-4 | Controls I2C4 routing (net CFG_MUX_I2C4):
151+
* I2C4 |11= Routes {SCL, SDA} to LPUART1 header as {CTS_B, RTS_B}.
152+
*/
153+
/* use lpuart0 as system console */
154+
uart = QIXIS_READ(brdcfg[13]);
155+
uart &= ~CFG_LPUART_MUX_MASK;
156+
uart |= CFG_LPUART_EN;
157+
QIXIS_WRITE(brdcfg[13], uart);
158+
#endif
159+
128160
return 0;
129161
}
130162

include/configs/ls1028aqds.h

+7
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@
6767
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
6868
#endif
6969

70+
/* LPUART */
71+
#ifdef CONFIG_LPUART
72+
#define CONFIG_LPUART_32B_REG
73+
#define CFG_LPUART_MUX_MASK 0xf0
74+
#define CFG_LPUART_EN 0xf0
75+
#endif
76+
7077
/* SATA */
7178
#define CONFIG_SCSI_AHCI_PLAT
7279

0 commit comments

Comments
 (0)