Add support for SoM "VoCore2".
Subsystems (2)
PATCH v5 1/1 Add support for SoM "VoCore2".
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.
Details about this SoM can be found at "https://vocore.io/v2.html".
---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization in board.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testing
Changes in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcount
Changes in v3:
- based on top of Weijie Gao patchset:
"[v3,xx/20]Refactor the architecture parts of mt7628"
Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)
arch/mips/dts/Makefile | 1 + arch/mips/dts/mt7628a.dtsi | 5 ++ arch/mips/dts/vocore_vocore2.dts | 78 ++++++++++++++++++++ arch/mips/mach-mtmips/Kconfig | 8 +++ board/vocore/vocore2/Kconfig | 12 ++++ board/vocore/vocore2/Makefile | 3 + board/vocore/vocore2/board.c | 6 ++ configs/vocore2_defconfig | 103 ++++++++++++++++++++++++++ configs/vocore2_defconfig_ENV_IN_FAT | 104 +++++++++++++++++++++++++++ include/configs/vocore2.h | 61 ++++++++++++++++ 10 files changed, 381 insertions(+) create mode 100644 arch/mips/dts/vocore_vocore2.dts create mode 100644 board/vocore/vocore2/Kconfig create mode 100644 board/vocore/vocore2/Makefile create mode 100644 board/vocore/vocore2/board.c create mode 100644 configs/vocore2_defconfig create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT create mode 100644 include/configs/vocore2.h
arch/mips/dts/Makefile +1 -0
@@ -23,6 +23,7 @@ dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f at st1704.dtb dtb-$(CONFIG_BOARD_SFR_NB4_SER) += sfr,nb4-ser.dtb dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb +dtb-$(CONFIG_BOARD_VOCORE2) += vocore_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
arch/mips/dts/mt7628a.dtsi +5 -0
@@ -402,6 +402,11 @@ builtin-cd = <1>; r_smpl = <1>; + bus-width = <4>; + max-frequency = <48000000>; + cap-sd-highspeed; + cap-mmc-highspeed; + clocks = <&clk48m>, <&clkctrl CLK_SDXC>; clock-names = "source", "hclk";
arch/mips/dts/vocore_vocore2.dts new file +78 -0
78 lines not on this page · raw message
arch/mips/mach-mtmips/Kconfig +8 -0
@@ -83,6 +83,13 @@ config BOARD_MT7628_RFB SPI-NOR flash, 1 built-in switch with 5 ports, 1 UART, 1 USB host, 1 SDXC, 1 PCIe socket and JTAG pins. +config BOARD_VOCORE2 + bool "VoCore2" + depends on SOC_MT7628 + help + VoCore VoCore2 board has a MT7628 SoC with 128 MiB of RAM + and 16 MiB of flash (SPI). + endchoice config SPL_UART2_SPIS_PINMUX
@@ -96,5 +103,6 @@ config SPL_UART2_SPIS_PINMUX source "board/gardena/smart-gateway-mt7688/Kconfig" source "board/mediatek/mt7628/Kconfig" source "board/seeed/linkit-smart-7688/Kconfig" +source "board/vocore/vocore2/Kconfig" endmenu
board/vocore/vocore2/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if BOARD_VOCORE2 + +config SYS_BOARD + default "vocore2" + +config SYS_VENDOR + default "vocore" + +config SYS_CONFIG_NAME + default "vocore2" + +endif
board/vocore/vocore2/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += board.o
board/vocore/vocore2/board.c new file +6 -0
@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +* +* Nothing actually needed here +*/
configs/vocore2_defconfig new file +103 -0
103 lines not on this page · raw message
configs/vocore2_defconfig_ENV_IN_FAT new file +104 -0
104 lines not on this page · raw message
include/configs/vocore2.h new file +61 -0
61 lines not on this page · raw message
Signature · 1 line
2.25.0
PATCH v5 1/1 Add support for SoM "VoCore2".
Quoted 226 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Details about this SoM can be found at "https://vocore.io/v2.html".
Signed-off-by Mauro Condarelli <[email protected]>---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization inboard.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testingChanges in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcountChanges in v3:
- based on top of Weijie Gao patchset:
"[v3,xx/20]Refactor the architecture parts of mt7628"Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)arch/mips/dts/Makefile | 1 + arch/mips/dts/mt7628a.dtsi | 5 ++ arch/mips/dts/vocore_vocore2.dts | 78 ++++++++++++++++++++ arch/mips/mach-mtmips/Kconfig | 8 +++ board/vocore/vocore2/Kconfig | 12 ++++ board/vocore/vocore2/Makefile | 3 + board/vocore/vocore2/board.c | 6 ++ configs/vocore2_defconfig | 103 ++++++++++++++++++++++++++ configs/vocore2_defconfig_ENV_IN_FAT | 104 +++++++++++++++++++++++++++ include/configs/vocore2.h | 61 ++++++++++++++++ 10 files changed, 381 insertions(+) create mode 100644 arch/mips/dts/vocore_vocore2.dts create mode 100644 board/vocore/vocore2/Kconfig create mode 100644 board/vocore/vocore2/Makefile create mode 100644 board/vocore/vocore2/board.c create mode 100644 configs/vocore2_defconfig create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT create mode 100644 include/configs/vocore2.harch/mips/dts/Makefile +1
-0@@ -23,6 +23,7 @@ dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f at st1704.dtb dtb-$(CONFIG_BOARD_SFR_NB4_SER) += sfr,nb4-ser.dtb dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb +dtb-$(CONFIG_BOARD_VOCORE2) += vocore_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.dtbarch/mips/dts/mt7628a.dtsi +5
-0@@ -402,6 +402,11 @@ builtin-cd = <1>; r_smpl = <1>; + bus-width = <4>; + max-frequency = <48000000>; + cap-sd-highspeed; + cap-mmc-highspeed; + clocks = <&clk48m>, <&clkctrl CLK_SDXC>; clock-names = "source", "hclk";arch/mips/dts/vocore_vocore2.dts new file +78
-0@@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Mauro Condarelli <[email protected]> + */ + +/dts-v1/; + +#include "mt7628a.dtsi" +#include <dt-bindings/gpio/gpio.h> + +/ { + compatible = "vocore,vocore2", "ralink,mt7628a-soc"; + model = "VoCore2"; + + aliases { + serial0 = &uart2; + spi0 = &spi0; + }; + + memory at 0 { + device_type = "memory"; + reg = <0x0 0x08000000>; + }; + leds { + compatible = "gpio-leds"; + + power { + label = "vocore:power"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + 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: spi-flash at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <25000000>; + reg = <0>; + }; +}; + +ð { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&ephy_iot_mode>; + mediatek,poll-link-phy = <0>; +}; + +&mmc { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&sd_iot_mode>; + pinctrl-1 = <&sd_iot_mode>; +};arch/mips/mach-mtmips/Kconfig +8
-0@@ -83,6 +83,13 @@ config BOARD_MT7628_RFB SPI-NOR flash, 1 built-in switch with 5 ports, 1 UART, 1 USB host, 1 SDXC, 1 PCIe socket and JTAG pins. +config BOARD_VOCORE2 + bool "VoCore2" + depends on SOC_MT7628 + help + VoCore VoCore2 board has a MT7628 SoC with 128 MiB of RAM + and 16 MiB of flash (SPI). + endchoice config SPL_UART2_SPIS_PINMUX@@ -96,5 +103,6 @@ config SPL_UART2_SPIS_PINMUX source "board/gardena/smart-gateway-mt7688/Kconfig" source "board/mediatek/mt7628/Kconfig" source "board/seeed/linkit-smart-7688/Kconfig" +source "board/vocore/vocore2/Kconfig" endmenuboard/vocore/vocore2/Kconfig new file +12
-0@@ -0,0 +1,12 @@ +if BOARD_VOCORE2 + +config SYS_BOARD + default "vocore2" + +config SYS_VENDOR + default "vocore" + +config SYS_CONFIG_NAME + default "vocore2" + +endifboard/vocore/vocore2/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += board.oboard/vocore/vocore2/board.c new file +0
-0
board/vocore/vocore2/board.c line 6
Quoted 6 lines
board/vocore/vocore2/board.c new file +6
-0@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +* +* Nothing actually needed here +*/
if that file is empty, don't add it at all
configs/vocore2_defconfig_ENV_IN_FAT
Quoted 114 lines
configs/vocore2_defconfig new file +103
-0@@ -0,0 +1,103 @@ +CONFIG_MIPS=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_ENV_SIZE=0x1000 +CONFIG_ENV_SECT_SIZE=0x1000 +CONFIG_ENV_OFFSET=0x04e000 +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SYS_BOOTCOUNT_ADDR=0xb000006c +CONFIG_SPL_SYS_MALLOC_F_LEN=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_SPL_UART2_SPIS_PINMUX=y +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=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_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_LOGLEVEL=8 +CONFIG_VERSION_VARIABLE=y +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_NOR_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_LICENSE=y +# 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_ELF is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_CRC32 is not set +CONFIG_CMD_MEMINFO=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_GPT_RENAME=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_TIME=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:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)" +CONFIG_DEFAULT_DEVICE_TREE="vocore_vocore2" +CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_MTK=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_MT7628_ETH=y +CONFIG_PHY=y +CONFIG_MT76X8_USB_PHY=y +# 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_WDT=y +CONFIG_WDT_MT7621=y +CONFIG_FS_EXT4=y +CONFIG_FAT_WRITE=y +CONFIG_LZMA=y +CONFIG_LZO=yconfigs/vocore2_defconfig_ENV_IN_FAT new file +0
-0
this config is project specific and should not be added. For mainline we only need one working
reference config which users can customize to their needs.
Quoted 111 lines
configs/vocore2_defconfig_ENV_IN_FAT new file +104
-0@@ -0,0 +1,104 @@ +CONFIG_MIPS=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_ENV_SIZE=0x1000 +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_SYS_MALLOC_F_LEN=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_SYS_BOOTCOUNT_ADDR=0xb000006c +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_SPL_UART2_SPIS_PINMUX=y +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=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_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_USE_BOOTARGS=y +CONFIG_LOGLEVEL=8 +CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_VERSION_VARIABLE=y +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_NOR_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_LICENSE=y +# 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_ELF is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_CRC32 is not set +CONFIG_CMD_MEMINFO=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_GPT_RENAME=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_TIME=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:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)" +CONFIG_DEFAULT_DEVICE_TREE="vocore_vocore2" +CONFIG_ENV_IS_IN_FAT=y +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_MTK=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_MT7628_ETH=y +CONFIG_PHY=y +CONFIG_MT76X8_USB_PHY=y +# 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_WDT=y +CONFIG_WDT_MT7621=y +CONFIG_FS_EXT4=y +CONFIG_LZMA=y +CONFIG_LZO=yinclude/configs/vocore2.h new file +0
-0
include/configs/vocore2.h line 10
Quoted 10 lines
include/configs/vocore2.h new file +10
-0@@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +*/ + +#ifndef __VOCORE2_CONFIG_H__ +#define __VOCORE2_CONFIG_H__ + +/* CPU */ +#define CONFIG_SYS_MIPS_TIMER_FREQ 290000000
is this still necessary? Weijie implemented a custom CPU clock handling which supports
dynamic timer clocks.
include/configs/vocore2.h line 22
Quoted 12 lines
include/configs/vocore2.h new file +12
-0+ +/* RAM */ +#define CONFIG_SYS_SDRAM_BASE 0x80000000 + +#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE + 0x100000 + +#define CONFIG_SYS_INIT_SP_OFFSET 0x400000 + +/* SPL */ +#if defined(CONFIG_SPL ) && !defined(CONFIG_SPL_BUILD ) +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif
CONFIG_SPL_BUILD is only relevant in Makefiles and shouldn't be used in config header files
include/configs/vocore2.h line 30
Quoted 8 lines
include/configs/vocore2.h new file +8
-0+ +#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SPL_BSS_START_ADDR 0x80010000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x10000 +#define CONFIG_SPL_MAX_SIZE 0x10000 + +/* Dummy value */ +#define CONFIG_SYS_UBOOT_BASE 0
where is that needed?
include/configs/vocore2.h line 40
Quoted 10 lines
include/configs/vocore2.h new file +10
-0+ +/* Serial SPL */ +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_SERIAL_SUPPORT ) +#define CONFIG_SYS_NS16550_MEM32 +#define CONFIG_SYS_NS16550_CLK 40000000 +#define CONFIG_SYS_NS16550_REG_SIZE -4 +#define CONFIG_SYS_NS16550_COM3 0xb0000e00 +#define CONFIG_CONS_INDEX 3 + +#endif
CONFIG_SPL_SERIAL_SUPPORT as guard is enough if a guard is needed at all
include/configs/vocore2.h line 44
Quoted 4 lines
include/configs/vocore2.h new file +4
-0+ +/* UART */ +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, \ + 230400, 460800, 921600 }
you don't need that anymore
Quoted 20 lines
include/configs/vocore2.h new file +17
-1+ +/* 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 */ + +#endif //__VOCORE2_CONFIG_H__ --2.25.0
Signature · 1 line
- Daniel
PATCH v5 1/1 Add support for SoM "VoCore2".
Thanks Daniel,
Quoted 225 lines · Daniel Schwierzeck
Quoted 224 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Details about this SoM can be found at "https://vocore.io/v2.html".
Signed-off-by Mauro Condarelli <[email protected]>---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization inboard.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testingChanges in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcountChanges in v3:
- based on top of Weijie Gao patchset:
"[v3,xx/20]Refactor the architecture parts of mt7628"Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)arch/mips/dts/Makefile | 1 + arch/mips/dts/mt7628a.dtsi | 5 ++ arch/mips/dts/vocore_vocore2.dts | 78 ++++++++++++++++++++ arch/mips/mach-mtmips/Kconfig | 8 +++ board/vocore/vocore2/Kconfig | 12 ++++ board/vocore/vocore2/Makefile | 3 + board/vocore/vocore2/board.c | 6 ++ configs/vocore2_defconfig | 103 ++++++++++++++++++++++++++ configs/vocore2_defconfig_ENV_IN_FAT | 104 +++++++++++++++++++++++++++ include/configs/vocore2.h | 61 ++++++++++++++++ 10 files changed, 381 insertions(+) create mode 100644 arch/mips/dts/vocore_vocore2.dts create mode 100644 board/vocore/vocore2/Kconfig create mode 100644 board/vocore/vocore2/Makefile create mode 100644 board/vocore/vocore2/board.c create mode 100644 configs/vocore2_defconfig create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT create mode 100644 include/configs/vocore2.harch/mips/dts/Makefile +1
-0@@ -23,6 +23,7 @@ dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f at st1704.dtb dtb-$(CONFIG_BOARD_SFR_NB4_SER) += sfr,nb4-ser.dtb dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb +dtb-$(CONFIG_BOARD_VOCORE2) += vocore_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.dtbarch/mips/dts/mt7628a.dtsi +5
-0@@ -402,6 +402,11 @@ builtin-cd = <1>; r_smpl = <1>; + bus-width = <4>; + max-frequency = <48000000>; + cap-sd-highspeed; + cap-mmc-highspeed; + clocks = <&clk48m>, <&clkctrl CLK_SDXC>; clock-names = "source", "hclk";arch/mips/dts/vocore_vocore2.dts new file +78
-0@@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Mauro Condarelli <[email protected]> + */ + +/dts-v1/; + +#include "mt7628a.dtsi" +#include <dt-bindings/gpio/gpio.h> + +/ { + compatible = "vocore,vocore2", "ralink,mt7628a-soc"; + model = "VoCore2"; + + aliases { + serial0 = &uart2; + spi0 = &spi0; + }; + + memory at 0 { + device_type = "memory"; + reg = <0x0 0x08000000>; + }; + leds { + compatible = "gpio-leds"; + + power { + label = "vocore:power"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + 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: spi-flash at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <25000000>; + reg = <0>; + }; +}; + +ð { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&ephy_iot_mode>; + mediatek,poll-link-phy = <0>; +}; + +&mmc { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&sd_iot_mode>; + pinctrl-1 = <&sd_iot_mode>; +};arch/mips/mach-mtmips/Kconfig +8
-0@@ -83,6 +83,13 @@ config BOARD_MT7628_RFB SPI-NOR flash, 1 built-in switch with 5 ports, 1 UART, 1 USB host, 1 SDXC, 1 PCIe socket and JTAG pins. +config BOARD_VOCORE2 + bool "VoCore2" + depends on SOC_MT7628 + help + VoCore VoCore2 board has a MT7628 SoC with 128 MiB of RAM + and 16 MiB of flash (SPI). + endchoice config SPL_UART2_SPIS_PINMUX@@ -96,5 +103,6 @@ config SPL_UART2_SPIS_PINMUX source "board/gardena/smart-gateway-mt7688/Kconfig" source "board/mediatek/mt7628/Kconfig" source "board/seeed/linkit-smart-7688/Kconfig" +source "board/vocore/vocore2/Kconfig" endmenuboard/vocore/vocore2/Kconfig new file +12
-0@@ -0,0 +1,12 @@ +if BOARD_VOCORE2 + +config SYS_BOARD + default "vocore2" + +config SYS_VENDOR + default "vocore" + +config SYS_CONFIG_NAME + default "vocore2" + +endifboard/vocore/vocore2/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += board.oboard/vocore/vocore2/board.c new file +0
-0
Quoted 8 lines
board/vocore/vocore2/board.c line 6
Quoted 7 lines
board/vocore/vocore2/board.c new file +6
-0@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +* +* Nothing actually needed here +*/ if that file is empty, don't add it at all
Ahem...
I tried to remove it, but if I do I also have to remove entry in board/vocore/vocore2/Makefile (leaving it empty) and this leads (on a clean compile) to error:
? mipsel-linux-ld.bfd: cannot find board/vocore/vocore2/built-in.o: No such file or directory
Completely removing both files bombs with:
? scripts/Makefile.build:57: board/vocore/vocore2/Makefile: No such file or directory
It seems I should also remove board/vocore/vocore2/Kconfig, but I'm unsure this is the right thing to do.
I have no idea about how to solve this, sorry.
Can You point me in the right direction, please?
Quoted 109 lines
Quoted 109 lines
configs/vocore2_defconfig new file +103
-0@@ -0,0 +1,103 @@ +CONFIG_MIPS=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_ENV_SIZE=0x1000 +CONFIG_ENV_SECT_SIZE=0x1000 +CONFIG_ENV_OFFSET=0x04e000 +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SYS_BOOTCOUNT_ADDR=0xb000006c +CONFIG_SPL_SYS_MALLOC_F_LEN=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_SPL_UART2_SPIS_PINMUX=y +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=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_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_LOGLEVEL=8 +CONFIG_VERSION_VARIABLE=y +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_NOR_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_LICENSE=y +# 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_ELF is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_CRC32 is not set +CONFIG_CMD_MEMINFO=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_GPT_RENAME=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_TIME=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:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)" +CONFIG_DEFAULT_DEVICE_TREE="vocore_vocore2" +CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_MTK=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_MT7628_ETH=y +CONFIG_PHY=y +CONFIG_MT76X8_USB_PHY=y +# 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_WDT=y +CONFIG_WDT_MT7621=y +CONFIG_FS_EXT4=y +CONFIG_FAT_WRITE=y +CONFIG_LZMA=y +CONFIG_LZO=y
Quoted 8 lines
configs/vocore2_defconfig_ENV_IN_FAT
Quoted 5 lines
configs/vocore2_defconfig_ENV_IN_FAT new file +0
-0this config is project specific and should not be added. For mainline we only need one working
reference config which users can customize to their needs.
This is a leftover, sorry.
Removed.
Quoted 116 lines
Quoted 116 lines
configs/vocore2_defconfig_ENV_IN_FAT new file +104
-0@@ -0,0 +1,104 @@ +CONFIG_MIPS=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_ENV_SIZE=0x1000 +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_SYS_MALLOC_F_LEN=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_SYS_BOOTCOUNT_ADDR=0xb000006c +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_SPL_UART2_SPIS_PINMUX=y +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=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_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_USE_BOOTARGS=y +CONFIG_LOGLEVEL=8 +CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_VERSION_VARIABLE=y +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_NOR_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_LICENSE=y +# 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_ELF is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_CRC32 is not set +CONFIG_CMD_MEMINFO=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_GPT_RENAME=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_TIME=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:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)" +CONFIG_DEFAULT_DEVICE_TREE="vocore_vocore2" +CONFIG_ENV_IS_IN_FAT=y +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_MTK=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_MT7628_ETH=y +CONFIG_PHY=y +CONFIG_MT76X8_USB_PHY=y +# 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_WDT=y +CONFIG_WDT_MT7621=y +CONFIG_FS_EXT4=y +CONFIG_LZMA=y +CONFIG_LZO=yinclude/configs/vocore2.h new file +5
-0@@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +*/ +
Quoted 8 lines
include/configs/vocore2.h line 10
Quoted 5 lines
include/configs/vocore2.h new file +5
-0+#ifndef __VOCORE2_CONFIG_H__ +#define __VOCORE2_CONFIG_H__ + +/* CPU */ +#define CONFIG_SYS_MIPS_TIMER_FREQ 290000000is this still necessary? Weijie implemented a custom CPU clock handling which supports
dynamic timer clocks.
This is referenced in arch/mips/cpu/time.c
I don't know if it's still relevant, but removing it doesn't seem task for this patch.
Quoted 6 lines
Quoted 6 lines
include/configs/vocore2.h new file +6
-0+ +/* RAM */ +#define CONFIG_SYS_SDRAM_BASE 0x80000000 + +#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE + 0x100000 +
Quoted 8 lines
include/configs/vocore2.h line 22
Quoted 6 lines
include/configs/vocore2.h new file +6
-0+#define CONFIG_SYS_INIT_SP_OFFSET 0x400000 + +/* SPL */ +#if defined(CONFIG_SPL ) && !defined(CONFIG_SPL_BUILD ) +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif
CONFIG_SPL_BUILDis only relevant in Makefiles and shouldn't be used in config header files
Removed, apparently without adverse consequences.
Quoted 9 lines
include/configs/vocore2.h line 30
Quoted 8 lines
include/configs/vocore2.h new file +8
-0+ +#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SPL_BSS_START_ADDR 0x80010000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x10000 +#define CONFIG_SPL_MAX_SIZE 0x10000 + +/* Dummy value */ +#define CONFIG_SYS_UBOOT_BASE 0where is that needed?
This is referenced in common/spl/spl_nor.c
I don't know if it's still relevant, but removing it doesn't seem task for this patch.
Quoted 11 lines
include/configs/vocore2.h line 40
Quoted 10 lines
include/configs/vocore2.h new file +10
-0+ +/* Serial SPL */ +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_SERIAL_SUPPORT ) +#define CONFIG_SYS_NS16550_MEM32 +#define CONFIG_SYS_NS16550_CLK 40000000 +#define CONFIG_SYS_NS16550_REG_SIZE -4 +#define CONFIG_SYS_NS16550_COM3 0xb0000e00 +#define CONFIG_CONS_INDEX 3 + +#endif
CONFIG_SPL_SERIAL_SUPPORTas guard is enough if a guard is needed at all
No guard seems to be needed, at least for me (tested with and without CONFIG_SPL_SERIAL_SUPPORT).
Quoted 5 lines
include/configs/vocore2.h line 44
Quoted 4 lines
include/configs/vocore2.h new file +4
-0+ +/* UART */ +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, \ + 230400, 460800, 921600 }you don't need that anymore
Removed.
Quoted 13 lines
Quoted 13 lines
include/configs/vocore2.h new file +13
-0+ +/* 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
Quoted 8 lines
Quoted 8 lines
include/configs/vocore2.h new file +4
-1+ +/* Environment settings */ + +#endif //__VOCORE2_CONFIG_H__ --2.25.0
I'll wait for input before submitting another iteration.
Thanks a lot
Mauro
PATCH v5 1/1 Add support for SoM "VoCore2".
Hi Daniel,
Quoted 8 lines · Mauro Condarelli
Quoted 7 lines
include/configs/vocore2.h line 22
Quoted 5 lines
include/configs/vocore2.h new file +5
-0+ +/* SPL */ +#if defined(CONFIG_SPL ) && !defined(CONFIG_SPL_BUILD ) +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif
CONFIG_SPL_BUILDis only relevant in Makefiles and shouldn't be used in config header filesRemoved, apparently without adverse consequences.
Appearence was misguiding.
Any change to this guard leads to code unable to boot from SPI NOR. I'll have to leave it is as-is.
Someone more knowledgeable than me will have to understand why they are needed and how to remove them, if that's a requirement. After all the other boards with this SoC use the same code.
Regards
Mauro
PATCH v5 1/1 Add support for SoM "VoCore2".
In reply to Mauro CondarelliHi Daniel,
a gentle reminder...
I was unable to comply with a few of Your remarks (see below), What should I do?
Submit v6 as is or do You have specific instructions?
Thanks a lot
Mauro
Quoted 81 lines · Mauro Condarelli
Thanks Daniel,
Quoted 8 lines · Daniel Schwierzeck
Quoted 7 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Quoted 14 lines
board/vocore/vocore2/board.c line 6
Quoted 13 lines
===8<---
board/vocore/vocore2/board.c new file +6
-0@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +* +* Nothing actually needed here +*/ if that file is empty, don't add it at all
Ahem...
I tried to remove it, but if I do I also have to remove entry in board/vocore/vocore2/Makefile (leaving it empty) and this leads (on a clean compile) to error:
? mipsel-linux-ld.bfd: cannot findboard/vocore/vocore2/built-in.o: No such file or directory
Completely removing both files bombs with:
?scripts/Makefile.build:57: board/vocore/vocore2/Makefile: No such file or directory
It seems I should also remove board/vocore/vocore2/Kconfig, but I'm unsure this is the right thing to do.I have no idea about how to solve this, sorry.
Can You point me in the right direction, please?Quoted 12 lines
Quoted 12 lines
===8<---
include/configs/vocore2.h new file +5
-0@@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +*/ +Quoted 8 lines
include/configs/vocore2.h line 10
Quoted 5 lines
include/configs/vocore2.h new file +5
-0+#ifndef __VOCORE2_CONFIG_H__ +#define __VOCORE2_CONFIG_H__ + +/* CPU */ +#define CONFIG_SYS_MIPS_TIMER_FREQ 290000000is this still necessary? Weijie implemented a custom CPU clock handling which supports
dynamic timer clocks.This is referenced in
arch/mips/cpu/time.c
I don't know if it's still relevant, but removing it doesn't seem task for this patch.Quoted 6 lines
Quoted 6 lines
include/configs/vocore2.h new file +6
-0+ +/* RAM */ +#define CONFIG_SYS_SDRAM_BASE 0x80000000 + +#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE + 0x100000 +Quoted 8 lines
include/configs/vocore2.h line 22
Quoted 6 lines
include/configs/vocore2.h new file +6
-0+#define CONFIG_SYS_INIT_SP_OFFSET 0x400000 + +/* SPL */ +#if defined(CONFIG_SPL ) && !defined(CONFIG_SPL_BUILD ) +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif
CONFIG_SPL_BUILDis only relevant in Makefiles and shouldn't be used in config header files
Quoted 1 line
Removed, apparently without adverse consequences.
Appearence was misguiding.
Any change to this guard leads to code unable to boot from SPI NOR. I'll have to leave it is as-is.
Someone more knowledgeable than me will have to understand why they are needed and how to remove them, if that's a requirement. After all the other boards with this SoC use the same code.
Quoted 19 lines
Quoted 9 lines
include/configs/vocore2.h line 30
Quoted 8 lines
include/configs/vocore2.h new file +8
-0+ +#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SPL_BSS_START_ADDR 0x80010000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x10000 +#define CONFIG_SPL_MAX_SIZE 0x10000 + +/* Dummy value */ +#define CONFIG_SYS_UBOOT_BASE 0where is that needed?
This is referenced in
common/spl/spl_nor.c
I don't know if it's still relevant, but removing it doesn't seem task for this patch.Quoted 2 lines
Quoted 2 lines
==8<---
I'll wait for input before submitting another iteration.
Thanks a lot
Mauro
PATCH v5 1/1 Add support for SoM "VoCore2".
Quoted 76 lines · Mauro Condarelli
Hi Daniel,
a gentle reminder...I was unable to comply with a few of Your remarks (see below), What should I do?
Submit v6 as is or do You have specific instructions?Thanks a lot
MauroQuoted 65 lines · Mauro Condarelli
Thanks Daniel,
Quoted 8 lines · Daniel Schwierzeck
Quoted 7 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Quoted 14 lines
board/vocore/vocore2/board.c line 6
Quoted 13 lines
===8<---
board/vocore/vocore2/board.c new file +6
-0@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +* +* Nothing actually needed here +*/ if that file is empty, don't add it at all
Ahem...
I tried to remove it, but if I do I also have to remove entry in board/vocore/vocore2/Makefile (leaving it empty) and this leads (on a clean compile) to error:
mipsel-linux-ld.bfd: cannot findboard/vocore/vocore2/built-in.o: No
such file or directory
Completely removing both files bombs with:
scripts/Makefile.build:57: board/vocore/vocore2/Makefile: No such file
or directory
It seems I should also remove board/vocore/vocore2/Kconfig, but I'm unsure this is the right thing to do.I have no idea about how to solve this, sorry.
Can You point me in the right direction, please?Quoted 12 lines
Quoted 12 lines
===8<---
include/configs/vocore2.h new file +5
-0@@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +*/ +Quoted 8 lines
include/configs/vocore2.h line 10
Quoted 5 lines
include/configs/vocore2.h new file +5
-0+#ifndef __VOCORE2_CONFIG_H__ +#define __VOCORE2_CONFIG_H__ + +/* CPU */ +#define CONFIG_SYS_MIPS_TIMER_FREQ 290000000is this still necessary? Weijie implemented a custom CPU clock handling which supports
dynamic timer clocks.This is referenced in
arch/mips/cpu/time.c
I don't know if it's still relevant, but removing it doesn't seem task for this patch.
You have to keep this to make sure arch/mips/cpu/time.c can be compiled.
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
include/configs/vocore2.h new file +2
-0+ +/* RAM */ include/configs/vocore2.h line 22
Quoted 10 lines
include/configs/vocore2.h new file +10
-0+#define CONFIG_SYS_SDRAM_BASE 0x80000000 + +#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE + 0x100000 + +#define CONFIG_SYS_INIT_SP_OFFSET 0x400000 + +/* SPL */ +#if defined(CONFIG_SPL ) && !defined(CONFIG_SPL_BUILD ) +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif
CONFIG_SPL_BUILDis only relevant in Makefiles and shouldn't be used in config header files
Quoted 7 lines
Quoted 1 line
Removed, apparently without adverse consequences.
Appearence was misguiding.
Any change to this guard leads to code unable to boot from SPI NOR. I'll have to leave it is as-is.
Someone more knowledgeable than me will have to understand why they are needed and how to remove them, if that's a requirement. After all the other boards with this SoC use the same code.
CONFIG_SPL_BUILD is defined only when building the SPL binary. CONFIG_SPL is defined for both SPL and u-boot if SPL is enabled, and we can only use CONFIG_SPL_BUILD to distinguish whether we are building SPL or not.CONFIG_SKIP_LOWLEVEL_INIT apparently means do not do lowlevel_init. However lowlevel_init must be done once and only once for a SPI NOR bootable version.
The following table describes whether lowlevel_init is needed:
| SPL | u-boot
------------------------------
SPL enabled | Y | N
------------------------------
SPL disabled | | Y
As you can see we only want to define CONFIG_SKIP_LOWLEVEL_INIT for just one case: SPL enabled and not building SPL, because lowlevel_init is done in SPL and u-boot is a ram boot binary.
As a result this table produces the condition I used for other boards:
#if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD)
If we use only "defined(CONFIG_SPL)", CONFIG_SKIP_LOWLEVEL_INIT will be defined for both parts, and this will finally lead to code unable to boot from SPI NOR.
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
include/configs/vocore2.h line 30
Quoted 10 lines
include/configs/vocore2.h new file +8
-0+ +#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SPL_BSS_START_ADDR 0x80010000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x10000 +#define CONFIG_SPL_MAX_SIZE 0x10000 + +/* Dummy value */ +#define CONFIG_SYS_UBOOT_BASE 0where is that needed?
Quoted 3 lines
Quoted 3 lines
This is referenced in
common/spl/spl_nor.c
I don't know if it's still relevant, but removing it doesn't seem task for this patch.
Same as CONFIG_SYS_MIPS_TIMER_FREQ.
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
==8<---
I'll wait for input before submitting another iteration.
Thanks a lot
Mauro
PATCH v5 1/1 Add support for SoM "VoCore2".
In reply to Mauro CondarelliHi Mauro,
Quoted 11 lines · Mauro Condarelli
Hi Daniel,
a gentle reminder...I was unable to comply with a few of Your remarks (see below), What should I do?
Submit v6 as is or do You have specific instructions?Thanks a lot
Mauro
sorry for the late response. Please only remove
configs/vocore2_defconfig_ENV_IN_FAT andCONFIG_BAUDRATE and ignore my other comments.
Signature · 1 line
- Daniel
PATCH v5 1/1 Add support for SoM "VoCore2".
In reply to Mauro CondarelliQuoted 72 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Details about this SoM can be found at "https://vocore.io/v2.html".
Signed-off-by Mauro Condarelli <[email protected]>---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization inboard.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testingChanges in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcountChanges in v3:
- based on top of Weijie Gao patchset:
"[v3,xx/20]Refactor the architecture parts of mt7628"Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)arch/mips/dts/Makefile | 1 + arch/mips/dts/mt7628a.dtsi | 5 ++ arch/mips/dts/vocore_vocore2.dts | 78 ++++++++++++++++++++ arch/mips/mach-mtmips/Kconfig | 8 +++ board/vocore/vocore2/Kconfig | 12 ++++ board/vocore/vocore2/Makefile | 3 + board/vocore/vocore2/board.c | 6 ++ configs/vocore2_defconfig | 103 ++++++++++++++++++++++++++ configs/vocore2_defconfig_ENV_IN_FAT | 104 +++++++++++++++++++++++++++ include/configs/vocore2.h | 61 ++++++++++++++++ 10 files changed, 381 insertions(+) create mode 100644 arch/mips/dts/vocore_vocore2.dts create mode 100644 board/vocore/vocore2/Kconfig create mode 100644 board/vocore/vocore2/Makefile create mode 100644 board/vocore/vocore2/board.c create mode 100644 configs/vocore2_defconfig create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT create mode 100644 include/configs/vocore2.harch/mips/dts/Makefile +1
-0@@ -23,6 +23,7 @@ dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f at st1704.dtb dtb-$(CONFIG_BOARD_SFR_NB4_SER) += sfr,nb4-ser.dtb dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb +dtb-$(CONFIG_BOARD_VOCORE2) += vocore_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.dtbarch/mips/dts/mt7628a.dtsi +0
-0
arch/mips/dts/mt7628a.dtsi line 409
Quoted 8 lines
arch/mips/dts/mt7628a.dtsi +5
-0@@ -402,6 +402,11 @@ builtin-cd = <1>; r_smpl = <1>; + bus-width = <4>; + max-frequency = <48000000>; + cap-sd-highspeed; + cap-mmc-highspeed; +
could you please move these lines to vocore_vocore2.dts? these are board specific properties.
Quoted 49 lines
arch/mips/dts/mt7628a.dtsi +0
-0clocks = <&clk48m>, <&clkctrl CLK_SDXC>; clock-names = "source", "hclk";arch/mips/dts/vocore_vocore2.dts new file +40
-0@@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Mauro Condarelli <[email protected]> + */ + +/dts-v1/; + +#include "mt7628a.dtsi" +#include <dt-bindings/gpio/gpio.h> + +/ { + compatible = "vocore,vocore2", "ralink,mt7628a-soc"; + model = "VoCore2"; + + aliases { + serial0 = &uart2; + spi0 = &spi0; + }; + + memory at 0 { + device_type = "memory"; + reg = <0x0 0x08000000>; + }; + leds { + compatible = "gpio-leds"; + + power { + label = "vocore:power"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + chosen { + bootargs = "console=ttyS2,115200"; + stdout-path = &uart2; + }; +}; + +&pinctrl {
arch/mips/dts/vocore_vocore2.dts line 50
Quoted 10 lines
arch/mips/dts/vocore_vocore2.dts new file +10
-0+ state_default: pin_state { + p0led { + groups = "p0led_a"; + function = "led"; + }; + }; +}; + +&uart2 { + status = "okay";
have you tried adding these two lines?
pinctrl-names = "default"; pinctrl-0 = <&uart2_pwm_pins>;
Quoted 17 lines
arch/mips/dts/vocore_vocore2.dts new file +17
-0+}; + +&spi0 { + status = "okay"; + nor0: spi-flash at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <25000000>; + reg = <0>; + }; +}; + +ð { + status = "okay"; + + pinctrl-names = "default";
arch/mips/dts/vocore_vocore2.dts line 77
Quoted 10 lines
arch/mips/dts/vocore_vocore2.dts new file +10
-0+ pinctrl-0 = <&ephy_iot_mode>; + mediatek,poll-link-phy = <0>; +}; + +&mmc { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&sd_iot_mode>; + pinctrl-1 = <&sd_iot_mode>;
pinctrl-1 should be removed. the driver never uses it.
Quoted 6 lines
arch/mips/dts/vocore_vocore2.dts new file +1
-0+};arch/mips/mach-mtmips/Kconfig +0
-0
arch/mips/mach-mtmips/Kconfig config BOARD_MT7628_RFB · line 92
Quoted 10 lines
arch/mips/mach-mtmips/Kconfig +7
-0@@ -83,6 +83,13 @@ config BOARD_MT7628_RFB SPI-NOR flash, 1 built-in switch with 5 ports, 1 UART, 1 USB host, 1 SDXC, 1 PCIe socket and JTAG pins. +config BOARD_VOCORE2 + bool "VoCore2" + depends on SOC_MT7628 + help + VoCore VoCore2 board has a MT7628 SoC with 128 MiB of RAM + and 16 MiB of flash (SPI). +
if CONFIG_SPL_UART2_SPIS_PINMUX is the only uart pinmux used by the board, you can add "select CONFIG_SPL_UART2_SPIS_PINMUX" here.
Quoted 335 lines
arch/mips/mach-mtmips/Kconfig +1
-0endchoice config SPL_UART2_SPIS_PINMUX@@ -96,5 +103,6 @@ config SPL_UART2_SPIS_PINMUX source "board/gardena/smart-gateway-mt7688/Kconfig" source "board/mediatek/mt7628/Kconfig" source "board/seeed/linkit-smart-7688/Kconfig" +source "board/vocore/vocore2/Kconfig" endmenuboard/vocore/vocore2/Kconfig new file +12
-0@@ -0,0 +1,12 @@ +if BOARD_VOCORE2 + +config SYS_BOARD + default "vocore2" + +config SYS_VENDOR + default "vocore" + +config SYS_CONFIG_NAME + default "vocore2" + +endifboard/vocore/vocore2/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += board.oboard/vocore/vocore2/board.c new file +6
-0@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +* +* Nothing actually needed here +*/ configs/vocore2_defconfig new file +103
-0@@ -0,0 +1,103 @@ +CONFIG_MIPS=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_ENV_SIZE=0x1000 +CONFIG_ENV_SECT_SIZE=0x1000 +CONFIG_ENV_OFFSET=0x04e000 +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SYS_BOOTCOUNT_ADDR=0xb000006c +CONFIG_SPL_SYS_MALLOC_F_LEN=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_SPL_UART2_SPIS_PINMUX=y +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=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_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_LOGLEVEL=8 +CONFIG_VERSION_VARIABLE=y +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_NOR_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_LICENSE=y +# 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_ELF is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_CRC32 is not set +CONFIG_CMD_MEMINFO=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_GPT_RENAME=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_TIME=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:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)" +CONFIG_DEFAULT_DEVICE_TREE="vocore_vocore2" +CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_MTK=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_MT7628_ETH=y +CONFIG_PHY=y +CONFIG_MT76X8_USB_PHY=y +# 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_WDT=y +CONFIG_WDT_MT7621=y +CONFIG_FS_EXT4=y +CONFIG_FAT_WRITE=y +CONFIG_LZMA=y +CONFIG_LZO=yconfigs/vocore2_defconfig_ENV_IN_FAT new file +104
-0@@ -0,0 +1,104 @@ +CONFIG_MIPS=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_ENV_SIZE=0x1000 +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_SYS_MALLOC_F_LEN=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_SYS_BOOTCOUNT_ADDR=0xb000006c +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_SPL_UART2_SPIS_PINMUX=y +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=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_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_USE_BOOTARGS=y +CONFIG_LOGLEVEL=8 +CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_VERSION_VARIABLE=y +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_NOR_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_LICENSE=y +# 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_ELF is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_CRC32 is not set +CONFIG_CMD_MEMINFO=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_GPT_RENAME=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_TIME=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:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)" +CONFIG_DEFAULT_DEVICE_TREE="vocore_vocore2" +CONFIG_ENV_IS_IN_FAT=y +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_MTK=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_MT7628_ETH=y +CONFIG_PHY=y +CONFIG_MT76X8_USB_PHY=y +# 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_WDT=y +CONFIG_WDT_MT7621=y +CONFIG_FS_EXT4=y +CONFIG_LZMA=y +CONFIG_LZO=yinclude/configs/vocore2.h new file +61
-0@@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +*/ + +#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 + +/* SPL */ +#if defined(CONFIG_SPL ) && !defined(CONFIG_SPL_BUILD ) +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif + +#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SPL_BSS_START_ADDR 0x80010000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x10000 +#define CONFIG_SPL_MAX_SIZE 0x10000 + +/* Dummy value */ +#define CONFIG_SYS_UBOOT_BASE 0 + +/* Serial SPL */ +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_SERIAL_SUPPORT ) +#define CONFIG_SYS_NS16550_MEM32 +#define CONFIG_SYS_NS16550_CLK 40000000 +#define CONFIG_SYS_NS16550_REG_SIZE -4 +#define CONFIG_SYS_NS16550_COM3 0xb0000e00 +#define CONFIG_CONS_INDEX 3 + +#endif + +/* UART */ +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, \ + 230400, 460800, 921600 } + +/* 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 */ + +#endif //__VOCORE2_CONFIG_H__
PATCH v5 1/1 Add support for SoM "VoCore2".
Thanks Weijie.
Quoted 76 lines · Weijie Gao
Quoted 75 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Details about this SoM can be found at "https://vocore.io/v2.html".
Signed-off-by Mauro Condarelli <[email protected]>---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization inboard.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testingChanges in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcountChanges in v3:
- based on top of Weijie Gao patchset:
"[v3,xx/20]Refactor the architecture parts of mt7628"Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)arch/mips/dts/Makefile | 1 + arch/mips/dts/mt7628a.dtsi | 5 ++ arch/mips/dts/vocore_vocore2.dts | 78 ++++++++++++++++++++ arch/mips/mach-mtmips/Kconfig | 8 +++ board/vocore/vocore2/Kconfig | 12 ++++ board/vocore/vocore2/Makefile | 3 + board/vocore/vocore2/board.c | 6 ++ configs/vocore2_defconfig | 103 ++++++++++++++++++++++++++ configs/vocore2_defconfig_ENV_IN_FAT | 104 +++++++++++++++++++++++++++ include/configs/vocore2.h | 61 ++++++++++++++++ 10 files changed, 381 insertions(+) create mode 100644 arch/mips/dts/vocore_vocore2.dts create mode 100644 board/vocore/vocore2/Kconfig create mode 100644 board/vocore/vocore2/Makefile create mode 100644 board/vocore/vocore2/board.c create mode 100644 configs/vocore2_defconfig create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT create mode 100644 include/configs/vocore2.harch/mips/dts/Makefile +1
-0@@ -23,6 +23,7 @@ dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f at st1704.dtb dtb-$(CONFIG_BOARD_SFR_NB4_SER) += sfr,nb4-ser.dtb dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb +dtb-$(CONFIG_BOARD_VOCORE2) += vocore_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.dtbarch/mips/dts/mt7628a.dtsi +0
-0@@ -402,6 +402,11 @@ builtin-cd = <1>; r_smpl = <1>;
Quoted 7 lines
arch/mips/dts/mt7628a.dtsi line 409
Quoted 5 lines
arch/mips/dts/mt7628a.dtsi +5
-0+ bus-width = <4>; + max-frequency = <48000000>; + cap-sd-highspeed; + cap-mmc-highspeed; +could you please move these lines to
vocore_vocore2.dts? these are board specific properties.
Done.
Quoted 60 lines
Quoted 49 lines
arch/mips/dts/mt7628a.dtsi +0
-0clocks = <&clk48m>, <&clkctrl CLK_SDXC>; clock-names = "source", "hclk";arch/mips/dts/vocore_vocore2.dts new file +40
-0@@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Mauro Condarelli <[email protected]> + */ + +/dts-v1/; + +#include "mt7628a.dtsi" +#include <dt-bindings/gpio/gpio.h> + +/ { + compatible = "vocore,vocore2", "ralink,mt7628a-soc"; + model = "VoCore2"; + + aliases { + serial0 = &uart2; + spi0 = &spi0; + }; + + memory at 0 { + device_type = "memory"; + reg = <0x0 0x08000000>; + }; + leds { + compatible = "gpio-leds"; + + power { + label = "vocore:power"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + chosen { + bootargs = "console=ttyS2,115200"; + stdout-path = &uart2; + }; +}; + +&pinctrl {arch/mips/dts/vocore_vocore2.dts line 50
Quoted 10 lines
arch/mips/dts/vocore_vocore2.dts new file +10
-0+ state_default: pin_state { + p0led { + groups = "p0led_a"; + function = "led"; + }; + }; +}; + +&uart2 { + status = "okay";have you tried adding these two lines?
Quoted 2 lines
pinctrl-names = "default"; pinctrl-0 = <&uart2_pwm_pins>;
Yes that was one of the tests I did, but that did not seem enough; sincerely I don't remember why i removed them again. I will recheck before V6.
Quoted 20 lines
Quoted 20 lines
arch/mips/dts/vocore_vocore2.dts new file +20
-0+}; + +&spi0 { + status = "okay"; + nor0: spi-flash at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <25000000>; + reg = <0>; + }; +}; + +ð { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&ephy_iot_mode>; + mediatek,poll-link-phy = <0>; +};
Quoted 8 lines
arch/mips/dts/vocore_vocore2.dts line 77
Quoted 7 lines
arch/mips/dts/vocore_vocore2.dts new file +7
-0+ +&mmc { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&sd_iot_mode>; + pinctrl-1 = <&sd_iot_mode>;pinctrl-1 should be removed. the driver never uses it.
Done.
Quoted 9 lines
Quoted 9 lines
arch/mips/dts/vocore_vocore2.dts new file +1
-0+};arch/mips/mach-mtmips/Kconfig +0
-0@@ -83,6 +83,13 @@ config BOARD_MT7628_RFB SPI-NOR flash, 1 built-in switch with 5 ports, 1 UART, 1 USB host, 1 SDXC, 1 PCIe socket and JTAG pins.
Quoted 9 lines
arch/mips/mach-mtmips/Kconfig config BOARD_MT7628_RFB · line 92
Quoted 7 lines
arch/mips/mach-mtmips/Kconfig +7
-0+config BOARD_VOCORE2 + bool "VoCore2" + depends on SOC_MT7628 + help + VoCore VoCore2 board has a MT7628 SoC with 128 MiB of RAM + and 16 MiB of flash (SPI). +if
CONFIG_SPL_UART2_SPIS_PINMUXis the only uart pinmux used by the board, you can add "selectCONFIG_SPL_UART2_SPIS_PINMUX" here.
I thought about this, but I was unsure.
Will do in v6.
Quoted 327 lines
Quoted 327 lines
arch/mips/mach-mtmips/Kconfig +1
-0endchoice config SPL_UART2_SPIS_PINMUX@@ -96,5 +103,6 @@ config SPL_UART2_SPIS_PINMUX source "board/gardena/smart-gateway-mt7688/Kconfig" source "board/mediatek/mt7628/Kconfig" source "board/seeed/linkit-smart-7688/Kconfig" +source "board/vocore/vocore2/Kconfig" endmenuboard/vocore/vocore2/Kconfig new file +12
-0@@ -0,0 +1,12 @@ +if BOARD_VOCORE2 + +config SYS_BOARD + default "vocore2" + +config SYS_VENDOR + default "vocore" + +config SYS_CONFIG_NAME + default "vocore2" + +endifboard/vocore/vocore2/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += board.oboard/vocore/vocore2/board.c new file +6
-0@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +* +* Nothing actually needed here +*/ configs/vocore2_defconfig new file +103
-0@@ -0,0 +1,103 @@ +CONFIG_MIPS=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_ENV_SIZE=0x1000 +CONFIG_ENV_SECT_SIZE=0x1000 +CONFIG_ENV_OFFSET=0x04e000 +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SYS_BOOTCOUNT_ADDR=0xb000006c +CONFIG_SPL_SYS_MALLOC_F_LEN=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_SPL_UART2_SPIS_PINMUX=y +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=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_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_LOGLEVEL=8 +CONFIG_VERSION_VARIABLE=y +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_NOR_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_LICENSE=y +# 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_ELF is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_CRC32 is not set +CONFIG_CMD_MEMINFO=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_GPT_RENAME=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_TIME=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:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)" +CONFIG_DEFAULT_DEVICE_TREE="vocore_vocore2" +CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_MTK=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_MT7628_ETH=y +CONFIG_PHY=y +CONFIG_MT76X8_USB_PHY=y +# 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_WDT=y +CONFIG_WDT_MT7621=y +CONFIG_FS_EXT4=y +CONFIG_FAT_WRITE=y +CONFIG_LZMA=y +CONFIG_LZO=yconfigs/vocore2_defconfig_ENV_IN_FAT new file +104
-0@@ -0,0 +1,104 @@ +CONFIG_MIPS=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_ENV_SIZE=0x1000 +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_SYS_MALLOC_F_LEN=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_SYS_BOOTCOUNT_ADDR=0xb000006c +CONFIG_ARCH_MTMIPS=y +CONFIG_BOARD_VOCORE2=y +CONFIG_SPL_UART2_SPIS_PINMUX=y +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=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_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_USE_BOOTARGS=y +CONFIG_LOGLEVEL=8 +CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_VERSION_VARIABLE=y +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_NOR_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_LICENSE=y +# 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_ELF is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_CRC32 is not set +CONFIG_CMD_MEMINFO=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_GPT_RENAME=y +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_TIME=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:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)" +CONFIG_DEFAULT_DEVICE_TREE="vocore_vocore2" +CONFIG_ENV_IS_IN_FAT=y +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_LED_GPIO=y +CONFIG_MMC=y +CONFIG_DM_MMC=y +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_MTK=y +CONFIG_MTD=y +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_MT7628_ETH=y +CONFIG_PHY=y +CONFIG_MT76X8_USB_PHY=y +# 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_WDT=y +CONFIG_WDT_MT7621=y +CONFIG_FS_EXT4=y +CONFIG_LZMA=y +CONFIG_LZO=yinclude/configs/vocore2.h new file +53
-0@@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2019 Mauro Condarelli <[email protected]> +*/ + +#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 + +/* SPL */ +#if defined(CONFIG_SPL ) && !defined(CONFIG_SPL_BUILD ) +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif + +#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SPL_BSS_START_ADDR 0x80010000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x10000 +#define CONFIG_SPL_MAX_SIZE 0x10000 + +/* Dummy value */ +#define CONFIG_SYS_UBOOT_BASE 0 + +/* Serial SPL */ +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_SERIAL_SUPPORT ) +#define CONFIG_SYS_NS16550_MEM32 +#define CONFIG_SYS_NS16550_CLK 40000000 +#define CONFIG_SYS_NS16550_REG_SIZE -4 +#define CONFIG_SYS_NS16550_COM3 0xb0000e00 +#define CONFIG_CONS_INDEX 3 + +#endif + +/* UART */ +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, \ + 230400, 460800, 921600 } + +/* 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)
Quoted 8 lines
include/configs/vocore2.h line 61
Quoted 8 lines
include/configs/vocore2.h new file +8
-0+#define CONFIG_SYS_CBSIZE 512 + +/* U-Boot */ +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE + +/* Environment settings */ + +#endif //__VOCORE2_CONFIG_H__
Many thanks
Mauro
PATCH v5 1/1 Add support for SoM "VoCore2".
Hi Weijie,
Quoted 18 lines · Mauro Condarelli
Quoted 9 lines
Quoted 9 lines
(quoted diff) +1
-0+};arch/mips/mach-mtmips/Kconfig +0
-0@@ -83,6 +83,13 @@ config BOARD_MT7628_RFB SPI-NOR flash, 1 built-in switch with 5 ports, 1 UART, 1 USB host, 1 SDXC, 1 PCIe socket and JTAG pins.Quoted 9 lines
arch/mips/mach-mtmips/Kconfig config BOARD_MT7628_RFB · line 92
Quoted 7 lines
arch/mips/mach-mtmips/Kconfig +7
-0+config BOARD_VOCORE2 + bool "VoCore2" + depends on SOC_MT7628 + help + VoCore VoCore2 board has a MT7628 SoC with 128 MiB of RAM + and 16 MiB of flash (SPI). +if
CONFIG_SPL_UART2_SPIS_PINMUXis the only uart pinmux used by the board, you can add "selectCONFIG_SPL_UART2_SPIS_PINMUX" here.
Quoted 2 lines
I thought about this, but I was unsure.
Will do in v6.
While testing this I noticed it's possible to select SPL_UART2_SPIS_PINMUX *without* SPL_SERIAL_SUPPORT, leading to an invalid configuration.
IMHO we should have either a:
? "depends on SPL_SERIAL_SUPPORT"
or (perhaps better) a:
? "select SPL_SERIAL_SUPPORT"
in definition of SPL_UART2_SPIS_PINMUX.
I can provide a separate patch as this is not board-specific, but it seems to be Your call.
Alternatively I can add "select SPL_SERIAL_SUPPORT" to my board definition, but this doesn't look right to me.
Please advise.
Many Thanks
Mauro
PATCH v5 1/1 Add support for SoM "VoCore2".
In reply to Mauro CondarelliQuoted 47 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Details about this SoM can be found at "https://vocore.io/v2.html".
Signed-off-by Mauro Condarelli <[email protected]>---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization inboard.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testingChanges in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcountChanges in v3:
- based on top of Weijie Gao patchset:
"[v3,xx/20]Refactor the architecture parts of mt7628"Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)arch/mips/dts/Makefile | 1 + arch/mips/dts/mt7628a.dtsi | 5 ++ arch/mips/dts/vocore_vocore2.dts | 78 ++++++++++++++++++++ arch/mips/mach-mtmips/Kconfig | 8 +++ board/vocore/vocore2/Kconfig | 12 ++++ board/vocore/vocore2/Makefile | 3 + board/vocore/vocore2/board.c | 6 ++ configs/vocore2_defconfig | 103 ++++++++++++++++++++++++++ configs/vocore2_defconfig_ENV_IN_FAT | 104 +++++++++++++++++++++++++++ include/configs/vocore2.h | 61 ++++++++++++++++ 10 files changed, 381 insertions(+)
Quoted 7 lines
create mode 100644
arch/mips/dts/vocore_vocore2.dtscreate mode 100644 board/vocore/vocore2/Kconfig create mode 100644 board/vocore/vocore2/Makefile create mode 100644board/vocore/vocore2/board.ccreate mode 100644 configs/vocore2_defconfig create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT create mode 100644include/configs/vocore2.h
Apart from the other comments, the MAINTAINERS file is missing. Please add it in the next patch version.
Thanks,
Stefan
PATCH v5 1/1 Add support for SoM "VoCore2".
Thanks Stefan.
Quoted 56 lines · Stefan
Quoted 46 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Details about this SoM can be found at "https://vocore.io/v2.html".
Signed-off-by Mauro Condarelli <[email protected]>---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization inboard.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testingChanges in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcountChanges in v3:
- based on top of Weijie Gao patchset:
???? "[v3,xx/20]Refactor the architecture parts of mt7628"Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)? arch/mips/dts/Makefile?????????????? |?? 1 + ? arch/mips/dts/mt7628a.dtsi?????????? |?? 5 ++ ? arch/mips/dts/vocore_vocore2.dts???? |? 78 ++++++++++++++++++++ ? arch/mips/mach-mtmips/Kconfig??????? |?? 8 +++ ? board/vocore/vocore2/Kconfig???????? |? 12 ++++ ? board/vocore/vocore2/Makefile??????? |?? 3 + ? board/vocore/vocore2/board.c???????? |?? 6 ++ ? configs/vocore2_defconfig??????????? | 103 ++++++++++++++++++++++++++ ? configs/vocore2_defconfig_ENV_IN_FAT | 104 +++++++++++++++++++++++++++ ? include/configs/vocore2.h??????????? |? 61 ++++++++++++++++Quoted 8 lines
? 10 files changed, 381 insertions(+)
? create mode 100644arch/mips/dts/vocore_vocore2.dts? create mode 100644 board/vocore/vocore2/Kconfig ? create mode 100644 board/vocore/vocore2/Makefile ? create mode 100644board/vocore/vocore2/board.c? create mode 100644 configs/vocore2_defconfig
? create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT ? create mode 100644include/configs/vocore2.h
Quoted 2 lines
Apart from the other comments, the
MAINTAINERSfile is missing. Please add it in the next patch version.
Yes, I know.
Also patman was complaining.
I perused MAINTAINERS and it didn't look like specific board maintainers are in.
I have no problems adding me to the list, but I'm unsure I have the privilege and it's unclear where I should add myself.
Please advise.
Quoted 3 lines
Thanks,
Stefan
Thanks in Advance
Mauro
PATCH v5 1/1 Add support for SoM "VoCore2".
Quoted 59 lines · Mauro Condarelli
Thanks Stefan.
Quoted 56 lines · Stefan
Quoted 54 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Details about this SoM can be found at "https://vocore.io/v2.html".
Signed-off-by Mauro Condarelli <[email protected]>---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization inboard.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testingChanges in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcountChanges in v3:
- based on top of Weijie Gao patchset:
???? "[v3,xx/20]Refactor the architecture parts of mt7628"Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)? arch/mips/dts/Makefile?????????????? |?? 1 + ? arch/mips/dts/mt7628a.dtsi?????????? |?? 5 ++ ? arch/mips/dts/vocore_vocore2.dts???? |? 78 ++++++++++++++++++++ ? arch/mips/mach-mtmips/Kconfig??????? |?? 8 +++ ? board/vocore/vocore2/Kconfig???????? |? 12 ++++ ? board/vocore/vocore2/Makefile??????? |?? 3 + ? board/vocore/vocore2/board.c???????? |?? 6 ++ ? configs/vocore2_defconfig??????????? | 103 ++++++++++++++++++++++++++ ? configs/vocore2_defconfig_ENV_IN_FAT | 104 +++++++++++++++++++++++++++ ? include/configs/vocore2.h??????????? |? 61 ++++++++++++++++? 10 files changed, 381 insertions(+)
? create mode 100644arch/mips/dts/vocore_vocore2.dts? create mode 100644 board/vocore/vocore2/Kconfig ? create mode 100644 board/vocore/vocore2/Makefile ? create mode 100644board/vocore/vocore2/board.c? create mode 100644 configs/vocore2_defconfig
? create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT ? create mode 100644include/configs/vocore2.h
Quoted 8 lines
Quoted 2 lines
Apart from the other comments, the
MAINTAINERSfile is missing. Please add it in the next patch version.Yes, I know.
Also patman was complaining.
I perusedMAINTAINERSand it didn't look like specific board maintainers are in.
I have no problems adding me to the list, but I'm unsure I have the privilege and it's unclear where I should add myself.
I was not referring to the global MAINTAINERS file but the one located in the board directory. Please see:
board/gardena/smart-gateway-mt7688/MAINTAINERS
Thanks,
Stefan
PATCH v5 1/1 Add support for SoM "VoCore2".
Thanks Stefan.
Quoted 71 lines · Stefan
Quoted 61 lines · Mauro Condarelli
Thanks Stefan.
Quoted 58 lines · Stefan
Quoted 56 lines · Mauro Condarelli
Small patch series to add support for VoCore/VoCore2 board.
VoCore is open hardware and runs OpenWrt/LEDE.
It has WIFI, USB, UART, 20+ GPIOs but is only one inch square. It will help you to make a smart house, study embedded system or even make the tiniest router in the world.Details about this SoM can be found at "https://vocore.io/v2.html".
Signed-off-by Mauro Condarelli <[email protected]>---
Changes in v5:
- Removed unneeded (and wrong) UART2 initialization inboard.c
- Added network setup.
- Removed project-specific code.
- Move back environment to SPI NOR.
- Changes to environment default settings.
- Rebase on current u-boot-mips/testingChanges in v4:
- Reverted some overzealous DTS cleaning.
- Added support for bootcountChanges in v3:
- based on top of Weijie Gao patchset:
????? "[v3,xx/20]Refactor the architecture parts of mt7628"Changes in v2:
- Removed some dead code
- Changed Author to my full name (no nick)
- Removed unwanted fixup to .dts generation (not my call).
- Fixed commit message
- Fixed various variables/filenames to include Vendor name
- Changed Vendor name (Vonger -> Vocore)?? arch/mips/dts/Makefile?????????????? |?? 1 + ?? arch/mips/dts/mt7628a.dtsi?????????? |?? 5 ++ ?? arch/mips/dts/vocore_vocore2.dts???? |? 78 ++++++++++++++++++++ ?? arch/mips/mach-mtmips/Kconfig??????? |?? 8 +++ ?? board/vocore/vocore2/Kconfig???????? |? 12 ++++ ?? board/vocore/vocore2/Makefile??????? |?? 3 + ?? board/vocore/vocore2/board.c???????? |?? 6 ++ ?? configs/vocore2_defconfig??????????? | 103++++++++++++++++++++++++++
?? configs/vocore2_defconfig_ENV_IN_FAT | 104
+++++++++++++++++++++++++++
??include/configs/vocore2.h??????????? |? 61 ++++++++++++++++ ?? 10 files changed, 381 insertions(+)
?? create mode 100644arch/mips/dts/vocore_vocore2.dts?? create mode 100644 board/vocore/vocore2/Kconfig ?? create mode 100644 board/vocore/vocore2/Makefile ?? create mode 100644board/vocore/vocore2/board.c?? create mode 100644 configs/vocore2_defconfig
?? create mode 100644 configs/vocore2_defconfig_ENV_IN_FAT ?? create mode 100644include/configs/vocore2.hQuoted 8 lines
Quoted 2 lines
Apart from the other comments, the
MAINTAINERSfile is missing. Please add it in the next patch version.Yes, I know.
Also patman was complaining.
I perusedMAINTAINERSand it didn't look like specific board maintainers are in.
I have no problems adding me to the list, but I'm unsure I have the privilege and it's unclear where I should add myself.
Quoted 4 lines
I was not referring to the global
MAINTAINERSfile but the one located in the board directory. Please see:board/gardena/smart-gateway-mt7688/MAINTAINERS
Oops!
I completely overlooked that.
Done.
Quoted 2 lines
Thanks,
Stefan
Many Thanks
Mauro