Commit 66f03c61 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull "ARM: device tree work" from Arnd Bergmann:
 "Most of these patches convert code from using static platform data to
  describing the hardware in the device tree.  This is only the first
  half of the changes for v3.4 because a lot of patches for this topic
  came in the last week before the merge window.

  Signed-off-by: Arnd Bergmann <arnd@arndb.de>"

Fix up trivial conflicts in arch/arm/mach-vexpress/{Kconfig,core.h}

* tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (86 commits)
  Document: devicetree: add OF documents for arch-mmp
  ARM: dts: append DTS file of pxa168
  ARM: mmp: append OF support on pxa168
  ARM: mmp: enable rtc clk in pxa168
  i2c: pxa: add OF support
  serial: pxa: add OF support
  arm/dts: mt_ventoux: very basic support for TeeJet Mt.Ventoux board
  ARM: OMAP2+: Remove extra ifdefs for board-generic
  ARM: OMAP2+: Fix build error when only ARCH_OMAP2/3 or 4 is selected
  ASoC: DT: Add digital microphone binding to PAZ00 board.
  ARM: dt: Add ARM PMU to tegra*.dtsi
  ARM: at91: at91sam9x5cm/dt: add leds support
  ARM: at91: usb_a9g20/dt: add gpio-keys support
  ARM: at91: at91sam9m10g45ek/dt: add gpio-keys support
  ARM: at91: at91sam9m10g45ek/dt: add leds support
  ARM: at91: usb_a9g20/dt: add leds support
  ARM: at91/pio: add new PIO3 features
  ARM: at91: add sam9_smc.o to at91sam9x5 build
  ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter
  ARM: at91/tc: add device tree support to atmel_tclib
  ...
