
On Monday, October 26, 2015 at 01:15:19 AM, Thomas Chou wrote:
Add 10m50 devboard support. It is based on the Golden Hardware Reference Design (GHRD), available at,
http://rocketboards.org/foswiki/view/Documentation/ AlteraMAX1010M50RevCDevelopmentKitLinuxSetup
Though we supported only one nios2-generic board in the past. Now, with the removal of the nios2-generic board dir, adding new nios2 boards to u-boot is easier than before. It should be helpful to add those boards supported in Linux mainline. There are only two such nios2 boards, the 3c120 devboard and 10m50 devboard. The nios2-generic is actually 3c120, and should restore the name. The 10m50 is this one.
Signed-off-by: Thomas Chou thomas@wytron.com.tw
arch/nios2/dts/10m50_devboard.dts | 259 ++++++++++++++++++++++++++++++++++++++ configs/10m50_defconfig | 23 ++++ include/configs/10m50_devboard.h | 98 +++++++++++++++ 3 files changed, 380 insertions(+) create mode 100644 arch/nios2/dts/10m50_devboard.dts create mode 100644 configs/10m50_defconfig create mode 100644 include/configs/10m50_devboard.h
Indeed, this patch is an excellent example of adding a new nios2 board.
Just a few nitpicks below.
[...]
diff --git a/configs/10m50_defconfig b/configs/10m50_defconfig new file mode 100644 index 0000000..fa5ffd7 --- /dev/null +++ b/configs/10m50_defconfig @@ -0,0 +1,23 @@ +CONFIG_NIOS2=y +CONFIG_SYS_CONFIG_NAME="10m50_devboard" +CONFIG_DM_SERIAL=y +CONFIG_DM_GPIO=y +CONFIG_DEFAULT_DEVICE_TREE="10m50_devboard" +CONFIG_HUSH_PARSER=y +CONFIG_CMD_CPU=y +# CONFIG_CMD_BOOTD is not set +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_FPGA is not set +# CONFIG_CMD_ITEST is not set +# CONFIG_CMD_SETEXPR is not set
Please keep setexpr, it's really useful.
+CONFIG_CMD_DHCP=y +# CONFIG_CMD_NFS is not set +CONFIG_CMD_PING=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_ALTERA_PIO=y +CONFIG_MISC=y +CONFIG_ALTERA_SYSID=y +CONFIG_ALTERA_UART=y +CONFIG_TIMER=y +CONFIG_ALTERA_TIMER=y diff --git a/include/configs/10m50_devboard.h b/include/configs/10m50_devboard.h new file mode 100644 index 0000000..4140f2d --- /dev/null +++ b/include/configs/10m50_devboard.h @@ -0,0 +1,98 @@ +/*
- (C) Copyright 2005, Psyent Corporation <www.psyent.com>
- Scott McNutt smcnutt@psyent.com
- (C) Copyright 2010, Thomas Chou thomas@wytron.com.tw
- SPDX-License-Identifier: GPL-2.0+
- */
+#ifndef __CONFIG_H +#define __CONFIG_H
+/*
- BOARD/CPU
- */
+#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO_LATE
+/*
- SERIAL
- */
+#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console info */
+/*
- CFI Flash
- */
+#define CONFIG_SYS_NO_FLASH
+/*
- MII/PHY
- */
+#define CONFIG_CMD_MII 1 +#define CONFIG_PHY_GIGE 1 +#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1 +#define CONFIG_PHY_MARVELL 1
Are you sure all these macros must have a value (1) ? I doubt it.
[...]