diff options
-rw-r--r-- | arch/arm/boot/dts/at91sam9g45.dtsi | 106 | ||||
-rw-r--r-- | arch/arm/boot/dts/at91sam9m10g45ek.dts | 35 | ||||
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 11 | ||||
-rw-r--r-- | arch/arm/mach-at91/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-at91/Makefile.boot | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-dt.c | 122 |
7 files changed, 285 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi new file mode 100644 index 000000000000..db6a45202f26 --- /dev/null +++ b/arch/arm/boot/dts/at91sam9g45.dtsi | |||
@@ -0,0 +1,106 @@ | |||
1 | /* | ||
2 | * at91sam9g45.dtsi - Device Tree Include file for AT91SAM9G45 family SoC | ||
3 | * applies to AT91SAM9G45, AT91SAM9M10, | ||
4 | * AT91SAM9G46, AT91SAM9M11 SoC | ||
5 | * | ||
6 | * Copyright (C) 2011 Atmel, | ||
7 | * 2011 Nicolas Ferre <nicolas.ferre@atmel.com> | ||
8 | * | ||
9 | * Licensed under GPLv2 or later. | ||
10 | */ | ||
11 | |||
12 | /include/ "skeleton.dtsi" | ||
13 | |||
14 | / { | ||
15 | model = "Atmel AT91SAM9G45 family SoC"; | ||
16 | compatible = "atmel,at91sam9g45"; | ||
17 | interrupt-parent = <&aic>; | ||
18 | |||
19 | aliases { | ||
20 | serial0 = &dbgu; | ||
21 | serial1 = &usart0; | ||
22 | serial2 = &usart1; | ||
23 | serial3 = &usart2; | ||
24 | serial4 = &usart3; | ||
25 | }; | ||
26 | cpus { | ||
27 | cpu@0 { | ||
28 | compatible = "arm,arm926ejs"; | ||
29 | }; | ||
30 | }; | ||
31 | |||
32 | memory@70000000 { | ||
33 | reg = <0x70000000 0x10000000>; | ||
34 | }; | ||
35 | |||
36 | ahb { | ||
37 | compatible = "simple-bus"; | ||
38 | #address-cells = <1>; | ||
39 | #size-cells = <1>; | ||
40 | ranges; | ||
41 | |||
42 | apb { | ||
43 | compatible = "simple-bus"; | ||
44 | #address-cells = <1>; | ||
45 | #size-cells = <1>; | ||
46 | ranges; | ||
47 | |||
48 | aic: interrupt-controller@fffff000 { | ||
49 | #interrupt-cells = <1>; | ||
50 | compatible = "atmel,at91rm9200-aic"; | ||
51 | interrupt-controller; | ||
52 | interrupt-parent; | ||
53 | reg = <0xfffff000 0x200>; | ||
54 | }; | ||
55 | |||
56 | dma: dma-controller@ffffec00 { | ||
57 | compatible = "atmel,at91sam9g45-dma"; | ||
58 | reg = <0xffffec00 0x200>; | ||
59 | interrupts = <21>; | ||
60 | }; | ||
61 | |||
62 | dbgu: serial@ffffee00 { | ||
63 | compatible = "atmel,at91sam9260-usart"; | ||
64 | reg = <0xffffee00 0x200>; | ||
65 | interrupts = <1>; | ||
66 | status = "disabled"; | ||
67 | }; | ||
68 | |||
69 | usart0: serial@fff8c000 { | ||
70 | compatible = "atmel,at91sam9260-usart"; | ||
71 | reg = <0xfff8c000 0x200>; | ||
72 | interrupts = <7>; | ||
73 | atmel,use-dma-rx; | ||
74 | atmel,use-dma-tx; | ||
75 | status = "disabled"; | ||
76 | }; | ||
77 | |||
78 | usart1: serial@fff90000 { | ||
79 | compatible = "atmel,at91sam9260-usart"; | ||
80 | reg = <0xfff90000 0x200>; | ||
81 | interrupts = <8>; | ||
82 | atmel,use-dma-rx; | ||
83 | atmel,use-dma-tx; | ||
84 | status = "disabled"; | ||
85 | }; | ||
86 | |||
87 | usart2: serial@fff94000 { | ||
88 | compatible = "atmel,at91sam9260-usart"; | ||
89 | reg = <0xfff94000 0x200>; | ||
90 | interrupts = <9>; | ||
91 | atmel,use-dma-rx; | ||
92 | atmel,use-dma-tx; | ||
93 | status = "disabled"; | ||
94 | }; | ||
95 | |||
96 | usart3: serial@fff98000 { | ||
97 | compatible = "atmel,at91sam9260-usart"; | ||
98 | reg = <0xfff98000 0x200>; | ||
99 | interrupts = <10>; | ||
100 | atmel,use-dma-rx; | ||
101 | atmel,use-dma-tx; | ||
102 | status = "disabled"; | ||
103 | }; | ||
104 | }; | ||
105 | }; | ||
106 | }; | ||
diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts new file mode 100644 index 000000000000..85b34f59cd82 --- /dev/null +++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * at91sam9m10g45ek.dts - Device Tree file for AT91SAM9M10G45-EK board | ||
3 | * | ||
4 | * Copyright (C) 2011 Atmel, | ||
5 | * 2011 Nicolas Ferre <nicolas.ferre@atmel.com> | ||
6 | * | ||
7 | * Licensed under GPLv2 or later. | ||
8 | */ | ||
9 | /dts-v1/; | ||
10 | /include/ "at91sam9g45.dtsi" | ||
11 | |||
12 | / { | ||
13 | model = "Atmel AT91SAM9M10G45-EK"; | ||
14 | compatible = "atmel,at91sam9m10g45ek", "atmel,at91sam9g45", "atmel,at91sam9"; | ||
15 | |||
16 | chosen { | ||
17 | bootargs = "mem=64M console=ttyS0,115200 mtdparts=atmel_nand:4M(bootstrap/uboot/kernel)ro,60M(rootfs),-(data) root=/dev/mtdblock1 rw rootfstype=jffs2"; | ||
18 | }; | ||
19 | |||
20 | memory@70000000 { | ||
21 | reg = <0x70000000 0x4000000>; | ||
22 | }; | ||
23 | |||
24 | ahb { | ||
25 | apb { | ||
26 | dbgu: serial@ffffee00 { | ||
27 | status = "okay"; | ||
28 | }; | ||
29 | |||
30 | usart1: serial@fff90000 { | ||
31 | status = "okay"; | ||
32 | }; | ||
33 | }; | ||
34 | }; | ||
35 | }; | ||
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 22484670e7ba..4b59d96e1cd8 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -442,6 +442,17 @@ endif | |||
442 | 442 | ||
443 | # ---------------------------------------------------------- | 443 | # ---------------------------------------------------------- |
444 | 444 | ||
445 | comment "Generic Board Type" | ||
446 | |||
447 | config MACH_AT91SAM_DT | ||
448 | bool "Atmel AT91SAM Evaluation Kits with device-tree support" | ||
449 | select USE_OF | ||
450 | help | ||
451 | Select this if you want to experiment device-tree with | ||
452 | an Atmel Evaluation Kit. | ||
453 | |||
454 | # ---------------------------------------------------------- | ||
455 | |||
445 | comment "AT91 Board Options" | 456 | comment "AT91 Board Options" |
446 | 457 | ||
447 | config MTD_AT91_DATAFLASH_CARD | 458 | config MTD_AT91_DATAFLASH_CARD |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index bf57e8b1c9d0..3ff245ebcad1 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -74,6 +74,9 @@ obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o | |||
74 | # AT91SAM9G45 board-specific support | 74 | # AT91SAM9G45 board-specific support |
75 | obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o | 75 | obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o |
76 | 76 | ||
77 | # AT91SAM board with device-tree | ||
78 | obj-$(CONFIG_MACH_AT91SAM_DT) += board-dt.o | ||
79 | |||
77 | # AT91CAP9 board-specific support | 80 | # AT91CAP9 board-specific support |
78 | obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o | 81 | obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o |
79 | 82 | ||
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot index 3462b815054a..d2788636805c 100644 --- a/arch/arm/mach-at91/Makefile.boot +++ b/arch/arm/mach-at91/Makefile.boot | |||
@@ -16,3 +16,5 @@ else | |||
16 | params_phys-y := 0x20000100 | 16 | params_phys-y := 0x20000100 |
17 | initrd_phys-y := 0x20410000 | 17 | initrd_phys-y := 0x20410000 |
18 | endif | 18 | endif |
19 | |||
20 | dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb | ||
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index e04c5fb6f1ee..8baf5a1ed167 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c | |||
@@ -215,6 +215,12 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
215 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), | 215 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), |
216 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 216 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
217 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 217 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
218 | /* more usart lookup table for DT entries */ | ||
219 | CLKDEV_CON_DEV_ID("usart", "ffffee00.serial", &mck), | ||
220 | CLKDEV_CON_DEV_ID("usart", "fff8c000.serial", &usart0_clk), | ||
221 | CLKDEV_CON_DEV_ID("usart", "fff90000.serial", &usart1_clk), | ||
222 | CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk), | ||
223 | CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk), | ||
218 | }; | 224 | }; |
219 | 225 | ||
220 | static struct clk_lookup usart_clocks_lookups[] = { | 226 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c new file mode 100644 index 000000000000..33a0d8b549b4 --- /dev/null +++ b/arch/arm/mach-at91/board-dt.c | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * Setup code for AT91SAM Evaluation Kits with Device Tree support | ||
3 | * | ||
4 | * Covers: * AT91SAM9G45-EKES board | ||
5 | * * AT91SAM9M10-EKES board | ||
6 | * * AT91SAM9M10G45-EK board | ||
7 | * | ||
8 | * Copyright (C) 2011 Atmel, | ||
9 | * 2011 Nicolas Ferre <nicolas.ferre@atmel.com> | ||
10 | * | ||
11 | * Licensed under GPLv2 or later. | ||
12 | */ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/irqdomain.h> | ||
19 | #include <linux/of_irq.h> | ||
20 | #include <linux/of_platform.h> | ||
21 | |||
22 | #include <mach/hardware.h> | ||
23 | #include <mach/board.h> | ||
24 | #include <mach/system_rev.h> | ||
25 | #include <mach/at91sam9_smc.h> | ||
26 | |||
27 | #include <asm/setup.h> | ||
28 | #include <asm/irq.h> | ||
29 | #include <asm/mach/arch.h> | ||
30 | #include <asm/mach/map.h> | ||
31 | #include <asm/mach/irq.h> | ||
32 | |||
33 | #include "sam9_smc.h" | ||
34 | #include "generic.h" | ||
35 | |||
36 | |||
37 | static void __init ek_init_early(void) | ||
38 | { | ||
39 | /* Initialize processor: 12.000 MHz crystal */ | ||
40 | at91_initialize(12000000); | ||
41 | |||
42 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
43 | at91_register_uart(0, 0, 0); | ||
44 | |||
45 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
46 | at91_set_serial_console(0); | ||
47 | } | ||
48 | |||
49 | /* det_pin is not connected */ | ||
50 | static struct atmel_nand_data __initdata ek_nand_data = { | ||
51 | .ale = 21, | ||
52 | .cle = 22, | ||
53 | .rdy_pin = AT91_PIN_PC8, | ||
54 | .enable_pin = AT91_PIN_PC14, | ||
55 | }; | ||
56 | |||
57 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | ||
58 | .ncs_read_setup = 0, | ||
59 | .nrd_setup = 2, | ||
60 | .ncs_write_setup = 0, | ||
61 | .nwe_setup = 2, | ||
62 | |||
63 | .ncs_read_pulse = 4, | ||
64 | .nrd_pulse = 4, | ||
65 | .ncs_write_pulse = 4, | ||
66 | .nwe_pulse = 4, | ||
67 | |||
68 | .read_cycle = 7, | ||
69 | .write_cycle = 7, | ||
70 | |||
71 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE, | ||
72 | .tdf_cycles = 3, | ||
73 | }; | ||
74 | |||
75 | static void __init ek_add_device_nand(void) | ||
76 | { | ||
77 | ek_nand_data.bus_width_16 = board_have_nand_16bit(); | ||
78 | /* setup bus-width (8 or 16) */ | ||
79 | if (ek_nand_data.bus_width_16) | ||
80 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | ||
81 | else | ||
82 | ek_nand_smc_config.mode |= AT91_SMC_DBW_8; | ||
83 | |||
84 | /* configure chip-select 3 (NAND) */ | ||
85 | sam9_smc_configure(3, &ek_nand_smc_config); | ||
86 | |||
87 | at91_add_device_nand(&ek_nand_data); | ||
88 | } | ||
89 | |||
90 | static const struct of_device_id aic_of_match[] __initconst = { | ||
91 | { .compatible = "atmel,at91rm9200-aic", }, | ||
92 | {}, | ||
93 | }; | ||
94 | |||
95 | static void __init at91_dt_init_irq(void) | ||
96 | { | ||
97 | irq_domain_generate_simple(aic_of_match, 0xfffff000, 0); | ||
98 | at91_init_irq_default(); | ||
99 | } | ||
100 | |||
101 | static void __init at91_dt_device_init(void) | ||
102 | { | ||
103 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
104 | |||
105 | /* NAND */ | ||
106 | ek_add_device_nand(); | ||
107 | } | ||
108 | |||
109 | static const char *at91_dt_board_compat[] __initdata = { | ||
110 | "atmel,at91sam9m10g45ek", | ||
111 | NULL | ||
112 | }; | ||
113 | |||
114 | DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") | ||
115 | /* Maintainer: Atmel */ | ||
116 | .timer = &at91sam926x_timer, | ||
117 | .map_io = at91_map_io, | ||
118 | .init_early = ek_init_early, | ||
119 | .init_irq = at91_dt_init_irq, | ||
120 | .init_machine = at91_dt_device_init, | ||
121 | .dt_compat = at91_dt_board_compat, | ||
122 | MACHINE_END | ||