public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: sgdfkk@163.com
To: duhuanpeng@139.com, u-boot@lists.denx.de
Cc: chenhuacai@loongson.cn, jiaxun.yang@flygoat.com,
	Du Huanpeng <u74147@gmail.com>
Subject: [PATCH v6 4/7] mips: loongson: ls1c300 board support
Date: Wed, 11 Mar 2026 16:41:26 +0800	[thread overview]
Message-ID: <20260311084129.12809-5-sgdfkk@163.com> (raw)
In-Reply-To: <20260311084129.12809-1-sgdfkk@163.com>

From: Du Huanpeng <u74147@gmail.com>

- 64MiB SDRAM K9F1G08
- 4MiB spi flash
- ethernet DM9161CEP
- UART2 console

Links:
https://dfgh.top/loongson
Signed-off-by: Du Huanpeng <u74147@gmail.com>
---
 board/loongson/ls1c300-eval/Kconfig     | 12 ++++++
 board/loongson/ls1c300-eval/MAINTAINERS |  7 ++++
 board/loongson/ls1c300-eval/Makefile    |  3 ++
 board/loongson/ls1c300-eval/board.c     | 19 +++++++++
 configs/ls1c300_defconfig               | 52 +++++++++++++++++++++++++
 include/configs/ls1c300.h               | 36 +++++++++++++++++
 6 files changed, 129 insertions(+)
 create mode 100644 board/loongson/ls1c300-eval/Kconfig
 create mode 100644 board/loongson/ls1c300-eval/MAINTAINERS
 create mode 100644 board/loongson/ls1c300-eval/Makefile
 create mode 100644 board/loongson/ls1c300-eval/board.c
 create mode 100644 configs/ls1c300_defconfig
 create mode 100644 include/configs/ls1c300.h