parents 34800598 cdc3df6f
* Advanced Interrupt Controller (AIC)
Required properties:
- compatible: Should be "atmel,<chip>-aic"
- interrupt-controller: Identifies the node as an interrupt controller.
- interrupt-parent: For single AIC system, it is an empty property.
- #interrupt-cells: The number of cells to define the interrupts. It sould be 2.
The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet).
The second cell is used to specify flags:
bits[3:0] trigger type and level flags:
1 = low-to-high edge triggered.
2 = high-to-low edge triggered.
4 = active high level-sensitive.
8 = active low level-sensitive.
Valid combinations are 1, 2, 3, 4, 8.
Default flag for internal sources should be set to 4 (active high).
- reg: Should contain AIC registers location and length
Examples:
/*
* AIC
*/
aic: interrupt-controller@fffff000 {
compatible = "atmel,at91rm9200-aic";
interrupt-controller;
interrupt-parent;
#interrupt-cells = <2>;
reg = <0xfffff000 0x200>;
};
/*
* An interrupt generating device that is wired to an AIC.
*/
dma: dma-controller@ffffec00 {
compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>;
interrupts = <21 4>;
};
Atmel AT91 device tree bindings.
================================
PIT Timer required properties:
- compatible: Should be "atmel,at91sam9260-pit"
- reg: Should contain registers location and length
- interrupts: Should contain interrupt for the PIT which is the IRQ line
shared across all System Controller members.
TC/TCLIB Timer required properties:
- compatible: Should be "atmel,<chip>-pit".
<chip> can be "at91rm9200" or "at91sam9x5"
- reg: Should contain registers location and length
- interrupts: Should contain all interrupts for the TC block
Note that you can specify several interrupt cells if the TC
block has one interrupt per channel.
Examples:
One interrupt per TC block:
tcb0: timer@fff7c000 {
compatible = "atmel,at91rm9200-tcb";
reg = <0xfff7c000 0x100>;
interrupts = <18 4>;
};
One interrupt per TC channel in a TC block:
tcb1: timer@fffdc000 {
compatible = "atmel,at91rm9200-tcb";
reg = <0xfffdc000 0x100>;
interrupts = <26 4 27 4 28 4>;
};
...@@ -28,3 +28,25 @@ Required root node properties: ...@@ -28,3 +28,25 @@ Required root node properties:
i.MX6 Quad SABRE Lite Board i.MX6 Quad SABRE Lite Board
Required root node properties: Required root node properties:
- compatible = "fsl,imx6q-sabrelite", "fsl,imx6q"; - compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
Generic i.MX boards
-------------------
No iomux setup is done for these boards, so this must have been configured
by the bootloader for boards to work with the generic bindings.
i.MX27 generic board
Required root node properties:
- compatible = "fsl,imx27";
i.MX51 generic board
Required root node properties:
- compatible = "fsl,imx51";
i.MX53 generic board
Required root node properties:
- compatible = "fsl,imx53";
i.MX6q generic board
Required root node properties:
- compatible = "fsl,imx6q";
Marvell Platforms Device Tree Bindings
----------------------------------------------------
PXA168 Aspenite Board
Required root node properties:
- compatible = "mrvl,pxa168-aspenite", "mrvl,pxa168";
* OMAP Interrupt Controller
OMAP2/3 are using a TI interrupt controller that can support several
configurable number of interrupts.
Main node required properties:
- compatible : should be:
"ti,omap2-intc"
- interrupt-controller : Identifies the node as an interrupt controller
- #interrupt-cells : Specifies the number of cells needed to encode an
interrupt source. The type shall be a <u32> and the value shall be 1.
The cell contains the interrupt number in the range [0-128].
- ti,intc-size: Number of interrupts handled by the interrupt controller.
- reg: physical base address and size of the intc registers map.
Example:
intc: interrupt-controller@1 {
compatible = "ti,omap2-intc";
interrupt-controller;
#interrupt-cells = <1>;
ti,intc-size = <96>;
reg = <0x48200000 0x1000>;
};
ARM Versatile Express boards family
-----------------------------------
ARM's Versatile Express platform consists of a motherboard and one
or more daughterboards (tiles). The motherboard provides a set of
peripherals. Processor and RAM "live" on the tiles.
The motherboard and each core tile should be described by a separate
Device Tree source file, with the tile's description including
the motherboard file using a /include/ directive. As the motherboard
can be initialized in one of two different configurations ("memory
maps"), care must be taken to include the correct one.
Required properties in the root node:
- compatible value:
compatible = "arm,vexpress,<model>", "arm,vexpress";
where <model> is the full tile model name (as used in the tile's
Technical Reference Manual), eg.:
- for Coretile Express A5x2 (V2P-CA5s):
compatible = "arm,vexpress,v2p-ca5s", "arm,vexpress";
- for Coretile Express A9x4 (V2P-CA9):
compatible = "arm,vexpress,v2p-ca9", "arm,vexpress";
If a tile comes in several variants or can be used in more then one
configuration, the compatible value should be:
compatible = "arm,vexpress,<model>,<variant>", \
"arm,vexpress,<model>", "arm,vexpress";
eg:
- Coretile Express A15x2 (V2P-CA15) with Tech Chip 1:
compatible = "arm,vexpress,v2p-ca15,tc1", \
"arm,vexpress,v2p-ca15", "arm,vexpress";
- LogicTile Express 13MG (V2F-2XV6) running Cortex-A7 (3 cores) SMM:
compatible = "arm,vexpress,v2f-2xv6,ca7x3", \
"arm,vexpress,v2f-2xv6", "arm,vexpress";
Optional properties in the root node:
- tile model name (use name from the tile's Technical Reference
Manual, eg. "V2P-CA5s")
model = "<model>";
- tile's HBI number (unique ARM's board model ID, visible on the
PCB's silkscreen) in hexadecimal transcription:
arm,hbi = <0xhbi>
eg:
- for Coretile Express A5x2 (V2P-CA5s) HBI-0191:
arm,hbi = <0x191>;
- Coretile Express A9x4 (V2P-CA9) HBI-0225:
arm,hbi = <0x225>;
Top-level standard "cpus" node is required. It must contain a node
with device_type = "cpu" property for every available core, eg.:
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a5";
reg = <0>;
};
};
The motherboard description file provides a single "motherboard" node
using 2 address cells corresponding to the Static Memory Bus used
between the motherboard and the tile. The first cell defines the Chip
Select (CS) line number, the second cell address offset within the CS.
All interrupt lines between the motherboard and the tile are active
high and are described using single cell.
Optional properties of the "motherboard" node:
- motherboard's memory map variant:
arm,v2m-memory-map = "<name>";
where name is one of:
- "rs1" - for RS1 map (i.a. peripherals on CS3); this map is also
referred to as "ARM Cortex-A Series memory map":
arm,v2m-memory-map = "rs1";
When this property is missing, the motherboard is using the original
memory map (also known as the "Legacy memory map", primarily used
with the original CoreTile Express A9x4) with peripherals on CS7.
Motherboard .dtsi files provide a set of labelled peripherals that
can be used to obtain required phandle in the tile's "aliases" node:
- UARTs, note that the numbers correspond to the physical connectors
on the motherboard's back panel:
v2m_serial0, v2m_serial1, v2m_serial2 and v2m_serial3
- I2C controllers:
v2m_i2c_dvi and v2m_i2c_pcie
- SP804 timers:
v2m_timer01 and v2m_timer23
Current Linux implementation requires a "arm,v2m_timer" alias
pointing at one of the motherboard's SP804 timers, if it is to be
used as the system timer. This alias should be defined in the
motherboard files.
The tile description must define "ranges", "interrupt-map-mask" and
"interrupt-map" properties to translate the motherboard's address
and interrupt space into one used by the tile's processor.
Abbreviated example:
/dts-v1/;
/ {
model = "V2P-CA5s";
arm,hbi = <0x225>;
compatible = "arm,vexpress-v2p-ca5s", "arm,vexpress";
interrupt-parent = <&gic>;
#address-cells = <1>;
#size-cells = <1>;
chosen { };
aliases {
serial0 = &v2m_serial0;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a5";
reg = <0>;
};
};
gic: interrupt-controller@2c001000 {
compatible = "arm,cortex-a9-gic";
#interrupt-cells = <3>;
#address-cells = <0>;
interrupt-controller;
reg = <0x2c001000 0x1000>,
<0x2c000100 0x100>;
};
motherboard {
/* CS0 is visible at 0x08000000 */
ranges = <0 0 0x08000000 0x04000000>;
interrupt-map-mask = <0 0 63>;
/* Active high IRQ 0 is connected to GIC's SPI0 */
interrupt-map = <0 0 0 &gic 0 0 4>;
};
};
/include/ "vexpress-v2m-rs1.dtsi"
* Atmel GPIO controller (PIO)
Required properties:
- compatible: "atmel,<chip>-gpio", where <chip> is at91rm9200 or at91sam9x5.
- reg: Should contain GPIO controller registers location and length
- interrupts: Should be the port interrupt shared by all the pins.
- #gpio-cells: Should be two. The first cell is the pin number and
the second cell is used to specify optional parameters (currently
unused).
- gpio-controller: Marks the device node as a GPIO controller.
Example:
pioA: gpio@fffff200 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff200 0x100>;
interrupts = <2 4>;
#gpio-cells = <2>;
gpio-controller;
};
* Marvell PXA GPIO controller
Required properties:
- compatible : Should be "mrvl,pxa-gpio" or "mrvl,mmp-gpio"
- reg : Address and length of the register set for the device
- interrupts : Should be the port interrupt shared by all gpio pins, if
- interrupt-name : Should be the name of irq resource.
one number.
- gpio-controller : Marks the device node as a gpio controller.
- #gpio-cells : Should be one. It is the pin number.
Example:
gpio: gpio@d4019000 {
compatible = "mrvl,mmp-gpio", "mrvl,pxa-gpio";
reg = <0xd4019000 0x1000>;
interrupts = <49>, <17>, <18>;
interrupt-name = "gpio_mux", "gpio0", "gpio1";
gpio-controller;
#gpio-cells = <1>;
interrupt-controller;
#interrupt-cells = <1>;
};
* I2C
Required properties :
- reg : Offset and length of the register set for the device
- compatible : should be "mrvl,mmp-twsi" where CHIP is the name of a
compatible processor, e.g. pxa168, pxa910, mmp2, mmp3.
For the pxa2xx/pxa3xx, an additional node "mrvl,pxa-i2c" is required
as shown in the example below.
Recommended properties :
- interrupts : <a b> where a is the interrupt number and b is a
field that represents an encoding of the sense and level
information for the interrupt. This should be encoded based on
the information in section 2) depending on the type of interrupt
controller you have.
- interrupt-parent : the phandle for the interrupt controller that
services interrupts for this device.
- mrvl,i2c-polling : Disable interrupt of i2c controller. Polling
status register of i2c controller instead.
- mrvl,i2c-fast-mode : Enable fast mode of i2c controller.
Examples:
twsi1: i2c@d4011000 {
compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c";
reg = <0xd4011000 0x1000>;
interrupts = <7>;
mrvl,i2c-fast-mode;
};
twsi2: i2c@d4025000 {
compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c";
reg = <0xd4025000 0x1000>;
interrupts = <58>;
};
* Marvell Real Time Clock controller
Required properties:
- compatible: should be "mrvl,sa1100-rtc"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: Should be two. The first interrupt number is the rtc alarm
interrupt and the second interrupt number is the rtc hz interrupt.
- interrupt-names: Assign name of irq resource.
Example:
rtc: rtc@d4010000 {
compatible = "mrvl,mmp-rtc";
reg = <0xd4010000 0x1000>;
interrupts = <5>, <6>;
interrupt-name = "rtc 1Hz", "rtc alarm";
};
PXA UART controller
Required properties:
- compatible : should be "mrvl,mmp-uart" or "mrvl,pxa-uart".
...@@ -325,6 +325,7 @@ config ARCH_AT91 ...@@ -325,6 +325,7 @@ config ARCH_AT91
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select HAVE_CLK select HAVE_CLK
select CLKDEV_LOOKUP select CLKDEV_LOOKUP
select IRQ_DOMAIN
help help
This enables support for systems based on the Atmel AT91RM9200, This enables support for systems based on the Atmel AT91RM9200,
AT91SAM9 processors. AT91SAM9 processors.
......
/*
* Copyright (C) 2011 Ilya Yanok, EmCraft Systems
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/include/ "omap3.dtsi"
/ {
model = "TeeJet Mt.Ventoux";
compatible = "teejet,mt_ventoux", "ti,omap3";
memory {
device_type = "memory";
reg = <0x80000000 0x10000000>; /* 256 MB */
};
/* AM35xx doesn't have IVA */
soc {
iva {
status = "disabled";
};
};
};
...@@ -23,6 +23,11 @@ aliases { ...@@ -23,6 +23,11 @@ aliases {
serial4 = &usart3; serial4 = &usart3;
serial5 = &usart4; serial5 = &usart4;
serial6 = &usart5; serial6 = &usart5;
gpio0 = &pioA;
gpio1 = &pioB;
gpio2 = &pioC;
tcb0 = &tcb0;
tcb1 = &tcb1;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
...@@ -47,24 +52,69 @@ apb { ...@@ -47,24 +52,69 @@ apb {
ranges; ranges;
aic: interrupt-controller@fffff000 { aic: interrupt-controller@fffff000 {
#interrupt-cells = <1>; #interrupt-cells = <2>;
compatible = "atmel,at91rm9200-aic"; compatible = "atmel,at91rm9200-aic";
interrupt-controller; interrupt-controller;
interrupt-parent; interrupt-parent;
reg = <0xfffff000 0x200>; reg = <0xfffff000 0x200>;
}; };
pit: timer@fffffd30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffd30 0xf>;
interrupts = <1 4>;
};
tcb0: timer@fffa0000 {
compatible = "atmel,at91rm9200-tcb";
reg = <0xfffa0000 0x100>;
interrupts = <17 4 18 4 19 4>;
};
tcb1: timer@fffdc000 {
compatible = "atmel,at91rm9200-tcb";
reg = <0xfffdc000 0x100>;
interrupts = <26 4 27 4 28 4>;
};
pioA: gpio@fffff400 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff400 0x100>;
interrupts = <2 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};
pioB: gpio@fffff600 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff600 0x100>;
interrupts = <3 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};
pioC: gpio@fffff800 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff800 0x100>;
interrupts = <4 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};
dbgu: serial@fffff200 { dbgu: serial@fffff200 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfffff200 0x200>; reg = <0xfffff200 0x200>;
interrupts = <1>; interrupts = <1 4>;
status = "disabled"; status = "disabled";
}; };
usart0: serial@fffb0000 { usart0: serial@fffb0000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfffb0000 0x200>; reg = <0xfffb0000 0x200>;
interrupts = <6>; interrupts = <6 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -73,7 +123,7 @@ usart0: serial@fffb0000 { ...@@ -73,7 +123,7 @@ usart0: serial@fffb0000 {
usart1: serial@fffb4000 { usart1: serial@fffb4000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfffb4000 0x200>; reg = <0xfffb4000 0x200>;
interrupts = <7>; interrupts = <7 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -82,7 +132,7 @@ usart1: serial@fffb4000 { ...@@ -82,7 +132,7 @@ usart1: serial@fffb4000 {
usart2: serial@fffb8000 { usart2: serial@fffb8000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfffb8000 0x200>; reg = <0xfffb8000 0x200>;
interrupts = <8>; interrupts = <8 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -91,7 +141,7 @@ usart2: serial@fffb8000 { ...@@ -91,7 +141,7 @@ usart2: serial@fffb8000 {
usart3: serial@fffd0000 { usart3: serial@fffd0000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfffd0000 0x200>; reg = <0xfffd0000 0x200>;
interrupts = <23>; interrupts = <23 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -100,7 +150,7 @@ usart3: serial@fffd0000 { ...@@ -100,7 +150,7 @@ usart3: serial@fffd0000 {
usart4: serial@fffd4000 { usart4: serial@fffd4000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfffd4000 0x200>; reg = <0xfffd4000 0x200>;
interrupts = <24>; interrupts = <24 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -109,7 +159,7 @@ usart4: serial@fffd4000 { ...@@ -109,7 +159,7 @@ usart4: serial@fffd4000 {
usart5: serial@fffd8000 { usart5: serial@fffd8000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfffd8000 0x200>; reg = <0xfffd8000 0x200>;
interrupts = <25>; interrupts = <25 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -118,7 +168,7 @@ usart5: serial@fffd8000 { ...@@ -118,7 +168,7 @@ usart5: serial@fffd8000 {
macb0: ethernet@fffc4000 { macb0: ethernet@fffc4000 {
compatible = "cdns,at32ap7000-macb", "cdns,macb"; compatible = "cdns,at32ap7000-macb", "cdns,macb";
reg = <0xfffc4000 0x100>; reg = <0xfffc4000 0x100>;
interrupts = <21>; interrupts = <21 4>;
status = "disabled"; status = "disabled";
}; };
}; };
......
...@@ -22,6 +22,13 @@ aliases { ...@@ -22,6 +22,13 @@ aliases {
serial2 = &usart1; serial2 = &usart1;
serial3 = &usart2; serial3 = &usart2;
serial4 = &usart3; serial4 = &usart3;
gpio0 = &pioA;
gpio1 = &pioB;
gpio2 = &pioC;
gpio3 = &pioD;
gpio4 = &pioE;
tcb0 = &tcb0;
tcb1 = &tcb1;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
...@@ -46,30 +53,94 @@ apb { ...@@ -46,30 +53,94 @@ apb {
ranges; ranges;
aic: interrupt-controller@fffff000 { aic: interrupt-controller@fffff000 {
#interrupt-cells = <1>; #interrupt-cells = <2>;
compatible = "atmel,at91rm9200-aic"; compatible = "atmel,at91rm9200-aic";
interrupt-controller; interrupt-controller;
interrupt-parent; interrupt-parent;
reg = <0xfffff000 0x200>; reg = <0xfffff000 0x200>;
}; };
pit: timer@fffffd30 {
compatible = "atmel,at91sam9260-pit";
reg = <0xfffffd30 0xf>;
interrupts = <1 4>;
};
tcb0: timer@fff7c000 {
compatible = "atmel,at91rm9200-tcb";
reg = <0xfff7c000 0x100>;
interrupts = <18 4>;
};
tcb1: timer@fffd4000 {
compatible = "atmel,at91rm9200-tcb";
reg = <0xfffd4000 0x100>;
interrupts = <18 4>;
};
dma: dma-controller@ffffec00 { dma: dma-controller@ffffec00 {
compatible = "atmel,at91sam9g45-dma"; compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>; reg = <0xffffec00 0x200>;
interrupts = <21>; interrupts = <21 4>;
};
pioA: gpio@fffff200 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff200 0x100>;
interrupts = <2 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};
pioB: gpio@fffff400 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff400 0x100>;
interrupts = <3 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};
pioC: gpio@fffff600 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff600 0x100>;
interrupts = <4 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};
pioD: gpio@fffff800 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff800 0x100>;
interrupts = <5 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};
pioE: gpio@fffffa00 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffffa00 0x100>;
interrupts = <5 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
}; };
dbgu: serial@ffffee00 { dbgu: serial@ffffee00 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xffffee00 0x200>; reg = <0xffffee00 0x200>;
interrupts = <1>; interrupts = <1 4>;
status = "disabled"; status = "disabled";
}; };
usart0: serial@fff8c000 { usart0: serial@fff8c000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfff8c000 0x200>; reg = <0xfff8c000 0x200>;
interrupts = <7>; interrupts = <7 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -78,7 +149,7 @@ usart0: serial@fff8c000 { ...@@ -78,7 +149,7 @@ usart0: serial@fff8c000 {
usart1: serial@fff90000 { usart1: serial@fff90000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfff90000 0x200>; reg = <0xfff90000 0x200>;
interrupts = <8>; interrupts = <8 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -87,7 +158,7 @@ usart1: serial@fff90000 { ...@@ -87,7 +158,7 @@ usart1: serial@fff90000 {
usart2: serial@fff94000 { usart2: serial@fff94000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfff94000 0x200>; reg = <0xfff94000 0x200>;
interrupts = <9>; interrupts = <9 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -96,7 +167,7 @@ usart2: serial@fff94000 { ...@@ -96,7 +167,7 @@ usart2: serial@fff94000 {
usart3: serial@fff98000 { usart3: serial@fff98000 {
compatible = "atmel,at91sam9260-usart"; compatible = "atmel,at91sam9260-usart";
reg = <0xfff98000 0x200>; reg = <0xfff98000 0x200>;
interrupts = <10>; interrupts = <10 4>;
atmel,use-dma-rx; atmel,use-dma-rx;
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
...@@ -105,7 +176,7 @@ usart3: serial@fff98000 { ...@@ -105,7 +176,7 @@ usart3: serial@fff98000 {
macb0: ethernet@fffbc000 { macb0: ethernet@fffbc000 {
compatible = "cdns,at32ap7000-macb", "cdns,macb"; compatible = "cdns,at32ap7000-macb", "cdns,macb";
reg = <0xfffbc000 0x100>; reg = <0xfffbc000 0x100>;
interrupts = <25>; interrupts = <25 4>;
status = "disabled"; status = "disabled";
}; };
}; };
......
...@@ -37,4 +37,76 @@ macb0: ethernet@fffbc000 { ...@@ -37,4 +37,76 @@ macb0: ethernet@fffbc000 {
}; };
}; };
}; };
leds {
compatible = "gpio-leds";
d8 {
label = "d8";
gpios = <&pioD 30 0>;
linux,default-trigger = "heartbeat";
};
d6 {
label = "d6";
gpios = <&pioD 0 1>;
linux,default-trigger = "nand-disk";
};
d7 {
label = "d7";
gpios = <&pioD 31 1>;
linux,default-trigger = "mmc0";
};
};
gpio_keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
left_click {
label = "left_click";
gpios = <&pioB 6 1>;
linux,code = <272>;
gpio-key,wakeup;
};
right_click {
label = "right_click";
gpios = <&pioB 7 1>;
linux,code = <273>;
gpio-key,wakeup;
};
left {
label = "Joystick Left";
gpios = <&pioB 14 1>;
linux,code = <105>;
};
right {
label = "Joystick Right";
gpios = <&pioB 15 1>;
linux,code = <106>;
};
up {
label = "Joystick Up";
gpios = <&pioB 16 1>;
linux,code = <103>;
};
down {
label = "Joystick Down";
gpios = <&pioB 17 1>;
linux,code = <108>;
};
enter {
label = "Joystick Press";
gpios = <&pioB 18 1>;
linux,code = <28>;
};
};
}; };
...@@ -89,35 +89,39 @@ dma1: dma-controller@ffffee00 { ...@@ -89,35 +89,39 @@ dma1: dma-controller@ffffee00 {
}; };
pioA: gpio@fffff400 { pioA: gpio@fffff400 {
compatible = "atmel,at91rm9200-gpio"; compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
reg = <0xfffff400 0x100>; reg = <0xfffff400 0x100>;
interrupts = <2 4>; interrupts = <2 4>;
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
interrupt-controller;
}; };
pioB: gpio@fffff600 { pioB: gpio@fffff600 {
compatible = "atmel,at91rm9200-gpio"; compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
reg = <0xfffff600 0x100>; reg = <0xfffff600 0x100>;
interrupts = <2 4>; interrupts = <2 4>;
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
interrupt-controller;
}; };
pioC: gpio@fffff800 { pioC: gpio@fffff800 {
compatible = "atmel,at91rm9200-gpio"; compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
reg = <0xfffff800 0x100>; reg = <0xfffff800 0x100>;
interrupts = <3 4>; interrupts = <3 4>;
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
interrupt-controller;
}; };
pioD: gpio@fffffa00 { pioD: gpio@fffffa00 {
compatible = "atmel,at91rm9200-gpio"; compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
reg = <0xfffffa00 0x100>; reg = <0xfffffa00 0x100>;
interrupts = <3 4>; interrupts = <3 4>;
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
interrupt-controller;
}; };
dbgu: serial@fffff200 { dbgu: serial@fffff200 {
......
...@@ -11,4 +11,19 @@ / { ...@@ -11,4 +11,19 @@ / {
memory@20000000 { memory@20000000 {
reg = <0x20000000 0x8000000>; reg = <0x20000000 0x8000000>;
}; };
leds {
compatible = "gpio-leds";
pb18 {
label = "pb18";
gpios = <&pioB 18 1>;
linux,default-trigger = "heartbeat";
};
pd21 {
label = "pd21";
gpios = <&pioD 21 0>;
};
};
}; };
/*
* Copyright 2012 Sascha Hauer, Pengutronix
*
* 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/ "imx27.dtsi"
/ {
model = "Phytec pcm038";
compatible = "phytec,imx27-pcm038", "fsl,imx27";
memory {
reg = <0x0 0x0>;
};
soc {
aipi@10000000 { /* aipi */
wdog@10002000 {
status = "okay";
};
uart@1000a000 {
fsl,uart-has-rtscts;
status = "okay";
};
uart@1000b000 {
fsl,uart-has-rtscts;
status = "okay";
};
uart@1000c000 {
fsl,uart-has-rtscts;
status = "okay";
};
fec@1002b000 {
status = "okay";
};
i2c@1001d000 {
clock-frequency = <400000>;
status = "okay";
at24@4c {
compatible = "at,24c32";
pagesize = <32>;
reg = <0x52>;
};
pcf8563@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
};
lm75@4a {
compatible = "national,lm75";
reg = <0x4a>;
};
};
};
};
nor_flash@c0000000 {
compatible = "cfi-flash";
bank-width = <2>;
reg = <0xc0000000 0x02000000>;
#address-cells = <1>;
#size-cells = <1>;
};
};
/*
* Copyright 2012 Sascha Hauer, Pengutronix
*
* 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"
/ {
aliases {
serial0 = &uart1;
serial1 = &uart2;
serial2 = &uart3;
serial3 = &uart4;
serial4 = &uart5;
serial5 = &uart6;
};
avic: avic-interrupt-controller@e0000000 {
compatible = "fsl,imx27-avic", "fsl,avic";
interrupt-controller;
#interrupt-cells = <1>;
reg = <0x10040000 0x1000>;
};
clocks {
#address-cells = <1>;
#size-cells = <0>;
osc26m {
compatible = "fsl,imx-osc26m", "fixed-clock";
clock-frequency = <26000000>;
};
};
soc {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
interrupt-parent = <&avic>;
ranges;
aipi@10000000 { /* AIPI1 */
compatible = "fsl,aipi-bus", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x10000000 0x10000000>;
ranges;
wdog@10002000 {
compatible = "fsl,imx27-wdt", "fsl,imx21-wdt";
reg = <0x10002000 0x4000>;
interrupts = <27>;
status = "disabled";
};
uart1: uart@1000a000 {
compatible = "fsl,imx27-uart", "fsl,imx21-uart";
reg = <0x1000a000 0x1000>;
interrupts = <20>;
status = "disabled";
};
uart2: uart@1000b000 {
compatible = "fsl,imx27-uart", "fsl,imx21-uart";
reg = <0x1000b000 0x1000>;
interrupts = <19>;
status = "disabled";
};
uart3: uart@1000c000 {
compatible = "fsl,imx27-uart", "fsl,imx21-uart";
reg = <0x1000c000 0x1000>;
interrupts = <18>;
status = "disabled";
};
uart4: uart@1000d000 {
compatible = "fsl,imx27-uart", "fsl,imx21-uart";
reg = <0x1000d000 0x1000>;
interrupts = <17>;
status = "disabled";
};
cspi1: cspi@1000e000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,imx27-cspi";
reg = <0x1000e000 0x1000>;
interrupts = <16>;
status = "disabled";
};
cspi2: cspi@1000f000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,imx27-cspi";
reg = <0x1000f000 0x1000>;
interrupts = <15>;
status = "disabled";
};
i2c1: i2c@10012000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,imx27-i2c", "fsl,imx1-i2c";
reg = <0x10012000 0x1000>;
interrupts = <12>;
status = "disabled";
};
gpio1: gpio@10015000 {
compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
reg = <0x10015000 0x100>;
interrupts = <8>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <1>;
};
gpio2: gpio@10015100 {
compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
reg = <0x10015100 0x100>;
interrupts = <8>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <1>;
};
gpio3: gpio@10015200 {
compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
reg = <0x10015200 0x100>;
interrupts = <8>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <1>;
};
gpio4: gpio@10015300 {
compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
reg = <0x10015300 0x100>;
interrupts = <8>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <1>;
};
gpio5: gpio@10015400 {
compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
reg = <0x10015400 0x100>;
interrupts = <8>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <1>;
};
gpio6: gpio@10015500 {
compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
reg = <0x10015500 0x100>;
interrupts = <8>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <1>;
};
cspi3: cspi@10017000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,imx27-cspi";
reg = <0x10017000 0x1000>;
interrupts = <6>;
status = "disabled";
};
uart5: uart@1001b000 {
compatible = "fsl,imx27-uart", "fsl,imx21-uart";
reg = <0x1001b000 0x1000>;
interrupts = <49>;
status = "disabled";
};
uart6: uart@1001c000 {
compatible = "fsl,imx27-uart", "fsl,imx21-uart";
reg = <0x1001c000 0x1000>;
interrupts = <48>;
status = "disabled";
};
i2c2: i2c@1001d000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,imx27-i2c", "fsl,imx1-i2c";
reg = <0x1001d000 0x1000>;
interrupts = <1>;
status = "disabled";
};
fec: fec@1002b000 {
compatible = "fsl,imx27-fec";
reg = <0x1002b000 0x4000>;
interrupts = <50>;
status = "disabled";
};
};
};
};
...@@ -56,8 +56,95 @@ pmic: mc13892@0 { ...@@ -56,8 +56,95 @@ pmic: mc13892@0 {
compatible = "fsl,mc13892"; compatible = "fsl,mc13892";
spi-max-frequency = <6000000>; spi-max-frequency = <6000000>;
reg = <0>; reg = <0>;
mc13xxx-irq-gpios = <&gpio1 8 0>; interrupt-parent = <&gpio1>;
fsl,mc13xxx-uses-regulator; interrupts = <8>;
regulators {
sw1_reg: sw1 {
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <1375000>;
regulator-boot-on;
regulator-always-on;
};
sw2_reg: sw2 {
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <1850000>;
regulator-boot-on;
regulator-always-on;
};
sw3_reg: sw3 {
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1850000>;
regulator-boot-on;
regulator-always-on;
};
sw4_reg: sw4 {
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1850000>;
regulator-boot-on;
regulator-always-on;
};
vpll_reg: vpll {
regulator-min-microvolt = <1050000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
regulator-always-on;
};
vdig_reg: vdig {
regulator-min-microvolt = <1650000>;
regulator-max-microvolt = <1650000>;
regulator-boot-on;
};
vsd_reg: vsd {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3150000>;
};
vusb2_reg: vusb2 {
regulator-min-microvolt = <2400000>;
regulator-max-microvolt = <2775000>;
regulator-boot-on;
regulator-always-on;
};
vvideo_reg: vvideo {
regulator-min-microvolt = <2775000>;
regulator-max-microvolt = <2775000>;
};
vaudio_reg: vaudio {
regulator-min-microvolt = <2300000>;
regulator-max-microvolt = <3000000>;
};
vcam_reg: vcam {
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <3000000>;
};
vgen1_reg: vgen1 {
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
};
vgen2_reg: vgen2 {
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3150000>;
regulator-always-on;
};
vgen3_reg: vgen3 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <2900000>;
regulator-always-on;
};
};
}; };
flash: at45db321d@1 { flash: at45db321d@1 {
......
...@@ -36,11 +36,13 @@ enet@02188000 { ...@@ -36,11 +36,13 @@ enet@02188000 {
usdhc@02198000 { /* uSDHC3 */ usdhc@02198000 { /* uSDHC3 */
cd-gpios = <&gpio6 11 0>; cd-gpios = <&gpio6 11 0>;
wp-gpios = <&gpio6 14 0>; wp-gpios = <&gpio6 14 0>;
vmmc-supply = <&reg_3p3v>;
status = "okay"; status = "okay";
}; };
usdhc@0219c000 { /* uSDHC4 */ usdhc@0219c000 { /* uSDHC4 */
fsl,card-wired; fsl,card-wired;
vmmc-supply = <&reg_3p3v>;
status = "okay"; status = "okay";
}; };
...@@ -50,6 +52,18 @@ uart4: uart@021f0000 { ...@@ -50,6 +52,18 @@ uart4: uart@021f0000 {
}; };
}; };
regulators {
compatible = "simple-bus";
reg_3p3v: 3p3v {
compatible = "regulator-fixed";
regulator-name = "3P3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
};
leds { leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
......
...@@ -32,18 +32,52 @@ enet@02188000 { ...@@ -32,18 +32,52 @@ enet@02188000 {
usdhc@02198000 { /* uSDHC3 */ usdhc@02198000 { /* uSDHC3 */
cd-gpios = <&gpio7 0 0>; cd-gpios = <&gpio7 0 0>;
wp-gpios = <&gpio7 1 0>; wp-gpios = <&gpio7 1 0>;
vmmc-supply = <&reg_3p3v>;
status = "okay"; status = "okay";
}; };
usdhc@0219c000 { /* uSDHC4 */ usdhc@0219c000 { /* uSDHC4 */
cd-gpios = <&gpio2 6 0>; cd-gpios = <&gpio2 6 0>;
wp-gpios = <&gpio2 7 0>; wp-gpios = <&gpio2 7 0>;
vmmc-supply = <&reg_3p3v>;
status = "okay"; status = "okay";
}; };
uart2: uart@021e8000 { uart2: uart@021e8000 {
status = "okay"; status = "okay";
}; };
i2c@021a0000 { /* I2C1 */
status = "okay";
clock-frequency = <100000>;
codec: sgtl5000@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
VDDA-supply = <&reg_2p5v>;
VDDIO-supply = <&reg_3p3v>;
};
};
};
};
regulators {
compatible = "simple-bus";
reg_2p5v: 2p5v {
compatible = "regulator-fixed";
regulator-name = "2P5V";
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <2500000>;
regulator-always-on;
};
reg_3p3v: 3p3v {
compatible = "regulator-fixed";
regulator-name = "3P3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
}; };
}; };
}; };
...@@ -13,15 +13,6 @@ / { ...@@ -13,15 +13,6 @@ / {
model = "TI OMAP3 BeagleBoard"; model = "TI OMAP3 BeagleBoard";
compatible = "ti,omap3-beagle", "ti,omap3"; compatible = "ti,omap3-beagle", "ti,omap3";
/*
* Since the initial device tree board file does not create any
* devices (MMC, network...), the only way to boot is to provide a
* ramdisk.
*/
chosen {
bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug earlyprintk";
};
memory { memory {
device_type = "memory"; device_type = "memory";
reg = <0x80000000 0x20000000>; /* 512 MB */ reg = <0x80000000 0x20000000>; /* 512 MB */
......
/*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/include/ "omap3.dtsi"
/ {
model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)";
compatible = "ti,omap3-evm", "ti,omap3";
memory {
device_type = "memory";
reg = <0x80000000 0x10000000>; /* 256 MB */
};
};
...@@ -61,34 +61,57 @@ ocp { ...@@ -61,34 +61,57 @@ ocp {
ranges; ranges;
ti,hwmods = "l3_main"; ti,hwmods = "l3_main";
intc: interrupt-controller@1 { intc: interrupt-controller@48200000 {
compatible = "ti,omap3-intc"; compatible = "ti,omap2-intc";
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <1>;
ti,intc-size = <96>;
reg = <0x48200000 0x1000>;
}; };
uart1: serial@0x4806a000 { uart1: serial@4806a000 {
compatible = "ti,omap3-uart"; compatible = "ti,omap3-uart";
ti,hwmods = "uart1"; ti,hwmods = "uart1";
clock-frequency = <48000000>; clock-frequency = <48000000>;
}; };
uart2: serial@0x4806c000 { uart2: serial@4806c000 {
compatible = "ti,omap3-uart"; compatible = "ti,omap3-uart";
ti,hwmods = "uart2"; ti,hwmods = "uart2";
clock-frequency = <48000000>; clock-frequency = <48000000>;
}; };
uart3: serial@0x49020000 { uart3: serial@49020000 {
compatible = "ti,omap3-uart"; compatible = "ti,omap3-uart";
ti,hwmods = "uart3"; ti,hwmods = "uart3";
clock-frequency = <48000000>; clock-frequency = <48000000>;
}; };
uart4: serial@0x49042000 { uart4: serial@49042000 {
compatible = "ti,omap3-uart"; compatible = "ti,omap3-uart";
ti,hwmods = "uart4"; ti,hwmods = "uart4";
clock-frequency = <48000000>; clock-frequency = <48000000>;
}; };
i2c1: i2c@48070000 {
compatible = "ti,omap3-i2c";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "i2c1";
};
i2c2: i2c@48072000 {
compatible = "ti,omap3-i2c";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "i2c2";
};
i2c3: i2c@48060000 {
compatible = "ti,omap3-i2c";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "i2c3";
};
}; };
}; };
...@@ -13,15 +13,6 @@ / { ...@@ -13,15 +13,6 @@ / {
model = "TI OMAP4 PandaBoard"; model = "TI OMAP4 PandaBoard";
compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4"; compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
/*
* Since the initial device tree board file does not create any
* devices (MMC, network...), the only way to boot is to provide a
* ramdisk.
*/
chosen {
bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug";
};
memory { memory {
device_type = "memory"; device_type = "memory";
reg = <0x80000000 0x40000000>; /* 1 GB */ reg = <0x80000000 0x40000000>; /* 1 GB */
......
...@@ -13,15 +13,6 @@ / { ...@@ -13,15 +13,6 @@ / {
model = "TI OMAP4 SDP board"; model = "TI OMAP4 SDP board";
compatible = "ti,omap4-sdp", "ti,omap4430", "ti,omap4"; compatible = "ti,omap4-sdp", "ti,omap4430", "ti,omap4";
/*
* Since the initial device tree board file does not create any
* devices (MMC, network...), the only way to boot is to provide a
* ramdisk.
*/
chosen {
bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug";
};
memory { memory {
device_type = "memory"; device_type = "memory";
reg = <0x80000000 0x40000000>; /* 1 GB */ reg = <0x80000000 0x40000000>; /* 1 GB */
......
...@@ -99,33 +99,61 @@ ocp { ...@@ -99,33 +99,61 @@ ocp {
gic: interrupt-controller@48241000 { gic: interrupt-controller@48241000 {
compatible = "arm,cortex-a9-gic"; compatible = "arm,cortex-a9-gic";
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <3>;
reg = <0x48241000 0x1000>, reg = <0x48241000 0x1000>,
<0x48240100 0x0100>; <0x48240100 0x0100>;
}; };
uart1: serial@0x4806a000 { uart1: serial@4806a000 {
compatible = "ti,omap4-uart"; compatible = "ti,omap4-uart";
ti,hwmods = "uart1"; ti,hwmods = "uart1";
clock-frequency = <48000000>; clock-frequency = <48000000>;
}; };
uart2: serial@0x4806c000 { uart2: serial@4806c000 {
compatible = "ti,omap4-uart"; compatible = "ti,omap4-uart";
ti,hwmods = "uart2"; ti,hwmods = "uart2";
clock-frequency = <48000000>; clock-frequency = <48000000>;
}; };
uart3: serial@0x48020000 { uart3: serial@48020000 {
compatible = "ti,omap4-uart"; compatible = "ti,omap4-uart";
ti,hwmods = "uart3"; ti,hwmods = "uart3";
clock-frequency = <48000000>; clock-frequency = <48000000>;
}; };
uart4: serial@0x4806e000 { uart4: serial@4806e000 {
compatible = "ti,omap4-uart"; compatible = "ti,omap4-uart";
ti,hwmods = "uart4"; ti,hwmods = "uart4";
clock-frequency = <48000000>; clock-frequency = <48000000>;
}; };
i2c1: i2c@48070000 {
compatible = "ti,omap4-i2c";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "i2c1";
};
i2c2: i2c@48072000 {
compatible = "ti,omap4-i2c";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "i2c2";
};
i2c3: i2c@48060000 {
compatible = "ti,omap4-i2c";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "i2c3";
};
i2c4: i2c@48350000 {
compatible = "ti,omap4-i2c";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "i2c4";
};
}; };
}; };
/*
* Copyright (C) 2012 Marvell Technology Group Ltd.
* Author: Haojian Zhuang <haojian.zhuang@marvell.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* publishhed by the Free Software Foundation.
*/
/dts-v1/;
/include/ "pxa168.dtsi"
/ {
model = "Marvell PXA168 Aspenite Development Board";
compatible = "mrvl,pxa168-aspenite", "mrvl,pxa168";
chosen {
bootargs = "console=ttyS0,115200 root=/dev/nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on";
};
memory {
reg = <0x00000000 0x04000000>;
};
soc {
apb@d4000000 {
uart1: uart@d4017000 {
status = "okay";
};
twsi1: i2c@d4011000 {
status = "okay";
};
rtc: rtc@d4010000 {
status = "okay";
};
};
};
};
/*
* Copyright (C) 2012 Marvell Technology Group Ltd.
* Author: Haojian Zhuang <haojian.zhuang@marvell.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* publishhed by the Free Software Foundation.
*/
/include/ "skeleton.dtsi"
/ {
aliases {
serial0 = &uart1;
serial1 = &uart2;
serial2 = &uart3;
i2c0 = &twsi1;
i2c1 = &twsi2;
};
intc: intc-interrupt-controller@d4282000 {
compatible = "mrvl,mmp-intc", "mrvl,intc";
interrupt-controller;
#interrupt-cells = <1>;
reg = <0xd4282000 0x1000>;
};
soc {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
interrupt-parent = <&intc>;
ranges;
apb@d4000000 { /* APB */
compatible = "mrvl,apb-bus", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
reg = <0xd4000000 0x00200000>;
ranges;
uart1: uart@d4017000 {
compatible = "mrvl,mmp-uart", "mrvl,pxa-uart";
reg = <0xd4017000 0x1000>;
interrupts = <27>;
status = "disabled";
};
uart2: uart@d4018000 {
compatible = "mrvl,mmp-uart", "mrvl,pxa-uart";
reg = <0xd4018000 0x1000>;
interrupts = <28>;
status = "disabled";
};
uart3: uart@d4026000 {
compatible = "mrvl,mmp-uart", "mrvl,pxa-uart";
reg = <0xd4026000 0x1000>;
interrupts = <29>;
status = "disabled";
};
gpio: gpio@d4019000 {
compatible = "mrvl,mmp-gpio", "mrvl,pxa-gpio";
reg = <0xd4019000 0x1000>;
interrupts = <49>;
interrupt-names = "gpio_mux";
gpio-controller;
#gpio-cells = <1>;
interrupt-controller;
#interrupt-cells = <1>;
};
twsi1: i2c@d4011000 {
compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c";
reg = <0xd4011000 0x1000>;
interrupts = <7>;
mrvl,i2c-fast-mode;
status = "disabled";
};
twsi2: i2c@d4025000 {
compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c";
reg = <0xd4025000 0x1000>;
interrupts = <58>;
status = "disabled";
};
rtc: rtc@d4010000 {
compatible = "mrvl,mmp-rtc";
reg = <0xd4010000 0x1000>;
interrupts = <5 6>;
interrupt-names = "rtc 1Hz", "rtc alarm";
status = "disabled";
};
};
};
};
...@@ -33,4 +33,22 @@ i2c@7000c700 { ...@@ -33,4 +33,22 @@ i2c@7000c700 {
i2c@7000d000 { i2c@7000d000 {
clock-frequency = <100000>; clock-frequency = <100000>;
}; };
sdhci@78000000 {
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
wp-gpios = <&gpio 155 0>; /* gpio PT3 */
power-gpios = <&gpio 31 0>; /* gpio PD7 */
};
sdhci@78000200 {
status = "disable";
};
sdhci@78000400 {
status = "disable";
};
sdhci@78000400 {
support-8bit;
};
}; };
...@@ -65,7 +65,8 @@ sound { ...@@ -65,7 +65,8 @@ sound {
"Headset Mic", "MICBIAS1", "Headset Mic", "MICBIAS1",
"MIC1", "Headset Mic", "MIC1", "Headset Mic",
"Headset Stereophone", "HPR", "Headset Stereophone", "HPR",
"Headset Stereophone", "HPL"; "Headset Stereophone", "HPL",
"DMICDAT", "Digital Mic";
nvidia,audio-codec = <&alc5632>; nvidia,audio-codec = <&alc5632>;
nvidia,i2s-controller = <&tegra_i2s1>; nvidia,i2s-controller = <&tegra_i2s1>;
......
...@@ -17,6 +17,12 @@ intc: interrupt-controller@50041000 { ...@@ -17,6 +17,12 @@ intc: interrupt-controller@50041000 {
< 0x50040100 0x0100 >; < 0x50040100 0x0100 >;
}; };
pmu {
compatible = "arm,cortex-a9-pmu";
interrupts = <0 56 0x04
0 57 0x04>;
};
apbdma: dma@6000a000 { apbdma: dma@6000a000 {
compatible = "nvidia,tegra20-apbdma"; compatible = "nvidia,tegra20-apbdma";
reg = <0x6000a000 0x1200>; reg = <0x6000a000 0x1200>;
......
...@@ -17,6 +17,14 @@ intc: interrupt-controller@50041000 { ...@@ -17,6 +17,14 @@ intc: interrupt-controller@50041000 {
< 0x50040100 0x0100 >; < 0x50040100 0x0100 >;
}; };
pmu {
compatible = "arm,cortex-a9-pmu";
interrupts = <0 144 0x04
0 145 0x04
0 146 0x04
0 147 0x04>;
};
apbdma: dma@6000a000 { apbdma: dma@6000a000 {
compatible = "nvidia,tegra30-apbdma", "nvidia,tegra20-apbdma"; compatible = "nvidia,tegra30-apbdma", "nvidia,tegra20-apbdma";
reg = <0x6000a000 0x1400>; reg = <0x6000a000 0x1400>;
......
...@@ -32,4 +32,27 @@ macb0: ethernet@fffc4000 { ...@@ -32,4 +32,27 @@ macb0: ethernet@fffc4000 {
}; };
}; };
}; };
leds {
compatible = "gpio-leds";
user_led {
label = "user_led";
gpios = <&pioB 21 1>;
linux,default-trigger = "heartbeat";
};
};
gpio_keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
user_pb {
label = "user_pb";
gpios = <&pioB 10 1>;
linux,code = <28>;
gpio-key,wakeup;
};
};
}; };
/*
* ARM Ltd. Versatile Express
*
* Motherboard Express uATX
* V2M-P1
*
* HBI-0190D
*
* RS1 memory map ("ARM Cortex-A Series memory map" in the board's
* Technical Reference Manual)
*
* WARNING! The hardware described in this file is independent from the
* original variant (vexpress-v2m.dtsi), but there is a strong
* correspondence between the two configurations.
*
* TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
* CHANGES TO vexpress-v2m.dtsi!
*/
/ {
aliases {
arm,v2m_timer = &v2m_timer01;
};
motherboard {
compatible = "simple-bus";
arm,v2m-memory-map = "rs1";
#address-cells = <2>; /* SMB chipselect number and offset */
#size-cells = <1>;
#interrupt-cells = <1>;
flash@0,00000000 {
compatible = "arm,vexpress-flash", "cfi-flash";
reg = <0 0x00000000 0x04000000>,
<4 0x00000000 0x04000000>;
bank-width = <4>;
};
psram@1,00000000 {
compatible = "arm,vexpress-psram", "mtd-ram";
reg = <1 0x00000000 0x02000000>;
bank-width = <4>;
};
vram@2,00000000 {
compatible = "arm,vexpress-vram";
reg = <2 0x00000000 0x00800000>;
};
ethernet@2,02000000 {
compatible = "smsc,lan9118", "smsc,lan9115";
reg = <2 0x02000000 0x10000>;
interrupts = <15>;
phy-mode = "mii";
reg-io-width = <4>;
smsc,irq-active-high;
smsc,irq-push-pull;
};
usb@2,03000000 {
compatible = "nxp,usb-isp1761";
reg = <2 0x03000000 0x20000>;
interrupts = <16>;
port1-otg;
};
iofpga@3,00000000 {
compatible = "arm,amba-bus", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 3 0 0x200000>;
sysreg@010000 {
compatible = "arm,vexpress-sysreg";
reg = <0x010000 0x1000>;
};
sysctl@020000 {
compatible = "arm,sp810", "arm,primecell";
reg = <0x020000 0x1000>;
};
/* PCI-E I2C bus */
v2m_i2c_pcie: i2c@030000 {
compatible = "arm,versatile-i2c";
reg = <0x030000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
pcie-switch@60 {
compatible = "idt,89hpes32h8";
reg = <0x60>;
};
};
aaci@040000 {
compatible = "arm,pl041", "arm,primecell";
reg = <0x040000 0x1000>;
interrupts = <11>;
};
mmci@050000 {
compatible = "arm,pl180", "arm,primecell";
reg = <0x050000 0x1000>;
interrupts = <9 10>;
};
kmi@060000 {
compatible = "arm,pl050", "arm,primecell";
reg = <0x060000 0x1000>;
interrupts = <12>;
};
kmi@070000 {
compatible = "arm,pl050", "arm,primecell";
reg = <0x070000 0x1000>;
interrupts = <13>;
};
v2m_serial0: uart@090000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x090000 0x1000>;
interrupts = <5>;
};
v2m_serial1: uart@0a0000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0a0000 0x1000>;
interrupts = <6>;
};
v2m_serial2: uart@0b0000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0b0000 0x1000>;
interrupts = <7>;
};
v2m_serial3: uart@0c0000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0c0000 0x1000>;
interrupts = <8>;
};
wdt@0f0000 {
compatible = "arm,sp805", "arm,primecell";
reg = <0x0f0000 0x1000>;
interrupts = <0>;
};
v2m_timer01: timer@110000 {
compatible = "arm,sp804", "arm,primecell";
reg = <0x110000 0x1000>;
interrupts = <2>;
};
v2m_timer23: timer@120000 {
compatible = "arm,sp804", "arm,primecell";
reg = <0x120000 0x1000>;
};
/* DVI I2C bus */
v2m_i2c_dvi: i2c@160000 {
compatible = "arm,versatile-i2c";
reg = <0x160000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
dvi-transmitter@39 {
compatible = "sil,sii9022-tpi", "sil,sii9022";
reg = <0x39>;
};
dvi-transmitter@60 {
compatible = "sil,sii9022-cpi", "sil,sii9022";
reg = <0x60>;
};
};
rtc@170000 {
compatible = "arm,pl031", "arm,primecell";
reg = <0x170000 0x1000>;
interrupts = <4>;
};
compact-flash@1a0000 {
compatible = "arm,vexpress-cf", "ata-generic";
reg = <0x1a0000 0x100
0x1a0100 0xf00>;
reg-shift = <2>;
};
clcd@1f0000 {
compatible = "arm,pl111", "arm,primecell";
reg = <0x1f0000 0x1000>;
interrupts = <14>;
};
};
};
};
/*
* ARM Ltd. Versatile Express
*
* Motherboard Express uATX
* V2M-P1
*
* HBI-0190D
*
* Original memory map ("Legacy memory map" in the board's
* Technical Reference Manual)
*
* WARNING! The hardware described in this file is independent from the
* RS1 variant (vexpress-v2m-rs1.dtsi), but there is a strong
* correspondence between the two configurations.
*
* TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
* CHANGES TO vexpress-v2m-rs1.dtsi!
*/
/ {
aliases {
arm,v2m_timer = &v2m_timer01;
};
motherboard {
compatible = "simple-bus";
#address-cells = <2>; /* SMB chipselect number and offset */
#size-cells = <1>;
#interrupt-cells = <1>;
flash@0,00000000 {
compatible = "arm,vexpress-flash", "cfi-flash";
reg = <0 0x00000000 0x04000000>,
<1 0x00000000 0x04000000>;
bank-width = <4>;
};
psram@2,00000000 {
compatible = "arm,vexpress-psram", "mtd-ram";
reg = <2 0x00000000 0x02000000>;
bank-width = <4>;
};
vram@3,00000000 {
compatible = "arm,vexpress-vram";
reg = <3 0x00000000 0x00800000>;
};
ethernet@3,02000000 {
compatible = "smsc,lan9118", "smsc,lan9115";
reg = <3 0x02000000 0x10000>;
interrupts = <15>;
phy-mode = "mii";
reg-io-width = <4>;
smsc,irq-active-high;
smsc,irq-push-pull;
};
usb@3,03000000 {
compatible = "nxp,usb-isp1761";
reg = <3 0x03000000 0x20000>;
interrupts = <16>;
port1-otg;
};
iofpga@7,00000000 {
compatible = "arm,amba-bus", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 7 0 0x20000>;
sysreg@00000 {
compatible = "arm,vexpress-sysreg";
reg = <0x00000 0x1000>;
};
sysctl@01000 {
compatible = "arm,sp810", "arm,primecell";
reg = <0x01000 0x1000>;
};
/* PCI-E I2C bus */
v2m_i2c_pcie: i2c@02000 {
compatible = "arm,versatile-i2c";
reg = <0x02000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
pcie-switch@60 {
compatible = "idt,89hpes32h8";
reg = <0x60>;
};
};
aaci@04000 {
compatible = "arm,pl041", "arm,primecell";
reg = <0x04000 0x1000>;
interrupts = <11>;
};
mmci@05000 {
compatible = "arm,pl180", "arm,primecell";
reg = <0x05000 0x1000>;
interrupts = <9 10>;
};
kmi@06000 {
compatible = "arm,pl050", "arm,primecell";
reg = <0x06000 0x1000>;
interrupts = <12>;
};
kmi@07000 {
compatible = "arm,pl050", "arm,primecell";
reg = <0x07000 0x1000>;
interrupts = <13>;
};
v2m_serial0: uart@09000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x09000 0x1000>;
interrupts = <5>;
};
v2m_serial1: uart@0a000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0a000 0x1000>;
interrupts = <6>;
};
v2m_serial2: uart@0b000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0b000 0x1000>;
interrupts = <7>;
};
v2m_serial3: uart@0c000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0c000 0x1000>;
interrupts = <8>;
};
wdt@0f000 {
compatible = "arm,sp805", "arm,primecell";
reg = <0x0f000 0x1000>;
interrupts = <0>;
};
v2m_timer01: timer@11000 {
compatible = "arm,sp804", "arm,primecell";
reg = <0x11000 0x1000>;
interrupts = <2>;
};
v2m_timer23: timer@12000 {
compatible = "arm,sp804", "arm,primecell";
reg = <0x12000 0x1000>;
};
/* DVI I2C bus */
v2m_i2c_dvi: i2c@16000 {
compatible = "arm,versatile-i2c";
reg = <0x16000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
dvi-transmitter@39 {
compatible = "sil,sii9022-tpi", "sil,sii9022";
reg = <0x39>;
};
dvi-transmitter@60 {
compatible = "sil,sii9022-cpi", "sil,sii9022";
reg = <0x60>;
};
};
rtc@17000 {
compatible = "arm,pl031", "arm,primecell";
reg = <0x17000 0x1000>;
interrupts = <4>;
};
compact-flash@1a000 {
compatible = "arm,vexpress-cf", "ata-generic";
reg = <0x1a000 0x100
0x1a100 0xf00>;
reg-shift = <2>;
};
clcd@1f000 {
compatible = "arm,pl111", "arm,primecell";
reg = <0x1f000 0x1000>;
interrupts = <14>;
};
};
};
};
/*
* ARM Ltd. Versatile Express
*
* CoreTile Express A15x2 (version with Test Chip 1)
* Cortex-A15 MPCore (V2P-CA15)
*
* HBI-0237A
*/
/dts-v1/;
/ {
model = "V2P-CA15";
arm,hbi = <0x237>;
compatible = "arm,vexpress,v2p-ca15,tc1", "arm,vexpress,v2p-ca15", "arm,vexpress";
interrupt-parent = <&gic>;
#address-cells = <1>;
#size-cells = <1>;
chosen { };
aliases {
serial0 = &v2m_serial0;
serial1 = &v2m_serial1;
serial2 = &v2m_serial2;
serial3 = &v2m_serial3;
i2c0 = &v2m_i2c_dvi;
i2c1 = &v2m_i2c_pcie;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a15";
reg = <0>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a15";
reg = <1>;
};
};
memory@80000000 {
device_type = "memory";
reg = <0x80000000 0x40000000>;
};
hdlcd@2b000000 {
compatible = "arm,hdlcd";
reg = <0x2b000000 0x1000>;
interrupts = <0 85 4>;
};
memory-controller@2b0a0000 {
compatible = "arm,pl341", "arm,primecell";
reg = <0x2b0a0000 0x1000>;
};
wdt@2b060000 {
compatible = "arm,sp805", "arm,primecell";
reg = <0x2b060000 0x1000>;
interrupts = <98>;
};
gic: interrupt-controller@2c001000 {
compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
#interrupt-cells = <3>;
#address-cells = <0>;
interrupt-controller;
reg = <0x2c001000 0x1000>,
<0x2c002000 0x100>;
};
memory-controller@7ffd0000 {
compatible = "arm,pl354", "arm,primecell";
reg = <0x7ffd0000 0x1000>;
interrupts = <0 86 4>,
<0 87 4>;
};
dma@7ffb0000 {
compatible = "arm,pl330", "arm,primecell";
reg = <0x7ffb0000 0x1000>;
interrupts = <0 92 4>,
<0 88 4>,
<0 89 4>,
<0 90 4>,
<0 91 4>;
};
pmu {
compatible = "arm,cortex-a15-pmu", "arm,cortex-a9-pmu";
interrupts = <0 68 4>,
<0 69 4>;
};
motherboard {
ranges = <0 0 0x08000000 0x04000000>,
<1 0 0x14000000 0x04000000>,
<2 0 0x18000000 0x04000000>,
<3 0 0x1c000000 0x04000000>,
<4 0 0x0c000000 0x04000000>,
<5 0 0x10000000 0x04000000>;
interrupt-map-mask = <0 0 63>;
interrupt-map = <0 0 0 &gic 0 0 4>,
<0 0 1 &gic 0 1 4>,
<0 0 2 &gic 0 2 4>,
<0 0 3 &gic 0 3 4>,
<0 0 4 &gic 0 4 4>,
<0 0 5 &gic 0 5 4>,
<0 0 6 &gic 0 6 4>,
<0 0 7 &gic 0 7 4>,
<0 0 8 &gic 0 8 4>,
<0 0 9 &gic 0 9 4>,
<0 0 10 &gic 0 10 4>,
<0 0 11 &gic 0 11 4>,
<0 0 12 &gic 0 12 4>,
<0 0 13 &gic 0 13 4>,
<0 0 14 &gic 0 14 4>,
<0 0 15 &gic 0 15 4>,
<0 0 16 &gic 0 16 4>,
<0 0 17 &gic 0 17 4>,
<0 0 18 &gic 0 18 4>,
<0 0 19 &gic 0 19 4>,
<0 0 20 &gic 0 20 4>,
<0 0 21 &gic 0 21 4>,
<0 0 22 &gic 0 22 4>,
<0 0 23 &gic 0 23 4>,
<0 0 24 &gic 0 24 4>,
<0 0 25 &gic 0 25 4>,
<0 0 26 &gic 0 26 4>,
<0 0 27 &gic 0 27 4>,
<0 0 28 &gic 0 28 4>,
<0 0 29 &gic 0 29 4>,
<0 0 30 &gic 0 30 4>,
<0 0 31 &gic 0 31 4>,
<0 0 32 &gic 0 32 4>,
<0 0 33 &gic 0 33 4>,
<0 0 34 &gic 0 34 4>,
<0 0 35 &gic 0 35 4>,
<0 0 36 &gic 0 36 4>,
<0 0 37 &gic 0 37 4>,
<0 0 38 &gic 0 38 4>,
<0 0 39 &gic 0 39 4>,
<0 0 40 &gic 0 40 4>,
<0 0 41 &gic 0 41 4>,
<0 0 42 &gic 0 42 4>;
};
};
/include/ "vexpress-v2m-rs1.dtsi"
/*
* ARM Ltd. Versatile Express
*
* CoreTile Express A5x2
* Cortex-A5 MPCore (V2P-CA5s)
*
* HBI-0225B
*/
/dts-v1/;
/ {
model = "V2P-CA5s";
arm,hbi = <0x225>;
compatible = "arm,vexpress,v2p-ca5s", "arm,vexpress";
interrupt-parent = <&gic>;
#address-cells = <1>;
#size-cells = <1>;
chosen { };
aliases {
serial0 = &v2m_serial0;
serial1 = &v2m_serial1;
serial2 = &v2m_serial2;
serial3 = &v2m_serial3;
i2c0 = &v2m_i2c_dvi;
i2c1 = &v2m_i2c_pcie;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a5";
reg = <0>;
next-level-cache = <&L2>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a5";
reg = <1>;
next-level-cache = <&L2>;
};
};
memory@80000000 {
device_type = "memory";
reg = <0x80000000 0x40000000>;
};
hdlcd@2a110000 {
compatible = "arm,hdlcd";
reg = <0x2a110000 0x1000>;
interrupts = <0 85 4>;
};
memory-controller@2a150000 {
compatible = "arm,pl341", "arm,primecell";
reg = <0x2a150000 0x1000>;
};
memory-controller@2a190000 {
compatible = "arm,pl354", "arm,primecell";
reg = <0x2a190000 0x1000>;
interrupts = <0 86 4>,
<0 87 4>;
};
scu@2c000000 {
compatible = "arm,cortex-a5-scu";
reg = <0x2c000000 0x58>;
};
timer@2c000600 {
compatible = "arm,cortex-a5-twd-timer";
reg = <0x2c000600 0x38>;
interrupts = <1 2 0x304>,
<1 3 0x304>;
};
gic: interrupt-controller@2c001000 {
compatible = "arm,corex-a5-gic", "arm,cortex-a9-gic";
#interrupt-cells = <3>;
#address-cells = <0>;
interrupt-controller;
reg = <0x2c001000 0x1000>,
<0x2c000100 0x100>;
};
L2: cache-controller@2c0f0000 {
compatible = "arm,pl310-cache";
reg = <0x2c0f0000 0x1000>;
interrupts = <0 84 4>;
cache-level = <2>;
};
pmu {
compatible = "arm,cortex-a5-pmu", "arm,cortex-a9-pmu";
interrupts = <0 68 4>,
<0 69 4>;
};
motherboard {
ranges = <0 0 0x08000000 0x04000000>,
<1 0 0x14000000 0x04000000>,
<2 0 0x18000000 0x04000000>,
<3 0 0x1c000000 0x04000000>,
<4 0 0x0c000000 0x04000000>,
<5 0 0x10000000 0x04000000>;
interrupt-map-mask = <0 0 63>;
interrupt-map = <0 0 0 &gic 0 0 4>,
<0 0 1 &gic 0 1 4>,
<0 0 2 &gic 0 2 4>,
<0 0 3 &gic 0 3 4>,
<0 0 4 &gic 0 4 4>,
<0 0 5 &gic 0 5 4>,
<0 0 6 &gic 0 6 4>,
<0 0 7 &gic 0 7 4>,
<0 0 8 &gic 0 8 4>,
<0 0 9 &gic 0 9 4>,
<0 0 10 &gic 0 10 4>,
<0 0 11 &gic 0 11 4>,
<0 0 12 &gic 0 12 4>,
<0 0 13 &gic 0 13 4>,
<0 0 14 &gic 0 14 4>,
<0 0 15 &gic 0 15 4>,
<0 0 16 &gic 0 16 4>,
<0 0 17 &gic 0 17 4>,
<0 0 18 &gic 0 18 4>,
<0 0 19 &gic 0 19 4>,
<0 0 20 &gic 0 20 4>,
<0 0 21 &gic 0 21 4>,
<0 0 22 &gic 0 22 4>,
<0 0 23 &gic 0 23 4>,
<0 0 24 &gic 0 24 4>,
<0 0 25 &gic 0 25 4>,
<0 0 26 &gic 0 26 4>,
<0 0 27 &gic 0 27 4>,
<0 0 28 &gic 0 28 4>,
<0 0 29 &gic 0 29 4>,
<0 0 30 &gic 0 30 4>,
<0 0 31 &gic 0 31 4>,
<0 0 32 &gic 0 32 4>,
<0 0 33 &gic 0 33 4>,
<0 0 34 &gic 0 34 4>,
<0 0 35 &gic 0 35 4>,
<0 0 36 &gic 0 36 4>,
<0 0 37 &gic 0 37 4>,
<0 0 38 &gic 0 38 4>,
<0 0 39 &gic 0 39 4>,
<0 0 40 &gic 0 40 4>,
<0 0 41 &gic 0 41 4>,
<0 0 42 &gic 0 42 4>;
};
};
/include/ "vexpress-v2m-rs1.dtsi"
/*
* ARM Ltd. Versatile Express
*
* CoreTile Express A9x4
* Cortex-A9 MPCore (V2P-CA9)
*
* HBI-0191B
*/
/dts-v1/;
/ {
model = "V2P-CA9";
arm,hbi = <0x191>;
compatible = "arm,vexpress,v2p-ca9", "arm,vexpress";
interrupt-parent = <&gic>;
#address-cells = <1>;
#size-cells = <1>;
chosen { };
aliases {
serial0 = &v2m_serial0;
serial1 = &v2m_serial1;
serial2 = &v2m_serial2;
serial3 = &v2m_serial3;
i2c0 = &v2m_i2c_dvi;
i2c1 = &v2m_i2c_pcie;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <0>;
next-level-cache = <&L2>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <1>;
next-level-cache = <&L2>;
};
cpu@2 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <2>;
next-level-cache = <&L2>;
};
cpu@3 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <3>;
next-level-cache = <&L2>;
};
};
memory@60000000 {
device_type = "memory";
reg = <0x60000000 0x40000000>;
};
clcd@10020000 {
compatible = "arm,pl111", "arm,primecell";
reg = <0x10020000 0x1000>;
interrupts = <0 44 4>;
};
memory-controller@100e0000 {
compatible = "arm,pl341", "arm,primecell";
reg = <0x100e0000 0x1000>;
};
memory-controller@100e1000 {
compatible = "arm,pl354", "arm,primecell";
reg = <0x100e1000 0x1000>;
interrupts = <0 45 4>,
<0 46 4>;
};
timer@100e4000 {
compatible = "arm,sp804", "arm,primecell";
reg = <0x100e4000 0x1000>;
interrupts = <0 48 4>,
<0 49 4>;
};
watchdog@100e5000 {
compatible = "arm,sp805", "arm,primecell";
reg = <0x100e5000 0x1000>;
interrupts = <0 51 4>;
};
scu@1e000000 {
compatible = "arm,cortex-a9-scu";
reg = <0x1e000000 0x58>;
};
timer@1e000600 {
compatible = "arm,cortex-a9-twd-timer";
reg = <0x1e000600 0x20>;
interrupts = <1 2 0xf04>,
<1 3 0xf04>;
};
gic: interrupt-controller@1e001000 {
compatible = "arm,cortex-a9-gic";
#interrupt-cells = <3>;
#address-cells = <0>;
interrupt-controller;
reg = <0x1e001000 0x1000>,
<0x1e000100 0x100>;
};
L2: cache-controller@1e00a000 {
compatible = "arm,pl310-cache";
reg = <0x1e00a000 0x1000>;
interrupts = <0 43 4>;
cache-level = <2>;
arm,data-latency = <1 1 1>;
arm,tag-latency = <1 1 1>;
};
pmu {
compatible = "arm,cortex-a9-pmu";
interrupts = <0 60 4>,
<0 61 4>,
<0 62 4>,
<0 63 4>;
};
motherboard {
ranges = <0 0 0x40000000 0x04000000>,
<1 0 0x44000000 0x04000000>,
<2 0 0x48000000 0x04000000>,
<3 0 0x4c000000 0x04000000>,
<7 0 0x10000000 0x00020000>;
interrupt-map-mask = <0 0 63>;
interrupt-map = <0 0 0 &gic 0 0 4>,
<0 0 1 &gic 0 1 4>,
<0 0 2 &gic 0 2 4>,
<0 0 3 &gic 0 3 4>,
<0 0 4 &gic 0 4 4>,
<0 0 5 &gic 0 5 4>,
<0 0 6 &gic 0 6 4>,
<0 0 7 &gic 0 7 4>,
<0 0 8 &gic 0 8 4>,
<0 0 9 &gic 0 9 4>,
<0 0 10 &gic 0 10 4>,
<0 0 11 &gic 0 11 4>,
<0 0 12 &gic 0 12 4>,
<0 0 13 &gic 0 13 4>,
<0 0 14 &gic 0 14 4>,
<0 0 15 &gic 0 15 4>,
<0 0 16 &gic 0 16 4>,
<0 0 17 &gic 0 17 4>,
<0 0 18 &gic 0 18 4>,
<0 0 19 &gic 0 19 4>,
<0 0 20 &gic 0 20 4>,
<0 0 21 &gic 0 21 4>,
<0 0 22 &gic 0 22 4>,
<0 0 23 &gic 0 23 4>,
<0 0 24 &gic 0 24 4>,
<0 0 25 &gic 0 25 4>,
<0 0 26 &gic 0 26 4>,
<0 0 27 &gic 0 27 4>,
<0 0 28 &gic 0 28 4>,
<0 0 29 &gic 0 29 4>,
<0 0 30 &gic 0 30 4>,
<0 0 31 &gic 0 31 4>,
<0 0 32 &gic 0 32 4>,
<0 0 33 &gic 0 33 4>,
<0 0 34 &gic 0 34 4>,
<0 0 35 &gic 0 35 4>,
<0 0 36 &gic 0 36 4>,
<0 0 37 &gic 0 37 4>,
<0 0 38 &gic 0 38 4>,
<0 0 39 &gic 0 39 4>,
<0 0 40 &gic 0 40 4>,
<0 0 41 &gic 0 41 4>,
<0 0 42 &gic 0 42 4>;
};
};
/include/ "vexpress-v2m.dtsi"
...@@ -20,7 +20,7 @@ obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_d ...@@ -20,7 +20,7 @@ obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_d
obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o
obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o
obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o
obj-$(CONFIG_ARCH_AT91SAM9X5) += at91sam9x5.o at91sam926x_time.o obj-$(CONFIG_ARCH_AT91SAM9X5) += at91sam9x5.o at91sam926x_time.o sam9_smc.o
obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o
# AT91RM9200 board-specific support # AT91RM9200 board-specific support
......
...@@ -13,4 +13,10 @@ params_phys-y := 0x20000100 ...@@ -13,4 +13,10 @@ params_phys-y := 0x20000100
initrd_phys-y := 0x20410000 initrd_phys-y := 0x20410000
endif endif
dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb usb_a9g20.dtb # Keep dtb files sorted alphabetically for each SoC
# sam9g20
dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb
# sam9g45
dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb
# sam9x5
dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g25ek.dtb
...@@ -295,7 +295,7 @@ static void at91rm9200_idle(void) ...@@ -295,7 +295,7 @@ static void at91rm9200_idle(void)
* Disable the processor clock. The processor will be automatically * Disable the processor clock. The processor will be automatically
* re-enabled by an interrupt or by a reset. * re-enabled by an interrupt or by a reset.
*/ */
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
} }
static void at91rm9200_restart(char mode, const char *cmd) static void at91rm9200_restart(char mode, const char *cmd)
...@@ -303,8 +303,8 @@ static void at91rm9200_restart(char mode, const char *cmd) ...@@ -303,8 +303,8 @@ static void at91rm9200_restart(char mode, const char *cmd)
/* /*
* Perform a hardware reset with the use of the Watchdog timer. * Perform a hardware reset with the use of the Watchdog timer.
*/ */
at91_sys_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1); at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
} }
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
...@@ -319,6 +319,8 @@ static void __init at91rm9200_map_io(void) ...@@ -319,6 +319,8 @@ static void __init at91rm9200_map_io(void)
static void __init at91rm9200_ioremap_registers(void) static void __init at91rm9200_ioremap_registers(void)
{ {
at91rm9200_ioremap_st(AT91RM9200_BASE_ST);
at91_ioremap_ramc(0, AT91RM9200_BASE_MC, 256);
} }
static void __init at91rm9200_initialize(void) static void __init at91rm9200_initialize(void)
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91rm9200.h> #include <mach/at91rm9200.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
#include <mach/at91_ramc.h>
#include "generic.h" #include "generic.h"
...@@ -241,15 +242,15 @@ void __init at91_add_device_cf(struct at91_cf_data *data) ...@@ -241,15 +242,15 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
data->chipselect = 4; /* can only use EBI ChipSelect 4 */ data->chipselect = 4; /* can only use EBI ChipSelect 4 */
/* CF takes over CS4, CS5, CS6 */ /* CF takes over CS4, CS5, CS6 */
csa = at91_sys_read(AT91_EBI_CSA); csa = at91_ramc_read(0, AT91_EBI_CSA);
at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH); at91_ramc_write(0, AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH);
/* /*
* Static memory controller timing adjustments. * Static memory controller timing adjustments.
* REVISIT: these timings are in terms of MCK cycles, so * REVISIT: these timings are in terms of MCK cycles, so
* when MCK changes (cpufreq etc) so must these values... * when MCK changes (cpufreq etc) so must these values...
*/ */
at91_sys_write(AT91_SMC_CSR(4), at91_ramc_write(0, AT91_SMC_CSR(4),
AT91_SMC_ACSS_STD AT91_SMC_ACSS_STD
| AT91_SMC_DBW_16 | AT91_SMC_DBW_16
| AT91_SMC_BAT | AT91_SMC_BAT
...@@ -407,11 +408,11 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) ...@@ -407,11 +408,11 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
return; return;
/* enable the address range of CS3 */ /* enable the address range of CS3 */
csa = at91_sys_read(AT91_EBI_CSA); csa = at91_ramc_read(0, AT91_EBI_CSA);
at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS3A_SMC_SMARTMEDIA); at91_ramc_write(0, AT91_EBI_CSA, csa | AT91_EBI_CS3A_SMC_SMARTMEDIA);
/* set the bus interface characteristics */ /* set the bus interface characteristics */
at91_sys_write(AT91_SMC_CSR(3), AT91_SMC_ACSS_STD | AT91_SMC_DBW_8 | AT91_SMC_WSEN at91_ramc_write(0, AT91_SMC_CSR(3), AT91_SMC_ACSS_STD | AT91_SMC_DBW_8 | AT91_SMC_WSEN
| AT91_SMC_NWS_(5) | AT91_SMC_NWS_(5)
| AT91_SMC_TDF_(1) | AT91_SMC_TDF_(1)
| AT91_SMC_RWSETUP_(0) /* tDS Data Set up Time 30 - ns */ | AT91_SMC_RWSETUP_(0) /* tDS Data Set up Time 30 - ns */
...@@ -1114,7 +1115,6 @@ static inline void configure_usart3_pins(unsigned pins) ...@@ -1114,7 +1115,6 @@ static inline void configure_usart3_pins(unsigned pins)
} }
static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
struct platform_device *atmel_default_console_device; /* the serial console device */
void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
{ {
......
...@@ -43,9 +43,9 @@ static inline unsigned long read_CRTR(void) ...@@ -43,9 +43,9 @@ static inline unsigned long read_CRTR(void)
{ {
unsigned long x1, x2; unsigned long x1, x2;
x1 = at91_sys_read(AT91_ST_CRTR); x1 = at91_st_read(AT91_ST_CRTR);
do { do {
x2 = at91_sys_read(AT91_ST_CRTR); x2 = at91_st_read(AT91_ST_CRTR);
if (x1 == x2) if (x1 == x2)
break; break;
x1 = x2; x1 = x2;
...@@ -58,7 +58,7 @@ static inline unsigned long read_CRTR(void) ...@@ -58,7 +58,7 @@ static inline unsigned long read_CRTR(void)
*/ */
static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id) static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
{ {
u32 sr = at91_sys_read(AT91_ST_SR) & irqmask; u32 sr = at91_st_read(AT91_ST_SR) & irqmask;
/* /*
* irqs should be disabled here, but as the irq is shared they are only * irqs should be disabled here, but as the irq is shared they are only
...@@ -110,22 +110,22 @@ static void ...@@ -110,22 +110,22 @@ static void
clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev) clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
{ {
/* Disable and flush pending timer interrupts */ /* Disable and flush pending timer interrupts */
at91_sys_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_ALMS); at91_st_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_ALMS);
(void) at91_sys_read(AT91_ST_SR); at91_st_read(AT91_ST_SR);
last_crtr = read_CRTR(); last_crtr = read_CRTR();
switch (mode) { switch (mode) {
case CLOCK_EVT_MODE_PERIODIC: case CLOCK_EVT_MODE_PERIODIC:
/* PIT for periodic irqs; fixed rate of 1/HZ */ /* PIT for periodic irqs; fixed rate of 1/HZ */
irqmask = AT91_ST_PITS; irqmask = AT91_ST_PITS;
at91_sys_write(AT91_ST_PIMR, RM9200_TIMER_LATCH); at91_st_write(AT91_ST_PIMR, RM9200_TIMER_LATCH);
break; break;
case CLOCK_EVT_MODE_ONESHOT: case CLOCK_EVT_MODE_ONESHOT:
/* ALM for oneshot irqs, set by next_event() /* ALM for oneshot irqs, set by next_event()
* before 32 seconds have passed * before 32 seconds have passed
*/ */
irqmask = AT91_ST_ALMS; irqmask = AT91_ST_ALMS;
at91_sys_write(AT91_ST_RTAR, last_crtr); at91_st_write(AT91_ST_RTAR, last_crtr);
break; break;
case CLOCK_EVT_MODE_SHUTDOWN: case CLOCK_EVT_MODE_SHUTDOWN:
case CLOCK_EVT_MODE_UNUSED: case CLOCK_EVT_MODE_UNUSED:
...@@ -133,7 +133,7 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev) ...@@ -133,7 +133,7 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
irqmask = 0; irqmask = 0;
break; break;
} }
at91_sys_write(AT91_ST_IER, irqmask); at91_st_write(AT91_ST_IER, irqmask);
} }
static int static int
...@@ -156,12 +156,12 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) ...@@ -156,12 +156,12 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
alm = read_CRTR(); alm = read_CRTR();
/* Cancel any pending alarm; flush any pending IRQ */ /* Cancel any pending alarm; flush any pending IRQ */
at91_sys_write(AT91_ST_RTAR, alm); at91_st_write(AT91_ST_RTAR, alm);
(void) at91_sys_read(AT91_ST_SR); at91_st_read(AT91_ST_SR);
/* Schedule alarm by writing RTAR. */ /* Schedule alarm by writing RTAR. */
alm += delta; alm += delta;
at91_sys_write(AT91_ST_RTAR, alm); at91_st_write(AT91_ST_RTAR, alm);
return status; return status;
} }
...@@ -175,15 +175,24 @@ static struct clock_event_device clkevt = { ...@@ -175,15 +175,24 @@ static struct clock_event_device clkevt = {
.set_mode = clkevt32k_mode, .set_mode = clkevt32k_mode,
}; };
void __iomem *at91_st_base;
void __init at91rm9200_ioremap_st(u32 addr)
{
at91_st_base = ioremap(addr, 256);
if (!at91_st_base)
panic("Impossible to ioremap ST\n");
}
/* /*
* ST (system timer) module supports both clockevents and clocksource. * ST (system timer) module supports both clockevents and clocksource.
*/ */
void __init at91rm9200_timer_init(void) void __init at91rm9200_timer_init(void)
{ {
/* Disable all timer interrupts, and clear any pending ones */ /* Disable all timer interrupts, and clear any pending ones */
at91_sys_write(AT91_ST_IDR, at91_st_write(AT91_ST_IDR,
AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS); AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
(void) at91_sys_read(AT91_ST_SR); at91_st_read(AT91_ST_SR);
/* Make IRQs happen for the system timer */ /* Make IRQs happen for the system timer */
setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq); setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
...@@ -192,7 +201,7 @@ void __init at91rm9200_timer_init(void) ...@@ -192,7 +201,7 @@ void __init at91rm9200_timer_init(void)
* directly for the clocksource and all clockevents, after adjusting * directly for the clocksource and all clockevents, after adjusting
* its prescaler from the 1 Hz default. * its prescaler from the 1 Hz default.
*/ */
at91_sys_write(AT91_ST_RTMR, 1); at91_st_write(AT91_ST_RTMR, 1);
/* Setup timer clockevent, with minimum of two ticks (important!!) */ /* Setup timer clockevent, with minimum of two ticks (important!!) */
clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift); clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
......
...@@ -209,6 +209,13 @@ static struct clk_lookup periph_clocks_lookups[] = { ...@@ -209,6 +209,13 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk), CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk),
CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk), CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk),
CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk),
/* more tc lookup table for DT entries */
CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk),
CLKDEV_CON_DEV_ID("t0_clk", "fffdc000.timer", &tc3_clk),
CLKDEV_CON_DEV_ID("t1_clk", "fffdc000.timer", &tc4_clk),
CLKDEV_CON_DEV_ID("t2_clk", "fffdc000.timer", &tc5_clk),
/* fake hclk clock */ /* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
CLKDEV_CON_ID("pioA", &pioA_clk), CLKDEV_CON_ID("pioA", &pioA_clk),
...@@ -310,34 +317,27 @@ static void __init at91sam9xe_map_io(void) ...@@ -310,34 +317,27 @@ static void __init at91sam9xe_map_io(void)
static void __init at91sam9260_map_io(void) static void __init at91sam9260_map_io(void)
{ {
if (cpu_is_at91sam9xe()) { if (cpu_is_at91sam9xe())
at91sam9xe_map_io(); at91sam9xe_map_io();
} else if (cpu_is_at91sam9g20()) { else if (cpu_is_at91sam9g20())
at91_init_sram(0, AT91SAM9G20_SRAM0_BASE, AT91SAM9G20_SRAM0_SIZE); at91_init_sram(0, AT91SAM9G20_SRAM_BASE, AT91SAM9G20_SRAM_SIZE);
at91_init_sram(1, AT91SAM9G20_SRAM1_BASE, AT91SAM9G20_SRAM1_SIZE); else
} else { at91_init_sram(0, AT91SAM9260_SRAM_BASE, AT91SAM9260_SRAM_SIZE);
at91_init_sram(0, AT91SAM9260_SRAM0_BASE, AT91SAM9260_SRAM0_SIZE);
at91_init_sram(1, AT91SAM9260_SRAM1_BASE, AT91SAM9260_SRAM1_SIZE);
}
} }
static void __init at91sam9260_ioremap_registers(void) static void __init at91sam9260_ioremap_registers(void)
{ {
at91_ioremap_shdwc(AT91SAM9260_BASE_SHDWC); at91_ioremap_shdwc(AT91SAM9260_BASE_SHDWC);
at91_ioremap_rstc(AT91SAM9260_BASE_RSTC); at91_ioremap_rstc(AT91SAM9260_BASE_RSTC);
at91_ioremap_ramc(0, AT91SAM9260_BASE_SDRAMC, 512);
at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT); at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT);
at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC); at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC);
} at91_ioremap_matrix(AT91SAM9260_BASE_MATRIX);
static void at91sam9260_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
} }
static void __init at91sam9260_initialize(void) static void __init at91sam9260_initialize(void)
{ {
arm_pm_idle = at91sam9260_idle; arm_pm_idle = at91sam9_idle;
arm_pm_restart = at91sam9_alt_restart; arm_pm_restart = at91sam9_alt_restart;
at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
| (1 << AT91SAM9260_ID_IRQ2); | (1 << AT91SAM9260_ID_IRQ2);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <mach/cpu.h> #include <mach/cpu.h>
#include <mach/at91sam9260.h> #include <mach/at91sam9260.h>
#include <mach/at91sam9260_matrix.h> #include <mach/at91sam9260_matrix.h>
#include <mach/at91_matrix.h>
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include "generic.h" #include "generic.h"
...@@ -422,8 +423,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) ...@@ -422,8 +423,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
if (!data) if (!data)
return; return;
csa = at91_sys_read(AT91_MATRIX_EBICSA); csa = at91_matrix_read(AT91_MATRIX_EBICSA);
at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
/* enable pin */ /* enable pin */
if (gpio_is_valid(data->enable_pin)) if (gpio_is_valid(data->enable_pin))
...@@ -641,7 +642,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) ...@@ -641,7 +642,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
static struct resource tcb0_resources[] = { static struct resource tcb0_resources[] = {
[0] = { [0] = {
.start = AT91SAM9260_BASE_TCB0, .start = AT91SAM9260_BASE_TCB0,
.end = AT91SAM9260_BASE_TCB0 + SZ_16K - 1, .end = AT91SAM9260_BASE_TCB0 + SZ_256 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -671,7 +672,7 @@ static struct platform_device at91sam9260_tcb0_device = { ...@@ -671,7 +672,7 @@ static struct platform_device at91sam9260_tcb0_device = {
static struct resource tcb1_resources[] = { static struct resource tcb1_resources[] = {
[0] = { [0] = {
.start = AT91SAM9260_BASE_TCB1, .start = AT91SAM9260_BASE_TCB1,
.end = AT91SAM9260_BASE_TCB1 + SZ_16K - 1, .end = AT91SAM9260_BASE_TCB1 + SZ_256 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -698,8 +699,25 @@ static struct platform_device at91sam9260_tcb1_device = { ...@@ -698,8 +699,25 @@ static struct platform_device at91sam9260_tcb1_device = {
.num_resources = ARRAY_SIZE(tcb1_resources), .num_resources = ARRAY_SIZE(tcb1_resources),
}; };
#if defined(CONFIG_OF)
static struct of_device_id tcb_ids[] = {
{ .compatible = "atmel,at91rm9200-tcb" },
{ /*sentinel*/ }
};
#endif
static void __init at91_add_device_tc(void) static void __init at91_add_device_tc(void)
{ {
#if defined(CONFIG_OF)
struct device_node *np;
np = of_find_matching_node(NULL, tcb_ids);
if (np) {
of_node_put(np);
return;
}
#endif
platform_device_register(&at91sam9260_tcb0_device); platform_device_register(&at91sam9260_tcb0_device);
platform_device_register(&at91sam9260_tcb1_device); platform_device_register(&at91sam9260_tcb1_device);
} }
...@@ -717,18 +735,42 @@ static struct resource rtt_resources[] = { ...@@ -717,18 +735,42 @@ static struct resource rtt_resources[] = {
.start = AT91SAM9260_BASE_RTT, .start = AT91SAM9260_BASE_RTT,
.end = AT91SAM9260_BASE_RTT + SZ_16 - 1, .end = AT91SAM9260_BASE_RTT + SZ_16 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
} }, {
.flags = IORESOURCE_MEM,
},
}; };
static struct platform_device at91sam9260_rtt_device = { static struct platform_device at91sam9260_rtt_device = {
.name = "at91_rtt", .name = "at91_rtt",
.id = 0, .id = 0,
.resource = rtt_resources, .resource = rtt_resources,
.num_resources = ARRAY_SIZE(rtt_resources),
}; };
#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
static void __init at91_add_device_rtt_rtc(void)
{
at91sam9260_rtt_device.name = "rtc-at91sam9";
/*
* The second resource is needed:
* GPBR will serve as the storage for RTC time offset
*/
at91sam9260_rtt_device.num_resources = 2;
rtt_resources[1].start = AT91SAM9260_BASE_GPBR +
4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
rtt_resources[1].end = rtt_resources[1].start + 3;
}
#else
static void __init at91_add_device_rtt_rtc(void)
{
/* Only one resource is needed: RTT not used as RTC */
at91sam9260_rtt_device.num_resources = 1;
}
#endif
static void __init at91_add_device_rtt(void) static void __init at91_add_device_rtt(void)
{ {
at91_add_device_rtt_rtc();
platform_device_register(&at91sam9260_rtt_device); platform_device_register(&at91sam9260_rtt_device);
} }
...@@ -1139,7 +1181,6 @@ static inline void configure_usart5_pins(void) ...@@ -1139,7 +1181,6 @@ static inline void configure_usart5_pins(void)
} }
static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
struct platform_device *atmel_default_console_device; /* the serial console device */
void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
{ {
...@@ -1264,7 +1305,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data) ...@@ -1264,7 +1305,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
if (!data) if (!data)
return; return;
csa = at91_sys_read(AT91_MATRIX_EBICSA); csa = at91_matrix_read(AT91_MATRIX_EBICSA);
switch (data->chipselect) { switch (data->chipselect) {
case 4: case 4:
...@@ -1287,7 +1328,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data) ...@@ -1287,7 +1328,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
return; return;
} }
at91_sys_write(AT91_MATRIX_EBICSA, csa); at91_matrix_write(AT91_MATRIX_EBICSA, csa);
if (gpio_is_valid(data->rst_pin)) { if (gpio_is_valid(data->rst_pin)) {
at91_set_multi_drive(data->rst_pin, 0); at91_set_multi_drive(data->rst_pin, 0);
......
...@@ -283,19 +283,15 @@ static void __init at91sam9261_ioremap_registers(void) ...@@ -283,19 +283,15 @@ static void __init at91sam9261_ioremap_registers(void)
{ {
at91_ioremap_shdwc(AT91SAM9261_BASE_SHDWC); at91_ioremap_shdwc(AT91SAM9261_BASE_SHDWC);
at91_ioremap_rstc(AT91SAM9261_BASE_RSTC); at91_ioremap_rstc(AT91SAM9261_BASE_RSTC);
at91_ioremap_ramc(0, AT91SAM9261_BASE_SDRAMC, 512);
at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT); at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT);
at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC); at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC);
} at91_ioremap_matrix(AT91SAM9261_BASE_MATRIX);
static void at91sam9261_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
} }
static void __init at91sam9261_initialize(void) static void __init at91sam9261_initialize(void)
{ {
arm_pm_idle = at91sam9261_idle; arm_pm_idle = at91sam9_idle;
arm_pm_restart = at91sam9_alt_restart; arm_pm_restart = at91sam9_alt_restart;
at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
| (1 << AT91SAM9261_ID_IRQ2); | (1 << AT91SAM9261_ID_IRQ2);
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91sam9261.h> #include <mach/at91sam9261.h>
#include <mach/at91sam9261_matrix.h> #include <mach/at91sam9261_matrix.h>
#include <mach/at91_matrix.h>
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include "generic.h" #include "generic.h"
...@@ -236,8 +237,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) ...@@ -236,8 +237,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
if (!data) if (!data)
return; return;
csa = at91_sys_read(AT91_MATRIX_EBICSA); csa = at91_matrix_read(AT91_MATRIX_EBICSA);
at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
/* enable pin */ /* enable pin */
if (gpio_is_valid(data->enable_pin)) if (gpio_is_valid(data->enable_pin))
...@@ -603,6 +604,8 @@ static struct resource rtt_resources[] = { ...@@ -603,6 +604,8 @@ static struct resource rtt_resources[] = {
.start = AT91SAM9261_BASE_RTT, .start = AT91SAM9261_BASE_RTT,
.end = AT91SAM9261_BASE_RTT + SZ_16 - 1, .end = AT91SAM9261_BASE_RTT + SZ_16 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, {
.flags = IORESOURCE_MEM,
} }
}; };
...@@ -610,11 +613,32 @@ static struct platform_device at91sam9261_rtt_device = { ...@@ -610,11 +613,32 @@ static struct platform_device at91sam9261_rtt_device = {
.name = "at91_rtt", .name = "at91_rtt",
.id = 0, .id = 0,
.resource = rtt_resources, .resource = rtt_resources,
.num_resources = ARRAY_SIZE(rtt_resources),
}; };
#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
static void __init at91_add_device_rtt_rtc(void)
{
at91sam9261_rtt_device.name = "rtc-at91sam9";
/*
* The second resource is needed:
* GPBR will serve as the storage for RTC time offset
*/
at91sam9261_rtt_device.num_resources = 2;
rtt_resources[1].start = AT91SAM9261_BASE_GPBR +
4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
rtt_resources[1].end = rtt_resources[1].start + 3;
}
#else
static void __init at91_add_device_rtt_rtc(void)
{
/* Only one resource is needed: RTT not used as RTC */
at91sam9261_rtt_device.num_resources = 1;
}
#endif
static void __init at91_add_device_rtt(void) static void __init at91_add_device_rtt(void)
{ {
at91_add_device_rtt_rtc();
platform_device_register(&at91sam9261_rtt_device); platform_device_register(&at91sam9261_rtt_device);
} }
...@@ -991,7 +1015,6 @@ static inline void configure_usart2_pins(unsigned pins) ...@@ -991,7 +1015,6 @@ static inline void configure_usart2_pins(unsigned pins)
} }
static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
struct platform_device *atmel_default_console_device; /* the serial console device */
void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
{ {
......
...@@ -303,20 +303,17 @@ static void __init at91sam9263_ioremap_registers(void) ...@@ -303,20 +303,17 @@ static void __init at91sam9263_ioremap_registers(void)
{ {
at91_ioremap_shdwc(AT91SAM9263_BASE_SHDWC); at91_ioremap_shdwc(AT91SAM9263_BASE_SHDWC);
at91_ioremap_rstc(AT91SAM9263_BASE_RSTC); at91_ioremap_rstc(AT91SAM9263_BASE_RSTC);
at91_ioremap_ramc(0, AT91SAM9263_BASE_SDRAMC0, 512);
at91_ioremap_ramc(1, AT91SAM9263_BASE_SDRAMC1, 512);
at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT); at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT);
at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0); at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0);
at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1); at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1);
} at91_ioremap_matrix(AT91SAM9263_BASE_MATRIX);
static void at91sam9263_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
} }
static void __init at91sam9263_initialize(void) static void __init at91sam9263_initialize(void)
{ {
arm_pm_idle = at91sam9263_idle; arm_pm_idle = at91sam9_idle;
arm_pm_restart = at91sam9_alt_restart; arm_pm_restart = at91sam9_alt_restart;
at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91sam9263.h> #include <mach/at91sam9263.h>
#include <mach/at91sam9263_matrix.h> #include <mach/at91sam9263_matrix.h>
#include <mach/at91_matrix.h>
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include "generic.h" #include "generic.h"
...@@ -409,7 +410,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data) ...@@ -409,7 +410,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
* we assume SMC timings are configured by board code, * we assume SMC timings are configured by board code,
* except True IDE where timings are controlled by driver * except True IDE where timings are controlled by driver
*/ */
ebi0_csa = at91_sys_read(AT91_MATRIX_EBI0CSA); ebi0_csa = at91_matrix_read(AT91_MATRIX_EBI0CSA);
switch (data->chipselect) { switch (data->chipselect) {
case 4: case 4:
at91_set_A_periph(AT91_PIN_PD6, 0); /* EBI0_NCS4/CFCS0 */ at91_set_A_periph(AT91_PIN_PD6, 0); /* EBI0_NCS4/CFCS0 */
...@@ -428,7 +429,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data) ...@@ -428,7 +429,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
data->chipselect); data->chipselect);
return; return;
} }
at91_sys_write(AT91_MATRIX_EBI0CSA, ebi0_csa); at91_matrix_write(AT91_MATRIX_EBI0CSA, ebi0_csa);
if (gpio_is_valid(data->det_pin)) { if (gpio_is_valid(data->det_pin)) {
at91_set_gpio_input(data->det_pin, 1); at91_set_gpio_input(data->det_pin, 1);
...@@ -496,8 +497,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) ...@@ -496,8 +497,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
if (!data) if (!data)
return; return;
csa = at91_sys_read(AT91_MATRIX_EBI0CSA); csa = at91_matrix_read(AT91_MATRIX_EBI0CSA);
at91_sys_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA); at91_matrix_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
/* enable pin */ /* enable pin */
if (gpio_is_valid(data->enable_pin)) if (gpio_is_valid(data->enable_pin))
...@@ -966,6 +967,8 @@ static struct resource rtt0_resources[] = { ...@@ -966,6 +967,8 @@ static struct resource rtt0_resources[] = {
.start = AT91SAM9263_BASE_RTT0, .start = AT91SAM9263_BASE_RTT0,
.end = AT91SAM9263_BASE_RTT0 + SZ_16 - 1, .end = AT91SAM9263_BASE_RTT0 + SZ_16 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, {
.flags = IORESOURCE_MEM,
} }
}; };
...@@ -973,7 +976,6 @@ static struct platform_device at91sam9263_rtt0_device = { ...@@ -973,7 +976,6 @@ static struct platform_device at91sam9263_rtt0_device = {
.name = "at91_rtt", .name = "at91_rtt",
.id = 0, .id = 0,
.resource = rtt0_resources, .resource = rtt0_resources,
.num_resources = ARRAY_SIZE(rtt0_resources),
}; };
static struct resource rtt1_resources[] = { static struct resource rtt1_resources[] = {
...@@ -981,6 +983,8 @@ static struct resource rtt1_resources[] = { ...@@ -981,6 +983,8 @@ static struct resource rtt1_resources[] = {
.start = AT91SAM9263_BASE_RTT1, .start = AT91SAM9263_BASE_RTT1,
.end = AT91SAM9263_BASE_RTT1 + SZ_16 - 1, .end = AT91SAM9263_BASE_RTT1 + SZ_16 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, {
.flags = IORESOURCE_MEM,
} }
}; };
...@@ -988,11 +992,53 @@ static struct platform_device at91sam9263_rtt1_device = { ...@@ -988,11 +992,53 @@ static struct platform_device at91sam9263_rtt1_device = {
.name = "at91_rtt", .name = "at91_rtt",
.id = 1, .id = 1,
.resource = rtt1_resources, .resource = rtt1_resources,
.num_resources = ARRAY_SIZE(rtt1_resources),
}; };
#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
static void __init at91_add_device_rtt_rtc(void)
{
struct platform_device *pdev;
struct resource *r;
switch (CONFIG_RTC_DRV_AT91SAM9_RTT) {
case 0:
/*
* The second resource is needed only for the chosen RTT:
* GPBR will serve as the storage for RTC time offset
*/
at91sam9263_rtt0_device.num_resources = 2;
at91sam9263_rtt1_device.num_resources = 1;
pdev = &at91sam9263_rtt0_device;
r = rtt0_resources;
break;
case 1:
at91sam9263_rtt0_device.num_resources = 1;
at91sam9263_rtt1_device.num_resources = 2;
pdev = &at91sam9263_rtt1_device;
r = rtt1_resources;
break;
default:
pr_err("at91sam9263: only supports 2 RTT (%d)\n",
CONFIG_RTC_DRV_AT91SAM9_RTT);
return;
}
pdev->name = "rtc-at91sam9";
r[1].start = AT91SAM9263_BASE_GPBR + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
r[1].end = r[1].start + 3;
}
#else
static void __init at91_add_device_rtt_rtc(void)
{
/* Only one resource is needed: RTT not used as RTC */
at91sam9263_rtt0_device.num_resources = 1;
at91sam9263_rtt1_device.num_resources = 1;
}
#endif
static void __init at91_add_device_rtt(void) static void __init at91_add_device_rtt(void)
{ {
at91_add_device_rtt_rtc();
platform_device_register(&at91sam9263_rtt0_device); platform_device_register(&at91sam9263_rtt0_device);
platform_device_register(&at91sam9263_rtt1_device); platform_device_register(&at91sam9263_rtt1_device);
} }
...@@ -1378,7 +1424,6 @@ static inline void configure_usart2_pins(unsigned pins) ...@@ -1378,7 +1424,6 @@ static inline void configure_usart2_pins(unsigned pins)
} }
static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
struct platform_device *atmel_default_console_device; /* the serial console device */
void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
{ {
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/clockchips.h> #include <linux/clockchips.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
...@@ -133,7 +136,8 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id) ...@@ -133,7 +136,8 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
static struct irqaction at91sam926x_pit_irq = { static struct irqaction at91sam926x_pit_irq = {
.name = "at91_tick", .name = "at91_tick",
.flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
.handler = at91sam926x_pit_interrupt .handler = at91sam926x_pit_interrupt,
.irq = AT91_ID_SYS,
}; };
static void at91sam926x_pit_reset(void) static void at91sam926x_pit_reset(void)
...@@ -149,6 +153,51 @@ static void at91sam926x_pit_reset(void) ...@@ -149,6 +153,51 @@ static void at91sam926x_pit_reset(void)
pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
} }
#ifdef CONFIG_OF
static struct of_device_id pit_timer_ids[] = {
{ .compatible = "atmel,at91sam9260-pit" },
{ /* sentinel */ }
};
static int __init of_at91sam926x_pit_init(void)
{
struct device_node *np;
int ret;
np = of_find_matching_node(NULL, pit_timer_ids);
if (!np)
goto err;
pit_base_addr = of_iomap(np, 0);
if (!pit_base_addr)
goto node_err;
/* Get the interrupts property */
ret = irq_of_parse_and_map(np, 0);
if (!ret) {
pr_crit("AT91: PIT: Unable to get IRQ from DT\n");
goto ioremap_err;
}
at91sam926x_pit_irq.irq = ret;
of_node_put(np);
return 0;
ioremap_err:
iounmap(pit_base_addr);
node_err:
of_node_put(np);
err:
return -EINVAL;
}
#else
static int __init of_at91sam926x_pit_init(void)
{
return -EINVAL;
}
#endif
/* /*
* Set up both clocksource and clockevent support. * Set up both clocksource and clockevent support.
*/ */
...@@ -156,6 +205,10 @@ static void __init at91sam926x_pit_init(void) ...@@ -156,6 +205,10 @@ static void __init at91sam926x_pit_init(void)
{ {
unsigned long pit_rate; unsigned long pit_rate;
unsigned bits; unsigned bits;
int ret;
/* For device tree enabled device: initialize here */
of_at91sam926x_pit_init();
/* /*
* Use our actual MCK to figure out how many MCK/16 ticks per * Use our actual MCK to figure out how many MCK/16 ticks per
...@@ -177,7 +230,9 @@ static void __init at91sam926x_pit_init(void) ...@@ -177,7 +230,9 @@ static void __init at91sam926x_pit_init(void)
clocksource_register_hz(&pit_clk, pit_rate); clocksource_register_hz(&pit_clk, pit_rate);
/* Set up irq handler */ /* Set up irq handler */
setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq); ret = setup_irq(at91sam926x_pit_irq.irq, &at91sam926x_pit_irq);
if (ret)
pr_crit("AT91: PIT: Unable to setup IRQ\n");
/* Set up and register clockevents */ /* Set up and register clockevents */
pit_clkevt.mult = div_sc(pit_rate, NSEC_PER_SEC, pit_clkevt.shift); pit_clkevt.mult = div_sc(pit_rate, NSEC_PER_SEC, pit_clkevt.shift);
...@@ -193,6 +248,15 @@ static void at91sam926x_pit_suspend(void) ...@@ -193,6 +248,15 @@ static void at91sam926x_pit_suspend(void)
void __init at91sam926x_ioremap_pit(u32 addr) void __init at91sam926x_ioremap_pit(u32 addr)
{ {
#if defined(CONFIG_OF)
struct device_node *np =
of_find_matching_node(NULL, pit_timer_ids);
if (np) {
of_node_put(np);
return;
}
#endif
pit_base_addr = ioremap(addr, 16); pit_base_addr = ioremap(addr, 16);
if (!pit_base_addr) if (!pit_base_addr)
......
...@@ -15,16 +15,17 @@ ...@@ -15,16 +15,17 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/at91sam9_sdramc.h> #include <mach/at91_ramc.h>
#include <mach/at91_rstc.h> #include <mach/at91_rstc.h>
.arm .arm
.globl at91sam9_alt_restart .globl at91sam9_alt_restart
at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants at91sam9_alt_restart: ldr r0, =at91_ramc_base @ preload constants
ldr r1, =at91_rstc_base ldr r0, [r0]
ldr r1, [r1] ldr r4, =at91_rstc_base
ldr r1, [r4]
mov r2, #1 mov r2, #1
mov r3, #AT91_SDRAMC_LPCB_POWER_DOWN mov r3, #AT91_SDRAMC_LPCB_POWER_DOWN
...@@ -37,6 +38,3 @@ at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants ...@@ -37,6 +38,3 @@ at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants
str r4, [r1, #AT91_RSTC_CR] @ reset processor str r4, [r1, #AT91_RSTC_CR] @ reset processor
b . b .
.at91_va_base_sdramc:
.word AT91_VA_BASE_SYS + AT91_SDRAMC0
...@@ -229,6 +229,9 @@ static struct clk_lookup periph_clocks_lookups[] = { ...@@ -229,6 +229,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("usart", "fff90000.serial", &usart1_clk), CLKDEV_CON_DEV_ID("usart", "fff90000.serial", &usart1_clk),
CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk), CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk),
CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk), CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk),
/* more tc lookup table for DT entries */
CLKDEV_CON_DEV_ID("t0_clk", "fff7c000.timer", &tcb0_clk),
CLKDEV_CON_DEV_ID("t0_clk", "fffd4000.timer", &tcb0_clk),
/* fake hclk clock */ /* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk),
CLKDEV_CON_ID("pioA", &pioA_clk), CLKDEV_CON_ID("pioA", &pioA_clk),
...@@ -317,12 +320,6 @@ static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = { ...@@ -317,12 +320,6 @@ static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = {
} }
}; };
static void at91sam9g45_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
}
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* AT91SAM9G45 processor initialization * AT91SAM9G45 processor initialization
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
...@@ -337,13 +334,16 @@ static void __init at91sam9g45_ioremap_registers(void) ...@@ -337,13 +334,16 @@ static void __init at91sam9g45_ioremap_registers(void)
{ {
at91_ioremap_shdwc(AT91SAM9G45_BASE_SHDWC); at91_ioremap_shdwc(AT91SAM9G45_BASE_SHDWC);
at91_ioremap_rstc(AT91SAM9G45_BASE_RSTC); at91_ioremap_rstc(AT91SAM9G45_BASE_RSTC);
at91_ioremap_ramc(0, AT91SAM9G45_BASE_DDRSDRC1, 512);
at91_ioremap_ramc(1, AT91SAM9G45_BASE_DDRSDRC0, 512);
at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT); at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT);
at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC); at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC);
at91_ioremap_matrix(AT91SAM9G45_BASE_MATRIX);
} }
static void __init at91sam9g45_initialize(void) static void __init at91sam9g45_initialize(void)
{ {
arm_pm_idle = at91sam9g45_idle; arm_pm_idle = at91sam9_idle;
arm_pm_restart = at91sam9g45_restart; arm_pm_restart = at91sam9g45_restart;
at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91sam9g45.h> #include <mach/at91sam9g45.h>
#include <mach/at91sam9g45_matrix.h> #include <mach/at91sam9g45_matrix.h>
#include <mach/at91_matrix.h>
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include <mach/at_hdmac.h> #include <mach/at_hdmac.h>
#include <mach/atmel-mci.h> #include <mach/atmel-mci.h>
...@@ -557,8 +558,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) ...@@ -557,8 +558,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
if (!data) if (!data)
return; return;
csa = at91_sys_read(AT91_MATRIX_EBICSA); csa = at91_matrix_read(AT91_MATRIX_EBICSA);
at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA);
/* enable pin */ /* enable pin */
if (gpio_is_valid(data->enable_pin)) if (gpio_is_valid(data->enable_pin))
...@@ -1051,7 +1052,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} ...@@ -1051,7 +1052,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
static struct resource tcb0_resources[] = { static struct resource tcb0_resources[] = {
[0] = { [0] = {
.start = AT91SAM9G45_BASE_TCB0, .start = AT91SAM9G45_BASE_TCB0,
.end = AT91SAM9G45_BASE_TCB0 + SZ_16K - 1, .end = AT91SAM9G45_BASE_TCB0 + SZ_256 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -1072,7 +1073,7 @@ static struct platform_device at91sam9g45_tcb0_device = { ...@@ -1072,7 +1073,7 @@ static struct platform_device at91sam9g45_tcb0_device = {
static struct resource tcb1_resources[] = { static struct resource tcb1_resources[] = {
[0] = { [0] = {
.start = AT91SAM9G45_BASE_TCB1, .start = AT91SAM9G45_BASE_TCB1,
.end = AT91SAM9G45_BASE_TCB1 + SZ_16K - 1, .end = AT91SAM9G45_BASE_TCB1 + SZ_256 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -1089,8 +1090,25 @@ static struct platform_device at91sam9g45_tcb1_device = { ...@@ -1089,8 +1090,25 @@ static struct platform_device at91sam9g45_tcb1_device = {
.num_resources = ARRAY_SIZE(tcb1_resources), .num_resources = ARRAY_SIZE(tcb1_resources),
}; };
#if defined(CONFIG_OF)
static struct of_device_id tcb_ids[] = {
{ .compatible = "atmel,at91rm9200-tcb" },
{ /*sentinel*/ }
};
#endif
static void __init at91_add_device_tc(void) static void __init at91_add_device_tc(void)
{ {
#if defined(CONFIG_OF)
struct device_node *np;
np = of_find_matching_node(NULL, tcb_ids);
if (np) {
of_node_put(np);
return;
}
#endif
platform_device_register(&at91sam9g45_tcb0_device); platform_device_register(&at91sam9g45_tcb0_device);
platform_device_register(&at91sam9g45_tcb1_device); platform_device_register(&at91sam9g45_tcb1_device);
} }
...@@ -1193,6 +1211,8 @@ static struct resource rtt_resources[] = { ...@@ -1193,6 +1211,8 @@ static struct resource rtt_resources[] = {
.start = AT91SAM9G45_BASE_RTT, .start = AT91SAM9G45_BASE_RTT,
.end = AT91SAM9G45_BASE_RTT + SZ_16 - 1, .end = AT91SAM9G45_BASE_RTT + SZ_16 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, {
.flags = IORESOURCE_MEM,
} }
}; };
...@@ -1200,11 +1220,32 @@ static struct platform_device at91sam9g45_rtt_device = { ...@@ -1200,11 +1220,32 @@ static struct platform_device at91sam9g45_rtt_device = {
.name = "at91_rtt", .name = "at91_rtt",
.id = 0, .id = 0,
.resource = rtt_resources, .resource = rtt_resources,
.num_resources = ARRAY_SIZE(rtt_resources),
}; };
#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
static void __init at91_add_device_rtt_rtc(void)
{
at91sam9g45_rtt_device.name = "rtc-at91sam9";
/*
* The second resource is needed:
* GPBR will serve as the storage for RTC time offset
*/
at91sam9g45_rtt_device.num_resources = 2;
rtt_resources[1].start = AT91SAM9G45_BASE_GPBR +
4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
rtt_resources[1].end = rtt_resources[1].start + 3;
}
#else
static void __init at91_add_device_rtt_rtc(void)
{
/* Only one resource is needed: RTT not used as RTC */
at91sam9g45_rtt_device.num_resources = 1;
}
#endif
static void __init at91_add_device_rtt(void) static void __init at91_add_device_rtt(void)
{ {
at91_add_device_rtt_rtc();
platform_device_register(&at91sam9g45_rtt_device); platform_device_register(&at91sam9g45_rtt_device);
} }
...@@ -1659,7 +1700,6 @@ static inline void configure_usart3_pins(unsigned pins) ...@@ -1659,7 +1700,6 @@ static inline void configure_usart3_pins(unsigned pins)
} }
static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
struct platform_device *atmel_default_console_device; /* the serial console device */
void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
{ {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/at91sam9_ddrsdr.h> #include <mach/at91_ramc.h>
#include <mach/at91_rstc.h> #include <mach/at91_rstc.h>
.arm .arm
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
.globl at91sam9g45_restart .globl at91sam9g45_restart
at91sam9g45_restart: at91sam9g45_restart:
ldr r0, .at91_va_base_sdramc0 @ preload constants ldr r5, =at91_ramc_base @ preload constants
ldr r1, =at91_rstc_base ldr r0, [r5]
ldr r1, [r1] ldr r4, =at91_rstc_base
ldr r1, [r4]
mov r2, #1 mov r2, #1
mov r3, #AT91_DDRSDRC_LPCB_POWER_DOWN mov r3, #AT91_DDRSDRC_LPCB_POWER_DOWN
...@@ -35,6 +36,3 @@ at91sam9g45_restart: ...@@ -35,6 +36,3 @@ at91sam9g45_restart:
str r4, [r1, #AT91_RSTC_CR] @ reset processor str r4, [r1, #AT91_RSTC_CR] @ reset processor
b . b .
.at91_va_base_sdramc0:
.word AT91_VA_BASE_SYS + AT91_DDRSDRC0
...@@ -288,19 +288,15 @@ static void __init at91sam9rl_ioremap_registers(void) ...@@ -288,19 +288,15 @@ static void __init at91sam9rl_ioremap_registers(void)
{ {
at91_ioremap_shdwc(AT91SAM9RL_BASE_SHDWC); at91_ioremap_shdwc(AT91SAM9RL_BASE_SHDWC);
at91_ioremap_rstc(AT91SAM9RL_BASE_RSTC); at91_ioremap_rstc(AT91SAM9RL_BASE_RSTC);
at91_ioremap_ramc(0, AT91SAM9RL_BASE_SDRAMC, 512);
at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT); at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT);
at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC); at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC);
} at91_ioremap_matrix(AT91SAM9RL_BASE_MATRIX);
static void at91sam9rl_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
} }
static void __init at91sam9rl_initialize(void) static void __init at91sam9rl_initialize(void)
{ {
arm_pm_idle = at91sam9rl_idle; arm_pm_idle = at91sam9_idle;
arm_pm_restart = at91sam9_alt_restart; arm_pm_restart = at91sam9_alt_restart;
at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91sam9rl.h> #include <mach/at91sam9rl.h>
#include <mach/at91sam9rl_matrix.h> #include <mach/at91sam9rl_matrix.h>
#include <mach/at91_matrix.h>
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include <mach/at_hdmac.h> #include <mach/at_hdmac.h>
...@@ -265,8 +266,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) ...@@ -265,8 +266,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
if (!data) if (!data)
return; return;
csa = at91_sys_read(AT91_MATRIX_EBICSA); csa = at91_matrix_read(AT91_MATRIX_EBICSA);
at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
/* enable pin */ /* enable pin */
if (gpio_is_valid(data->enable_pin)) if (gpio_is_valid(data->enable_pin))
...@@ -682,6 +683,8 @@ static struct resource rtt_resources[] = { ...@@ -682,6 +683,8 @@ static struct resource rtt_resources[] = {
.start = AT91SAM9RL_BASE_RTT, .start = AT91SAM9RL_BASE_RTT,
.end = AT91SAM9RL_BASE_RTT + SZ_16 - 1, .end = AT91SAM9RL_BASE_RTT + SZ_16 - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, {
.flags = IORESOURCE_MEM,
} }
}; };
...@@ -689,11 +692,32 @@ static struct platform_device at91sam9rl_rtt_device = { ...@@ -689,11 +692,32 @@ static struct platform_device at91sam9rl_rtt_device = {
.name = "at91_rtt", .name = "at91_rtt",
.id = 0, .id = 0,
.resource = rtt_resources, .resource = rtt_resources,
.num_resources = ARRAY_SIZE(rtt_resources),
}; };
#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
static void __init at91_add_device_rtt_rtc(void)
{
at91sam9rl_rtt_device.name = "rtc-at91sam9";
/*
* The second resource is needed:
* GPBR will serve as the storage for RTC time offset
*/
at91sam9rl_rtt_device.num_resources = 2;
rtt_resources[1].start = AT91SAM9RL_BASE_GPBR +
4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
rtt_resources[1].end = rtt_resources[1].start + 3;
}
#else
static void __init at91_add_device_rtt_rtc(void)
{
/* Only one resource is needed: RTT not used as RTC */
at91sam9rl_rtt_device.num_resources = 1;
}
#endif
static void __init at91_add_device_rtt(void) static void __init at91_add_device_rtt(void)
{ {
at91_add_device_rtt_rtc();
platform_device_register(&at91sam9rl_rtt_device); platform_device_register(&at91sam9rl_rtt_device);
} }
...@@ -1128,7 +1152,6 @@ static inline void configure_usart3_pins(unsigned pins) ...@@ -1128,7 +1152,6 @@ static inline void configure_usart3_pins(unsigned pins)
} }
static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
struct platform_device *atmel_default_console_device; /* the serial console device */
void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
{ {
......
...@@ -301,8 +301,7 @@ static void __init at91sam9x5_map_io(void) ...@@ -301,8 +301,7 @@ static void __init at91sam9x5_map_io(void)
static void __init at91sam9x5_ioremap_registers(void) static void __init at91sam9x5_ioremap_registers(void)
{ {
if (of_at91sam926x_pit_init() < 0) at91_ioremap_ramc(0, AT91SAM9X5_BASE_DDRSDRC0, 512);
panic("Impossible to find PIT\n");
} }
void __init at91sam9x5_initialize(void) void __init at91sam9x5_initialize(void)
...@@ -317,10 +316,6 @@ void __init at91sam9x5_initialize(void) ...@@ -317,10 +316,6 @@ void __init at91sam9x5_initialize(void)
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* AT91SAM9x5 devices (temporary before modification of code) * AT91SAM9x5 devices (temporary before modification of code)
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
void __init at91_set_serial_console(unsigned portnr) {}
struct platform_device *atmel_default_console_device = NULL;
void __init at91_add_device_nand(struct atmel_nand_data *data) {} void __init at91_add_device_nand(struct atmel_nand_data *data) {}
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
......
...@@ -44,7 +44,7 @@ static void at91x40_idle(void) ...@@ -44,7 +44,7 @@ static void at91x40_idle(void)
* Disable the processor clock. The processor will be automatically * Disable the processor clock. The processor will be automatically
* re-enabled by an interrupt or by a reset. * re-enabled by an interrupt or by a reset.
*/ */
at91_sys_write(AT91_PS_CR, AT91_PS_CR_CPU); __raw_writel(AT91_PS_CR_CPU, AT91_PS_CR);
cpu_do_idle(); cpu_do_idle();
} }
......
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <mach/at91_tc.h> #include <mach/at91_tc.h>
#define at91_tc_read(field) \
__raw_readl(AT91_TC + field)
#define at91_tc_write(field, value) \
__raw_writel(value, AT91_TC + field);
/* /*
* 3 counter/timer units present. * 3 counter/timer units present.
*/ */
...@@ -37,12 +43,12 @@ ...@@ -37,12 +43,12 @@
static unsigned long at91x40_gettimeoffset(void) static unsigned long at91x40_gettimeoffset(void)
{ {
return (at91_sys_read(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128)); return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128));
} }
static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id)
{ {
at91_sys_read(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_SR); at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_SR);
timer_tick(); timer_tick();
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -57,20 +63,20 @@ void __init at91x40_timer_init(void) ...@@ -57,20 +63,20 @@ void __init at91x40_timer_init(void)
{ {
unsigned int v; unsigned int v;
at91_sys_write(AT91_TC + AT91_TC_BCR, 0); at91_tc_write(AT91_TC_BCR, 0);
v = at91_sys_read(AT91_TC + AT91_TC_BMR); v = at91_tc_read(AT91_TC_BMR);
v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE; v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE;
at91_sys_write(AT91_TC + AT91_TC_BMR, v); at91_tc_write(AT91_TC_BMR, v);
at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_CCR, AT91_TC_CLKDIS); at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, AT91_TC_CLKDIS);
at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_CMR, (AT91_TC_TIMER_CLOCK4 | AT91_TC_CPCTRG)); at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CMR, (AT91_TC_TIMER_CLOCK4 | AT91_TC_CPCTRG));
at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_IDR, 0xffffffff); at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_IDR, 0xffffffff);
at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_RC, (AT91X40_MASTER_CLOCK / 128) / HZ - 1); at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_RC, (AT91X40_MASTER_CLOCK / 128) / HZ - 1);
at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_IER, (1<<4)); at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_IER, (1<<4));
setup_irq(AT91X40_ID_TC1, &at91x40_timer_irq); setup_irq(AT91X40_ID_TC1, &at91x40_timer_irq);
at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN)); at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN));
} }
struct sys_timer at91x40_timer = { struct sys_timer at91x40_timer = {
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include <mach/at91sam9260_matrix.h> #include <mach/at91sam9260_matrix.h>
#include <mach/at91_matrix.h>
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
...@@ -238,8 +239,8 @@ static __init void cpu9krea_add_device_nor(void) ...@@ -238,8 +239,8 @@ static __init void cpu9krea_add_device_nor(void)
{ {
unsigned long csa; unsigned long csa;
csa = at91_sys_read(AT91_MATRIX_EBICSA); csa = at91_matrix_read(AT91_MATRIX_EBICSA);
at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V); at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V);
/* configure chip-select 0 (NOR) */ /* configure chip-select 0 (NOR) */
sam9_smc_configure(0, 0, &cpu9krea_nor_smc_config); sam9_smc_configure(0, 0, &cpu9krea_nor_smc_config);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
#include <mach/at91_ramc.h>
#include <mach/cpu.h> #include <mach/cpu.h>
#include "generic.h" #include "generic.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/irqdomain.h> #include <linux/of.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
...@@ -38,12 +38,6 @@ static void __init ek_init_early(void) ...@@ -38,12 +38,6 @@ static void __init ek_init_early(void)
{ {
/* Initialize processor: 12.000 MHz crystal */ /* Initialize processor: 12.000 MHz crystal */
at91_initialize(12000000); at91_initialize(12000000);
/* DGBU on ttyS0. (Rx & Tx only) */
at91_register_uart(0, 0, 0);
/* set serial console to ttyS0 (ie, DBGU) */
at91_set_serial_console(0);
} }
/* det_pin is not connected */ /* det_pin is not connected */
...@@ -88,15 +82,17 @@ static void __init ek_add_device_nand(void) ...@@ -88,15 +82,17 @@ static void __init ek_add_device_nand(void)
at91_add_device_nand(&ek_nand_data); at91_add_device_nand(&ek_nand_data);
} }
static const struct of_device_id aic_of_match[] __initconst = { static const struct of_device_id irq_of_match[] __initconst = {
{ .compatible = "atmel,at91rm9200-aic", },
{}, { .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init },
{ .compatible = "atmel,at91rm9200-gpio", .data = at91_gpio_of_irq_setup },
{ .compatible = "atmel,at91sam9x5-gpio", .data = at91_gpio_of_irq_setup },
{ /*sentinel*/ }
}; };
static void __init at91_dt_init_irq(void) static void __init at91_dt_init_irq(void)
{ {
irq_domain_generate_simple(aic_of_match, 0xfffff000, 0); of_irq_init(irq_of_match);
at91_init_irq_default();
} }
static void __init at91_dt_device_init(void) static void __init at91_dt_device_init(void)
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
#include <mach/at91_ramc.h>
#include <mach/cpu.h> #include <mach/cpu.h>
#include "generic.h" #include "generic.h"
...@@ -110,7 +111,7 @@ static void __init eco920_board_init(void) ...@@ -110,7 +111,7 @@ static void __init eco920_board_init(void)
at91_add_device_mmc(0, &eco920_mmc_data); at91_add_device_mmc(0, &eco920_mmc_data);
platform_device_register(&eco920_flash); platform_device_register(&eco920_flash);
at91_sys_write(AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1) at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)
| AT91_SMC_RWSETUP_(1) | AT91_SMC_RWSETUP_(1)
| AT91_SMC_DBW_8 | AT91_SMC_DBW_8
| AT91_SMC_WSEN | AT91_SMC_WSEN
...@@ -122,7 +123,7 @@ static void __init eco920_board_init(void) ...@@ -122,7 +123,7 @@ static void __init eco920_board_init(void)
at91_set_deglitch(AT91_PIN_PA23, 1); at91_set_deglitch(AT91_PIN_PA23, 1);
/* Initialization of the Static Memory Controller for Chip Select 3 */ /* Initialization of the Static Memory Controller for Chip Select 3 */
at91_sys_write(AT91_SMC_CSR(3), at91_ramc_write(0, AT91_SMC_CSR(3),
AT91_SMC_DBW_16 | /* 16 bit */ AT91_SMC_DBW_16 | /* 16 bit */
AT91_SMC_WSEN | AT91_SMC_WSEN |
AT91_SMC_NWS_(5) | /* wait states */ AT91_SMC_NWS_(5) | /* wait states */
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/cpu.h> #include <mach/cpu.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
#include <mach/at91_ramc.h>
#include "generic.h" #include "generic.h"
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
#include <mach/at91_ramc.h>
#include "generic.h" #include "generic.h"
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
#include <mach/at91_ramc.h>
#include "generic.h" #include "generic.h"
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
#include <mach/at91_ramc.h>
#include "generic.h" #include "generic.h"
......
...@@ -145,11 +145,11 @@ static struct i2c_board_info __initdata snapper9260_i2c_devices[] = { ...@@ -145,11 +145,11 @@ static struct i2c_board_info __initdata snapper9260_i2c_devices[] = {
/* Audio codec */ /* Audio codec */
I2C_BOARD_INFO("tlv320aic23", 0x1a), I2C_BOARD_INFO("tlv320aic23", 0x1a),
}, },
{ };
static struct i2c_board_info __initdata snapper9260_i2c_isl1208 = {
/* RTC */ /* RTC */
I2C_BOARD_INFO("isl1208", 0x6f), I2C_BOARD_INFO("isl1208", 0x6f),
.irq = gpio_to_irq(AT91_PIN_PA31),
},
}; };
static void __init snapper9260_add_device_nand(void) static void __init snapper9260_add_device_nand(void)
...@@ -163,6 +163,10 @@ static void __init snapper9260_board_init(void) ...@@ -163,6 +163,10 @@ static void __init snapper9260_board_init(void)
{ {
at91_add_device_i2c(snapper9260_i2c_devices, at91_add_device_i2c(snapper9260_i2c_devices,
ARRAY_SIZE(snapper9260_i2c_devices)); ARRAY_SIZE(snapper9260_i2c_devices));
snapper9260_i2c_isl1208.irq = gpio_to_irq(AT91_PIN_PA31);
i2c_register_board_info(0, &snapper9260_i2c_isl1208, 1);
at91_add_device_serial(); at91_add_device_serial();
at91_add_device_usbh(&snapper9260_usbh_data); at91_add_device_usbh(&snapper9260_usbh_data);
at91_add_device_udc(&snapper9260_udc_data); at91_add_device_udc(&snapper9260_udc_data);
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
#include <mach/at91_ramc.h>
#include <mach/cpu.h> #include <mach/cpu.h>
#include "generic.h" #include "generic.h"
...@@ -393,7 +394,7 @@ static void yl9200_init_video(void) ...@@ -393,7 +394,7 @@ static void yl9200_init_video(void)
at91_set_A_periph(AT91_PIN_PC6, 0); at91_set_A_periph(AT91_PIN_PC6, 0);
/* Initialization of the Static Memory Controller for Chip Select 2 */ /* Initialization of the Static Memory Controller for Chip Select 2 */
at91_sys_write(AT91_SMC_CSR(2), AT91_SMC_DBW_16 /* 16 bit */ at91_ramc_write(0, AT91_SMC_CSR(2), AT91_SMC_DBW_16 /* 16 bit */
| AT91_SMC_WSEN | AT91_SMC_NWS_(0x4) /* wait states */ | AT91_SMC_WSEN | AT91_SMC_NWS_(0x4) /* wait states */
| AT91_SMC_TDF_(0x100) /* float time */ | AT91_SMC_TDF_(0x100) /* float time */
); );
......
...@@ -28,9 +28,12 @@ ...@@ -28,9 +28,12 @@
#include <mach/at91_pmc.h> #include <mach/at91_pmc.h>
#include <mach/cpu.h> #include <mach/cpu.h>
#include <asm/proc-fns.h>
#include "clock.h" #include "clock.h"
#include "generic.h" #include "generic.h"
void __iomem *at91_pmc_base;
/* /*
* There's a lot more which can be done with clocks, including cpufreq * There's a lot more which can be done with clocks, including cpufreq
...@@ -123,11 +126,11 @@ static void pllb_mode(struct clk *clk, int is_on) ...@@ -123,11 +126,11 @@ static void pllb_mode(struct clk *clk, int is_on)
value = 0; value = 0;
// REVISIT: Add work-around for AT91RM9200 Errata #26 ? // REVISIT: Add work-around for AT91RM9200 Errata #26 ?
at91_sys_write(AT91_CKGR_PLLBR, value); at91_pmc_write(AT91_CKGR_PLLBR, value);
do { do {
cpu_relax(); cpu_relax();
} while ((at91_sys_read(AT91_PMC_SR) & AT91_PMC_LOCKB) != is_on); } while ((at91_pmc_read(AT91_PMC_SR) & AT91_PMC_LOCKB) != is_on);
} }
static struct clk pllb = { static struct clk pllb = {
...@@ -142,24 +145,24 @@ static struct clk pllb = { ...@@ -142,24 +145,24 @@ static struct clk pllb = {
static void pmc_sys_mode(struct clk *clk, int is_on) static void pmc_sys_mode(struct clk *clk, int is_on)
{ {
if (is_on) if (is_on)
at91_sys_write(AT91_PMC_SCER, clk->pmc_mask); at91_pmc_write(AT91_PMC_SCER, clk->pmc_mask);
else else
at91_sys_write(AT91_PMC_SCDR, clk->pmc_mask); at91_pmc_write(AT91_PMC_SCDR, clk->pmc_mask);
} }
static void pmc_uckr_mode(struct clk *clk, int is_on) static void pmc_uckr_mode(struct clk *clk, int is_on)
{ {
unsigned int uckr = at91_sys_read(AT91_CKGR_UCKR); unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR);
if (is_on) { if (is_on) {
is_on = AT91_PMC_LOCKU; is_on = AT91_PMC_LOCKU;
at91_sys_write(AT91_CKGR_UCKR, uckr | clk->pmc_mask); at91_pmc_write(AT91_CKGR_UCKR, uckr | clk->pmc_mask);
} else } else
at91_sys_write(AT91_CKGR_UCKR, uckr & ~(clk->pmc_mask)); at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(clk->pmc_mask));
do { do {
cpu_relax(); cpu_relax();
} while ((at91_sys_read(AT91_PMC_SR) & AT91_PMC_LOCKU) != is_on); } while ((at91_pmc_read(AT91_PMC_SR) & AT91_PMC_LOCKU) != is_on);
} }
/* USB function clocks (PLLB must be 48 MHz) */ /* USB function clocks (PLLB must be 48 MHz) */
...@@ -195,9 +198,9 @@ struct clk mck = { ...@@ -195,9 +198,9 @@ struct clk mck = {
static void pmc_periph_mode(struct clk *clk, int is_on) static void pmc_periph_mode(struct clk *clk, int is_on)
{ {
if (is_on) if (is_on)
at91_sys_write(AT91_PMC_PCER, clk->pmc_mask); at91_pmc_write(AT91_PMC_PCER, clk->pmc_mask);
else else
at91_sys_write(AT91_PMC_PCDR, clk->pmc_mask); at91_pmc_write(AT91_PMC_PCDR, clk->pmc_mask);
} }
static struct clk __init *at91_css_to_clk(unsigned long css) static struct clk __init *at91_css_to_clk(unsigned long css)
...@@ -357,10 +360,10 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ...@@ -357,10 +360,10 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (actual && actual <= rate) { if (actual && actual <= rate) {
u32 pckr; u32 pckr;
pckr = at91_sys_read(AT91_PMC_PCKR(clk->id)); pckr = at91_pmc_read(AT91_PMC_PCKR(clk->id));
pckr &= css_mask; /* keep clock selection */ pckr &= css_mask; /* keep clock selection */
pckr |= prescale << prescale_offset; pckr |= prescale << prescale_offset;
at91_sys_write(AT91_PMC_PCKR(clk->id), pckr); at91_pmc_write(AT91_PMC_PCKR(clk->id), pckr);
clk->rate_hz = actual; clk->rate_hz = actual;
break; break;
} }
...@@ -394,7 +397,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent) ...@@ -394,7 +397,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
clk->rate_hz = parent->rate_hz; clk->rate_hz = parent->rate_hz;
clk->parent = parent; clk->parent = parent;
at91_sys_write(AT91_PMC_PCKR(clk->id), parent->id); at91_pmc_write(AT91_PMC_PCKR(clk->id), parent->id);
spin_unlock_irqrestore(&clk_lock, flags); spin_unlock_irqrestore(&clk_lock, flags);
return 0; return 0;
...@@ -413,7 +416,7 @@ static void __init init_programmable_clock(struct clk *clk) ...@@ -413,7 +416,7 @@ static void __init init_programmable_clock(struct clk *clk)
else else
css_mask = AT91_PMC_CSS; css_mask = AT91_PMC_CSS;
pckr = at91_sys_read(AT91_PMC_PCKR(clk->id)); pckr = at91_pmc_read(AT91_PMC_PCKR(clk->id));
parent = at91_css_to_clk(pckr & css_mask); parent = at91_css_to_clk(pckr & css_mask);
clk->parent = parent; clk->parent = parent;
clk->rate_hz = parent->rate_hz / pmc_prescaler_divider(pckr); clk->rate_hz = parent->rate_hz / pmc_prescaler_divider(pckr);
...@@ -430,19 +433,24 @@ static int at91_clk_show(struct seq_file *s, void *unused) ...@@ -430,19 +433,24 @@ static int at91_clk_show(struct seq_file *s, void *unused)
u32 scsr, pcsr, uckr = 0, sr; u32 scsr, pcsr, uckr = 0, sr;
struct clk *clk; struct clk *clk;
seq_printf(s, "SCSR = %8x\n", scsr = at91_sys_read(AT91_PMC_SCSR)); scsr = at91_pmc_read(AT91_PMC_SCSR);
seq_printf(s, "PCSR = %8x\n", pcsr = at91_sys_read(AT91_PMC_PCSR)); pcsr = at91_pmc_read(AT91_PMC_PCSR);
seq_printf(s, "MOR = %8x\n", at91_sys_read(AT91_CKGR_MOR)); sr = at91_pmc_read(AT91_PMC_SR);
seq_printf(s, "MCFR = %8x\n", at91_sys_read(AT91_CKGR_MCFR)); seq_printf(s, "SCSR = %8x\n", scsr);
seq_printf(s, "PLLA = %8x\n", at91_sys_read(AT91_CKGR_PLLAR)); seq_printf(s, "PCSR = %8x\n", pcsr);
seq_printf(s, "MOR = %8x\n", at91_pmc_read(AT91_CKGR_MOR));
seq_printf(s, "MCFR = %8x\n", at91_pmc_read(AT91_CKGR_MCFR));
seq_printf(s, "PLLA = %8x\n", at91_pmc_read(AT91_CKGR_PLLAR));
if (cpu_has_pllb()) if (cpu_has_pllb())
seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR)); seq_printf(s, "PLLB = %8x\n", at91_pmc_read(AT91_CKGR_PLLBR));
if (cpu_has_utmi()) if (cpu_has_utmi()) {
seq_printf(s, "UCKR = %8x\n", uckr = at91_sys_read(AT91_CKGR_UCKR)); uckr = at91_pmc_read(AT91_CKGR_UCKR);
seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR)); seq_printf(s, "UCKR = %8x\n", uckr);
}
seq_printf(s, "MCKR = %8x\n", at91_pmc_read(AT91_PMC_MCKR));
if (cpu_has_upll()) if (cpu_has_upll())
seq_printf(s, "USB = %8x\n", at91_sys_read(AT91_PMC_USB)); seq_printf(s, "USB = %8x\n", at91_pmc_read(AT91_PMC_USB));
seq_printf(s, "SR = %8x\n", sr = at91_sys_read(AT91_PMC_SR)); seq_printf(s, "SR = %8x\n", sr);
seq_printf(s, "\n"); seq_printf(s, "\n");
...@@ -630,14 +638,14 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock) ...@@ -630,14 +638,14 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock)
if (cpu_is_at91rm9200()) { if (cpu_is_at91rm9200()) {
uhpck.pmc_mask = AT91RM9200_PMC_UHP; uhpck.pmc_mask = AT91RM9200_PMC_UHP;
udpck.pmc_mask = AT91RM9200_PMC_UDP; udpck.pmc_mask = AT91RM9200_PMC_UDP;
at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); at91_pmc_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
} else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() ||
cpu_is_at91sam9263() || cpu_is_at91sam9g20() || cpu_is_at91sam9263() || cpu_is_at91sam9g20() ||
cpu_is_at91sam9g10()) { cpu_is_at91sam9g10()) {
uhpck.pmc_mask = AT91SAM926x_PMC_UHP; uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
udpck.pmc_mask = AT91SAM926x_PMC_UDP; udpck.pmc_mask = AT91SAM926x_PMC_UDP;
} }
at91_sys_write(AT91_CKGR_PLLBR, 0); at91_pmc_write(AT91_CKGR_PLLBR, 0);
udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init); udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init); uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
...@@ -654,13 +662,13 @@ static void __init at91_upll_usbfs_clock_init(unsigned long main_clock) ...@@ -654,13 +662,13 @@ static void __init at91_upll_usbfs_clock_init(unsigned long main_clock)
/* Setup divider by 10 to reach 48 MHz */ /* Setup divider by 10 to reach 48 MHz */
usbr |= ((10 - 1) << 8) & AT91_PMC_OHCIUSBDIV; usbr |= ((10 - 1) << 8) & AT91_PMC_OHCIUSBDIV;
at91_sys_write(AT91_PMC_USB, usbr); at91_pmc_write(AT91_PMC_USB, usbr);
/* Now set uhpck values */ /* Now set uhpck values */
uhpck.parent = &utmi_clk; uhpck.parent = &utmi_clk;
uhpck.pmc_mask = AT91SAM926x_PMC_UHP; uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
uhpck.rate_hz = utmi_clk.rate_hz; uhpck.rate_hz = utmi_clk.rate_hz;
uhpck.rate_hz /= 1 + ((at91_sys_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8); uhpck.rate_hz /= 1 + ((at91_pmc_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8);
} }
int __init at91_clock_init(unsigned long main_clock) int __init at91_clock_init(unsigned long main_clock)
...@@ -669,6 +677,10 @@ int __init at91_clock_init(unsigned long main_clock) ...@@ -669,6 +677,10 @@ int __init at91_clock_init(unsigned long main_clock)
int i; int i;
int pll_overclock = false; int pll_overclock = false;
at91_pmc_base = ioremap(AT91_PMC, 256);
if (!at91_pmc_base)
panic("Impossible to ioremap AT91_PMC 0x%x\n", AT91_PMC);
/* /*
* When the bootloader initialized the main oscillator correctly, * When the bootloader initialized the main oscillator correctly,
* there's no problem using the cycle counter. But if it didn't, * there's no problem using the cycle counter. But if it didn't,
...@@ -677,14 +689,14 @@ int __init at91_clock_init(unsigned long main_clock) ...@@ -677,14 +689,14 @@ int __init at91_clock_init(unsigned long main_clock)
*/ */
if (!main_clock) { if (!main_clock) {
do { do {
tmp = at91_sys_read(AT91_CKGR_MCFR); tmp = at91_pmc_read(AT91_CKGR_MCFR);
} while (!(tmp & AT91_PMC_MAINRDY)); } while (!(tmp & AT91_PMC_MAINRDY));
main_clock = (tmp & AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16); main_clock = (tmp & AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16);
} }
main_clk.rate_hz = main_clock; main_clk.rate_hz = main_clock;
/* report if PLLA is more than mildly overclocked */ /* report if PLLA is more than mildly overclocked */
plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR)); plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_pmc_read(AT91_CKGR_PLLAR));
if (cpu_has_300M_plla()) { if (cpu_has_300M_plla()) {
if (plla.rate_hz > 300000000) if (plla.rate_hz > 300000000)
pll_overclock = true; pll_overclock = true;
...@@ -699,7 +711,7 @@ int __init at91_clock_init(unsigned long main_clock) ...@@ -699,7 +711,7 @@ int __init at91_clock_init(unsigned long main_clock)
pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000); pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000);
if (cpu_has_plladiv2()) { if (cpu_has_plladiv2()) {
mckr = at91_sys_read(AT91_PMC_MCKR); mckr = at91_pmc_read(AT91_PMC_MCKR);
plla.rate_hz /= (1 << ((mckr & AT91_PMC_PLLADIV2) >> 12)); /* plla divisor by 2 */ plla.rate_hz /= (1 << ((mckr & AT91_PMC_PLLADIV2) >> 12)); /* plla divisor by 2 */
} }
...@@ -739,7 +751,7 @@ int __init at91_clock_init(unsigned long main_clock) ...@@ -739,7 +751,7 @@ int __init at91_clock_init(unsigned long main_clock)
* MCK and CPU derive from one of those primary clocks. * MCK and CPU derive from one of those primary clocks.
* For now, assume this parentage won't change. * For now, assume this parentage won't change.
*/ */
mckr = at91_sys_read(AT91_PMC_MCKR); mckr = at91_pmc_read(AT91_PMC_MCKR);
mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS); mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS);
freq = mck.parent->rate_hz; freq = mck.parent->rate_hz;
freq /= pmc_prescaler_divider(mckr); /* prescale */ freq /= pmc_prescaler_divider(mckr); /* prescale */
...@@ -812,9 +824,15 @@ static int __init at91_clock_reset(void) ...@@ -812,9 +824,15 @@ static int __init at91_clock_reset(void)
pr_debug("Clocks: disable unused %s\n", clk->name); pr_debug("Clocks: disable unused %s\n", clk->name);
} }
at91_sys_write(AT91_PMC_PCDR, pcdr); at91_pmc_write(AT91_PMC_PCDR, pcdr);
at91_sys_write(AT91_PMC_SCDR, scdr); at91_pmc_write(AT91_PMC_SCDR, scdr);
return 0; return 0;
} }
late_initcall(at91_clock_reset); late_initcall(at91_clock_reset);
void at91sam9_idle(void)
{
at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
}
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/clkdev.h> #include <linux/clkdev.h>
#include <linux/of.h>
/* Map io */ /* Map io */
extern void __init at91_map_io(void); extern void __init at91_map_io(void);
...@@ -25,9 +26,13 @@ extern void __init at91_init_irq_default(void); ...@@ -25,9 +26,13 @@ extern void __init at91_init_irq_default(void);
extern void __init at91_init_interrupts(unsigned int priority[]); extern void __init at91_init_interrupts(unsigned int priority[]);
extern void __init at91x40_init_interrupts(unsigned int priority[]); extern void __init at91x40_init_interrupts(unsigned int priority[]);
extern void __init at91_aic_init(unsigned int priority[]); extern void __init at91_aic_init(unsigned int priority[]);
extern int __init at91_aic_of_init(struct device_node *node,
struct device_node *parent);
/* Timer */ /* Timer */
struct sys_timer; struct sys_timer;
extern void at91rm9200_ioremap_st(u32 addr);
extern struct sys_timer at91rm9200_timer; extern struct sys_timer at91rm9200_timer;
extern void at91sam926x_ioremap_pit(u32 addr); extern void at91sam926x_ioremap_pit(u32 addr);
extern struct sys_timer at91sam926x_timer; extern struct sys_timer at91sam926x_timer;
...@@ -56,6 +61,9 @@ struct device; ...@@ -56,6 +61,9 @@ struct device;
extern void at91_irq_suspend(void); extern void at91_irq_suspend(void);
extern void at91_irq_resume(void); extern void at91_irq_resume(void);
/* idle */
extern void at91sam9_idle(void);
/* reset */ /* reset */
extern void at91_ioremap_rstc(u32 base_addr); extern void at91_ioremap_rstc(u32 base_addr);
extern void at91sam9_alt_restart(char, const char *); extern void at91sam9_alt_restart(char, const char *);
...@@ -64,6 +72,12 @@ extern void at91sam9g45_restart(char, const char *); ...@@ -64,6 +72,12 @@ extern void at91sam9g45_restart(char, const char *);
/* shutdown */ /* shutdown */
extern void at91_ioremap_shdwc(u32 base_addr); extern void at91_ioremap_shdwc(u32 base_addr);
/* Matrix */
extern void at91_ioremap_matrix(u32 base_addr);
/* Ram Controler */
extern void at91_ioremap_ramc(int id, u32 addr, u32 size);
/* GPIO */ /* GPIO */
#define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */
#define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */ #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */
...@@ -74,5 +88,7 @@ struct at91_gpio_bank { ...@@ -74,5 +88,7 @@ struct at91_gpio_bank {
}; };
extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks); extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
extern void __init at91_gpio_irq_setup(void); extern void __init at91_gpio_irq_setup(void);
extern int __init at91_gpio_of_irq_setup(struct device_node *node,
struct device_node *parent);
extern int at91_extern_irq; extern int at91_extern_irq;
This diff is collapsed.
/*
* Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
*
* Under GPLv2
*/
#ifndef __MACH_AT91_MATRIX_H__
#define __MACH_AT91_MATRIX_H__
#ifndef __ASSEMBLY__
extern void __iomem *at91_matrix_base;
#define at91_matrix_read(field) \
__raw_readl(at91_matrix_base + field)
#define at91_matrix_write(field, value) \
__raw_writel(value, at91_matrix_base + field);
#else
.extern at91_matrix_base
#endif
#endif /* __MACH_AT91_MATRIX_H__ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -121,10 +121,4 @@ ...@@ -121,10 +121,4 @@
#define AT91_DDRSDRC_WPVS (1 << 0) /* Write protect violation status */ #define AT91_DDRSDRC_WPVS (1 << 0) /* Write protect violation status */
#define AT91_DDRSDRC_WPVSRC (0xffff << 8) /* Write protect violation source */ #define AT91_DDRSDRC_WPVSRC (0xffff << 8) /* Write protect violation source */
/* Register access macros */
#define at91_ramc_read(num, reg) \
at91_sys_read(AT91_DDRSDRC##num + reg)
#define at91_ramc_write(num, reg, value) \
at91_sys_write(AT91_DDRSDRC##num + reg, value)
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment