public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Jun Chang <jun.chang@metanoia-comm.com>
Cc: u-boot@lists.denx.de, Rick Chen <rick@andestech.com>,
	Leo <ycliang@andestech.com>
Subject: Re: [PATCH 1/1] board: mt5824: Add initial support for Metanoia MT5824 EVB
Date: Tue, 30 Dec 2025 09:31:15 -0600	[thread overview]
Message-ID: <20251230153115.GR710860@bill-the-cat> (raw)
In-Reply-To: <20251230030328.215240-2-jun.chang@metanoia-comm.com>

[-- Attachment #1: Type: text/plain, Size: 5276 bytes --]

On Tue, Dec 30, 2025 at 11:03:28AM +0800, Jun Chang wrote:

> - Add RISC-V target for MT5824
> - Add board defconfig and DTS for MT5824 EVB
> - Add SPL and U-Boot board support for MT5824 EVB
> - Add DDR init for MT5824 EVB
> 
> Signed-off-by: Jun Chang <jun.chang@metanoia-comm.com>
> ---
>  arch/riscv/Kconfig                    |   4 +
>  arch/riscv/dts/mt5824-evb.dts         | 232 +++++++++++++++++

What is the status on upstreaming this device tree?

[snip]
> diff --git a/board/metanoia/mt5824/lpddr4.h b/board/metanoia/mt5824/lpddr4.h
> new file mode 100644
> index 00000000000..5de70c536ca
> --- /dev/null
> +++ b/board/metanoia/mt5824/lpddr4.h
> @@ -0,0 +1,91 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright (C) 2025 Metanoia Communications Inc.,
> + * Jun Chang, Metanoia Communications Inc. <jun.chang@metanoia-comm.com>
> + */
> +
> +#ifndef __COBRA_DDR_H
> +#define __COBRA_DDR_H
> +
> +#include <asm/io.h>
> +
> +#define UMCTL2_REGS_BASE_ADDR 0x10060000
> +
> +#define reg8_write(addr, data) \
> +	writeb((uint8_t)(data), (volatile void __iomem *)(addr))
> +#define reg16_write(addr, data) \
> +	writew((uint16_t)(data), (volatile void __iomem *)(addr))
> +#define reg32_write(addr, data) \
> +	writel((uint32_t)(data), (volatile void __iomem *)(addr))

We really don't already have an appropriate macro here to use?

[snip]
> +#endif /* __COBRA_DDR_H */
> \ No newline at end of file

Please fix that globally.

> diff --git a/board/metanoia/mt5824/lpddr4_helper.c b/board/metanoia/mt5824/lpddr4_helper.c
> new file mode 100644
> index 00000000000..3bc447038dc
> --- /dev/null
> +++ b/board/metanoia/mt5824/lpddr4_helper.c
[snip]
> +#if 0 /* Enable for debugging */
> +		if (i < 10) {
> +			printf("  [%02d] 0x%08x = 0x%08x\n", i, reg_addr, reg_value);
> +		}
> +#endif

Just use debug() here? And remove other "if 0" or commented out code
globally.

[snip]
> diff --git a/board/metanoia/mt5824/mt5824.c b/board/metanoia/mt5824/mt5824.c
> new file mode 100644
> index 00000000000..f385de1d897
> --- /dev/null
> +++ b/board/metanoia/mt5824/mt5824.c
> @@ -0,0 +1,188 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright (C) 2025 Metanoia Communications Inc.,
> + * Jun Chang, Metanoia Communications Inc. <jun.chang@metanoia-comm.com>
> + */
> +
> +#include <log.h>
> +#include <asm/csr.h>
> +#include <asm/sbi.h>
> +#include <config.h>
> +#include <cpu_func.h>
> +#include <image.h>
> +#include <init.h>
> +#include <net.h>
> +#include <asm/global_data.h>
> +#include <linux/io.h>
> +#include <fdtdec.h>
> +#include <dm.h>
> +#include <hang.h>
> +#include <misc.h>
> +#include <hexdump.h>
> +#include <env_internal.h>
> +#include <linux/delay.h>
> +#include <asm/io.h>

Globally, please audit your include list.

[snip]
> diff --git a/configs/mt5824_evb_defconfig b/configs/mt5824_evb_defconfig
> new file mode 100644
> index 00000000000..74f6ceb2284
> --- /dev/null
> +++ b/configs/mt5824_evb_defconfig
> @@ -0,0 +1,61 @@
> +CONFIG_RISCV=y
> +CONFIG_RISCV_ANDES=y
> +CONFIG_ARCH_RV64I=y
> +CONFIG_RISCV_SMODE=y
> +

Please re-generate this with "make savedefconfig".

[snip]
> diff --git a/include/configs/mt5824.h b/include/configs/mt5824.h
> new file mode 100644
> index 00000000000..9809080b805
> --- /dev/null
> +++ b/include/configs/mt5824.h
[snip]
> +/* environments */
> +
> +/* SPI FLASH */
> +
> +/*
> + * For booting Linux, the board info and command line data
> + * have to be in the first 16 MB of memory, since this is
> + * the maximum mapped by the Linux kernel during initialization.
> + */
> +
> +/* Initial Memory map for Linux*/
> +#define CFG_SYS_BOOTMAPSZ	(64 << 20)
> +/* Increase max gunzip size */
> +
> +/* Support autoboot from RAM (kernel image is loaded via debug port) */
> +#define BOOTENV_DEV_NAME_RAM(devtypeu, devtypel, instance) \
> +	"ram "
> +
> +#define BOOTENV_DEV_RAM(devtypeu, devtypel, instance) \
> +	"bootcmd_ram=" \
> +	"bootm ${fit_addr}\0"
> +
> +#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
> +	"bootcmd_" #devtypel #instance "=" \
> +	"setenv mmcdev " #instance"; "\
> +	"setenv bootpart " #instance":2 ; "\
> +	"run mmcboot\0"
> +
> +#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
> +	#devtypel #instance " "
> +
> +#define BOOTENV_DEV_NAME_TFTP(devtypeu, devtypel, instance) \
> +	#devtypel " "
> +
> +#define BOOTENV_DEV_TFTP(devtypeu, devtypel, instance) \
> +	"bootcmd_" #devtypel "=" \
> +	"tftpboot ${fit_addr} $serverip:fitImage-dev-image-initramfs; " \
> +	"bootm ${fit_addr}\0"
> +
> +/* Enable distro boot */
> +#define BOOT_TARGET_DEVICES(func) \
> +	func(TFTP, tftp, na) \
> +	func(RAM, ram, na)
> +
> +#include <config_distro_bootcmd.h>
> +
> +#define CFG_EXTRA_ENV_SETTINGS	\
> +	"bootcmd=bootm 90000000\0" \
> +	"kernel_addr_r=82000000\0" \
> +	"pxefile_addr_r=0x83f00000\0" \
> +	"scriptaddr=0x83f00000\0" \
> +	"fdt_addr_r=0x68010000\0" \
> +	"ramdisk_addr_r=0x83000000\0" \
> +	"fit_addr=0x83000000\0" \
> +	"initrd_high=0x100000000\0" \
> +	BOOTENV

Please switch to plain text environment and consider standard boot,
thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-12-30 15:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-30  3:03 [PATCH 0/1] Add initial support for Metanoia MT5824 EVB Jun Chang
2025-12-30  3:03 ` [PATCH 1/1] board: mt5824: " Jun Chang
2025-12-30 15:31   ` Tom Rini [this message]
2025-12-31  6:32     ` Jun Chang
2025-12-31 14:34       ` Tom Rini
2026-01-05 11:39         ` Jun Chang
2026-01-05 14:15           ` Tom Rini
2026-01-06  5:17             ` Jun Chang
2026-01-06 14:20               ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251230153115.GR710860@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=jun.chang@metanoia-comm.com \
    --cc=rick@andestech.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox