[PATCH] Add initial support for Netgear ReadyNAS 104

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently only second stage booting from the vendor U-Boot is tested. I
don't want to flash barebox into NAND yet because UART-booting for
recovery doesn't work for me.

Working so far are:

 - UART
 - networking
 - nand flash

Signed-off-by: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>
---
 arch/arm/boards/Makefile                   |  1 +
 arch/arm/boards/netgear-rn104/Makefile     |  2 ++
 arch/arm/boards/netgear-rn104/board.c      |  1 +
 arch/arm/boards/netgear-rn104/kwbimage.cfg |  7 +++++++
 arch/arm/boards/netgear-rn104/lowlevel.c   | 22 ++++++++++++++++++++++
 arch/arm/configs/mvebu_defconfig           |  1 +
 arch/arm/dts/Makefile                      |  1 +
 arch/arm/dts/armada-370-rn104-bb.dts       | 11 +++++++++++
 arch/arm/mach-mvebu/Kconfig                |  4 ++++
 images/Makefile.mvebu                      | 11 +++++++++++
 10 files changed, 61 insertions(+)
 create mode 100644 arch/arm/boards/netgear-rn104/Makefile
 create mode 100644 arch/arm/boards/netgear-rn104/board.c
 create mode 100644 arch/arm/boards/netgear-rn104/kwbimage.cfg
 create mode 100644 arch/arm/boards/netgear-rn104/lowlevel.c
 create mode 100644 arch/arm/dts/armada-370-rn104-bb.dts

diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 1029e8f46f3a..5a755c96360b 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -70,6 +70,7 @@ obj-$(CONFIG_MACH_MX23EVK)			+= freescale-mx23-evk/
 obj-$(CONFIG_MACH_MX28EVK)			+= freescale-mx28-evk/
 obj-$(CONFIG_MACH_MX31MOBOARD)			+= mx31moboard/
 obj-$(CONFIG_MACH_NESO)				+= guf-neso/
+obj-$(CONFIG_MACH_NETGEAR_RN104)		+= netgear-rn104/
 obj-$(CONFIG_MACH_NOMADIK_8815NHK)		+= nhk8815/
 obj-$(CONFIG_MACH_NVIDIA_BEAVER)		+= nvidia-beaver/
 obj-$(CONFIG_MACH_NVIDIA_JETSON)		+= nvidia-jetson-tk1/
diff --git a/arch/arm/boards/netgear-rn104/Makefile b/arch/arm/boards/netgear-rn104/Makefile
new file mode 100644
index 000000000000..01c7a259e9a5
--- /dev/null
+++ b/arch/arm/boards/netgear-rn104/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/netgear-rn104/board.c b/arch/arm/boards/netgear-rn104/board.c
new file mode 100644
index 000000000000..40a8c178f10d
--- /dev/null
+++ b/arch/arm/boards/netgear-rn104/board.c
@@ -0,0 +1 @@
+/* empty */
diff --git a/arch/arm/boards/netgear-rn104/kwbimage.cfg b/arch/arm/boards/netgear-rn104/kwbimage.cfg
new file mode 100644
index 000000000000..83a4149053d0
--- /dev/null
+++ b/arch/arm/boards/netgear-rn104/kwbimage.cfg
@@ -0,0 +1,7 @@
+VERSION 1
+BOOT_FROM nand
+DESTADDR 00600000
+EXECADDR 006a0000
+NAND_BLKSZ 00020000
+NAND_BADBLK_LOCATION 01
+BINARY binary.0 0000005b 00000068
diff --git a/arch/arm/boards/netgear-rn104/lowlevel.c b/arch/arm/boards/netgear-rn104/lowlevel.c
new file mode 100644
index 000000000000..f0d6df0da645
--- /dev/null
+++ b/arch/arm/boards/netgear-rn104/lowlevel.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2014  Uwe Kleine-Koenig <uwe@xxxxxxxxxxxxxxxxx>
+ */
+
+#include <common.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/lowlevel.h>
+
+extern char __dtb_armada_370_rn104_bb_start[];
+
+ENTRY_FUNCTION(start_netgear_rn104, r0, r1, r2)
+{
+	void *fdt;
+
+	arm_cpu_lowlevel_init();
+
+	fdt = __dtb_armada_370_rn104_bb_start -
+		get_runtime_offset();
+
+	mvebu_barebox_entry(fdt);
+}
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig
index 6d1b021768df..39372fd93b5d 100644
--- a/arch/arm/configs/mvebu_defconfig
+++ b/arch/arm/configs/mvebu_defconfig
@@ -1,5 +1,6 @@
 CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_GLOBALSCALE_MIRABOX=y
