From patchwork Thu Dec 19 11:40:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Condarelli X-Patchwork-Id: 1213236 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mclink.it Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47dqhc11Jwz9sPn for ; Thu, 19 Dec 2019 22:41:19 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 014E181582; Thu, 19 Dec 2019 12:41:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=mclink.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 657BE81486; Thu, 19 Dec 2019 12:41:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from relaygw2-2.mclink.it (relaygw2-2.mclink.it [213.21.178.137]) by phobos.denx.de (Postfix) with ESMTP id 93EE481486 for ; Thu, 19 Dec 2019 12:41:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=mclink.it Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=mc5686@mclink.it Received: from smtpoutgw2.mclink.it ([172.24.30.42] verified) by relaygw2-2.mclink.it (CommuniGate Pro SMTP 6.0.4) with ESMTP id 160230126 for u-boot@lists.denx.de; Thu, 19 Dec 2019 12:41:03 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DMDQCoYPtd/5tP919kHAEBAQEBBwEBEQEEBAEBgWsEAQELAYIhLRoaEE8hEiqNCYZSCQUBgTMTJgGJSIMrjCCBZwkBAQEBAQEBAQE3AQGEQAILgg0nNwYOAhABAQUBAQEBAQUEbYVDhV8GMgFGED8SVxmDIoJTKQGuGopSgTYBhz+FbIEHgRGHX4YpBIE8AQEBjjufDgEGAoFfWIIJk38MG5pRqy8jgViCXoFOUBgNjR4XjiRDMJEEAQE Received: from host155-79-dynamic.247-95-r.retail.telecomitalia.it (HELO cinderella.condarelli.it) ([95.247.79.155]) by smtpoutgw2.mclink.it with ESMTP; 19 Dec 2019 12:41:01 +0100 From: MCon To: u-boot@lists.denx.de Subject: [PATCH 1/1] Port to new board "VoCore2" Date: Thu, 19 Dec 2019 12:40:53 +0100 Message-Id: <20191219114053.20811-2-mc5686@mclink.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191219114053.20811-1-mc5686@mclink.it> References: <20191219114053.20811-1-mc5686@mclink.it> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Evgeniy Paltsev , Stefan Roese , Jagan Teki Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean modified: arch/mips/dts/Makefile Add support for creation of vocore2.dtb move creation of gardena-smart-gateway-mt7688.dtb and linkit-smart-7688.dtb to more specific setting. new file: arch/mips/dts/vocore2.dts modified: arch/mips/mach-mtmips/Kconfig new file: board/vonger/vocore2/Kconfig KConfig support for board VoCore2. new file: board/vonger/vocore2/Makefile new file: board/vonger/vocore2/board.c Board initialization (largely copied from existing). new file: configs/vocore2_defconfig new file: include/configs/vocore2.h Board settings (WIP). Signed-off-by: MCon Signed-off-by: Mauro Condarelli --- arch/mips/dts/Makefile | 6 ++-- arch/mips/dts/vocore2.dts | 62 +++++++++++++++++++++++++++++++++++ arch/mips/mach-mtmips/Kconfig | 9 +++++ board/vonger/vocore2/Kconfig | 11 +++++++ board/vonger/vocore2/Makefile | 2 ++ board/vonger/vocore2/board.c | 35 ++++++++++++++++++++ configs/vocore2_defconfig | 61 ++++++++++++++++++++++++++++++++++ include/configs/vocore2.h | 57 ++++++++++++++++++++++++++++++++ 8 files changed, 240 insertions(+), 3 deletions(-) create mode 100644 arch/mips/dts/vocore2.dts create mode 100644 board/vonger/vocore2/Kconfig create mode 100644 board/vonger/vocore2/Makefile create mode 100644 board/vonger/vocore2/board.c create mode 100644 configs/vocore2_defconfig create mode 100644 include/configs/vocore2.h diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile index c9d75596f2..664505ee00 100644 --- a/arch/mips/dts/Makefile +++ b/arch/mips/dts/Makefile @@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-$(CONFIG_ARCH_MTMIPS) += \ - gardena-smart-gateway-mt7688.dtb \ - linkit-smart-7688.dtb dtb-$(CONFIG_TARGET_AP121) += ap121.dtb dtb-$(CONFIG_TARGET_AP143) += ap143.dtb dtb-$(CONFIG_TARGET_AP152) += ap152.dtb @@ -16,12 +13,15 @@ dtb-$(CONFIG_BOARD_COMTREND_AR5387UN) += comtrend,ar-5387un.dtb dtb-$(CONFIG_BOARD_COMTREND_CT5361) += comtrend,ct-5361.dtb dtb-$(CONFIG_BOARD_COMTREND_VR3032U) += comtrend,vr-3032u.dtb dtb-$(CONFIG_BOARD_COMTREND_WAP5813N) += comtrend,wap-5813n.dtb +dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY_MT7688) += gardena-smart-gateway-mt7688.dtb dtb-$(CONFIG_BOARD_HUAWEI_HG556A) += huawei,hg556a.dtb +dtb-$(CONFIG_BOARD_LINKIT._SMART_7688) += linkit-smart-7688.dtb dtb-$(CONFIG_BOARD_NETGEAR_CG3100D) += netgear,cg3100d.dtb dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f@st1704.dtb dtb-$(CONFIG_BOARD_SFR_NB4_SER) += sfr,nb4-ser.dtb dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb +dtb-$(CONFIG_BOARD_VOCORE2) += vocore2.dtb dtb-$(CONFIG_TARGET_JZ4780_CI20) += ci20.dtb dtb-$(CONFIG_SOC_LUTON) += luton_pcb090.dtb luton_pcb091.dtb dtb-$(CONFIG_SOC_OCELOT) += ocelot_pcb120.dtb ocelot_pcb123.dtb diff --git a/arch/mips/dts/vocore2.dts b/arch/mips/dts/vocore2.dts new file mode 100644 index 0000000000..cdcd9b4e1d --- /dev/null +++ b/arch/mips/dts/vocore2.dts @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Mauro Condarelli + */ + +/dts-v1/; +#include "mt7628a.dtsi" + +/ { + compatible = "vocore,vocore2", "ralink,mt7628a-soc"; + model = "VoCore2"; + + aliases { + serial0 = &uart2; + spi0 = &spi0; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x08000000>; + }; + + chosen { + bootargs = "console=ttyS2,115200"; + stdout-path = &uart2; + }; +}; + +&pinctrl { + state_default: pin_state { + p0led { + groups = "p0led_a"; + function = "led"; + }; + }; +}; + +&uart2 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + nor0: m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "m25p80"; + spi-max-frequency = <10000000>; + reg = <0x0>; + m25p,chunked-io = <32>; + }; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_iot_mode>; + mediatek,poll-link-phy = <0>; +}; + +&mmc { + status = "okay"; +}; diff --git a/arch/mips/mach-mtmips/Kconfig b/arch/mips/mach-mtmips/Kconfig index c8dcf19c0d..5ea260232f 100644 --- a/arch/mips/mach-mtmips/Kconfig +++ b/arch/mips/mach-mtmips/Kconfig @@ -43,6 +43,14 @@ config BOARD_LINKIT_SMART_7688 ethernet ports, 1 USB port, 1 UART, GPIO buttons and LEDs, and a MT7688 (PCIe). +config BOARD_VOCORE2 + bool "VoCore2" + depends on SOC_MT7628 + select SUPPORTS_BOOT_RAM + help + Vonger VoCore2 board has a MT7628 SoC with 128 MiB of RAM + and 16 MiB of flash (SPI). + endchoice choice @@ -134,5 +142,6 @@ config SUPPORTS_BOOT_RAM source "board/gardena/smart-gateway-mt7688/Kconfig" source "board/seeed/linkit-smart-7688/Kconfig" +source "board/vonger/vocore2/Kconfig" endmenu diff --git a/board/vonger/vocore2/Kconfig b/board/vonger/vocore2/Kconfig new file mode 100644 index 0000000000..4067973e70 --- /dev/null +++ b/board/vonger/vocore2/Kconfig @@ -0,0 +1,11 @@ +if BOARD_VOCORE2 +config SYS_BOARD + default "vocore2" + +config SYS_VENDOR + default "vonger" + +config SYS_CONFIG_NAME + default "vocore2" + +endif diff --git a/board/vonger/vocore2/Makefile b/board/vonger/vocore2/Makefile new file mode 100644 index 0000000000..4b162318c2 --- /dev/null +++ b/board/vonger/vocore2/Makefile @@ -0,0 +1,2 @@ + +obj-y := board.o diff --git a/board/vonger/vocore2/board.c b/board/vonger/vocore2/board.c new file mode 100644 index 0000000000..1ab430247b --- /dev/null +++ b/board/vonger/vocore2/board.c @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Mauro Condarelli + * + * Note: this is largely copied from: + * board/seeed/linkit_smart_7688/board.c + * Copyright (C) 2018 Stefan Roese + */ + +#include +#include + +#define MT76XX_GPIO1_MODE 0x10000060 + +DECLARE_GLOBAL_DATA_PTR; + +void board_debug_uart_init(void) +{ + void __iomem *gpio_mode; + + /* Select UART2 mode instead of GPIO mode (default) */ + gpio_mode = ioremap_nocache(MT76XX_GPIO1_MODE, 0x100); + clrbits_le32(gpio_mode, GENMASK(27, 26)); +} + +int board_early_init_f(void) +{ + /* + * The pin muxing of UART2 also needs to be done, if debug uart + * is not enabled. So we need to call this function here as well. + */ + board_debug_uart_init(); + + return 0; +} diff --git a/configs/vocore2_defconfig b/configs/vocore2_defconfig new file mode 100644 index 0000000000..7b09a16fa4 --- /dev/null +++ b/configs/vocore2_defconfig @@ -0,0 +1,61 @@ +CONFIG_MIPS=y +CONFIG_SYS_TEXT_BASE=0x80010000 +CONFIG_ENV_SIZE=0x00001000 +CONFIG_ENV_OFFSET=0x00FFE000 +CONFIG_ENV_SECT_SIZE=0x00001000 +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_MIPS_BOOT_FDT=y +CONFIG_ENV_VARS_UBOOT_CONFIG=y +CONFIG_SYS_BOOT_GET_CMDLINE=y +CONFIG_SYS_BOOT_GET_KBD=y +# CONFIG_LEGACY_IMAGE_FORMAT is not set +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set +CONFIG_LOGLEVEL=8 +CONFIG_VERSION_VARIABLE=y +CONFIG_DISPLAY_BOARDINFO_LATE=y +# CONFIG_AUTOBOOT is not set +# CONFIG_BOOTM_NETBSD is not set +# CONFIG_BOOTM_PLAN9 is not set +# CONFIG_BOOTM_RTEMS is not set +# CONFIG_BOOTM_VXWORKS is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_MTDPARTS=y +CONFIG_MTDIDS_DEFAULT="nor0=spi0.0" +CONFIG_MTDPARTS_DEFAULT="spi0.0:320k(u-boot),2752k(kernel),13304k(filesystem),4k(env),-(factory)" +# CONFIG_ISO_PARTITION is not set +CONFIG_DEFAULT_DEVICE_TREE="vocore2" +CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_ENV_ADDR=0x00FFE000 +# CONFIG_NET is not set +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BLK=y +# CONFIG_INPUT is not set +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MTD=y +# CONFIG_DM_ETH is not set +# CONFIG_RAM_ROCKCHIP_DEBUG is not set +CONFIG_SPECIFY_CONSOLE_INDEX=y +CONFIG_CONS_INDEX=3 +CONFIG_SPI=y +CONFIG_MT7621_SPI=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_GENERIC=y +CONFIG_USB_STORAGE=y +CONFIG_LZMA=y +CONFIG_LZO=y diff --git a/include/configs/vocore2.h b/include/configs/vocore2.h new file mode 100644 index 0000000000..9ee32329f2 --- /dev/null +++ b/include/configs/vocore2.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2019 Mauro Condarelli + */ + +#ifndef __VOCORE2_CONFIG_H__ +#define __VOCORE2_CONFIG_H__ + +/* CPU */ +#define CONFIG_SYS_MIPS_TIMER_FREQ 290000000 + +/* RAM */ +#define CONFIG_SYS_SDRAM_BASE 0x80000000 + +#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE + 0x100000 + +#define CONFIG_SYS_INIT_SP_OFFSET 0x400000 + +#ifdef CONFIG_BOOT_RAM +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif + +/* UART */ +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \ + 115200, 230400, 460800, 921600 } +#define CONFIG_BAUDRATE 115200 + +/* RAM */ +#define CONFIG_SYS_MEMTEST_START 0x80100000 +#define CONFIG_SYS_MEMTEST_END 0x80400000 + +/* Memory usage */ +#define CONFIG_SYS_MAXARGS 64 +#define CONFIG_SYS_MALLOC_LEN (1024 * 1024) +#define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) +#define CONFIG_SYS_CBSIZE 512 + +/* U-Boot */ +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE + +/* Environment settings */ +#if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT) +#define CONFIG_EXTRA_ENV_SETTINGS \ + "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ + "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" +#endif +/* + * Environment is right behind U-Boot in flash. Make sure U-Boot + * doesn't grow into the environment area. + */ +//MCon: serve? #define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET + +#define CONFIG_ENV_IS_IN_SPI_FLASH 1 +//#define CONFIG_ENV_OFFSET 0x0FFF000 +//#define CONFIG_ENV_SIZE 0x0001000 + +#endif//__VOCORE2_CONFIG_H__