aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2007-11-01[POWERPC] 4xx: Workaround for the 440EP(x)/GR(x) processors identical PVR issue.Valentine Barshak1-0/+12
PowerPC 440EP(x) 440GR(x) processors have the same PVR values, since they have identical cores. However, FPU is not supported on GR(x) and enabling APU instruction broadcast in the CCR0 register (to enable FPU) may cause unpredictable results. There's no safe way to detect FPU support at runtime. This patch provides a workarund for the issue. We use a POWER6 "logical PVR approach". First, we identify all EP(x) and GR(x) processors as GR(x) ones (which is safe). Then we check the device tree cpu path. If we have a EP(x) processor entry, we call identify_cpu again with PVR | 0x8. This bit is always 0 in the real PVR. This way we enable FPU only for 440EP(x). Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
2007-10-09[POWERPC] Use cache-inhibited large page bit from firmwarePaul Mackerras1-3/+0
Discussions with firmware architects have confirmed that the bit in the ibm,pa-features property that indicates support for cache-inhibited large (>= 64kB) page mappings does in fact mean that the hypervisor allows 64kB mappings to I/O devices. Thus we can now enable the code that tests that bit and sets our CPU_FTR_CI_LARGE_PAGE feature bit. Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-09-14[POWERPC] setup_64.c and prom.c comment cleanupLinas Vepstas1-3/+5
Grammatical corrections to comments. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-09-14[POWERPC] prom.c whitespace cleanupLinas Vepstas1-6/+6
Whitespace cleanup: badly indented lines. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-08-17[POWERPC] Clean out a bunch of duplicate includesJesper Juhl1-1/+0
This removes several duplicate includes from arch/powerpc/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-22[POWERPC] of_detach_node()'s device node argument cannot be constSegher Boessenkool1-1/+1
...since it modifies it (when it sets the OF_DETACHED flag). Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-20Consolidate of_find_node_by routinesStephen Rothwell1-114/+1
This consolidates the routines of_find_node_by_path, of_find_node_by_name, of_find_node_by_type and of_find_compatible_device. Again, the comparison of strings are done differently by Sparc and PowerPC and also these add read_locks around the iterations. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>
2007-07-20Consolidate of_get_next_childStephen Rothwell1-24/+0
This adds a read_lock around the child/next accesses on Sparc. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>
2007-07-20Consolidate of_get_parentStephen Rothwell1-21/+0
This requires creating dummy of_node_{get,put} routines for sparc and sparc64. It also adds a read_lock around the parent accesses. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>
2007-07-20Consolidate of_find_propertyStephen Rothwell1-23/+1
The only change here is that a readlock is taken while the property list is being traversed on Sparc where it was not taken previously. Also, Sparc uses strcasecmp to compare property names while PowerPC uses strcmp. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>
2007-07-20Consolidate of_device_is_compatibleStephen Rothwell1-25/+0
The only difference here is that Sparc uses strncmp to match compatibility names while PowerPC uses strncasecmp. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>
2007-07-20Start split out of common open firmware codeStephen Rothwell1-41/+0
This creates drivers/of/base.c (depending on CONFIG_OF) and puts the first trivially common bits from the prom.c files into it. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>
2007-07-10[POWERPC] Remove unnecessary #undef printk from prom.cMathieu Desnoyers1-2/+0
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-10[POWERPC] Make the debugfs "powerpc" dir globally accessibleMichael Ellerman1-6/+3
The prom.c debugging code creates a "powerpc" directory in debugfs, which is nice, but doesn't allow any other debugging code to stick things under "powerpc" in debugfs. So make it global. While we're there we should make the prom.c debugging code depend on CONFIG_DEBUG_FS, because it doesn't work otherwise. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-10[POWERPC] Add a warning to help trackdown device_node refcounting bugsMichael Ellerman1-0/+11
When the refcount for a device node goes to 0, we call the destructor - of_node_release(). This should only happen if we've already detached the node from the device tree. So add a flag OF_DETACHED which tracks detached-ness, and if we find ourselves in of_node_release() without it set, issue a warning and don't free the device_node. To avoid warning continuously reinitialise the kref to a sane value. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-10[POWERPC] Generalise device_node flag interfaceMichael Ellerman1-1/+1
The struct device_node currently has a _flags variable, although it's only used for one flag - OF_DYNAMIC. Generalise the flag accessors so we can use them with other flags in future. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-10[POWERPC] Check for the root node in of_detach_node()Michael Ellerman1-0/+3
It's not sensible to call of_detach_node() on the root node, but we should check for it just to be safe. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-06-28[POWERPC] Output params value in early_init_devtreeGeoff Levand1-1/+1
Add a printout of the params value to early_init_devtree. This value is handy to have for comparison when debugging the bootwrapper code. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-06-02[POWERPC] Update documentation for of_find_node_by_type()Michael Ellerman1-5/+6
The documentation for of_find_node_by_type() incorrectly refers to the "name" parameter - it should be "type". Also the behaviour when from == NULL is not really documented, fix that. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-05-17[POWERPC] Make sure device node type/name is not NULL on hot-added nodesBenjamin Herrenschmidt1-0/+5
Our device-tree unflattening code makes sure the name and type fields of a device-node are not NULL. However, the code for dynamically adding devices nodes which is used for pSeries hotplug for example didn't do it, potentially causing crashes in some code that assume it can always do things like strcmp on those. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-05-10[POWERPC] Split initrd logic out of early_init_dt_scan_chosen() to fix warningMichael Ellerman1-16/+31
If CONFIG_BLK_DEV_INITRD is not defined the prop variable in early_init_dt_scan_chosen() is unused, causing a compiler warning. So split the initrd logic into a separate function, allowing us to declare prop only when we need it. Built for both cases and booted with an initrd. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-24[POWERPC] Remove old interface find_devicesStephen Rothwell1-19/+0
Replace uses with of_find_node_by_name and for_each_node_by_name. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-24[POWERPC] Remove old interface find_type_devicesStephen Rothwell1-19/+0
Replaced by of_find_node_by_type. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-24[POWERPC] Remove old interface find_path_deviceStephen Rothwell1-14/+0
Replaced by of_find_node_by_path. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-24[POWERPC] Remove find_all_nodesStephen Rothwell1-17/+0
This old interface has no more users. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-24[POWERPC] Remove find_compatible_devicesStephen Rothwell1-24/+0
This is an old interface and is replaced by of_find_compatible_node. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Make struct property's value a void *Stephen Rothwell1-2/+3
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Rename prom_n_size_cells to of_n_size_cellsStephen Rothwell1-3/+2
This is more consistent and gets us closer to the Sparc code. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Rename prom_n_addr_cells to of_n_addr_cellsStephen Rothwell1-3/+2
This is more consistent and gets us closer to the Sparc code. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Rename device_is_compatible to of_device_is_compatibleStephen Rothwell1-5/+6
This is more consistent and gets us closer to the Sparc code. We add a device_is_compatible define for compatibility during the change over. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Rename get_property to of_get_propertyStephen Rothwell1-12/+12
This is more consistent and gets us closer to the Sparc code. We add a get_property define for compatibility during the change over. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-08[POWERPC] Automatically lmb_reserve() initrdDavid Gibson1-0/+23
At present, when an initrd is passed to the kernel used flat device tree properties, the memory the initrd occupies must also be reserved in the flat tree's reserve map, or the kernel may overwrite it. That makes life more complicated than it could be for the bootwrapper. This patch makes the kernel automatically reserve the initrd's space. That in turn requires parsing the initrd parameters earlier than they are currently, in early_init_dt_scan_chosen() instead of check_for_initrd(). Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-08[POWERPC] Allow duplicate lmb_reserve() callsDavid Gibson1-3/+0
At present calling lmb_reserve() (and hence lmb_add_region()) twice for exactly the same memory region will cause strange behaviour. This makes life difficult when booting from a flat device tree with memory reserve map. Which regions are automatically reserved by the kernel has changed over time, so it's quite possible a newer kernel could attempt to auto-reserve a region which is also explicitly listed in the device tree's reserve map, leading to trouble. This patch avoids the problem by making lmb_reserve() ignore a call to reserve a previously reserved region. It also removes a now redundant test designed to avoid one specific case of the problem noted above. At present, this patch deals only with duplicate reservations of an identical region. Attempting to reserve two different, but overlapping regions will still cause problems. I might post another patch later dealing with this case, but I'm avoiding it now since it is substantially more complicated to deal with, less likely to occur and more likely to indicate a genuine bug elsewhere if it does occur. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-02-16[POWERPC] Export of_find_propertyDave Jones1-0/+1
Without this, building drivers/serial/of_serial.c as a module fails. WARNING: ".of_find_property" [drivers/serial/of_serial.ko] undefined! Signed-off-by: Dave Jones <davej@redhat.com> Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-02-12[PATCH] Dynamic kernel command-line: powerpcAlon Bar-Lev1-1/+1
Rename saved_command_line into boot_command_line. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-24[POWERPC] arch/ppc/kernel/prom.c of_node_(get|put) cleanupMariusz Kozlowski1-12/+6
Remove redundant argument checks for of_node_get() and of_node_put(). Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-12-11[POWERPC] Support ibm,dynamic-reconfiguration-memory nodesPaul Mackerras1-0/+55
For PAPR partitions with large amounts of memory, the firmware has an alternative, more compact representation for the information about the memory in the partition and its NUMA associativity information. This adds the code to the kernel to parse this alternative representation. The other part of this patch is telling the firmware that we can handle the alternative representation. There is however a subtlety here, because the firmware will invoke a reboot if the memory representation we request is different from the representation that firmware is currently using. This is because firmware can't change the representation on the fly. Further, some firmware versions used on POWER5+ machines have a bug where this reboot leaves the machine with an altered value of load-base, which will prevent any kernel booting until it is reset to the normal value (0x4000). Because of this bug, we do NOT set fake_elf.rpanote.new_mem_def = 1, and thus we do not request the new representation on POWER5+ and earlier machines. We do request the new representation on POWER6, which uses the ibm,client-architecture-support call. Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-12-04[POWERPC] Distinguish POWER6 partition modes and tell userspacePaul Mackerras1-34/+76
This adds code to look at the properties firmware puts in the device tree to determine what compatibility mode the partition is in on POWER6 machines, and set the ELF aux vector AT_HWCAP and AT_PLATFORM entries appropriately. Specifically, we look at the cpu-version property in the cpu node(s). If that contains a "logical" PVR value (of the form 0x0f00000x), we call identify_cpu again with this PVR value. A value of 0x0f000001 indicates the partition is in POWER5+ compatibility mode, and a value of 0x0f000002 indicates "POWER6 architected" mode, with various extensions disabled. We also look for various other properties: ibm,dfp, ibm,purr and ibm,spurr. Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-12-04Merge branch 'linux-2.6' into for-linusPaul Mackerras1-3/+5
2006-10-25[POWERPC] cell: add cpufreq driver for Cell BE processorChristian Krafft1-0/+1
This patch adds a cpufreq backend driver to enable frequency scaling on cell. Signed-off-by: Christian Krafft <krafft@de.ibm.com> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-10-25[POWERPC] Fix device_is_compatible() const warningBenjamin Herrenschmidt1-3/+5
Fix a const'ification related warning with device_is_compatible() and friends related to get_property() not properly having const on it's input device node argument. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-10-06[POWERPC] Minor fix for bootargs propertyGeoff Levand1-1/+1
Avoid the use of an uninitialized stack variable when the powerpc device tree bootargs property is either missing or incorrectly defined. This also makes CONFIG_CMDLINE work properly under these conditions. This change adds a test for the existence of the bootargs property. early_init_dt_scan_chosen() tests for a zero length bootargs property in its CONFIG_CMDLINE processing, but the current implementation of of_get_flat_dt_prop() doesn't assign a value to the length when no property is found. Since an automatic variable is used, a stale value from the stack will be used in the test. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-09-20[POWERPC] Define of_read_ulong helperPaul Mackerras1-17/+2
There are various places where we want to extract an unsigned long value from a device-tree property that can be 1 or 2 cells in length. This replaces some open-coded calculations, and one place where we assumed without checking that properties were the length we wanted, with a little of_read_ulong() helper. Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-07-31[POWERPC] Make get_property() return a const void *Jeremy Kerr1-1/+1
Previous changes have treated the return values of get_property as const, so now we can make the actual change to get_property(). There shouldn't be a need to cast the return values anymore. We will now get compiler warnings when property values are assigned to a non-const variable. If properties need to be updated, there's still the of_find_property function. Built for cell_defconfig, chrp32_defconfig, g5_defconfig, iseries_defconfig, maple_defconfig, pmac32_defconfig, ppc64_defconfig and pseries_defconfig. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-07-31[POWERPC] Constify & voidify get_property()Jeremy Kerr1-12/+11
Now that get_property() returns a void *, there's no need to cast its return value. Also, treat the return value as const, so we can constify get_property later. powerpc core changes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-07-03[POWERPC] Add new interrupt mapping core and change platforms to use itBenjamin Herrenschmidt1-449/+2
This adds the new irq remapper core and removes the old one. Because there are some fundamental conflicts with the old code, like the value of NO_IRQ which I'm now setting to 0 (as per discussions with Linus), etc..., this commit also changes the relevant platform and driver code over to use the new remapper (so as not to cause difficulties later in bisecting). This patch removes the old pre-parsing of the open firmware interrupt tree along with all the bogus assumptions it made to try to renumber interrupts according to the platform. This is all to be handled by the new code now. For the pSeries XICS interrupt controller, a single remapper host is created for the whole machine regardless of how many interrupt presentation and source controllers are found, and it's set to match any device node that isn't a 8259. That works fine on pSeries and avoids having to deal with some of the complexities of split source controllers vs. presentation controllers in the pSeries device trees. The powerpc i8259 PIC driver now always requests the legacy interrupt range. It also has the feature of being able to match any device node (including NULL) if passed no device node as an input. That will help porting over platforms with broken device-trees like Pegasos who don't have a proper interrupt tree. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-07-03[POWERPC] change get_property to return void *Jeremy Kerr1-2/+1
Change the get_property() function to return a void *. This allows us to later remove the cast done in the majority of callers. Built for pseries, iseries, pmac32, cell, cbesim, g5, systemsim, maple, and mpc* defconfigs Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel1-1/+0
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-29[POWERPC] Use little-endian bit from firmware ibm,pa-features propertyPaul Mackerras1-0/+1
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-06-28[POWERPC] Setup RTAS values earlier, to enable rtas_call() earlierMichael Ellerman1-18/+5
Althought RTAS is instantiated when we enter the kernel, we can't actually call into it until we know its entry point address. Currently we grab that in rtas_initialize(), however that's quite late in the boot sequence. To enable rtas_call() earlier, we can grab the RTAS entry etc. values while we're scanning the flattened device tree. There's existing code to retrieve the values from /chosen, however we don't store them there anymore, so remove that code. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>