summaryrefslogtreecommitdiffstats
path: root/drivers/of/fdt.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'earlycon-dt' into for-nextRob Herring2014-05-281-0/+56
|\
| * of/fdt: add FDT serial scanning for earlyconRob Herring2014-05-201-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds FDT parsing of {linux,}stdout-path to setup an early serial console. Enabling of the early console is triggered with "earlycon" (with no options) on the kernel command line. Platforms must either have fixmap permanent mapping support, have a functioning ioremap when early params are parsed, or explicitly call early_init_dt_scan_chosen_serial from architecture code. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Grant Likely <grant.likely@linaro.org>
* | of: Handle memory@0 node on PPC32 onlyLeif Lindholm2014-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to deal with an firmware bug on a specific ppc32 platform (longtrail), early_init_dt_scan_memory() looks for a node called memory@0 on all platforms. Restrict this quirk to ppc32 kernels only. Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Cc: linuxppc-dev@lists.ozlabs.org Cc: Grant Likely <grant.likely@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org
* | of: Use NULL for pointersThierry Reding2014-05-231-1/+1
|/ | | | | | | | | | | | Commit 4485681939b9 (of/fdt: Clean up casting in unflattening path) modified unflatten_dt_node() to take a void * for the mem parameter instead of an unsigned long. One of the call sites wasn't updated. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Grant Likely <grant.likely@linaro.org> Conflicts: drivers/of/fdt.c
* of/fdt: convert initial_boot_params to opaque pointerRob Herring2014-04-301-1/+1
| | | | | | | | | | Now that all accesses to FDT header data has been converted to accessor helpers, initial_boot_params can become an opaque pointer. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: introduce of_get_flat_dt_sizeRob Herring2014-04-301-0/+8
| | | | | | | | | Add a wrapper function to retrieve the FDT size from the FDT header. This is primarily to avoid libfdt include paths for the whole kernel. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: fix phys_addr_t related print size warningsRob Herring2014-04-301-2/+2
| | | | | | | | | Fix warnings in early_init_dt_reserve_memory_arch when phys_addr_t is 32-bit and memblock is not enabled. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: move memreserve and dtb memory reservations into coreRob Herring2014-04-301-0/+16
| | | | | | | | | | | | | | | | | | | | Move the /memreserve/ processing and dtb memory reservations into early_init_fdt_scan_reserved_mem. This converts arm, arm64, and powerpc as they are the only users of early_init_fdt_scan_reserved_mem. memblock_reserve is safe to call on the same region twice, so the reservation check for the dtb in powerpc 32-bit reservations is safe to remove. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Michal Simek <michal.simek@xilinx.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: create common debugfsRob Herring2014-04-301-0/+24
| | | | | | | | | | | | | | | | | | | Both powerpc and microblaze have the same FDT blob in debugfs feature. Move this to common location and remove the powerpc and microblaze implementations. This feature could become more useful when FDT overlay support is added. This changes the path of the blob from "$arch/flat-device-tree" to "device-tree/flat-device-tree". Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Michal Simek <michal.simek@xilinx.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: linuxppc-dev@lists.ozlabs.org Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: use libfdt accessors for header dataRob Herring2014-04-301-14/+12
| | | | | | | | | | | | | With libfdt support, we can take advantage of helper accessors in libfdt for accessing the FDT header data. This makes the code more readable and makes the FDT blob structure more opaque to the kernel. This also prepares for removing struct boot_param_header completely. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Max Filippov <jcmvbkbc@gmail.com> Tested-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: Convert FDT functions to use libfdtRob Herring2014-04-301-152/+57
| | | | | | | | | | | | | | | | | | | The kernel FDT functions predate libfdt and are much more limited in functionality. Also, the kernel functions and libfdt functions are not compatible with each other because they have different definitions of node offsets. To avoid this incompatibility and in preparation to add more FDT parsing functions which will need libfdt, let's first convert the existing code to use libfdt. The FDT unflattening, top-level FDT scanning, and property retrieval functions are converted to use libfdt. The scanning code should be re-worked to be more efficient and understandable by using libfdt to find nodes directly by path or compatible strings. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: update of_get_flat_dt_prop in prep for libfdtRob Herring2014-04-301-19/+20
| | | | | | | | | | | Make of_get_flat_dt_prop arguments compatible with libfdt fdt_getprop call in preparation to convert FDT code to use libfdt. Make the return value const and the property length ptr type an int. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: remove unused of_scan_flat_dt_by_pathRob Herring2014-04-301-67/+0
| | | | | | | | | of_scan_flat_dt_by_path is unused anywhere in the kernel, so remove it. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of/fdt: remove some unneeded includesRob Herring2014-04-301-5/+0
| | | | | | | | | | | | | Whatever needed powerpc machdep.h appears to have been removed, so the include can be dropped. module.h is not needed as this code is always built-in. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Grant Likely <grant.likely@linaro.org> Tested-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
* of: Fix the section mismatch warnings.Xiubo Li2014-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | In tag next-20140407, building with CONFIG_DEBUG_SECTION_MISMATCH enabled, the following WARNING is occured: WARNING: drivers/built-in.o(.text.unlikely+0x2220): Section mismatch in reference from the function __reserved_mem_check_root() to the function .init.text:of_get_flat_dt_prop() The function __reserved_mem_check_root() references the function __init of_get_flat_dt_prop(). This is often because __reserved_mem_check_root lacks a __init annotation or the annotation of of_get_flat_dt_prop is wrong. WARNING: vmlinux.o(.text.unlikely+0xb9d0): Section mismatch in reference from the function __reserved_mem_check_root() to the (unknown reference) .init.data:(unknown) The function __reserved_mem_check_root() references the (unknown reference) __initdata (unknown). This is often because __reserved_mem_check_root lacks a __initdata annotation or the annotation of (unknown) is wrong. This is cause by : 'drivers: of: add initialization code for dynamic reserved memory'. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Rob Herring <robh@kernel.org>
* Merge branch 'devicetree/next-reserved-mem' into devicetree/nextGrant Likely2014-03-191-0/+143
|\
| * of: only scan for reserved mem when fdt presentJosh Cartwright2014-03-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | When the reserved memory patches hit -next, several legacy (non-DT) boot failures were detected and bisected down to that commit. There needs to be some sanity checking whether a DT is even present before parsing the reserved ranges. Reported-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Josh Cartwright <joshc@codeaurora.org> Tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Grant Likely <grant.likely@linaro.org>
| * drivers: of: add initialization code for dynamic reserved memoryMarek Szyprowski2014-03-111-2/+11
| | | | | | | | | | | | | | | | | | | | | | This patch adds support for dynamically allocated reserved memory regions declared in device tree. Such regions are defined by 'size', 'alignment' and 'alloc-ranges' properties. Based on previous code provided by Josh Cartwright <joshc@codeaurora.org> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
| * drivers: of: add initialization code for static reserved memoryMarek Szyprowski2014-03-111-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for static (defined by 'reg' property) reserved memory regions declared in device tree. Memory blocks can be reliably reserved only during early boot. This must happen before the whole memory management subsystem is initialized, because we need to ensure that the given contiguous blocks are not yet allocated by kernel. Also it must happen before kernel mappings for the whole low memory are created, to ensure that there will be no mappings (for reserved blocks). Typically, all this happens before device tree structures are unflattened, so we need to get reserved memory layout directly from fdt. Based on previous code provided by Josh Cartwright <joshc@codeaurora.org> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | of: device_node kobject lifecycle fixesPantelis Antoniou2014-03-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the move to having device nodes be proper kobjects the lifecycle of the node needs to be controlled better. At first convert of_add_node() in the unflattened functions to of_init_node() which initializes the kobject so that of_node_get/put work correctly even before of_init is called. Afterwards introduce of_node_is_initialized & of_node_is_attached that query the underlying kobject about the state (attached means kobj is visible in sysfs) Using that make sure the lifecycle of the tree is correct at all times. Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com> [grant.likely: moved of_node_init() calls, fixed up locking, and dropped __of_populate() hunks] Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | of: Make device nodes kobjects so they show up in sysfsGrant Likely2014-03-111-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device tree nodes are already treated as objects, and we already want to expose them to userspace which is done using the /proc filesystem today. Right now the kernel has to do a lot of work to keep the /proc view in sync with the in-kernel representation. If device_nodes are switched to be kobjects then the device tree code can be a whole lot simpler. It also turns out that switching to using /sysfs from /proc results in smaller code and data size, and the userspace ABI won't change if /proc/device-tree symlinks to /sys/firmware/devicetree/base. v7: Add missing sysfs_bin_attr_init() v6: Add __of_add_property() early init fixes from Pantelis v5: Rename firmware/ofw to firmware/devicetree Fix updating property values in sysfs v4: Fixed build error on Powerpc Fixed handling of dynamic nodes on powerpc v3: Fixed handling of duplicate attribute and child node names v2: switch to using sysfs bin_attributes which solve the problem of reporting incorrect property size. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David S. Miller <davem@davemloft.net> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
* of: Fix NULL dereference in unflatten_and_copy()James Hogan2013-12-111-2/+10
| | | | | | | | | | | | Check whether initial_boot_params is NULL before dereferencing it in unflatten_and_copy_device_tree() for the case where no device tree is available but the arch can still boot to a minimal usable system without it. In this case also log a warning for when the kernel log buffer is obtainable. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
* Merge tag 'devicetree-for-3.13' of ↵Linus Torvalds2013-11-121-3/+135
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "DeviceTree updates for 3.13. This is a bit larger pull request than usual for this cycle with lots of clean-up. - Cross arch clean-up and consolidation of early DT scanning code. - Clean-up and removal of arch prom.h headers. Makes arch specific prom.h optional on all but Sparc. - Addition of interrupts-extended property for devices connected to multiple interrupt controllers. - Refactoring of DT interrupt parsing code in preparation for deferred probe of interrupts. - ARM cpu and cpu topology bindings documentation. - Various DT vendor binding documentation updates" * tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (82 commits) powerpc: add missing explicit OF includes for ppc dt/irq: add empty of_irq_count for !OF_IRQ dt: disable self-tests for !OF_IRQ of: irq: Fix interrupt-map entry matching MIPS: Netlogic: replace early_init_devtree() call of: Add Panasonic Corporation vendor prefix of: Add Chunghwa Picture Tubes Ltd. vendor prefix of: Add AU Optronics Corporation vendor prefix of/irq: Fix potential buffer overflow of/irq: Fix bug in interrupt parsing refactor. of: set dma_mask to point to coherent_dma_mask of: add vendor prefix for PHYTEC Messtechnik GmbH DT: sort vendor-prefixes.txt of: Add vendor prefix for Cadence of: Add empty for_each_available_child_of_node() macro definition arm/versatile: Fix versatile irq specifications. of/irq: create interrupts-extended property microblaze/pci: Drop PowerPC-ism from irq parsing of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code. of/irq: Use irq_of_parse_and_map() ...
| * of: introduce common FDT machine related functionsRob Herring2013-10-091-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce common of_flat_dt_match_machine and of_flat_dt_get_machine_name functions to unify architectures' handling of machine level model and compatible properties. Several architectures match the root compatible string with an arch specific list of machine descriptors duplicating the same search algorithm. Create a common implementation with a simple architecture specific hook to iterate over each machine's match table. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@linaro.org>
| * of: remove early_init_dt_setup_initrd_archRob Herring2013-10-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All arches do essentially the same thing now for early_init_dt_setup_initrd_arch, so it can now be removed. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Mark Salter <msalter@redhat.com> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Jonas Bonn <jonas@southpole.se> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: x86@kernel.org Cc: Chris Zankel <chris@zankel.net> Cc: Max Filippov <jcmvbkbc@gmail.com> Acked-by: Grant Likely <grant.likely@linaro.org>
| * of: create default early_init_dt_add_memory_archRob Herring2013-10-091-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a weak version of early_init_dt_add_memory_arch which uses memblock. This will unify all architectures except ones with custom memory bank structs. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Jonas Bonn <jonas@southpole.se> Acked-by: Grant Likely <grant.likely@linaro.org> Cc: linux-arm-kernel@lists.infradead.org Cc: microblaze-uclinux@itee.uq.edu.au Cc: linux@lists.openrisc.net Cc: devicetree@vger.kernel.org
| * of: Introduce common early_init_dt_scanRob Herring2013-10-091-0/+26
| | | | | | | | | | | | | | | | | | | | Most architectures scan the all the same items early in the FDT and none are really architecture specific. Create a common early_init_dt_scan to unify the early scan of root, memory, and chosen nodes in the flattened DT. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@linaro.org>
| * of: create unflatten_and_copy_device_treeRob Herring2013-10-091-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | Several architectures using DT support built-in dtb's in the init section. These platforms need to copy the dtb from init since the strings are referenced after unflattening. Every arch has their own copying routine which do the same thing. Create a common function, unflatten_and_copy_device_tree, to copy the dtb when unflattening the dtb. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@linaro.org>
* | Revert "of: Feed entire flattened device tree into the random pool"Grant Likely2013-10-141-12/+0
|/ | | | | | | | | | | | | | | | | | This reverts commit 109b6236294b53d8eaa50be7d9e9ad37079f5f7e. Tim Bird expressed concern that this will have a bad effect on boot time, and while simple tests have shown it to be okay with simple tree, a device tree blob can potentially be quite large and add_device_randomness() is not a fast function. Rather than do this for all platforms unconditionally, I'm reverting this patch and would like to see it revisited. Instead of feeding the entire tree into the random pool, it would probably be appropriate to hash the tree and feed the hash result into the pool. There really isn't a lot of randomness in a device tree anyway. In the majority of cases only a handful of properties are going to be different between machines with the same baseboard. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linuxLinus Torvalds2013-09-101-38/+60
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull device tree core updates from Grant Likely: "Generally minor changes. A bunch of bug fixes, particularly for initialization and some refactoring. Most notable change if feeding the entire flattened tree into the random pool at boot. May not be significant, but shouldn't hurt either" Tim Bird questions whether the boot time cost of the random feeding may be noticeable. And "add_device_randomness()" is definitely not some speed deamon of a function. * tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux: of/platform: add error reporting to of_amba_device_create() irq/of: Fix comment typo for irq_of_parse_and_map of: Feed entire flattened device tree into the random pool of/fdt: Clean up casting in unflattening path of/fdt: Remove duplicate memory clearing on FDT unflattening gpio: implement gpio-ranges binding document fix of: call __of_parse_phandle_with_args from of_parse_phandle of: introduce of_parse_phandle_with_fixed_args of: move of_parse_phandle() of: move documentation of of_parse_phandle_with_args of: Fix missing memory initialization on FDT unflattening of: consolidate definition of early_init_dt_alloc_memory_arch() of: Make of_get_phy_mode() return int i.s.o. const int include: dt-binding: input: create a DT header defining key codes. of/platform: Staticize of_platform_device_create_pdata() of: Specify initrd location using 64-bit dt: Typo fix OF: make of_property_for_each_{u32|string}() use parameters if OF is not enabled
| * of: Feed entire flattened device tree into the random poolAnton Blanchard2013-08-301-0/+12
| | | | | | | | | | | | | | | | | | We feed the entire DMI table into the random pool to provide better random data during early boot, so do the same with the flattened device tree. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Grant Likely <grant.likely@linaro.org>
| * of/fdt: Clean up casting in unflattening pathGrant Likely2013-08-301-33/+30
| | | | | | | | | | | | | | | | | | | | | | | | The flat tree unflatting path is using unsigned longs to carry around virtual address pointers to the device tree and the allocated memory used to unpack it. This is a little insane since every access to them needs to be cast to a pointer type before using it. This patch changes the data type to void* for the 'start' and 'mem' pointers and reworks the unflattening functions to use those values directly which results in slightly simpler code. Signed-off-by: Grant Likely <grant.likely@linaro.org>
| * of/fdt: Remove duplicate memory clearing on FDT unflatteningGrant Likely2013-08-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Patch 9e4012752, "of: fdt: fix memory initialization for expanded DT" fixed incomplete clearing of memory when unflattening the device tree. However the code was already clearing some of the memory, it just wasn't doing so for all allocations. Now that the memory is cleared right at the point of allocation, the memset after unflatten_dt_alloc() is redundant. Remove it. Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Wladislav Wiebe <wladislav.kw@gmail.com>
| * of: consolidate definition of early_init_dt_alloc_memory_arch()Grant Likely2013-08-281-0/+12
| | | | | | | | | | | | | | Most architectures use the same implementation. Collapse the common ones into a single weak function that can be overridden. Signed-off-by: Grant Likely <grant.likely@linaro.org>
| * Merge tag 'v3.11-rc7' into devicetree/nextGrant Likely2013-08-281-0/+2
| |\ | | | | | | | | | Linux 3.11-rc7
| * | of: Specify initrd location using 64-bitSantosh Shilimkar2013-07-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some PAE architectures, the entire range of physical memory could reside outside the 32-bit limit. These systems need the ability to specify the initrd location using 64-bit numbers. This patch globally modifies the early_init_dt_setup_initrd_arch() function to use 64-bit numbers instead of the current unsigned long. There has been quite a bit of debate about whether to use u64 or phys_addr_t. It was concluded to stick to u64 to be consistent with rest of the device tree code. As summarized by Geert, "The address to load the initrd is decided by the bootloader/user and set at that point later in time. The dtb should not be tied to the kernel you are booting" More details on the discussion can be found here: https://lkml.org/lkml/2013/6/20/690 https://lkml.org/lkml/2012/9/13/544 Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | | Merge branch 'for-v3.12' of ↵Linus Torvalds2013-09-091-0/+76
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.linaro.org/people/mszyprowski/linux-dma-mapping Pull DMA mapping update from Marek Szyprowski: "This contains an addition of Device Tree support for reserved memory regions (Contiguous Memory Allocator is one of the drivers for it) and changes required by the KVM extensions for PowerPC architectue" * 'for-v3.12' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: ARM: init: add support for reserved memory defined by device tree drivers: of: add initialization code for dma reserved memory drivers: of: add function to scan fdt nodes given by path drivers: dma-contiguous: clean source code and prepare for device tree
| * | drivers: of: add function to scan fdt nodes given by pathMarek Szyprowski2013-08-271-0/+76
| |/ | | | | | | | | | | | | | | | | | | | | Add a function to scan the flattened device-tree starting from the node given by the path. It is used to extract information (like reserved memory), which is required on early boot before we can unflatten the tree. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Acked-by: Tomasz Figa <t.figa@samsung.com> Reviewed-by: Rob Herring <rob.herring@calxeda.com>
* | of: fdt: fix memory initialization for expanded DTWladislav Wiebe2013-08-211-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Already existing property flags are filled wrong for properties created from initial FDT. This could cause problems if this DYNAMIC device-tree functions are used later, i.e. properties are attached/detached/replaced. Simply dumping flags from the running system show, that some initial static (not allocated via kzmalloc()) nodes are marked as dynamic. I putted some debug extensions to property_proc_show(..) : .. + if (OF_IS_DYNAMIC(pp)) + pr_err("DEBUG: xxx : OF_IS_DYNAMIC\n"); + if (OF_IS_DETACHED(pp)) + pr_err("DEBUG: xxx : OF_IS_DETACHED\n"); when you operate on the nodes (e.g.: ~$ cat /proc/device-tree/*some_node*) you will see that those flags are filled wrong, basically in most cases it will dump a DYNAMIC or DETACHED status, which is in not true. (BTW. this OF_IS_DETACHED is a own define for debug purposes which which just make a test_bit(OF_DETACHED, &x->_flags) If nodes are dynamic kernel is allowed to kfree() them. But it will crash attempting to do so on the nodes from FDT -- they are not allocated via kzmalloc(). Signed-off-by: Wladislav Wiebe <wladislav.kw@gmail.com> Acked-by: Alexander Sverdlin <alexander.sverdlin@nsn.com> Cc: stable@vger.kernel.org Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* open firmware: "/aliasas" -> "/aliases"Robert P. J. Day2013-06-181-1/+1
| | | | | | | Fix "/aliasas" typo in comments, no functional change. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* drivers/of/fdt.c: re-use kernel's kbasename()Andy Shevchenko2012-12-171-8/+2
| | | | | | | | | Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Fix build when CONFIG_W1_MASTER_GPIO=m b exporting "allnodes"Randy Dunlap2012-11-301-1/+1
| | | | | | | | | ERROR: "allnodes" [drivers/w1/masters/w1-gpio.ko] undefined! Signed-off-by: Randy Dunlap <rdunlap@infradead.org> [grant.likely: allnodes is too generic; rename to of_allnodes] Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Ville Syrjala <syrjala@sci.fi>
* of/fdt: NULL-terminate the root node pathCatalin Marinas2012-11-201-1/+2
| | | | | | | | | | | | Commit 509b7455 (of/fdt: Don't copy garbage after "/" in root node path) sets the path length to 0 to ignore any garbage after "/" in the root node path. This has the side effect of also ignoring '\0' at the end of the root node path. This patch sets the ignores the garbage by setting the last character to '\0' and length to 1. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* of: fdt: Constify 'pathp'Fabio Estevam2012-11-201-2/+2
| | | | | | | | | | Constify 'pathp' in order to get rid of the following warning: drivers/of/fdt.c:491:10: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> [Rob Herring: also constify np and lp] Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* drivers/of: Constify device_node->name and ->path_component_nameGrant Likely2012-11-171-5/+5
| | | | | | | | | | | | | | Neither of these should ever be changed once set. Make them const and fix up the users that try to modify it in-place. In one case kmalloc+memcpy is replaced with kstrdup() to avoid modifying the string. Build tested with defconfigs on ARM, PowerPC, Sparc, MIPS, x86 among others. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Julian Calaby <julian.calaby@gmail.com>
* of/fdt: Don't copy garbage after "/" in root node pathBenjamin Herrenschmidt2012-11-101-0/+1
| | | | | | | | | | | | | The root node path must be internally converted to "/", or various pieces of code looking for it that way will fail. The code to do that however had a bug where we might incorrectly append pieces of the original path from the fdt to the "/". We should probably add a proper dedicated accessor for the root node but in the meantime this patch should fix it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* of/fdt.c: asm/setup.h included twiceDanny Kukawka2012-02-271-1/+0
| | | | | | | drivers/of/fdt.c included 'asm/setup.h' twice, remove the duplicate. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* of: add include asm/setup.h in drivers/of/fdt.cYu Yue2012-01-101-0/+1
| | | | | | | | | | | | In the file drivers/of/fdt.c, it uses the COMMAND_LINE_SIZE which is stated in asm/setup.h, so asm/setup.h should be included in drivers/of/fdt.c. Signed-off-by: Yu Yue <yuyue@mprc.pku.edu.cn> Signed-off-by: Guan Xuetao <guanxuetao@mprc.pku.edu.cn> Cc: Grant Likerly <grant.likely@secretlab.ca> Cc: devicetree-discuss@lists.ozlabs.org Cc: Arnd Bergmann <arnd@arndb.de>
* ARM: prom.h: Fix build error by removing unneeded header fileFabio Estevam2012-01-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Fix the following build error: CC [M] fs/udf/balloc.o In file included from /home/fabio/next/linux-next/arch/arm/include/asm/prom.h:16, from include/linux/of.h:140, from include/asm-generic/gpio.h:7, from arch/arm/plat-mxc/include/mach/irqs.h:14, from /home/fabio/next/linux-next/arch/arm/include/asm/irq.h:4, from /home/fabio/next/linux-next/arch/arm/include/asm/hardirq.h:6, from include/linux/hardirq.h:7, from include/linux/highmem.h:8, from include/linux/pagemap.h:10, from include/linux/buffer_head.h:13, from fs/udf/udfdecl.h:11, from fs/udf/balloc.c:22: /home/fabio/next/linux-next/arch/arm/include/asm/setup.h:146: error: redefinition of 'struct tag' Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> [grant.likely: fix build failure on drivers/of/fdt.c] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* ARM/of: allow *machine_desc.dt_compat to be constUwe Kleine-König2011-12-271-2/+2
| | | | | | | This allows dt_compat to point to a constant list of compatible strings. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
OpenPOWER on IntegriCloud