Hi Yao,
On 18:00 Wed 23 Sep , Yao Zi wrote:
> On Wed, Sep 23, 2026 at 12:46:45PM +0000, Yixun Lan wrote:
> > Add initial support for K3 Pico-ITX board, in this version, the DRAM
> > information is parsed from DTS "/memory" node. And with UART enabled,
> > the U-Boot serial console works fine now.
> >
> > Signed-off-by: Yixun Lan <[email protected]>
> > ---
> > arch/riscv/Kconfig | 5 +++++
> > arch/riscv/cpu/k3/Kconfig | 18 ++++++++++++++++++
> > arch/riscv/cpu/k3/Makefile | 5 +++++
> > arch/riscv/cpu/k3/dram.c | 29 +++++++++++++++++++++++++++++
> > board/spacemit/k3/Kconfig | 30 ++++++++++++++++++++++++++++++
> > board/spacemit/k3/MAINTAINERS | 8 ++++++++
> > board/spacemit/k3/Makefile | 5 +++++
> > board/spacemit/k3/board.c | 4 ++++
> > include/configs/k3.h | 13 +++++++++++++
> > 9 files changed, 117 insertions(+)
>
> ...
>
> > diff --git a/arch/riscv/cpu/k3/dram.c b/arch/riscv/cpu/k3/dram.c
> > new file mode 100644
> > index 00000000000..203d72a5da1
> > --- /dev/null
> > +++ b/arch/riscv/cpu/k3/dram.c
> > @@ -0,0 +1,29 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +/*
> > + * Copyright (C) 2026 Yixun Lan <[email protected]>
> > + */
> > +
> > +#include <fdtdec.h>
> > +#include <init.h>
> > +#include <linux/sizes.h>
> > +#include <asm/global_data.h>
>
> Please sort the headers alphabetically.
>
Ok, will do
> > +DECLARE_GLOBAL_DATA_PTR;
> > +
> > +int dram_init(void)
> > +{
> > + return fdtdec_setup_mem_size_base();
> > +}
> > +
> > +int dram_init_banksize(void)
> > +{
> > + return fdtdec_setup_memory_banksize();
> > +}
> > +
> > +phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
> > +{
> > + if (gd->ram_size > SZ_2G)
> > + return gd->ram_base + SZ_2G;
>
> What's the intention of this limitation?
>
This is a copy & paste from k1's implementation while K1 has discrete
memory layout which 0x8000 0000 - 0xFFFF FFFF is iomem space
For K3, there is no such problem, so no need this function
> > + return gd->ram_base + gd->ram_size;
> > +}
>
> ...
>
> > diff --git a/board/spacemit/k3/Makefile b/board/spacemit/k3/Makefile
> > new file mode 100644
> > index 00000000000..bd5343be789
> > --- /dev/null
> > +++ b/board/spacemit/k3/Makefile
> > @@ -0,0 +1,5 @@
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +#
> > +# Copyright (C) 2026 Yixun Lan <[email protected]>
> > +
> > +obj-y := board.o
> > diff --git a/board/spacemit/k3/board.c b/board/spacemit/k3/board.c
> > new file mode 100644
> > index 00000000000..29994e49ce8
> > --- /dev/null
> > +++ b/board/spacemit/k3/board.c
> > @@ -0,0 +1,4 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +/*
> > + * Copyright (C) 2026 Yixun Lan <[email protected]>
> > + */
>
> I think it makes sense to omit the source if it's empty for now.
>
Ok, fair
--
Yixun Lan (dlan)