diff options
author | Paul Mackerras <paulus@samba.org> | 2008-01-25 23:30:35 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-25 23:30:35 -0500 |
commit | 75e06e2d7dd48ba655789e143e81c73617737890 (patch) | |
tree | 21d4df5ab24703b95e43c504512fbccfb773ffea /arch/powerpc/platforms | |
parent | 5bc977867f36fc36cde43b309b891b2f7b714f52 (diff) | |
parent | e08029675181a16d435431ad51255aa730fd6772 (diff) |
Merge branch 'for-2.6.25' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/40x/walnut.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/Kconfig | 15 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/ebony.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/warp-nand.c | 105 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/warp.c | 153 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig | 6 |
7 files changed, 284 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/40x/walnut.c b/arch/powerpc/platforms/40x/walnut.c index f115b6dbf5ad..5d9edd917f92 100644 --- a/arch/powerpc/platforms/40x/walnut.c +++ b/arch/powerpc/platforms/40x/walnut.c | |||
@@ -36,6 +36,7 @@ static __initdata struct of_device_id walnut_of_bus[] = { | |||
36 | static int __init walnut_device_probe(void) | 36 | static int __init walnut_device_probe(void) |
37 | { | 37 | { |
38 | of_platform_bus_probe(NULL, walnut_of_bus, NULL); | 38 | of_platform_bus_probe(NULL, walnut_of_bus, NULL); |
39 | of_instantiate_rtc(); | ||
39 | 40 | ||
40 | return 0; | 41 | return 0; |
41 | } | 42 | } |
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig index d24801305344..c062c4cbbed5 100644 --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig | |||
@@ -13,6 +13,7 @@ config EBONY | |||
13 | default y | 13 | default y |
14 | select 440GP | 14 | select 440GP |
15 | select PCI | 15 | select PCI |
16 | select OF_RTC | ||
16 | help | 17 | help |
17 | This option enables support for the IBM PPC440GP evaluation board. | 18 | This option enables support for the IBM PPC440GP evaluation board. |
18 | 19 | ||
@@ -53,6 +54,19 @@ config RAINIER | |||
53 | help | 54 | help |
54 | This option enables support for the AMCC PPC440GRX evaluation board. | 55 | This option enables support for the AMCC PPC440GRX evaluation board. |
55 | 56 | ||
57 | config WARP | ||
58 | bool "PIKA Warp" | ||
59 | depends on 44x | ||
60 | default n | ||
61 | select 440EP | ||
62 | help | ||
63 | This option enables support for the PIKA Warp(tm) Appliance. The Warp | ||
64 | is a small computer replacement with up to 9 ports of FXO/FXS plus VOIP | ||
65 | stations and trunks. | ||
66 | |||
67 | See http://www.pikatechnologies.com/ and follow the "PIKA for Computer | ||
68 | Telephony Developers" link for more information. | ||
69 | |||
56 | #config LUAN | 70 | #config LUAN |
57 | # bool "Luan" | 71 | # bool "Luan" |
58 | # depends on 44x | 72 | # depends on 44x |
@@ -75,6 +89,7 @@ config 440EP | |||
75 | select PPC_FPU | 89 | select PPC_FPU |
76 | select IBM440EP_ERR42 | 90 | select IBM440EP_ERR42 |
77 | select IBM_NEW_EMAC_ZMII | 91 | select IBM_NEW_EMAC_ZMII |
92 | select USB_ARCH_HAS_OHCI | ||
78 | 93 | ||
79 | config 440EPX | 94 | config 440EPX |
80 | bool | 95 | bool |
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile index a2a0dc13e9e9..0864d4f1cbc2 100644 --- a/arch/powerpc/platforms/44x/Makefile +++ b/arch/powerpc/platforms/44x/Makefile | |||
@@ -5,3 +5,5 @@ obj-$(CONFIG_BAMBOO) += bamboo.o | |||
5 | obj-$(CONFIG_SEQUOIA) += sequoia.o | 5 | obj-$(CONFIG_SEQUOIA) += sequoia.o |
6 | obj-$(CONFIG_KATMAI) += katmai.o | 6 | obj-$(CONFIG_KATMAI) += katmai.o |
7 | obj-$(CONFIG_RAINIER) += rainier.o | 7 | obj-$(CONFIG_RAINIER) += rainier.o |
8 | obj-$(CONFIG_WARP) += warp.o | ||
9 | obj-$(CONFIG_WARP) += warp-nand.o | ||
diff --git a/arch/powerpc/platforms/44x/ebony.c b/arch/powerpc/platforms/44x/ebony.c index 481a016e1535..1a8d467bff85 100644 --- a/arch/powerpc/platforms/44x/ebony.c +++ b/arch/powerpc/platforms/44x/ebony.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/of_platform.h> | 20 | #include <linux/of_platform.h> |
21 | #include <linux/rtc.h> | ||
21 | 22 | ||
22 | #include <asm/machdep.h> | 23 | #include <asm/machdep.h> |
23 | #include <asm/prom.h> | 24 | #include <asm/prom.h> |
@@ -38,6 +39,7 @@ static __initdata struct of_device_id ebony_of_bus[] = { | |||
38 | static int __init ebony_device_probe(void) | 39 | static int __init ebony_device_probe(void) |
39 | { | 40 | { |
40 | of_platform_bus_probe(NULL, ebony_of_bus, NULL); | 41 | of_platform_bus_probe(NULL, ebony_of_bus, NULL); |
42 | of_instantiate_rtc(); | ||
41 | 43 | ||
42 | return 0; | 44 | return 0; |
43 | } | 45 | } |
diff --git a/arch/powerpc/platforms/44x/warp-nand.c b/arch/powerpc/platforms/44x/warp-nand.c new file mode 100644 index 000000000000..84ab78ff8c03 --- /dev/null +++ b/arch/powerpc/platforms/44x/warp-nand.c | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * PIKA Warp(tm) NAND flash specific routines | ||
3 | * | ||
4 | * Copyright (c) 2008 PIKA Technologies | ||
5 | * Sean MacLennan <smaclennan@pikatech.com> | ||
6 | */ | ||
7 | |||
8 | #include <linux/platform_device.h> | ||
9 | #include <linux/mtd/mtd.h> | ||
10 | #include <linux/mtd/map.h> | ||
11 | #include <linux/mtd/partitions.h> | ||
12 | #include <linux/mtd/nand.h> | ||
13 | #include <linux/mtd/ndfc.h> | ||
14 | |||
15 | #ifdef CONFIG_MTD_NAND_NDFC | ||
16 | |||
17 | #define CS_NAND_0 1 /* use chip select 1 for NAND device 0 */ | ||
18 | |||
19 | #define WARP_NAND_FLASH_REG_ADDR 0xD0000000UL | ||
20 | #define WARP_NAND_FLASH_REG_SIZE 0x2000 | ||
21 | |||
22 | static struct resource warp_ndfc = { | ||
23 | .start = WARP_NAND_FLASH_REG_ADDR, | ||
24 | .end = WARP_NAND_FLASH_REG_ADDR + WARP_NAND_FLASH_REG_SIZE, | ||
25 | .flags = IORESOURCE_MEM, | ||
26 | }; | ||
27 | |||
28 | static struct mtd_partition nand_parts[] = { | ||
29 | { | ||
30 | .name = "kernel", | ||
31 | .offset = 0, | ||
32 | .size = 0x0200000 | ||
33 | }, | ||
34 | { | ||
35 | .name = "root", | ||
36 | .offset = 0x0200000, | ||
37 | .size = 0x3400000 | ||
38 | }, | ||
39 | { | ||
40 | .name = "user", | ||
41 | .offset = 0x3600000, | ||
42 | .size = 0x0A00000 | ||
43 | }, | ||
44 | }; | ||
45 | |||
46 | struct ndfc_controller_settings warp_ndfc_settings = { | ||
47 | .ccr_settings = (NDFC_CCR_BS(CS_NAND_0) | NDFC_CCR_ARAC1), | ||
48 | .ndfc_erpn = 0, | ||
49 | }; | ||
50 | |||
51 | static struct ndfc_chip_settings warp_chip0_settings = { | ||
52 | .bank_settings = 0x80002222, | ||
53 | }; | ||
54 | |||
55 | struct platform_nand_ctrl warp_nand_ctrl = { | ||
56 | .priv = &warp_ndfc_settings, | ||
57 | }; | ||
58 | |||
59 | static struct platform_device warp_ndfc_device = { | ||
60 | .name = "ndfc-nand", | ||
61 | .id = 0, | ||
62 | .dev = { | ||
63 | .platform_data = &warp_nand_ctrl, | ||
64 | }, | ||
65 | .num_resources = 1, | ||
66 | .resource = &warp_ndfc, | ||
67 | }; | ||
68 | |||
69 | static struct nand_ecclayout nand_oob_16 = { | ||
70 | .eccbytes = 3, | ||
71 | .eccpos = { 0, 1, 2, 3, 6, 7 }, | ||
72 | .oobfree = { {.offset = 8, .length = 16} } | ||
73 | }; | ||
74 | |||
75 | static struct platform_nand_chip warp_nand_chip0 = { | ||
76 | .nr_chips = 1, | ||
77 | .chip_offset = CS_NAND_0, | ||
78 | .nr_partitions = ARRAY_SIZE(nand_parts), | ||
79 | .partitions = nand_parts, | ||
80 | .chip_delay = 50, | ||
81 | .ecclayout = &nand_oob_16, | ||
82 | .priv = &warp_chip0_settings, | ||
83 | }; | ||
84 | |||
85 | static struct platform_device warp_nand_device = { | ||
86 | .name = "ndfc-chip", | ||
87 | .id = 0, | ||
88 | .num_resources = 1, | ||
89 | .resource = &warp_ndfc, | ||
90 | .dev = { | ||
91 | .platform_data = &warp_nand_chip0, | ||
92 | .parent = &warp_ndfc_device.dev, | ||
93 | } | ||
94 | }; | ||
95 | |||
96 | static int warp_setup_nand_flash(void) | ||
97 | { | ||
98 | platform_device_register(&warp_ndfc_device); | ||
99 | platform_device_register(&warp_nand_device); | ||
100 | |||
101 | return 0; | ||
102 | } | ||
103 | device_initcall(warp_setup_nand_flash); | ||
104 | |||
105 | #endif | ||
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c new file mode 100644 index 000000000000..8f01563dbd2a --- /dev/null +++ b/arch/powerpc/platforms/44x/warp.c | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * PIKA Warp(tm) board specific routines | ||
3 | * | ||
4 | * Copyright (c) 2008 PIKA Technologies | ||
5 | * Sean MacLennan <smaclennan@pikatech.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/of_platform.h> | ||
14 | #include <linux/kthread.h> | ||
15 | |||
16 | #include <asm/machdep.h> | ||
17 | #include <asm/prom.h> | ||
18 | #include <asm/udbg.h> | ||
19 | #include <asm/time.h> | ||
20 | #include <asm/uic.h> | ||
21 | |||
22 | #include "44x.h" | ||
23 | |||
24 | |||
25 | static __initdata struct of_device_id warp_of_bus[] = { | ||
26 | { .compatible = "ibm,plb4", }, | ||
27 | { .compatible = "ibm,opb", }, | ||
28 | { .compatible = "ibm,ebc", }, | ||
29 | {}, | ||
30 | }; | ||
31 | |||
32 | static int __init warp_device_probe(void) | ||
33 | { | ||
34 | of_platform_bus_probe(NULL, warp_of_bus, NULL); | ||
35 | return 0; | ||
36 | } | ||
37 | machine_device_initcall(warp, warp_device_probe); | ||
38 | |||
39 | static int __init warp_probe(void) | ||
40 | { | ||
41 | unsigned long root = of_get_flat_dt_root(); | ||
42 | |||
43 | return of_flat_dt_is_compatible(root, "pika,warp"); | ||
44 | } | ||
45 | |||
46 | define_machine(warp) { | ||
47 | .name = "Warp", | ||
48 | .probe = warp_probe, | ||
49 | .progress = udbg_progress, | ||
50 | .init_IRQ = uic_init_tree, | ||
51 | .get_irq = uic_get_irq, | ||
52 | .restart = ppc44x_reset_system, | ||
53 | .calibrate_decr = generic_calibrate_decr, | ||
54 | }; | ||
55 | |||
56 | |||
57 | #define LED_GREEN (0x80000000 >> 0) | ||
58 | #define LED_RED (0x80000000 >> 1) | ||
59 | |||
60 | |||
61 | /* This is for the power LEDs 1 = on, 0 = off, -1 = leave alone */ | ||
62 | void warp_set_power_leds(int green, int red) | ||
63 | { | ||
64 | static void __iomem *gpio_base = NULL; | ||
65 | unsigned leds; | ||
66 | |||
67 | if (gpio_base == NULL) { | ||
68 | struct device_node *np; | ||
69 | |||
70 | /* Power LEDS are on the second GPIO controller */ | ||
71 | np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP"); | ||
72 | if (np) | ||
73 | np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP"); | ||
74 | if (np == NULL) { | ||
75 | printk(KERN_ERR __FILE__ ": Unable to find gpio\n"); | ||
76 | return; | ||
77 | } | ||
78 | |||
79 | gpio_base = of_iomap(np, 0); | ||
80 | of_node_put(np); | ||
81 | if (gpio_base == NULL) { | ||
82 | printk(KERN_ERR __FILE__ ": Unable to map gpio"); | ||
83 | return; | ||
84 | } | ||
85 | } | ||
86 | |||
87 | leds = in_be32(gpio_base); | ||
88 | |||
89 | switch (green) { | ||
90 | case 0: leds &= ~LED_GREEN; break; | ||
91 | case 1: leds |= LED_GREEN; break; | ||
92 | } | ||
93 | switch (red) { | ||
94 | case 0: leds &= ~LED_RED; break; | ||
95 | case 1: leds |= LED_RED; break; | ||
96 | } | ||
97 | |||
98 | out_be32(gpio_base, leds); | ||
99 | } | ||
100 | EXPORT_SYMBOL(warp_set_power_leds); | ||
101 | |||
102 | |||
103 | #ifdef CONFIG_SENSORS_AD7414 | ||
104 | static int pika_dtm_thread(void __iomem *fpga) | ||
105 | { | ||
106 | extern int ad7414_get_temp(int index); | ||
107 | |||
108 | while (!kthread_should_stop()) { | ||
109 | int temp = ad7414_get_temp(0); | ||
110 | |||
111 | out_be32(fpga, temp); | ||
112 | |||
113 | set_current_state(TASK_INTERRUPTIBLE); | ||
114 | schedule_timeout(HZ); | ||
115 | } | ||
116 | |||
117 | return 0; | ||
118 | } | ||
119 | |||
120 | static int __init pika_dtm_start(void) | ||
121 | { | ||
122 | struct task_struct *dtm_thread; | ||
123 | struct device_node *np; | ||
124 | struct resource res; | ||
125 | void __iomem *fpga; | ||
126 | |||
127 | np = of_find_compatible_node(NULL, NULL, "pika,fpga"); | ||
128 | if (np == NULL) | ||
129 | return -ENOENT; | ||
130 | |||
131 | /* We do not call of_iomap here since it would map in the entire | ||
132 | * fpga space, which is over 8k. | ||
133 | */ | ||
134 | if (of_address_to_resource(np, 0, &res)) { | ||
135 | of_node_put(np); | ||
136 | return -ENOENT; | ||
137 | } | ||
138 | of_node_put(np); | ||
139 | |||
140 | fpga = ioremap(res.start + 0x20, 4); | ||
141 | if (fpga == NULL) | ||
142 | return -ENOENT; | ||
143 | |||
144 | dtm_thread = kthread_run(pika_dtm_thread, fpga + 0x20, "pika-dtm"); | ||
145 | if (IS_ERR(dtm_thread)) { | ||
146 | iounmap(fpga); | ||
147 | return PTR_ERR(dtm_thread); | ||
148 | } | ||
149 | |||
150 | return 0; | ||
151 | } | ||
152 | device_initcall(pika_dtm_start); | ||
153 | #endif | ||
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 2cec34314d2e..4286664741dd 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig | |||
@@ -321,6 +321,12 @@ config FSL_ULI1575 | |||
321 | config CPM | 321 | config CPM |
322 | bool | 322 | bool |
323 | 323 | ||
324 | config OF_RTC | ||
325 | bool | ||
326 | help | ||
327 | Uses information from the OF or flattened device tree to instatiate | ||
328 | platform devices for direct mapped RTC chips like the DS1742 or DS1743. | ||
329 | |||
324 | source "arch/powerpc/sysdev/bestcomm/Kconfig" | 330 | source "arch/powerpc/sysdev/bestcomm/Kconfig" |
325 | 331 | ||
326 | endmenu | 332 | endmenu |