diff --git a/board/loongson/ls1c300-eval/Kconfig b/board/loongson/ls1c300-eval/Kconfig
new file mode 100644
index 00000000000..e427570a836
--- /dev/null
+++ b/board/loongson/ls1c300-eval/Kconfig
@@ -0,0 +1,12 @@
+if BOARD_LS1C300
+
+config SYS_BOARD
+	default "ls1c300-eval"
+
+config SYS_VENDOR
+	default "loongson"
+
+config SYS_CONFIG_NAME
+	default "ls1c300"
+
+endif
diff --git a/board/loongson/ls1c300-eval/MAINTAINERS b/board/loongson/ls1c300-eval/MAINTAINERS
new file mode 100644
index 00000000000..d3498b18e2b
--- /dev/null
+++ b/board/loongson/ls1c300-eval/MAINTAINERS
@@ -0,0 +1,7 @@
+LS1C300_EVAL BOARD
+M:	Du Huanpeng <u74147@gmail.com>
+S:	Maintained
+F:	board/loongson/ls1c300-eval/
+F:	include/configs/ls1c300.h
+F:	configs/ls1c300_defconfig
+F:	arch/mips/dts/ls1c300-eval.dts
diff --git a/board/loongson/ls1c300-eval/Makefile b/board/loongson/ls1c300-eval/Makefile
new file mode 100644
index 00000000000..db129c5abae
--- /dev/null
+++ b/board/loongson/ls1c300-eval/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-y += board.o
diff --git a/board/loongson/ls1c300-eval/board.c b/board/loongson/ls1c300-eval/board.c
new file mode 100644
index 00000000000..0eb5df1dc7b
--- /dev/null
+++ b/board/loongson/ls1c300-eval/board.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020-2026 Du Huanpeng <u74147@gmail.com>
+ */
+
+#include <mach/serial.h>
+
+#if defined(CONFIG_DEBUG_UART_BOARD_INIT)
+
+#define UART2_RX	36
+#define UART2_TX	37
+#define AFUNC		2
+
+void board_debug_uart_init(void)
+{
+	gpio_set_alternate(UART2_TX, AFUNC);
+	gpio_set_alternate(UART2_RX, AFUNC);
+}
+#endif
diff --git a/configs/ls1c300_defconfig b/configs/ls1c300_defconfig
new file mode 100644
index 00000000000..22d6f18cac4
--- /dev/null
+++ b/configs/ls1c300_defconfig
@@ -0,0 +1,52 @@
+CONFIG_MIPS=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_TEXT_BASE=0x80200000
+CONFIG_SYS_MALLOC_F_LEN=0x40000
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SIZE=0x1000
+CONFIG_DEFAULT_DEVICE_TREE="ls1c300-eval"
+CONFIG_DM_RESET=y
+CONFIG_SPL_SERIAL=y
+CONFIG_SPL_TEXT_BASE=0xbfc00000
+CONFIG_SPL_BSS_START_ADDR=0x80010000
+CONFIG_SPL_BSS_MAX_SIZE=0x10000
+CONFIG_SYS_LOAD_ADDR=0x80010000
+CONFIG_WATCHDOG_TIMEOUT_MSECS=3000
+CONFIG_SPL_SIZE_LIMIT=0x100000
+CONFIG_SPL=y
+CONFIG_ARCH_LSMIPS=y
+CONFIG_SPL_PAYLOAD="u-boot.img"
+CONFIG_ROM_EXCEPTION_VECTORS=y
+CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=y
+CONFIG_MIPS_BOOT_FDT=y
+CONFIG_FIT=y
+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
+CONFIG_LOGLEVEL=9
+CONFIG_DISPLAY_CPUINFO=y
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_SPL_MAX_SIZE=0x10000
+CONFIG_SPL_PAD_TO=0
+CONFIG_SPL_LEGACY_IMAGE_CRC_CHECK=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_NOR_SUPPORT=y
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_CRC32 is not set
+CONFIG_CMD_CLK=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_OF_EMBED=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK_CCF=y
+# CONFIG_INPUT is not set
+# CONFIG_POWER is not set
+CONFIG_CONS_INDEX=2
+CONFIG_SPL_SYS_NS16550_SERIAL=y
+CONFIG_SYS_NS16550_REG_SIZE=-1
+CONFIG_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_SYSRESET_WATCHDOG_AUTO=y
+CONFIG_WDT_LOONGSON=y
+# CONFIG_GZIP is not set
diff --git a/include/configs/ls1c300.h b/include/configs/ls1c300.h
new file mode 100644
index 00000000000..8d834333ea8
--- /dev/null
+++ b/include/configs/ls1c300.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 MediaTek Inc.
+ *
+ * Author: Gao Weijie <weijie.gao@mediatek.com>
+ * based on: include/configs/mt7628.h
+ * Copyright (C) 2022-2026 Du Huanpeng <u74147@gmail.com>
+ */
+
+#ifndef __CONFIG_LS1C300_H__
+#define __CONFIG_LS1C300_H__
+
+#define CFG_SYS_SDRAM_BASE		0x80200000
+#define CFG_SYS_INIT_SP_OFFSET		0x2000
+
+/* SPL */
+#if defined(CONFIG_SPL_BUILD)
+
+/* Serial SPL */
+#define CFG_SYS_NS16550_CLK		66000000
+#define CFG_SYS_NS16550_COM1		0xbfe44000
+#define CFG_SYS_NS16550_COM2		0xbfe48000
+#define CFG_SYS_NS16550_COM3		0xbfe4c000
+#define CFG_SYS_NS16550_COM4		0xbfe4c400
+#define CFG_SYS_NS16550_COM5		0xbfe4c500
+#define CFG_SYS_NS16550_COM6		0xbfe4c600
+
+#define CFG_MALLOC_F_ADDR		0x80100000	/* FIXME: find a proper place */
+#define CFG_SYS_UBOOT_BASE		0xbd000000
+
+#endif
+
+/* Serial common */
+#define CFG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 }
+
+#endif /* __CONFIG_LS1C300_H__ */
-- 
2.43.0


  parent reply	other threads:[~2026-03-11 13:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11  8:41 [PATCH v6 0/7] add loongson mips ls1c300 initial support sgdfkk
2026-03-11  8:41 ` [PATCH v6 1/7] mips: loongson: minimal initial SoC support sgdfkk
2026-03-11 18:05   ` Daniel Schwierzeck
2026-03-11  8:41 ` [PATCH v6 2/7] mips: loongson: lowlevel initialize sgdfkk
2026-03-11 18:10   ` Daniel Schwierzeck
2026-03-11  8:41 ` [PATCH v6 3/7] mips: loongson: lowlevel debug serial sgdfkk
2026-03-11 18:11   ` Daniel Schwierzeck
2026-03-11  8:41 ` sgdfkk [this message]
2026-03-11 18:11   ` [PATCH v6 4/7] mips: loongson: ls1c300 board support Daniel Schwierzeck
2026-03-11  8:41 ` [PATCH v6 5/7] mips: loongson: add clk driver sgdfkk
2026-03-11  8:41 ` [PATCH v6 6/7] mips: loongson: add watchdog driver sgdfkk
2026-03-11 18:12   ` Daniel Schwierzeck
2026-03-11  8:41 ` [PATCH v6 7/7] mips: loongson: ls1c300 dts and bindings sgdfkk
2026-03-11 18:13   ` Daniel Schwierzeck

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=20260311084129.12809-5-sgdfkk@163.com \
    --to=sgdfkk@163.com \
    --cc=chenhuacai@loongson.cn \
    --cc=duhuanpeng@139.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=u-boot@lists.denx.de \
    --cc=u74147@gmail.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