From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B49C6C77B73 for ; Sat, 27 May 2023 03:01:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F1F78619E; Sat, 27 May 2023 05:01:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="q5LM8tKL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A8AA986188; Sat, 27 May 2023 03:46:06 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E13AB85D24 for ; Sat, 27 May 2023 03:46:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=guoren@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BE1336176F for ; Sat, 27 May 2023 01:46:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C505C4339B for ; Sat, 27 May 2023 01:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685151960; bh=ixSKj+HaiqS1FnCsi661ZYe9yvU+5Mldc9akcQ5RhWA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=q5LM8tKLFlpumBCiB2XFVvsATrM0LK6cjp371uT4LAMKJlUDtJJm3m448EaSqLq3p Z+On9z98H8ZU0k3Fd3vblTiLF4NSHeJOB8na7ALuQEOCXLYcimYDBn5SHKATXoOQCm 8r1kBlnPTKarmWss5NkarBU6+AELhj2JV+B1qNbhBrExBFgNOXgLeFRhP0SkCOYJFb H59Ub1/AakirJyMC03fubs/Wxqjf+77NcGLGDENE0PopS8dejLliGPTY5JKovTTZo1 GzqPwBzZXopJtI3hpKn6Zx4mCPhsvc5uxyywEA+G2xwsNvQOdti+3wQu/PiiGg7jY3 Gc7YRQOMls11A== Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-96fb45a5258so242699566b.2 for ; Fri, 26 May 2023 18:46:00 -0700 (PDT) X-Gm-Message-State: AC+VfDyyUtsbvo33QcqlLTYNAMkV60ye/i2iDcxQZVLnDi50UufHEPvK /K9ouCH8H2ldKuvnGl/1SGvAyNjO1jCpcHRaN4g= X-Google-Smtp-Source: ACHHUZ4xpJjqy2cxLkhc51GvWwci+lPcn6nbvbHs+J9tTAV7Ui3/6K3rkMhmmtOo1Fm6Onm2JQE8vIs/qA6xQMcTm0s= X-Received: by 2002:a17:907:da7:b0:96f:4fc4:f5ab with SMTP id go39-20020a1709070da700b0096f4fc4f5abmr3652284ejc.18.1685151958406; Fri, 26 May 2023 18:45:58 -0700 (PDT) MIME-Version: 1.0 References: <20230526124107.894-1-dlan@gentoo.org> <20230526124107.894-2-dlan@gentoo.org> In-Reply-To: <20230526124107.894-2-dlan@gentoo.org> From: Guo Ren Date: Sat, 27 May 2023 09:45:46 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RESEND PATCH v1 1/4] riscv: t-head: licheepi4a: initial support added To: Yixun Lan Cc: u-boot@lists.denx.de, Rick Chen , Leo , Wei Fu , Jisheng Zhang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Sat, 27 May 2023 05:00:56 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Fri, May 26, 2023 at 8:41=E2=80=AFPM Yixun Lan wrote: > > Add support for Sipeed's Lichee Pi 4A board which based on > T-HEAD's TH1520 SoC, only minimal device tree and serial onsole are enabl= ed, > so it's capable of chain booting from T-HEAD's vendor u-boot. > > Reviewed-by: Wei Fu > Signed-off-by: Yixun Lan > --- > arch/riscv/Kconfig | 5 ++++ > board/thead/th1520_lpi4a/Kconfig | 42 ++++++++++++++++++++++++++++ > board/thead/th1520_lpi4a/MAINTAINERS | 7 +++++ > board/thead/th1520_lpi4a/Makefile | 5 ++++ > board/thead/th1520_lpi4a/board.c | 14 ++++++++++ > include/configs/th1520_lpi4a.h | 22 +++++++++++++++ > 6 files changed, 95 insertions(+) > create mode 100644 board/thead/th1520_lpi4a/Kconfig > create mode 100644 board/thead/th1520_lpi4a/MAINTAINERS > create mode 100644 board/thead/th1520_lpi4a/Makefile > create mode 100644 board/thead/th1520_lpi4a/board.c > create mode 100644 include/configs/th1520_lpi4a.h > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index f6ed05906a..419b6171a9 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -27,6 +27,10 @@ config TARGET_SIFIVE_UNMATCHED > config TARGET_STARFIVE_VISIONFIVE2 > bool "Support StarFive VisionFive2 Board" > > +config TARGET_TH1520_LPI4A > + bool "Support Sipeed's TH1520 Lichee PI 4A Board" > + select SYS_CACHE_SHIFT_6 > + > config TARGET_SIPEED_MAIX > bool "Support Sipeed Maix Board" > select SYS_CACHE_SHIFT_6 > @@ -66,6 +70,7 @@ source "board/emulation/qemu-riscv/Kconfig" > source "board/microchip/mpfs_icicle/Kconfig" > source "board/sifive/unleashed/Kconfig" > source "board/sifive/unmatched/Kconfig" > +source "board/thead/th1520_lpi4a/Kconfig" > source "board/openpiton/riscv64/Kconfig" > source "board/sipeed/maix/Kconfig" > source "board/starfive/visionfive2/Kconfig" > diff --git a/board/thead/th1520_lpi4a/Kconfig b/board/thead/th1520_lpi4a/= Kconfig > new file mode 100644 > index 0000000000..622246127c > --- /dev/null > +++ b/board/thead/th1520_lpi4a/Kconfig > @@ -0,0 +1,42 @@ > +if TARGET_TH1520_LPI4A > + > +config ARCH_THEAD > + bool > + default y > + > +config SYS_BOARD > + default "th1520_lpi4a" > + > +config SYS_VENDOR > + default "thead" > + > +config SYS_CPU > + default "generic" > + > +config SYS_CONFIG_NAME > + default "th1520_lpi4a" > + > +config TEXT_BASE > + default 0x01b00000 if SPL > + default 0x01c00000 if !RISCV_SMODE > + default 0x01c00000 if RISCV_SMODE > + > +config SPL_TEXT_BASE > + default 0x08000000 > + > +config SPL_OPENSBI_LOAD_ADDR > + default 0x80000000 > + > +config BOARD_SPECIFIC_OPTIONS > + def_bool y > + select ARCH_EARLY_INIT_R > + imply CPU > + imply CPU_RISCV > + imply RISCV_TIMER if RISCV_SMODE > + imply CMD_CPU > + imply SMP > + imply SUPPORT_OF_CONTROL > + imply OF_CONTROL > + imply OF_REAL > + > +endif > diff --git a/board/thead/th1520_lpi4a/MAINTAINERS b/board/thead/th1520_lp= i4a/MAINTAINERS > new file mode 100644 > index 0000000000..36c7ab7cc3 > --- /dev/null > +++ b/board/thead/th1520_lpi4a/MAINTAINERS > @@ -0,0 +1,7 @@ > +Lichee PI 4A > +M: Wei Fu > +M: Yixun Lan > +S: Maintained > +F: board/thead/th1520_lpi4a/ > +F: configs/th1520_lpi4a_defconfig > +F: doc/board/thead/lpi4a.rst > diff --git a/board/thead/th1520_lpi4a/Makefile b/board/thead/th1520_lpi4a= /Makefile > new file mode 100644 > index 0000000000..9671b3bbb0 > --- /dev/null > +++ b/board/thead/th1520_lpi4a/Makefile > @@ -0,0 +1,5 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +# > +# Copyright (c) 2023, Yixun Lan > + > +obj-y +=3D board.o > diff --git a/board/thead/th1520_lpi4a/board.c b/board/thead/th1520_lpi4a/= board.c > new file mode 100644 > index 0000000000..378bab098b > --- /dev/null > +++ b/board/thead/th1520_lpi4a/board.c > @@ -0,0 +1,14 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * Copyright (c) 2023, Yixun Lan > + * > + */ > + > +#include > + > +int board_init(void) > +{ > + enable_caches(); > + > + return 0; > +} > diff --git a/include/configs/th1520_lpi4a.h b/include/configs/th1520_lpi4= a.h > new file mode 100644 > index 0000000000..87496a52c4 > --- /dev/null > +++ b/include/configs/th1520_lpi4a.h > @@ -0,0 +1,22 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > +/* > + * Copyright (c) 2023 Yixun Lan > + * > + */ > + > +#ifndef __TH1520_LPI4A_H > +#define __TH1520_LPI4A_H > + > +#include > + > +#define CFG_SYS_SDRAM_BASE 0x00000000 > + > +#define UART_BASE 0xffe7014000 > +#define UART_REG_WIDTH 32 why couldn't we get it from dts? just like opensbi. > + > +/* Environment options */ > + > +#define CFG_EXTRA_ENV_SETTINGS \ > + "PS1=3D[LPi4A]# \0" > + > +#endif /* __TH1520_LPI4A_H */ > -- > 2.40.0 > --=20 Best Regards Guo Ren