Skip to content

Commit 1e8fb26

Browse files
AlessandroLuokartben
authored andcommitted
drivers: serial: pl011: Add support for Ambiq Apollo510 SoC UART
Added more clock sources for Apollo510 support Signed-off-by: Hao Luo <hluo@ambiq.com>
1 parent 7090605 commit 1e8fb26

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

drivers/serial/uart_pl011.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "uart_pl011_ambiq.h"
3939
#endif
4040

41-
#if defined(CONFIG_SOC_SERIES_APOLLO3X)
41+
#if defined(CONFIG_SOC_SERIES_APOLLO3X) || defined(CONFIG_SOC_SERIES_APOLLO5X)
4242
#define PM_INST_GET(n) PM_DEVICE_DT_INST_GET(n)
4343
#else
4444
#define PM_INST_GET(n) NULL

drivers/serial/uart_pl011_ambiq.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ static inline int pl011_ambiq_clk_set(const struct device *dev, uint32_t clk)
3737
case 24000000:
3838
clksel = PL011_CR_AMBIQ_CLKSEL_24MHZ;
3939
break;
40+
#if !defined(CONFIG_SOC_SERIES_APOLLO3X)
41+
case 48000000:
42+
clksel = PL011_CR_AMBIQ_CLKSEL_48MHZ;
43+
break;
44+
#if !defined(CONFIG_SOC_SERIES_APOLLO4X)
45+
case AM_HAL_UART_PLLCLK_FREQ:
46+
clksel = PL011_CR_AMBIQ_CLKSEL_PLL;
47+
break;
48+
#endif
49+
#endif
4050
default:
4151
return -EINVAL;
4252
}

drivers/serial/uart_pl011_registers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ volatile struct pl011_regs *get_uart(const struct device *dev)
114114
#define PL011_CR_AMBIQ_CLKSEL_6MHZ 3
115115
#define PL011_CR_AMBIQ_CLKSEL_3MHZ 4
116116
#define PL011_CR_AMBIQ_CLKSEL_48MHZ 5
117+
#define PL011_CR_AMBIQ_CLKSEL_PLL 6
117118

118119
/* PL011 Interrupt Fifo Level Select Register */
119120
#define PL011_IFLS_RXIFLSEL_M GENMASK(5, 3)

0 commit comments

Comments
 (0)