aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:19:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:19:14 -0400
commit867a89e0b73af48838c7987e80899a1ff26dd6ff (patch)
treeb4a8830b3e880b9a5133ad1ec3106665819cc8d4 /arch/powerpc/platforms
parent44473d991332053eb3fea1e08f8a6ee2c6fb409c (diff)
parent6c39103ce5192bdb2195f3daab7323dfa44fb52e (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: [RAPIDIO] Change RapidIO doorbell source and target ID field to 16-bit [RAPIDIO] Add RapidIO connection info print out and re-training for broken connections [RAPIDIO] Add serial RapidIO controller support, which includes MPC8548, MPC8641 [RAPIDIO] Add RapidIO node probing into MPC86xx_HPCN board id table [RAPIDIO] Add RapidIO node into MPC8641HPCN dts file [RAPIDIO] Auto-probe the RapidIO system size [RAPIDIO] Add OF-tree support to RapidIO controller driver [RAPIDIO] Add RapidIO multi mport support [RAPIDIO] Move include/asm-ppc/rio.h to asm-powerpc [RAPIDIO] Add RapidIO option to kernel configuration [RAPIDIO] Change RIO function mpc85xx_ to fsl_ [POWERPC] Provide walk_memory_resource() for powerpc [POWERPC] Update lmb data structures for hotplug memory add/remove [POWERPC] Hotplug memory remove notifications for powerpc [POWERPC] windfarm: Add PowerMac 12,1 support [POWERPC] Fix building of pmac32 when CONFIG_NVRAM=m [POWERPC] Add IRQSTACKS support on ppc32 [POWERPC] Use __always_inline for xchg* and cmpxchg* [POWERPC] Add fast little-endian switch system call
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/86xx/Kconfig1
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c1
-rw-r--r--arch/powerpc/platforms/powermac/Makefile5
-rw-r--r--arch/powerpc/platforms/powermac/setup.c3
-rw-r--r--arch/powerpc/platforms/pseries/Makefile1
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-memory.c141
6 files changed, 150 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 7442c58d44f5..053f49a1dcae 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -8,6 +8,7 @@ config MPC8641_HPCN
8 select PPC_I8259 8 select PPC_I8259
9 select DEFAULT_UIMAGE 9 select DEFAULT_UIMAGE
10 select FSL_ULI1575 10 select FSL_ULI1575
11 select HAS_RAPIDIO
11 help 12 help
12 This option enables support for the MPC8641 HPCN board. 13 This option enables support for the MPC8641 HPCN board.
13 14
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index f947f555fd46..f13704aabbea 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -221,6 +221,7 @@ mpc86xx_time_init(void)
221 221
222static __initdata struct of_device_id of_bus_ids[] = { 222static __initdata struct of_device_id of_bus_ids[] = {
223 { .compatible = "simple-bus", }, 223 { .compatible = "simple-bus", },
224 { .compatible = "fsl,rapidio-delta", },
224 {}, 225 {},
225}; 226};
226 227
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile
index 78093d7f97af..4d72c8f72159 100644
--- a/arch/powerpc/platforms/powermac/Makefile
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -6,7 +6,10 @@ obj-y += pic.o setup.o time.o feature.o pci.o \
6obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o 6obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o
7obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o 7obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o
8obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o 8obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o
9obj-$(CONFIG_NVRAM) += nvram.o 9# CONFIG_NVRAM is an arch. independant tristate symbol, for pmac32 we really
10# need this to be a bool. Cheat here and pretend CONFIG_NVRAM=m is really
11# CONFIG_NVRAM=y
12obj-$(CONFIG_NVRAM:m=y) += nvram.o
10# ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff 13# ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff
11obj-$(CONFIG_PPC64) += nvram.o 14obj-$(CONFIG_PPC64) += nvram.o
12obj-$(CONFIG_PPC32) += bootx_init.o 15obj-$(CONFIG_PPC32) += bootx_init.o
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index bf44c5441a36..00bd0166d07f 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -337,7 +337,8 @@ static void __init pmac_setup_arch(void)
337 find_via_pmu(); 337 find_via_pmu();
338 smu_init(); 338 smu_init();
339 339
340#if defined(CONFIG_NVRAM) || defined(CONFIG_PPC64) 340#if defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) || \
341 defined(CONFIG_PPC64)
341 pmac_nvram_init(); 342 pmac_nvram_init();
342#endif 343#endif
343 344
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index bd2593ed28dd..554c6e42ef2a 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_PCI) += pci.o pci_dlpar.o
18obj-$(CONFIG_PCI_MSI) += msi.o 18obj-$(CONFIG_PCI_MSI) += msi.o
19 19
20obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o 20obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o
21obj-$(CONFIG_MEMORY_HOTPLUG) += hotplug-memory.o
21 22
22obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o 23obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
23obj-$(CONFIG_HVCS) += hvcserver.o 24obj-$(CONFIG_HVCS) += hvcserver.o
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
new file mode 100644
index 000000000000..3c5727dd5aa5
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -0,0 +1,141 @@
1/*
2 * pseries Memory Hotplug infrastructure.
3 *
4 * Copyright (C) 2008 Badari Pulavarty, IBM Corporation
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <linux/of.h>
13#include <linux/lmb.h>
14#include <asm/firmware.h>
15#include <asm/machdep.h>
16#include <asm/pSeries_reconfig.h>
17
18static int pseries_remove_memory(struct device_node *np)
19{
20 const char *type;
21 const unsigned int *my_index;
22 const unsigned int *regs;
23 u64 start_pfn, start;
24 struct zone *zone;
25 int ret = -EINVAL;
26
27 /*
28 * Check to see if we are actually removing memory
29 */
30 type = of_get_property(np, "device_type", NULL);
31 if (type == NULL || strcmp(type, "memory") != 0)
32 return 0;
33
34 /*
35 * Find the memory index and size of the removing section
36 */
37 my_index = of_get_property(np, "ibm,my-drc-index", NULL);
38 if (!my_index)
39 return ret;
40
41 regs = of_get_property(np, "reg", NULL);
42 if (!regs)
43 return ret;
44
45 start_pfn = section_nr_to_pfn(*my_index & 0xffff);
46 zone = page_zone(pfn_to_page(start_pfn));
47
48 /*
49 * Remove section mappings and sysfs entries for the
50 * section of the memory we are removing.
51 *
52 * NOTE: Ideally, this should be done in generic code like
53 * remove_memory(). But remove_memory() gets called by writing
54 * to sysfs "state" file and we can't remove sysfs entries
55 * while writing to it. So we have to defer it to here.
56 */
57 ret = __remove_pages(zone, start_pfn, regs[3] >> PAGE_SHIFT);
58 if (ret)
59 return ret;
60
61 /*
62 * Update memory regions for memory remove
63 */
64 lmb_remove(start_pfn << PAGE_SHIFT, regs[3]);
65
66 /*
67 * Remove htab bolted mappings for this section of memory
68 */
69 start = (unsigned long)__va(start_pfn << PAGE_SHIFT);
70 ret = remove_section_mapping(start, start + regs[3]);
71 return ret;
72}
73
74static int pseries_add_memory(struct device_node *np)
75{
76 const char *type;
77 const unsigned int *my_index;
78 const unsigned int *regs;
79 u64 start_pfn;
80 int ret = -EINVAL;
81
82 /*
83 * Check to see if we are actually adding memory
84 */
85 type = of_get_property(np, "device_type", NULL);
86 if (type == NULL || strcmp(type, "memory") != 0)
87 return 0;
88
89 /*
90 * Find the memory index and size of the added section
91 */
92 my_index = of_get_property(np, "ibm,my-drc-index", NULL);
93 if (!my_index)
94 return ret;
95
96 regs = of_get_property(np, "reg", NULL);
97 if (!regs)
98 return ret;
99
100 start_pfn = section_nr_to_pfn(*my_index & 0xffff);
101
102 /*
103 * Update memory region to represent the memory add
104 */
105 lmb_add(start_pfn << PAGE_SHIFT, regs[3]);
106 return 0;
107}
108
109static int pseries_memory_notifier(struct notifier_block *nb,
110 unsigned long action, void *node)
111{
112 int err = NOTIFY_OK;
113
114 switch (action) {
115 case PSERIES_RECONFIG_ADD:
116 if (pseries_add_memory(node))
117 err = NOTIFY_BAD;
118 break;
119 case PSERIES_RECONFIG_REMOVE:
120 if (pseries_remove_memory(node))
121 err = NOTIFY_BAD;
122 break;
123 default:
124 err = NOTIFY_DONE;
125 break;
126 }
127 return err;
128}
129
130static struct notifier_block pseries_mem_nb = {
131 .notifier_call = pseries_memory_notifier,
132};
133
134static int __init pseries_memory_hotplug_init(void)
135{
136 if (firmware_has_feature(FW_FEATURE_LPAR))
137 pSeries_reconfig_notifier_register(&pseries_mem_nb);
138
139 return 0;
140}
141machine_device_initcall(pseries, pseries_memory_hotplug_init);