Skip to content

Commit 0b9b0b1

Browse files
committed
uart0-helloworld-sdboot: add support for Allwinner A733
Enable UART's pinctrl and clock settings. The clock and pio offset for UART controller is changed in A733. Signed-off-by: Yixun Lan <dlan@gentoo.org>
1 parent 94ce5c0 commit 0b9b0b1

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎bare-metal.c‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,22 @@ static const struct soc_info soc_table[] = {
325325
.uart0 = { R329_UART0_BASE, SUNXI_GPB(9), MUX_2 },
326326
.jtag = { MUX_3 },
327327
},
328+
{
329+
.id = 0x1903,
330+
.name = "A733",
331+
.flags = FLAG_NEW_GPIO | FLAG_NEW2_CLOCK,
332+
.pio = {
333+
.base = V853_PIO_BASE,
334+
.offs = 0x80,
335+
.size = 0x80,
336+
.pull = 0x30,
337+
},
338+
.ccu = { A733_CCM_BASE },
339+
.sram = { SRAM_A1_ADDR_20000 },
340+
.uart0 = { R329_UART0_BASE, SUNXI_GPB(9), MUX_2 },
341+
.jtag = { MUX_3 },
342+
},
343+
328344
};
329345

330346
static const struct soc_info *find_soc_info(int id, int variant)
@@ -495,6 +511,9 @@ static void clock_init_uart(const struct soc_info *soc)
495511
if (soc->flags & FLAG_NEW_CLOCK) {
496512
set_wbit(soc->ccu.base + 0x90c,
497513
0x10001 << (CONFIG_CONS_INDEX - 1));
514+
} else if (soc->flags & FLAG_NEW2_CLOCK) {
515+
set_wbit(soc->ccu.base + 0xe00 + (CONFIG_CONS_INDEX - 1) * 4,
516+
0x10001);
498517
} else {
499518
int bit = 16 + CONFIG_CONS_INDEX - 1;
500519
int gate_ofs = 0x06c;

‎bare-metal.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ typedef unsigned char u8;
8787
#define R329_UART0_BASE 0x02500000
8888
#define R329_PIO_BASE 0x02000400
8989
#define R329_CCM_BASE 0x02001000
90+
#define A733_CCM_BASE 0x02002000
9091

9192
#define V853_PIO_BASE 0x02000000
9293

@@ -182,6 +183,7 @@ enum sunxi_gpio_number {
182183
#define FLAG_NEW_CLOCK BIT(3)
183184
#define FLAG_UART_ON_APB1 BIT(4)
184185
#define FLAG_A80_CLOCK BIT(5)
186+
#define FLAG_NEW2_CLOCK BIT(6)
185187

186188
#define FLAG_NCAT2 FLAG_NEW_GPIO | FLAG_NEW_CLOCK
187189

0 commit comments

Comments
 (0)