From f236f5aabe8ebd7824590ae82d701402ead237e7 Mon Sep 17 00:00:00 2001 From: Arnaud Ebalard Date: Tue, 19 Mar 2013 23:28:06 +0100 Subject: ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT Add support for NETGEAR ReadyNAS Duo v2 (Hardware specs available here: http://natisbad.org/NAS/). Almost everything is supported via provided .dts. A board-readynas.c file is nonetheless required for device not only converted to DT (Gbit controller). Signed-off-by: Arnaud Ebalard Tested-By: Arnaud Ebalard Acked-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/Kconfig | 9 +++++++++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/board-dt.c | 4 ++++ arch/arm/mach-kirkwood/board-readynas.c | 28 ++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.h | 6 ++++++ 5 files changed, 48 insertions(+) create mode 100644 arch/arm/mach-kirkwood/board-readynas.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 7b6a64b..3fd07eb 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -194,6 +194,15 @@ config MACH_OPENBLOCKS_A6_DT Say 'Y' here if you want your kernel to support the Plat'Home OpenBlocks A6 (Flattened Device Tree). +config MACH_READYNAS_DT + bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + select ARM_APPENDED_DTB + select ARM_ATAG_DTB_COMPAT + help + Say 'Y' here if you want your kernel to support the + NETGEAR ReadyNAS Duo v2 using Fattened Device Tree. + config MACH_TOPKICK_DT bool "USI Topkick (Flattened Device Tree)" select ARCH_KIRKWOOD_DT diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 4cc4bee..ff0f3cb 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -39,4 +39,5 @@ obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NSA310_DT) += board-nsa310.o obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT) += board-openblocks_a6.o +obj-$(CONFIG_MACH_READYNAS_DT) += board-readynas.o obj-$(CONFIG_MACH_TOPKICK_DT) += board-usi_topkick.o diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index d367aa6..e5a3cfe 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -149,6 +149,9 @@ static void __init kirkwood_dt_init(void) if (of_machine_is_compatible("mpl,cec4")) mplcec4_init(); + if (of_machine_is_compatible("netgear,readynas-duo-v2")) + netgear_readynas_init(); + if (of_machine_is_compatible("plathome,openblocks-a6")) openblocks_a6_init(); @@ -177,6 +180,7 @@ static const char * const kirkwood_dt_board_compat[] = { "lacie,netspace_lite_v2", "lacie,netspace_mini_v2", "mpl,cec4", + "netgear,readynas-duo-v2", "plathome,openblocks-a6", "usi,topkick", "zyxel,nsa310", diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c new file mode 100644 index 0000000..fb42c20 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-readynas.c @@ -0,0 +1,28 @@ +/* + * NETGEAR ReadyNAS Duo v2 Board setup for drivers not already + * converted to DT. + * + * Copyright (C) 2013, Arnaud EBALARD + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include "common.h" + +static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(0), +}; + +void __init netgear_readynas_init(void) +{ + kirkwood_ge00_init(&netgear_readynas_ge00_data); + kirkwood_pcie_init(KW_PCIE0); +} diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 5ed7056..7ee8670 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -141,6 +141,12 @@ void openblocks_a6_init(void); static inline void openblocks_a6_init(void) {}; #endif +#ifdef CONFIG_MACH_READYNAS_DT +void netgear_readynas_init(void); +#else +static inline void netgear_readynas_init(void) {}; +#endif + #ifdef CONFIG_MACH_TOPKICK_DT void usi_topkick_init(void); #else -- cgit v1.1