-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARM: Kirkwood: Add basic device tree support for QNAP TS219.
The two different variants of QNAP TS devices, varying by SoC, put the GPIO keys on different GPIO lines. Hence we need two different DT board descriptions, which share the same board-ts219.c file. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Jason Cooper <jason@lakedaemon.net>
- Loading branch information
Andrew Lunn
committed
Jul 27, 2012
1 parent
97b414e
commit 9eb61f4
Showing
9 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/dts-v1/; | ||
|
||
/include/ "kirkwood-ts219.dtsi" | ||
|
||
/ { | ||
gpio_keys { | ||
compatible = "gpio-keys"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
button@1 { | ||
label = "USB Copy"; | ||
linux,code = <133>; | ||
gpios = <&gpio0 15 1>; | ||
}; | ||
button@2 { | ||
label = "Reset"; | ||
linux,code = <0x198>; | ||
gpios = <&gpio0 16 1>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/dts-v1/; | ||
|
||
/include/ "kirkwood-ts219.dtsi" | ||
|
||
/ { | ||
gpio_keys { | ||
compatible = "gpio-keys"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
button@1 { | ||
label = "USB Copy"; | ||
linux,code = <133>; | ||
gpios = <&gpio1 11 1>; | ||
}; | ||
button@2 { | ||
label = "Reset"; | ||
linux,code = <0x198>; | ||
gpios = <&gpio1 5 1>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/include/ "kirkwood.dtsi" | ||
|
||
/ { | ||
model = "QNAP TS219 family"; | ||
compatible = "qnap,ts219", "mrvl,kirkwood"; | ||
|
||
memory { | ||
device_type = "memory"; | ||
reg = <0x00000000 0x20000000>; | ||
}; | ||
|
||
chosen { | ||
bootargs = "console=ttyS0,115200n8"; | ||
}; | ||
|
||
ocp@f1000000 { | ||
i2c@11000 { | ||
status = "okay"; | ||
clock-frequency = <400000>; | ||
|
||
s35390a: s35390a@30 { | ||
compatible = "s35390a"; | ||
reg = <0x30>; | ||
}; | ||
}; | ||
serial@12000 { | ||
clock-frequency = <200000000>; | ||
status = "okay"; | ||
}; | ||
serial@12100 { | ||
clock-frequency = <200000000>; | ||
status = "okay"; | ||
}; | ||
spi@10600 { | ||
status = "okay"; | ||
|
||
m25p128@0 { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
compatible = "m25p128"; | ||
reg = <0>; | ||
spi-max-frequency = <20000000>; | ||
mode = <0>; | ||
|
||
partition@0000000 { | ||
reg = <0x00000000 0x00080000>; | ||
label = "U-Boot"; | ||
}; | ||
|
||
partition@00200000 { | ||
reg = <0x00200000 0x00200000>; | ||
label = "Kernel"; | ||
}; | ||
|
||
partition@00400000 { | ||
reg = <0x00400000 0x00900000>; | ||
label = "RootFS1"; | ||
}; | ||
partition@00d00000 { | ||
reg = <0x00d00000 0x00300000>; | ||
label = "RootFS2"; | ||
}; | ||
partition@00040000 { | ||
reg = <0x00080000 0x00040000>; | ||
label = "U-Boot Config"; | ||
}; | ||
partition@000c0000 { | ||
reg = <0x000c0000 0x00140000>; | ||
label = "NAS Config"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* | ||
* QNAP TS-11x/TS-21x Turbo NAS Board Setup via DT | ||
* | ||
* Copyright (C) 2012 Andrew Lunn <andrew@lunn.ch> | ||
* | ||
* Based on the board file ts219-setup.c: | ||
* | ||
* Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com> | ||
* Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com> | ||
* | ||
* 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 <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/mv643xx_eth.h> | ||
#include <linux/ata_platform.h> | ||
#include <linux/gpio_keys.h> | ||
#include <linux/input.h> | ||
#include <asm/mach-types.h> | ||
#include <asm/mach/arch.h> | ||
#include <mach/kirkwood.h> | ||
#include "common.h" | ||
#include "mpp.h" | ||
#include "tsx1x-common.h" | ||
|
||
static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { | ||
.phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
}; | ||
|
||
static struct mv_sata_platform_data qnap_ts219_sata_data = { | ||
.n_ports = 2, | ||
}; | ||
|
||
static unsigned int qnap_ts219_mpp_config[] __initdata = { | ||
MPP0_SPI_SCn, | ||
MPP1_SPI_MOSI, | ||
MPP2_SPI_SCK, | ||
MPP3_SPI_MISO, | ||
MPP4_SATA1_ACTn, | ||
MPP5_SATA0_ACTn, | ||
MPP8_TW0_SDA, | ||
MPP9_TW0_SCK, | ||
MPP10_UART0_TXD, | ||
MPP11_UART0_RXD, | ||
MPP13_UART1_TXD, /* PIC controller */ | ||
MPP14_UART1_RXD, /* PIC controller */ | ||
MPP15_GPIO, /* USB Copy button (on devices with 88F6281) */ | ||
MPP16_GPIO, /* Reset button (on devices with 88F6281) */ | ||
MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */ | ||
MPP37_GPIO, /* Reset button (on devices with 88F6282) */ | ||
MPP43_GPIO, /* USB Copy button (on devices with 88F6282) */ | ||
MPP44_GPIO, /* Board ID: 0: TS-11x, 1: TS-21x */ | ||
0 | ||
}; | ||
|
||
void __init qnap_dt_ts219_init(void) | ||
{ | ||
u32 dev, rev; | ||
|
||
kirkwood_mpp_conf(qnap_ts219_mpp_config); | ||
|
||
kirkwood_pcie_id(&dev, &rev); | ||
if (dev == MV88F6282_DEV_ID) | ||
qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); | ||
|
||
kirkwood_ge00_init(&qnap_ts219_ge00_data); | ||
kirkwood_sata_init(&qnap_ts219_sata_data); | ||
kirkwood_ehci_init(); | ||
|
||
pm_power_off = qnap_tsx1x_power_off; | ||
} | ||
|
||
/* FIXME: Will not work with DT. Maybe use MPP40_GPIO? */ | ||
static int __init ts219_pci_init(void) | ||
{ | ||
if (machine_is_ts219()) | ||
kirkwood_pcie_init(KW_PCIE0); | ||
|
||
return 0; | ||
} | ||
subsys_initcall(ts219_pci_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters