summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2018-11-18 15:47:16 -0500
committerTom Rini <[email protected]>2018-11-18 15:47:16 -0500
commitd73d81fd85e4a030ade42c4b2d13466d45090aa3 (patch)
tree01a796e2be480b2590af9357f2926968b0050db6 /arch
parent0c4b382f9041f9f2f00246c8a0ece90dae5451be (diff)
parent1bef0c530beaaba08b8ca7a9ec6ce6dc25f62dfb (diff)
Merge tag 'mips-pull-2018-11-18' of git://git.denx.de/u-boot-mips
- tree-wide: introduce LDFLAGS_STANDALONE - MIPS: fix long-standing issue with linking of standalone programs - MIPS: MT76xx: add GPIO and WDT drivers - MIPS: MT76xx: various fixes and updates to gardena-smart-gateway board - MIPS: MT76xx: various fixes and updates to linkit-smart-7688 board
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/Kconfig3
-rw-r--r--arch/mips/config.mk4
-rw-r--r--arch/mips/cpu/mips32/config.mk7
-rw-r--r--arch/mips/cpu/mips64/config.mk7
-rw-r--r--arch/mips/dts/gardena-smart-gateway-mt7688.dts60
-rw-r--r--arch/mips/dts/linkit-smart-7688.dts1
-rw-r--r--arch/mips/dts/mt7628a.dtsi51
-rw-r--r--arch/mips/include/asm/u-boot-mips.h2
-rw-r--r--arch/mips/mach-mt7620/Kconfig1
-rw-r--r--arch/mips/mach-mt7620/cpu.c40
-rw-r--r--arch/mips/mach-mt7620/lowlevel_init.S6
-rw-r--r--arch/nds32/config.mk4
-rw-r--r--arch/riscv/config.mk4
-rw-r--r--arch/sh/config.mk2
14 files changed, 171 insertions, 21 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 6d646ef9997..1b1b1d7d003 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -74,9 +74,12 @@ config ARCH_MT7620
imply CMD_DM
select DISPLAY_CPUINFO
select DM
+ imply DM_ETH
+ imply DM_GPIO
select DM_SERIAL
imply DM_SPI
imply DM_SPI_FLASH
+ select ARCH_MISC_INIT if WATCHDOG
select MIPS_TUNE_24KC
select OF_CONTROL
select ROM_EXCEPTION_VECTORS
diff --git a/arch/mips/config.mk b/arch/mips/config.mk
index 22223a0f3e9..9d3a84539a7 100644
--- a/arch/mips/config.mk
+++ b/arch/mips/config.mk
@@ -25,12 +25,14 @@ ifdef CONFIG_32BIT
PLATFORM_CPPFLAGS += -mabi=32
PLATFORM_LDFLAGS += -m $(32bit-emul)
OBJCOPYFLAGS += -O $(32bit-bfd)
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000
endif
ifdef CONFIG_64BIT
PLATFORM_CPPFLAGS += -mabi=64
PLATFORM_LDFLAGS += -m$(64bit-emul)
OBJCOPYFLAGS += -O $(64bit-bfd)
+CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000
endif
PLATFORM_CPPFLAGS += -D__MIPS__
@@ -65,3 +67,5 @@ PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
LDFLAGS_FINAL += --gc-sections
OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list
+
+LDFLAGS_STANDALONE += --gc-sections
diff --git a/arch/mips/cpu/mips32/config.mk b/arch/mips/cpu/mips32/config.mk
deleted file mode 100644
index a0247596f55..00000000000
--- a/arch/mips/cpu/mips32/config.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# (C) Copyright 2003
-# Wolfgang Denk, DENX Software Engineering, <[email protected]>
-
-CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 \
- -T $(srctree)/examples/standalone/mips.lds
diff --git a/arch/mips/cpu/mips64/config.mk b/arch/mips/cpu/mips64/config.mk
deleted file mode 100644
index cd96bbcce98..00000000000
--- a/arch/mips/cpu/mips64/config.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# (C) Copyright 2003
-# Wolfgang Denk, DENX Software Engineering, <[email protected]>
-
-CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 \
- -T $(srctree)/examples/standalone/mips64.lds
diff --git a/arch/mips/dts/gardena-smart-gateway-mt7688.dts b/arch/mips/dts/gardena-smart-gateway-mt7688.dts
index ee99c3d17c8..d8d88686bb6 100644
--- a/arch/mips/dts/gardena-smart-gateway-mt7688.dts
+++ b/arch/mips/dts/gardena-smart-gateway-mt7688.dts
@@ -6,6 +6,7 @@
/dts-v1/;
#include "mt7628a.dtsi"
+#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "gardena,smart-gateway-mt7688", "ralink,mt7628a-soc";
@@ -21,8 +22,65 @@
reg = <0x0 0x08000000>;
};
+ leds {
+ compatible = "gpio-leds";
+
+ power_blue {
+ label = "smartgw:power:blue";
+ gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ power_green {
+ label = "smartgw:power:green";
+ gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ power_red {
+ label = "smartgw:power:red";
+ gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ radio_blue {
+ label = "smartgw:radio:blue";
+ gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ radio_green {
+ label = "smartgw:radio:green";
+ gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ radio_red {
+ label = "smartgw:radio:red";
+ gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ internet_blue {
+ label = "smartgw:internet:blue";
+ gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ internet_green {
+ label = "smartgw:internet:green";
+ gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ internet_red {
+ label = "smartgw:internet:red";
+ gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+ };
+
chosen {
- bootargs = "console=ttyS0,57600";
stdout-path = &uart0;
};
};
diff --git a/arch/mips/dts/linkit-smart-7688.dts b/arch/mips/dts/linkit-smart-7688.dts
index df4bf907c6b..c9db136f30f 100644
--- a/arch/mips/dts/linkit-smart-7688.dts
+++ b/arch/mips/dts/linkit-smart-7688.dts
@@ -22,7 +22,6 @@
};
chosen {
- bootargs = "console=ttyS0,57600";
stdout-path = &uart2;
};
};
diff --git a/arch/mips/dts/mt7628a.dtsi b/arch/mips/dts/mt7628a.dtsi
index c14259b1701..70e34cfdbc3 100644
--- a/arch/mips/dts/mt7628a.dtsi
+++ b/arch/mips/dts/mt7628a.dtsi
@@ -48,6 +48,17 @@
mask = <0x1>;
};
+ watchdog: watchdog@100 {
+ compatible = "ralink,mt7628a-wdt", "mediatek,mt7621-wdt";
+ reg = <0x100 0x30>;
+
+ resets = <&resetc 8>;
+ reset-names = "wdt";
+
+ interrupt-parent = <&intc>;
+ interrupts = <24>;
+ };
+
intc: interrupt-controller@200 {
compatible = "ralink,rt2880-intc";
reg = <0x200 0x100>;
@@ -71,6 +82,38 @@
reg = <0x300 0x100>;
};
+ gpio@600 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ compatible = "mtk,mt7628-gpio", "mtk,mt7621-gpio";
+ reg = <0x600 0x100>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <6>;
+
+ gpio0: bank@0 {
+ reg = <0>;
+ compatible = "mtk,mt7621-gpio-bank";
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpio1: bank@1 {
+ reg = <1>;
+ compatible = "mtk,mt7621-gpio-bank";
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpio2: bank@2 {
+ reg = <2>;
+ compatible = "mtk,mt7621-gpio-bank";
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+ };
+
spi0: spi@b00 {
compatible = "ralink,mt7621-spi";
reg = <0xb00 0x40>;
@@ -120,6 +163,14 @@
};
};
+ eth@10110000 {
+ compatible = "mediatek,mt7622-eth";
+ reg = <0x10100000 0x10000
+ 0x10110000 0x8000>;
+
+ syscon = <&sysc>;
+ };
+
usb_phy: usb-phy@10120000 {
compatible = "mediatek,mt7628-usbphy";
reg = <0x10120000 0x1000>;
diff --git a/arch/mips/include/asm/u-boot-mips.h b/arch/mips/include/asm/u-boot-mips.h
index f4bfbdc6933..88438b9576b 100644
--- a/arch/mips/include/asm/u-boot-mips.h
+++ b/arch/mips/include/asm/u-boot-mips.h
@@ -7,4 +7,6 @@ void exc_handler(void);
void except_vec3_generic(void);
void except_vec_ejtag_debug(void);
+int arch_misc_init(void);
+
#endif /* _U_BOOT_MIPS_H_ */
diff --git a/arch/mips/mach-mt7620/Kconfig b/arch/mips/mach-mt7620/Kconfig
index 13a7bd2cc03..4ebcb4b053c 100644
--- a/arch/mips/mach-mt7620/Kconfig
+++ b/arch/mips/mach-mt7620/Kconfig
@@ -24,6 +24,7 @@ choice
config BOARD_GARDENA_SMART_GATEWAY_MT7688
bool "Gardena Smart Gateway"
depends on SOC_MT7620
+ select BOARD_LATE_INIT
select SUPPORTS_BOOT_RAM
help
Gardena Smart Gateway boards have a MT7688 SoC with 128 MiB of RAM
diff --git a/arch/mips/mach-mt7620/cpu.c b/arch/mips/mach-mt7620/cpu.c
index 457f09f32c6..87cc973b756 100644
--- a/arch/mips/mach-mt7620/cpu.c
+++ b/arch/mips/mach-mt7620/cpu.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <dm.h>
#include <ram.h>
+#include <wdt.h>
#include <asm/io.h>
#include <linux/io.h>
#include <linux/sizes.h>
@@ -67,3 +68,42 @@ int print_cpuinfo(void)
return 0;
}
+
+#ifdef CONFIG_WATCHDOG
+static struct udevice *watchdog_dev;
+
+/* Called by macro WATCHDOG_RESET */
+void watchdog_reset(void)
+{
+ static ulong next_reset;
+ ulong now;
+
+ if (!watchdog_dev)
+ return;
+
+ now = get_timer(0);
+
+ /* Do not reset the watchdog too often */
+ if (now > next_reset) {
+ next_reset = now + 1000; /* reset every 1000ms */
+ wdt_reset(watchdog_dev);
+ }
+}
+
+int arch_misc_init(void)
+{
+ /* Init watchdog */
+ if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) {
+ debug("Watchdog: Not found by seq!\n");
+ if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
+ puts("Watchdog: Not found!\n");
+ return 0;
+ }
+ }
+
+ wdt_start(watchdog_dev, 60000, 0); /* 60 seconds */
+ printf("Watchdog: Started\n");
+
+ return 0;
+}
+#endif
diff --git a/arch/mips/mach-mt7620/lowlevel_init.S b/arch/mips/mach-mt7620/lowlevel_init.S
index 1a50f160fe0..aa707e0de6c 100644
--- a/arch/mips/mach-mt7620/lowlevel_init.S
+++ b/arch/mips/mach-mt7620/lowlevel_init.S
@@ -108,6 +108,12 @@ CPLL_READY:
sw t3, 0(t0)
CPLL_DONE:
+ /* Reset MC */
+ lw t2, 0x34(s0)
+ ori t2, BIT(10)
+ sw t2, 0x34(s0)
+ nop
+
/*
* SDR and DDR initialization: delay 200us
*/
diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk
index c5520fd8d83..12cec368d3b 100644
--- a/arch/nds32/config.mk
+++ b/arch/nds32/config.mk
@@ -12,8 +12,8 @@ ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := nds32le-linux-
endif
-CONFIG_STANDALONE_LOAD_ADDR = 0x300000 \
- -T $(srctree)/examples/standalone/nds32.lds
+CONFIG_STANDALONE_LOAD_ADDR = 0x300000
+LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/nds32.lds
PLATFORM_RELFLAGS += -fno-common -mrelax
PLATFORM_RELFLAGS += -gdwarf-2
diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk
index ed9eb0c24cd..cc5d8d1ad5e 100644
--- a/arch/riscv/config.mk
+++ b/arch/riscv/config.mk
@@ -27,8 +27,8 @@ CFLAGS_EFI += -march=rv64ima -mabi=lp64
EFI_LDS := elf_riscv64_efi.lds
endif
-CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \
- -T $(srctree)/examples/standalone/riscv.lds
+CONFIG_STANDALONE_LOAD_ADDR = 0x00000000
+LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/riscv.lds
PLATFORM_CPPFLAGS += -ffixed-gp -fpic
PLATFORM_RELFLAGS += -fno-common -gdwarf-2 -ffunction-sections
diff --git a/arch/sh/config.mk b/arch/sh/config.mk
index 92abee17ad0..6ef44638abd 100644
--- a/arch/sh/config.mk
+++ b/arch/sh/config.mk
@@ -9,7 +9,7 @@ endif
CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000
ifeq ($(CPU),sh2)
-CONFIG_STANDALONE_LOAD_ADDR += -EB
+LDFLAGS_STANDALONE += -EB
endif
PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__