summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2020-02-22 08:53:41 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-25 09:03:44 +0100
commit525cd9f8f8f10a357b8a9f22ff74931fe0993902 (patch)
tree464252f76e15f98fd6992a47bdfef8c0ca723438 /arch/mips
parent1b3ee1f1a292f88e5f18aae152082fac97aa1ba6 (diff)
downloadbarebox-525cd9f8f8f10a357b8a9f22ff74931fe0993902.tar.gz
barebox-525cd9f8f8f10a357b8a9f22ff74931fe0993902.tar.xz
MIPS: ath79: add support for OpenEmbed SOM9331 board
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/boards/Makefile1
-rw-r--r--arch/mips/boards/openembed-som9331/Makefile1
-rw-r--r--arch/mips/boards/openembed-som9331/lowlevel.S23
-rw-r--r--arch/mips/configs/ath79_defconfig1
-rw-r--r--arch/mips/dts/Makefile1
-rw-r--r--arch/mips/dts/ar9331-openembed-som9331-board.dts113
-rw-r--r--arch/mips/mach-ath79/Kconfig7
7 files changed, 147 insertions, 0 deletions
diff --git a/arch/mips/boards/Makefile b/arch/mips/boards/Makefile
index 50652f9841..e85647a0e5 100644
--- a/arch/mips/boards/Makefile
+++ b/arch/mips/boards/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_BOARD_BLACK_SWIFT) += black-swift/
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_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/openembed-som9331/Makefile b/arch/mips/boards/openembed-som9331/Makefile
new file mode 100644
index 0000000000..b08c4a93ca
--- /dev/null
+++ b/arch/mips/boards/openembed-som9331/Makefile
@@ -0,0 +1 @@
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/openembed-som9331/lowlevel.S b/arch/mips/boards/openembed-som9331/lowlevel.S
new file mode 100644
index 0000000000..dea735dd13
--- /dev/null
+++ b/arch/mips/boards/openembed-som9331/lowlevel.S
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2019 Oleksij Rempel <linux@rempel-privat.de>
+ */
+
+#define BOARD_PBL_START start_openembed_som9331_board
+
+#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
+ /* swap PHY4 and PHY0 */
+ pbl_reg_writel 0x190, 0xb8070000
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, ar9331_openembed_som9331_board, SZ_64M)
diff --git a/arch/mips/configs/ath79_defconfig b/arch/mips/configs/ath79_defconfig
index ab7af794a2..ab68f12533 100644
--- a/arch/mips/configs/ath79_defconfig
+++ b/arch/mips/configs/ath79_defconfig
@@ -1,6 +1,7 @@
CONFIG_MACH_MIPS_ATH79=y
CONFIG_BOARD_8DEVICES_LIMA=y
CONFIG_BOARD_DPTECHNICS_DPT_MODULE=y
+CONFIG_BOARD_OPENEMBEDED_SOM9331=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 b3660cd286..9e8a6a6aaf 100644
--- a/arch/mips/dts/Makefile
+++ b/arch/mips/dts/Makefile
@@ -8,6 +8,7 @@ pbl-dtb-$(CONFIG_BOARD_BLACK_SWIFT) += black-swift.dtb.o
pbl-dtb-$(CONFIG_BOARD_CI20) += img-ci20.dtb.o
pbl-dtb-$(CONFIG_BOARD_DLINK_DIR320) += dlink-dir-320.dtb.o
pbl-dtb-$(CONFIG_BOARD_DPTECHNICS_DPT_MODULE) += ar9331-dptechnics-dpt-module.dtb.o
+pbl-dtb-$(CONFIG_BOARD_OPENEMBEDED_SOM9331) += ar9331-openembed-som9331-board.dtb.o
pbl-dtb-$(CONFIG_BOARD_LOONGSON_TECH_LS1B) += loongson-ls1b.dtb.o
pbl-dtb-$(CONFIG_BOARD_QEMU_MALTA) += qemu-malta.dtb.o
pbl-dtb-$(CONFIG_BOARD_RZX50) += rzx50.dtb.o
diff --git a/arch/mips/dts/ar9331-openembed-som9331-board.dts b/arch/mips/dts/ar9331-openembed-som9331-board.dts
new file mode 100644
index 0000000000..ff9d25e352
--- /dev/null
+++ b/arch/mips/dts/ar9331-openembed-som9331-board.dts
@@ -0,0 +1,113 @@
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include <mips/qca/ar9331.dtsi>
+#include "ar9331.dtsi"
+
+/ {
+ model = "OpenEmbed SOM9331 Board";
+ compatible = "openembed,som9331-board", "openembed,som9331-module";
+
+ aliases {
+ serial0 = &uart;
+ spiflash = &spiflash;
+ };
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x4000000>;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ system {
+ label = "dpt-module:green:system";
+ gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ barebox,default-trigger = "heartbeat";
+ };
+ };
+
+
+ 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>;
+ };
+ };
+
+ gpio-keys {
+ button@0 {
+ gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&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";
+
+ /* Winbond 25Q128FVSG SPI flash */
+ spiflash: w25q128@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "winbond,w25q128", "jedec,spi-nor";
+ spi-max-frequency = <104000000>;
+ reg = <0>;
+ };
+};
+
+&spiflash {
+ partition@0 {
+ label = "barebox";
+ reg = <0 0x80000>;
+ };
+
+ partition@80000 {
+ label = "barebox-environment";
+ reg = <0x80000 0x10000>;
+ };
+
+ spiflash_art: partition@7f0000 {
+ label = "art";
+ reg = <0x7f0000 0x10000>;
+ };
+};
+
+&eth0 {
+ status = "okay";
+};
+
+&eth1 {
+ status = "okay";
+};
diff --git a/arch/mips/mach-ath79/Kconfig b/arch/mips/mach-ath79/Kconfig
index b1b49b0005..97eea6a2a2 100644
--- a/arch/mips/mach-ath79/Kconfig
+++ b/arch/mips/mach-ath79/Kconfig
@@ -33,6 +33,13 @@ config BOARD_DPTECHNICS_DPT_MODULE
select HAVE_IMAGE_COMPRESSION
select HAS_NMON
+config BOARD_OPENEMBEDED_SOM9331
+ bool "OpenEmbed SOM9331"
+ 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