summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-07-27 21:58:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-07-27 21:58:34 +0200
commit67f0e7aedefcb06b38ef50ddd32b0a280bbb10e8 (patch)
tree7198b811f5915ef29f1c2ac789301928ebdac662 /arch
parent058158ab9fa697dfcc9c53aa5fc521ba9c9842bf (diff)
parent942a71352a74220e02d860b9252f9423a20caee2 (diff)
downloadbarebox-67f0e7aedefcb06b38ef50ddd32b0a280bbb10e8.tar.gz
barebox-67f0e7aedefcb06b38ef50ddd32b0a280bbb10e8.tar.xz
Merge branch 'for-next/mips'
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/boards/Makefile1
-rw-r--r--arch/mips/boards/okud-max9331/Makefile2
-rw-r--r--arch/mips/boards/okud-max9331/lowlevel.S22
-rw-r--r--arch/mips/boards/okud-max9331/lowlevel_boot0.S22
-rw-r--r--arch/mips/configs/ath79_defconfig1
-rw-r--r--arch/mips/dts/Makefile1
-rw-r--r--arch/mips/dts/ar9331-okud-max9331.dts140
-rw-r--r--arch/mips/mach-ath79/Kconfig7
8 files changed, 196 insertions, 0 deletions
diff --git a/arch/mips/boards/Makefile b/arch/mips/boards/Makefile
index e85647a0e5..5f9b61e754 100644
--- a/arch/mips/boards/Makefile
+++ b/arch/mips/boards/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_BOARD_CI20) += img-ci20/
obj-$(CONFIG_BOARD_DLINK_DIR320) += dlink-dir-320/
obj-$(CONFIG_BOARD_DPTECHNICS_DPT_MODULE) += dptechnics-dpt-module/
obj-$(CONFIG_BOARD_OPENEMBEDED_SOM9331) += openembed-som9331/
+obj-$(CONFIG_BOARD_OKUD_MAX9331) += okud-max9331/
obj-$(CONFIG_BOARD_LOONGSON_TECH_LS1B) += loongson-ls1b/
obj-$(CONFIG_BOARD_NETGEAR_WG102) += netgear-wg102/
obj-$(CONFIG_BOARD_QEMU_MALTA) += qemu-malta/
diff --git a/arch/mips/boards/okud-max9331/Makefile b/arch/mips/boards/okud-max9331/Makefile
new file mode 100644
index 0000000000..c58bf72354
--- /dev/null
+++ b/arch/mips/boards/okud-max9331/Makefile
@@ -0,0 +1,2 @@
+lwl-y += lowlevel.o
+lwl-y += lowlevel_boot0.o
diff --git a/arch/mips/boards/okud-max9331/lowlevel.S b/arch/mips/boards/okud-max9331/lowlevel.S
new file mode 100644
index 0000000000..c5a288557f
--- /dev/null
+++ b/arch/mips/boards/okud-max9331/lowlevel.S
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2017 Oleksij Rempel <linux@rempel-privat.de>
+ * Copyright (C) 2019 Du Huanpeng <u74147@gmail.com>
+ */
+
+#define BOARD_PBL_START start_okud_max9331
+
+#include <mach/debug_ll.h>
+#include <asm/regdef.h>
+#include <asm/mipsregs.h>
+#include <asm/asm.h>
+#include <asm/pbl_macros.h>
+#include <mach/pbl_macros.h>
+#include <asm/pbl_nmon.h>
+#include <linux/sizes.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ ar9331_pbl_generic_start
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, ar9331_okud_max9331, SZ_64M)
diff --git a/arch/mips/boards/okud-max9331/lowlevel_boot0.S b/arch/mips/boards/okud-max9331/lowlevel_boot0.S
new file mode 100644
index 0000000000..b0a0e22683
--- /dev/null
+++ b/arch/mips/boards/okud-max9331/lowlevel_boot0.S
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2018 Oleksij Rempel <linux@rempel-privat.de>
+ * Copyright (C) 2019 Du Huanpeng <u74147@gmail.com>
+ */
+
+#define BOARD_PBL_START start_okud_max9331_boot0
+
+#include <mach/debug_ll.h>
+#include <asm/asm.h>
+#include <asm/pbl_macros.h>
+#include <mach/pbl_macros.h>
+#include <asm/pbl_nmon.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ li ra, 0xbfc20000
+ jr ra
+ nop
+
+
+STOP_WITH_DEBUG_EVENT
diff --git a/arch/mips/configs/ath79_defconfig b/arch/mips/configs/ath79_defconfig
index ab68f12533..64321ceddd 100644
--- a/arch/mips/configs/ath79_defconfig
+++ b/arch/mips/configs/ath79_defconfig
@@ -2,6 +2,7 @@ CONFIG_MACH_MIPS_ATH79=y
CONFIG_BOARD_8DEVICES_LIMA=y
CONFIG_BOARD_DPTECHNICS_DPT_MODULE=y
CONFIG_BOARD_OPENEMBEDED_SOM9331=y
+CONFIG_BOARD_OKUD_MAX9331=y
CONFIG_BOARD_TPLINK_MR3020=y
CONFIG_BOARD_TPLINK_WDR4300=y
CONFIG_BOARD_BLACK_SWIFT=y
diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile
index b0ad25ecfa..e5900c971b 100644
--- a/arch/mips/dts/Makefile
+++ b/arch/mips/dts/Makefile
@@ -8,6 +8,7 @@ pbl-$(CONFIG_BOARD_BLACK_SWIFT) += black-swift.dtb.o
pbl-$(CONFIG_BOARD_CI20) += img-ci20.dtb.o
pbl-$(CONFIG_BOARD_DLINK_DIR320) += dlink-dir-320.dtb.o
pbl-$(CONFIG_BOARD_DPTECHNICS_DPT_MODULE) += ar9331-dptechnics-dpt-module.dtb.o
+pbl-$(CONFIG_BOARD_OKUD_MAX9331) += ar9331-okud-max9331.dtb.o
pbl-$(CONFIG_BOARD_OPENEMBEDED_SOM9331) += ar9331-openembed-som9331-board.dtb.o
pbl-$(CONFIG_BOARD_LOONGSON_TECH_LS1B) += loongson-ls1b.dtb.o
pbl-$(CONFIG_BOARD_QEMU_MALTA) += qemu-malta.dtb.o
diff --git a/arch/mips/dts/ar9331-okud-max9331.dts b/arch/mips/dts/ar9331-okud-max9331.dts
new file mode 100644
index 0000000000..53350899f9
--- /dev/null
+++ b/arch/mips/dts/ar9331-okud-max9331.dts
@@ -0,0 +1,140 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include <mips/qca/ar9331.dtsi>
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "ar9331.dtsi"
+
+/ {
+ model = "o&kud max9331";
+ compatible = "okud,max9331";
+
+ aliases {
+ spiflash = &spiflash;
+ serial0 = &uart;
+ };
+
+ chosen {
+ environment {
+ compatible = "barebox,environment";
+ device-path = &spiflash, "partname:barebox-environment";
+ };
+
+ art@0 {
+ compatible = "qca,art-ar9331", "qca,art";
+ device-path = &spiflash_art;
+ barebox,provide-mac-address = <&eth0>;
+ };
+ };
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x4000000>;
+ };
+
+ /* FIXME: leds and gpio */
+ leds {
+ compatible = "gpio-leds";
+
+ net {
+ label = "board:LED1:system";
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ barebox,default-trigger = "net";
+ };
+
+ panic {
+ label = "board:LED2:system";
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ barebox,default-trigger = "panic";
+ };
+
+ system {
+ label = "board:LED3:system";
+ gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ barebox,default-trigger = "heartbeat";
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ button@0 {
+ label = "reset";
+ linux,code = <KEY_ENTER>;
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&eth0 {
+ status = "okay";
+};
+
+&ref {
+ clock-frequency = <25000000>;
+};
+
+&uart {
+ status = "okay";
+};
+
+&gpio {
+ status = "okay";
+};
+
+&usb {
+ dr_mode = "host";
+ status = "okay";
+};
+
+&usb_phy {
+ status = "okay";
+};
+
+&spi {
+ num-chipselects = <1>;
+ status = "okay";
+
+ /* Spansion FL128SA SPI flash */
+ spiflash: s25fl128s@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "spansion,s25fl128s1", "jedec,spi-nor";
+ spi-max-frequency = <25000000>;
+ reg = <0>;
+ };
+};
+
+&spiflash {
+ partition@0 {
+ label = "boot0";
+ reg = <0 0x10000>;
+ };
+
+ partition@10000 {
+ label = "barebox-environment";
+ reg = <0x10000 0x10000>;
+ };
+
+ partition@20000 {
+ label = "barebox";
+ reg = <0x20000 0x80000>;
+ };
+
+ partition@a0000 {
+ label = "kernel";
+ reg = <0xA0000 0xF50000>;
+ };
+
+ spiflash_art: partition@ff0000 {
+ label = "art";
+ reg = <0xff0000 0x10000>;
+ };
+};
diff --git a/arch/mips/mach-ath79/Kconfig b/arch/mips/mach-ath79/Kconfig
index 9dab5fc92a..2dfe0e587a 100644
--- a/arch/mips/mach-ath79/Kconfig
+++ b/arch/mips/mach-ath79/Kconfig
@@ -43,6 +43,13 @@ config BOARD_OPENEMBEDED_SOM9331
select HAVE_IMAGE_COMPRESSION
select HAS_NMON
+config BOARD_OKUD_MAX9331
+ bool "The Useless Board Max9331"
+ select SOC_QCA_AR9331
+ select HAVE_PBL_IMAGE
+ select HAVE_IMAGE_COMPRESSION
+ select HAS_NMON
+
config BOARD_TPLINK_MR3020
bool "TP-LINK MR3020"
select SOC_QCA_AR9331