+CONFIG_MACH_NETGEAR_RN104=y
 CONFIG_MACH_LENOVO_IX4_300D=y
 CONFIG_MACH_MARVELL_ARMADA_XP_GP=y
 CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2da930eb9108..d85c23768e22 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -28,6 +28,7 @@ pbl-dtb-$(CONFIG_MACH_GUF_VINCELL) += imx53-guf-vincell.dtb.o imx53-guf-vincell-
 pbl-dtb-$(CONFIG_MACH_GW_VENTANA) += imx6q-gw54xx.dtb.o
 pbl-dtb-$(CONFIG_MACH_LENOVO_IX4_300D) += armada-xp-lenovo-ix4-300d-bb.dtb.o
 pbl-dtb-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += armada-xp-gp-bb.dtb.o
+pbl-dtb-$(CONFIG_MACH_NETGEAR_RN104) += armada-370-rn104-bb.dtb.o
 pbl-dtb-$(CONFIG_MACH_NITROGEN6X) += imx6q-nitrogen6x.dtb.o imx6dl-nitrogen6x.dtb.o
 pbl-dtb-$(CONFIG_MACH_NVIDIA_BEAVER) += tegra30-beaver.dtb.o
 pbl-dtb-$(CONFIG_MACH_NVIDIA_JETSON) += tegra124-jetson-tk1.dtb.o
diff --git a/arch/arm/dts/armada-370-rn104-bb.dts b/arch/arm/dts/armada-370-rn104-bb.dts
new file mode 100644
index 000000000000..32f961e5292e
--- /dev/null
+++ b/arch/arm/dts/armada-370-rn104-bb.dts
@@ -0,0 +1,11 @@
+/*
+ * Barebox specific DT overlay for Netgear ReadyNAS 104
+ */
+
+#include "arm/armada-370-netgear-rn104.dts"
+
+/ {
+	chosen {
+		stdout-path = "/soc/internal-regs/serial@12000";
+	};
+};
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 5e96f16e8cf4..79fcc8d3ac36 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -37,6 +37,10 @@ config MACH_GLOBALSCALE_MIRABOX
 	bool "Globalscale Mirabox"
 	select ARCH_ARMADA_370
 
+config MACH_NETGEAR_RN104
+	bool "Netgear ReadyNAS 104"
+	select ARCH_ARMADA_370
+
 #
 # Armada XP SoC boards
 #
diff --git a/images/Makefile.mvebu b/images/Makefile.mvebu
index 0325f9961594..195f48d47073 100644
--- a/images/Makefile.mvebu
+++ b/images/Makefile.mvebu
@@ -23,6 +23,17 @@ image-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += barebox-globalscale-mirabox.img
 image-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += barebox-globalscale-mirabox-uart.img
 image-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += barebox-globalscale-mirabox-2nd.img
 
+NETGEAR_RN104_KWBOPTS = ${KWBOPTS} -i $(board)/netgear-rn104/kwbimage.cfg
+OPTS_start_netgear_rn104.pblx.kwbimg = $(NETGEAR_RN104_KWBOPTS)
+OPTS_start_netgear_rn104.pblx.kwbuartimg = -m uart $(NETGEAR_RN104_KWBOPTS)
+FILE_barebox-netgear-rn104.img	= start_netgear_rn104.pblx.kwbimg
+FILE_barebox-netgear-rn104-uart.img = start_netgear_rn104.pblx.kwbuartimg
+FILE_barebox-netgear-rn104-2nd.img = start_netgear_rn104.pblx
+pblx-$(CONFIG_MACH_NETGEAR_RN104) += start_netgear_rn104
+image-$(CONFIG_MACH_NETGEAR_RN104) += barebox-netgear-rn104.img
+image-$(CONFIG_MACH_NETGEAR_RN104) += barebox-netgear-rn104-uart.img
+image-$(CONFIG_MACH_NETGEAR_RN104) += barebox-netgear-rn104-2nd.img
+
 # ----------------------- Armada XP based boards ---------------------------
 LENOVO_IX4_300D_KWBOPTS = ${KWBOPTS} -i $(board)/lenovo-ix4-300d/kwbimage.cfg
 OPTS_start_lenovo_ix4_300d.pblx.kwbimg = $(LENOVO_IX4_300D_KWBOPTS)
-- 
2.7.0.rc3


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux