Skip to content

Commit

Permalink
ARM: SPEAr600: Add device-tree support to SPEAr600 boards
Browse files Browse the repository at this point in the history
This patch adds a generic target for SPEAr600 board that can be
configured via the device-tree. Currently the following devices
are supported via the devicetree:

- VIC interrupts
- PL011 UART
- PL061 GPIO
- Synopsys DW I2C
- Synopsys DW ethernet

Other peripheral devices (e.g. SMI flash, FSMC NAND flash etc) will
follow in later patches.

Only the spear600-evb is currently supported. Other SPEAr600
based boards will follow later.

Since the current mainline SPEAr600 code only supports the SPEAr600
evaluation board, with nearly zero peripheral devices (only UART
and GPIO), it makes sense to switch over to DT based configuration
completely now. So this patch also removes all non-DT stuff, mainly
platform device data. The files spear600.c and spear600_evb.c are
removed completely.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Stefan Roese authored and Arnd Bergmann committed Mar 16, 2012
1 parent fde7d90 commit 9652e8b
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 191 deletions.
8 changes: 8 additions & 0 deletions Documentation/devicetree/bindings/arm/spear.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ST SPEAr Platforms Device Tree Bindings
---------------------------------------

Boards with the ST SPEAr600 SoC shall have the following properties:

Required root node property:

compatible = "st,spear600";
47 changes: 47 additions & 0 deletions arch/arm/boot/dts/spear600-evb.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2012 Stefan Roese <sr@denx.de>
*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/

/dts-v1/;
/include/ "spear600.dtsi"

/ {
model = "ST SPEAr600 Evaluation Board";
compatible = "st,spear600-evb", "st,spear600";
#address-cells = <1>;
#size-cells = <1>;

memory {
device_type = "memory";
reg = <0 0x10000000>;
};

ahb {
gmac: ethernet@e0800000 {
phy-mode = "gmii";
status = "okay";
};

apb {
serial@d0000000 {
status = "okay";
};

serial@d0080000 {
status = "okay";
};

i2c@d0200000 {
clock-frequency = <400000>;
status = "okay";
};
};
};
};
174 changes: 174 additions & 0 deletions arch/arm/boot/dts/spear600.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
/*
* Copyright 2012 Stefan Roese <sr@denx.de>
*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/

/include/ "skeleton.dtsi"

/ {
compatible = "st,spear600";

cpus {
cpu@0 {
compatible = "arm,arm926ejs";
};
};

memory {
device_type = "memory";
reg = <0 0x40000000>;
};

ahb {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges = <0xd0000000 0xd0000000 0x30000000>;

vic0: interrupt-controller@f1100000 {
compatible = "arm,pl190-vic";
interrupt-controller;
reg = <0xf1100000 0x1000>;
#interrupt-cells = <1>;
};

vic1: interrupt-controller@f1000000 {
compatible = "arm,pl190-vic";
interrupt-controller;
reg = <0xf1000000 0x1000>;
#interrupt-cells = <1>;
};

gmac: ethernet@e0800000 {
compatible = "st,spear600-gmac";
reg = <0xe0800000 0x8000>;
interrupt-parent = <&vic1>;
interrupts = <24 23>;
interrupt-names = "macirq", "eth_wake_irq";
status = "disabled";
};

fsmc: flash@d1800000 {
compatible = "st,spear600-fsmc-nand";
#address-cells = <1>;
#size-cells = <1>;
reg = <0xd1800000 0x1000 /* FSMC Register */
0xd2000000 0x4000>; /* NAND Base */
reg-names = "fsmc_regs", "nand_data";
st,ale-off = <0x20000>;
st,cle-off = <0x10000>;
status = "disabled";
};

smi: flash@fc000000 {
compatible = "st,spear600-smi";
#address-cells = <1>;
#size-cells = <1>;
reg = <0xfc000000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <12>;
status = "disabled";
};

ehci@e1800000 {
compatible = "st,spear600-ehci", "usb-ehci";
reg = <0xe1800000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <27>;
status = "disabled";
};

ehci@e2000000 {
compatible = "st,spear600-ehci", "usb-ehci";
reg = <0xe2000000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <29>;
status = "disabled";
};

ohci@e1900000 {
compatible = "st,spear600-ohci", "usb-ohci";
reg = <0xe1900000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <26>;
status = "disabled";
};

ohci@e2100000 {
compatible = "st,spear600-ohci", "usb-ohci";
reg = <0xe2100000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <28>;
status = "disabled";
};

apb {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges = <0xd0000000 0xd0000000 0x30000000>;

serial@d0000000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0xd0000000 0x1000>;
interrupt-parent = <&vic0>;
interrupts = <24>;
status = "disabled";
};

serial@d0080000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0xd0080000 0x1000>;
interrupt-parent = <&vic0>;
interrupts = <25>;
status = "disabled";
};

/* local/cpu GPIO */
gpio0: gpio@f0100000 {
#gpio-cells = <2>;
compatible = "arm,pl061", "arm,primecell";
gpio-controller;
reg = <0xf0100000 0x1000>;
interrupt-parent = <&vic0>;
interrupts = <18>;
};

/* basic GPIO */
gpio1: gpio@fc980000 {
#gpio-cells = <2>;
compatible = "arm,pl061", "arm,primecell";
gpio-controller;
reg = <0xfc980000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <19>;
};

/* appl GPIO */
gpio2: gpio@d8100000 {
#gpio-cells = <2>;
compatible = "arm,pl061", "arm,primecell";
gpio-controller;
reg = <0xd8100000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <4>;
};

i2c@d0200000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,designware-i2c";
reg = <0xd0200000 0x1000>;
interrupt-parent = <&vic0>;
interrupts = <28>;
status = "disabled";
};
};
};
};
7 changes: 4 additions & 3 deletions arch/arm/mach-spear6xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
if ARCH_SPEAR6XX

menu "SPEAr6xx Implementations"
config BOARD_SPEAR600_EVB
bool "SPEAr600 Evaluation Board"
config BOARD_SPEAR600_DT
bool "SPEAr600 generic board configured via device-tree"
select MACH_SPEAR600
select USE_OF
help
Supports ST SPEAr600 Evaluation Board
Supports ST SPEAr600 boards configured via the device-tree

endmenu

Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-spear6xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@

# common files
obj-y += clock.o spear6xx.o

# spear600 specific files
obj-$(CONFIG_MACH_SPEAR600) += spear600.o

# spear600 boards files
obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
14 changes: 7 additions & 7 deletions arch/arm/mach-spear6xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ static struct clk_lookup spear_clk_lookups[] = {
{ .con_id = "gpt0_synth_clk", .clk = &gpt0_synth_clk},
{ .con_id = "gpt2_synth_clk", .clk = &gpt2_synth_clk},
{ .con_id = "gpt3_synth_clk", .clk = &gpt3_synth_clk},
{ .dev_id = "uart0", .clk = &uart0_clk},
{ .dev_id = "uart1", .clk = &uart1_clk},
{ .dev_id = "d0000000.serial", .clk = &uart0_clk},
{ .dev_id = "d0080000.serial", .clk = &uart1_clk},
{ .dev_id = "firda", .clk = &firda_clk},
{ .dev_id = "clcd", .clk = &clcd_clk},
{ .dev_id = "gpt0", .clk = &gpt0_clk},
Expand All @@ -655,20 +655,20 @@ static struct clk_lookup spear_clk_lookups[] = {
{ .con_id = "usbh.1_clk", .clk = &usbh1_clk},
/* clock derived from ahb clk */
{ .con_id = "apb_clk", .clk = &apb_clk},
{ .dev_id = "i2c_designware.0", .clk = &i2c_clk},
{ .dev_id = "d0200000.i2c", .clk = &i2c_clk},
{ .dev_id = "dma", .clk = &dma_clk},
{ .dev_id = "jpeg", .clk = &jpeg_clk},
{ .dev_id = "gmac", .clk = &gmac_clk},
{ .dev_id = "smi", .clk = &smi_clk},
{ .con_id = "fsmc", .clk = &fsmc_clk},
{ .dev_id = "fsmc-nand", .clk = &fsmc_clk},
/* clock derived from apb clk */
{ .dev_id = "adc", .clk = &adc_clk},
{ .dev_id = "ssp-pl022.0", .clk = &ssp0_clk},
{ .dev_id = "ssp-pl022.1", .clk = &ssp1_clk},
{ .dev_id = "ssp-pl022.2", .clk = &ssp2_clk},
{ .dev_id = "gpio0", .clk = &gpio0_clk},
{ .dev_id = "gpio1", .clk = &gpio1_clk},
{ .dev_id = "gpio2", .clk = &gpio2_clk},
{ .dev_id = "f0100000.gpio", .clk = &gpio0_clk},
{ .dev_id = "fc980000.gpio", .clk = &gpio1_clk},
{ .dev_id = "d8100000.gpio", .clk = &gpio2_clk},
};

void __init spear6xx_clk_init(void)
Expand Down
25 changes: 0 additions & 25 deletions arch/arm/mach-spear6xx/spear600.c

This file was deleted.

54 changes: 0 additions & 54 deletions arch/arm/mach-spear6xx/spear600_evb.c

This file was deleted.

Loading

0 comments on commit 9652e8b

Please sign in to comment.