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 5825FC001DE for ; Mon, 31 Jul 2023 18:43:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F1048699D; Mon, 31 Jul 2023 20:43:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="YRpmUvOr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 58FE9869ED; Mon, 31 Jul 2023 20:43:39 +0200 (CEST) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BCD4386988 for ; Mon, 31 Jul 2023 20:43:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=saproj@gmail.com Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-99bc9e3cbf1so1018365666b.0 for ; Mon, 31 Jul 2023 11:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690829016; x=1691433816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WrB07tQ6ANIg3sDmPGKMYYTkcHui0J/o1rYQvwt1Ixk=; b=YRpmUvOrFa992Z0BbU4jc4moeyLMwL0QM8rGfZYXs/qw2LuXQL8k15IxXN2sU6viTH U+wbYWdu2rrNpguXC+mAL6JgrQEsNOvOtFCX5f06+viCC5jYLildvfkFsLI8eX1uCvZf E+2igGYoufxgvz7TT2jSjzQTri3osLPbOzwil/rMGUnvEyiufzNH+4u1PtayToK9is5K MiRB0jwLiI0FVXs/WAXnZhQG/jUQSXKeNO+PgSZ7YolWvCXhwzwcekEIljjd/TMbMt0t MEOzveZsJyl9rS4ty73sq7dGKMODypBikoSQ/YlKD6VvJ7q2yFXj38LKu83U7mQsGvVb F8+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690829016; x=1691433816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WrB07tQ6ANIg3sDmPGKMYYTkcHui0J/o1rYQvwt1Ixk=; b=Z2flZ48Tbxqsg4MQIVbPyuYDWW3dDoBByHI2hyQ8qzVqqc9T8+tgXJQ32h6DIQzosx FvlIxfYfJsOKbJmXO0u9XwNL8NHljxA/ML1ojBlqdFY4560uAi7p4T5KNnEt0nsbrkED XYjyJ9gQ9DKe9CktO9oPfMccC6818L0xLbnOeY2UECRlB3qfVu1tuMsPWM20wzZCsi29 7/VWpQMib2CyLk/hy0tzwiCSfX5boa9zRv1jWhItcwgSKYj4mw/yMu4ehSdTCxFHQDSB C1jELO3z2kUXSWTxKTjWF/pdWeyIoK0xMUn5Z58dofFofdXlcr8Mn5hUKfD3BQWRdH2e dehA== X-Gm-Message-State: ABy/qLY84i4RLgEsLHZziBdVUTfewHQ4O3ShH9dave+nPbek3BgiDKSI Lsk03rY/F2LdHPsN1kOLiUsdiH8Nw9M= X-Google-Smtp-Source: APBJJlFW+pOcF79ICutOkI4P2bJyGIoIVHyzJawAulSpR4u/nPz8mSyV5fbL5xU9LvJgZsU9VhPA2A== X-Received: by 2002:a17:907:97d5:b0:992:13c7:560 with SMTP id js21-20020a17090797d500b0099213c70560mr610342ejc.38.1690829016030; Mon, 31 Jul 2023 11:43:36 -0700 (PDT) Received: from saproj-Latitude-5501.yandex.net ([2a02:6b8:0:51e:f4e6:53d9:ed21:d534]) by smtp.gmail.com with ESMTPSA id bc21-20020a056402205500b0052229882fb0sm5743169edb.71.2023.07.31.11.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 11:43:35 -0700 (PDT) From: Sergei Antonov To: u-boot@lists.denx.de, trini@konsulko.com Cc: sjg@chromium.org, Sergei Antonov Subject: [PATCH] arm: moxa: add nport6600 platform Date: Mon, 31 Jul 2023 21:43:29 +0300 Message-Id: <20230731184329.1789323-1-saproj@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Support for NPort 6600 Series RS-232/422/485 secure terminal servers. Technical specifications: FA526 ARMv4 CPU, 64 MB of RAM, 16 MB NOR flash, 100 Mbit/s Ethernet, optional expansion modules, up to 32 RS-232/422/485 ports. Signed-off-by: Sergei Antonov --- arch/arm/Kconfig | 9 +++ arch/arm/dts/nport6600.dts | 134 +++++++++++++++++++++++++++++++ board/moxa/nport6600/Kconfig | 15 ++++ board/moxa/nport6600/MAINTAINERS | 7 ++ board/moxa/nport6600/Makefile | 3 + board/moxa/nport6600/nport6600.c | 78 ++++++++++++++++++ configs/nport6600_defconfig | 129 +++++++++++++++++++++++++++++ include/configs/nport6600.h | 13 +++ 8 files changed, 388 insertions(+) create mode 100644 arch/arm/dts/nport6600.dts create mode 100644 board/moxa/nport6600/Kconfig create mode 100644 board/moxa/nport6600/MAINTAINERS create mode 100644 board/moxa/nport6600/Makefile create mode 100644 board/moxa/nport6600/nport6600.c create mode 100644 configs/nport6600_defconfig create mode 100644 include/configs/nport6600.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 97c25b4f146d..de5b746b93c9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -705,6 +705,14 @@ config TARGET_BCMNS3 ARMv8 Cortex-A72 processors targeting a broad range of networking applications. +config TARGET_NPORT6600 + bool "Support NPort 6600" + select CPU_ARM720T + help + Support for NPort 6600 Series RS-232/422/485 secure terminal servers. + FA526 ARMv4 CPU, 64 MB of RAM, 16 MB NOR flash, 100 Mbit/s Ethernet, + optional expansion modules, up to 32 RS-232/422/485 ports. + config ARCH_EXYNOS bool "Samsung EXYNOS" select DM @@ -2312,6 +2320,7 @@ source "board/hisilicon/hikey960/Kconfig" source "board/hisilicon/poplar/Kconfig" source "board/isee/igep003x/Kconfig" source "board/kontron/sl28/Kconfig" +source "board/moxa/nport6600/Kconfig" source "board/myir/mys_6ulx/Kconfig" source "board/samsung/common/Kconfig" source "board/siemens/common/Kconfig" diff --git a/arch/arm/dts/nport6600.dts b/arch/arm/dts/nport6600.dts new file mode 100644 index 000000000000..ea268ed16d9b --- /dev/null +++ b/arch/arm/dts/nport6600.dts @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/dts-v1/; + +#include + +/ { + model = "MOXA NPort 6600 Series"; + compatible = "moxa,nport6600"; + #address-cells = <1>; + #size-cells = <1>; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + ahb { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + ranges; + bootph-all; + + apb { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + bootph-all; + + uart1: serial@98200020 { + compatible = "ns16550a"; + reg = <0x98200020 0x20>; + reg-io-width = <4>; + reg-shift = <2>; + clock-frequency = <14745600>; + no-loopback-test; + bootph-all; + status = "okay"; + }; + + timer: timer@98400000 { + compatible = "faraday,fttmr010-timer"; + reg = <0x98400000 0x40>; + clock-frequency = <12000000>; + }; + + wdt: wdt@98500000 { + compatible = "faraday,ftwdt010"; + reg = <0x98500000 0x20>; + }; + + gpio: gpio@98700000 { + compatible = "faraday,ftgpio010"; + reg = <0x98700000 0x20>; + nr-gpios = <32>; + #gpio-cells = <2>; + }; + + rtc { + compatible = "holtek,ht1380"; + rst-gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + clk-gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; + dat-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + }; + + mmc0: mmc@98e00000 { + compatible = "andestech,atfsdc010"; + bus-width = <4>; + max-frequency = <25000000>; + reg = <0x98e00000 0x1000>; + cap-sd-highspeed; + }; + }; + + nor@80000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x80000000 0x0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + mtd1 { + label = "moxa"; + reg = <0x0 0x40000>; + read-only; + }; + mtd2 { + label = "env"; + reg = <0x40000 0x100000>; + read-only; + }; + mtd3 { + label = "uboot"; + reg = <0x140000 0xc0000>; + }; + mtd4 { + label = "mfs"; + reg = <0x200000 0x20000>; + read-only; + }; + mtd5 { + label = "ubi"; + reg = <0x220000 0xde0000>; + }; + }; + }; + + mac@92000000 { + compatible = "andestech,atmac100"; + reg = <0x92000000 0x90>; + }; + + pci0@90c00000 { + compatible = "faraday,ftpci100"; + device_type = "pci"; + reg = <0x90c00000 0x30>; + + #address-cells = <3>; + #size-cells = <2>; + bus-range = <0x0 0xff>; + ranges = <0x01000000 0 0x90c00000 0x90c00000 0 0x00100000 /* I/O */ + 0x02000000 0 0xa0000000 0xa0000000 0 0x02000000 /* MEM */>; + + status = "okay"; + }; + }; +}; diff --git a/board/moxa/nport6600/Kconfig b/board/moxa/nport6600/Kconfig new file mode 100644 index 000000000000..3094b380c0fd --- /dev/null +++ b/board/moxa/nport6600/Kconfig @@ -0,0 +1,15 @@ +if TARGET_NPORT6600 + +config SYS_BOARD + default "nport6600" + +config SYS_VENDOR + default "moxa" + +config SYS_SOC + default "moxa" + +config SYS_CONFIG_NAME + default "nport6600" + +endif diff --git a/board/moxa/nport6600/MAINTAINERS b/board/moxa/nport6600/MAINTAINERS new file mode 100644 index 000000000000..fca3d9d0dbfa --- /dev/null +++ b/board/moxa/nport6600/MAINTAINERS @@ -0,0 +1,7 @@ +NPORT6600 BOARD +M: Sergei Antonov +S: Maintained +F: board/moxa/nport6600/ +F: arch/arm/dts/nport6600.dts +F: include/configs/nport6600.h +F: configs/nport6600_defconfig diff --git a/board/moxa/nport6600/Makefile b/board/moxa/nport6600/Makefile new file mode 100644 index 000000000000..8d853eaa1a57 --- /dev/null +++ b/board/moxa/nport6600/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +obj-y := nport6600.o diff --git a/board/moxa/nport6600/nport6600.c b/board/moxa/nport6600/nport6600.c new file mode 100644 index 000000000000..88fa98c315fd --- /dev/null +++ b/board/moxa/nport6600/nport6600.c @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include +#include +#include +#include +#include + +int dram_init(void) +{ + return fdtdec_setup_mem_size_base(); +} + +int board_init(void) +{ + return 0; +} + +int show_board_info(void) +{ + const u8 *NPORT_EXPANSION_MODULE = (const u8 *)0x8c0000c0; + const unsigned int module_id = *NPORT_EXPANSION_MODULE; + static const char * const modules[] = { + NULL, + "NM-TX01", + "NM-FX01-M-SC", + "NM-FX01-S-SC", + NULL, + "NM-FX02-M-SC", + "NM-FX02-S-SC", + "NM_GPRS", + "NM-TX02", + }; + + /* Check for Module */ + if (module_id < ARRAY_SIZE(modules) && modules[module_id]) + printf("Expansion module %s detected\n", modules[module_id]); + + return 0; +} + +static int read_net_params(void) +{ + const u8 *MAC_ADDR = (const u8 *)0x80000050; + + if (eth_env_set_enetaddr("ethaddr", MAC_ADDR)) + return -1; + + return 0; +} + +int misc_init_r(void) +{ + const char *SERIAL_STR = (const char *)0x80000034; + const unsigned int SERIAL_LEN = 12; + char str[SERIAL_LEN + 1]; + + if (*SERIAL_STR) { + memcpy(str, SERIAL_STR, SERIAL_LEN); + str[SERIAL_LEN] = 0; + } else { + /* No serial string. Resort to a 2-byte serial number. */ + const u16 *SERIAL_NO = (const u16 *)0x8000004c; + + sprintf(str, "%05u", *SERIAL_NO); + } + + if (env_set("serial#", str)) + return -1; + + return read_net_params(); +} + +void enable_caches(void) +{ + icache_enable(); + dcache_enable(); +} diff --git a/configs/nport6600_defconfig b/configs/nport6600_defconfig new file mode 100644 index 000000000000..47db1ca20ae6 --- /dev/null +++ b/configs/nport6600_defconfig @@ -0,0 +1,129 @@ +CONFIG_ARM=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="echo Serial number: ${serial#}" +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="" +CONFIG_BOOTDELAY=1 +# CONFIG_BOOTSTD is not set +CONFIG_DISPLAY_BOARDINFO=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_LTO=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_CLS=y +CONFIG_CMD_CRC32=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_LOG=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_MEMTEST=y +CONFIG_CMD_MTDPARTS=y +CONFIG_CMD_MTD=y +CONFIG_CMD_NET=y +CONFIG_CMD_PING=y +CONFIG_CMD_UBI=y +CONFIG_CRC32_VERIFY=y +CONFIG_DM=y +CONFIG_ENV_SUPPORT=y +CONFIG_FTMAC100=y +CONFIG_HUSH_PARSER=y +CONFIG_LOG_CONSOLE=y +CONFIG_LOG_MAX_LEVEL=8 +CONFIG_LOG_DEFAULT_LEVEL=6 +CONFIG_LOGLEVEL=7 +CONFIG_LOG=y +CONFIG_MISC_INIT_R=y +CONFIG_OF_LIBFDT=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_SYS_CBSIZE=256 +CONFIG_SYS_DCACHE_OFF=y +CONFIG_SYS_LONGHELP=y +CONFIG_SYS_MEMTEST_END=0x3F00000 +CONFIG_SYS_MEMTEST_START=0x00000000 +CONFIG_SYS_NS16550=y +CONFIG_NS16550_DYNAMIC=y +CONFIG_SYS_PBSIZE=280 +CONFIG_SYS_PROMPT="MOXA NPort 6600 # " +CONFIG_TEXT_BASE=0x80140020 +CONFIG_TARGET_NPORT6600=y +CONFIG_FS_EXT4=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_FS_FAT=y +CONFIG_CMD_FAT=y +CONFIG_CMD_TIME=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_STRINGS=y +CONFIG_CMD_UNLZ4=y +CONFIG_CMD_UNZIP=y +CONFIG_CMD_SETEXPR=y +CONFIG_CMD_SETEXPR_FMT=y +CONFIG_CMD_READ=y +CONFIG_CMD_GETTIME=y +CONFIG_CMD_TIMER=y +CONFIG_CMD_UBI_RENAME=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_MEM_SEARCH=y +CONFIG_CMD_ASKENV=y +CONFIG_CMD_EXPORTENV=y +CONFIG_CMD_IMPORTENV=y +CONFIG_CMD_EDITENV=y +CONFIG_CMD_GREPENV=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_ERASEENV=y +CONFIG_CMD_ENV_EXISTS=y +CONFIG_CMD_ENV_CALLBACK=y +CONFIG_CMD_ENV_FLAGS=y +CONFIG_SYS_LOAD_ADDR=0x100000 +CONFIG_CMD_LOADB=y +CONFIG_CMD_DM=y +CONFIG_CMD_GPT=y +CONFIG_CMD_MBR=y +CONFIG_CMD_PART=y +CONFIG_CMD_WGET=y +CONFIG_DM_STATS=y +CONFIG_CMD_HASH=y +CONFIG_HASH_VERIFY=y +CONFIG_CMD_DHCP=y +CONFIG_BAUDRATE=115200 +CONFIG_MTD=y +CONFIG_DM_MTD=y +CONFIG_MTD_NOR_FLASH=y +CONFIG_FLASH_CFI_MTD=y +CONFIG_CFI_FLASH=y +CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y +CONFIG_SYS_FLASH_CFI=y +CONFIG_SYS_FLASH_CFI_WIDTH_16BIT=y +CONFIG_SYS_FLASH_EMPTY_INFO=y +CONFIG_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="nport6600" +CONFIG_SYS_CLK_FREQ=48000000 +CONFIG_TIMER=y +CONFIG_FTTMR010_TIMER=y +CONFIG_DM_SERIAL=y +CONFIG_DM_ETH=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +CONFIG_MMC_VERBOSE=y +CONFIG_CMD_MMC=y +CONFIG_FTSDC010=y +CONFIG_WDT_FTWDT010=y +CONFIG_WDT=y +CONFIG_CMD_WDT=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_WATCHDOG=y +CONFIG_SYSRESET_WATCHDOG_AUTO=y +CONFIG_CMD_GPIO=y +CONFIG_DM_GPIO=y +CONFIG_DM_RTC=y +CONFIG_RTC_HT1380=y +CONFIG_CMD_RTC=y +CONFIG_CMD_DATE=y +CONFIG_FTGPIO010=y +CONFIG_CMD_MII=y +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="console=ttyS0,115200n8" +CONFIG_IPV6=y +CONFIG_PCI=y +CONFIG_CMD_PCI=y +CONFIG_PCI_FTPCI100=y diff --git a/include/configs/nport6600.h b/include/configs/nport6600.h new file mode 100644 index 000000000000..c70cc7e1ac72 --- /dev/null +++ b/include/configs/nport6600.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef _CONFIG_NPORT6600_H +#define _CONFIG_NPORT6600_H + +#include + +#define CFG_SYS_INIT_RAM_ADDR 0 +#define CFG_SYS_INIT_RAM_SIZE SZ_64M + +#define __io + +#endif /* _CONFIG_NPORT6600_H */ -- 2.37.2