aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-06-11 14:08:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-06-11 14:08:57 -0400
commit90735c99edfa1968a3e8da26a0b471a59fbc0f57 (patch)
tree21aa6810cb4c7a998004c5df98e4384d79c16230
parentf1c32afdb83eb8fa1d130049f4bf8e14fdab7cc4 (diff)
parent06dfeef88573cf032e5c27e37f80ff5237b3318a (diff)
Merge tag 'devicetree-fixes-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree fixes from Rob Herring: - fix unflatten_dt_nodes when dad parameter is set. - add vendor prefixes for TechNexion and UniWest - documentation fix for Marvell BT - OF IRQ kerneldoc fixes - restrict CMA alignment adjustments to non dma-coherent - a couple of warning fixes in reserved-memory code - DT maintainers updates * tag 'devicetree-fixes-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: drivers: of: add definition of early_init_dt_alloc_reserved_memory_arch drivers/of: Fix depth for sub-tree blob in unflatten_dt_nodes() drivers: of: Fix of_pci.h header guard dt-bindings: Add vendor prefix for TechNexion of: add vendor prefix for UniWest dt: bindings: fix documentation for MARVELL's bt-sd8xxx wireless device of: add missing const for of_parse_phandle_with_args() in !CONFIG_OF of: silence warnings due to max() usage drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent of: irq: fix of_irq_get[_byname]() kernel-doc MAINTAINERS: DeviceTree maintainer updates
-rw-r--r--Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt8
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt2
-rw-r--r--MAINTAINERS7
-rw-r--r--drivers/of/fdt.c15
-rw-r--r--drivers/of/irq.c19
-rw-r--r--drivers/of/of_reserved_mem.c11
-rw-r--r--include/linux/of.h2
-rw-r--r--include/linux/of_pci.h2
-rw-r--r--include/linux/of_reserved_mem.h7
9 files changed, 49 insertions, 24 deletions
diff --git a/Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt b/Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt
index 14aa6cf58201..6a9a63cb0543 100644
--- a/Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt
+++ b/Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt
@@ -13,10 +13,10 @@ Optional properties:
13 initialization. This is an array of 28 values(u8). 13 initialization. This is an array of 28 values(u8).
14 14
15 - marvell,wakeup-pin: It represents wakeup pin number of the bluetooth chip. 15 - marvell,wakeup-pin: It represents wakeup pin number of the bluetooth chip.
16 firmware will use the pin to wakeup host system. 16 firmware will use the pin to wakeup host system (u16).
17 - marvell,wakeup-gap-ms: wakeup gap represents wakeup latency of the host 17 - marvell,wakeup-gap-ms: wakeup gap represents wakeup latency of the host
18 platform. The value will be configured to firmware. This 18 platform. The value will be configured to firmware. This
19 is needed to work chip's sleep feature as expected. 19 is needed to work chip's sleep feature as expected (u16).
20 - interrupt-parent: phandle of the parent interrupt controller 20 - interrupt-parent: phandle of the parent interrupt controller
21 - interrupts : interrupt pin number to the cpu. Driver will request an irq based 21 - interrupts : interrupt pin number to the cpu. Driver will request an irq based
22 on this interrupt number. During system suspend, the irq will be 22 on this interrupt number. During system suspend, the irq will be
@@ -50,7 +50,7 @@ calibration data is also available in below example.
50 0x37 0x01 0x1c 0x00 0xff 0xff 0xff 0xff 0x01 0x7f 0x04 0x02 50 0x37 0x01 0x1c 0x00 0xff 0xff 0xff 0xff 0x01 0x7f 0x04 0x02
51 0x00 0x00 0xba 0xce 0xc0 0xc6 0x2d 0x00 0x00 0x00 0x00 0x00 51 0x00 0x00 0xba 0xce 0xc0 0xc6 0x2d 0x00 0x00 0x00 0x00 0x00
52 0x00 0x00 0xf0 0x00>; 52 0x00 0x00 0xf0 0x00>;
53 marvell,wakeup-pin = <0x0d>; 53 marvell,wakeup-pin = /bits/ 16 <0x0d>;
54 marvell,wakeup-gap-ms = <0x64>; 54 marvell,wakeup-gap-ms = /bits/ 16 <0x64>;
55 }; 55 };
56}; 56};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index a7440bcd67ff..2c2500df0dce 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -255,6 +255,7 @@ synology Synology, Inc.
255SUNW Sun Microsystems, Inc 255SUNW Sun Microsystems, Inc
256tbs TBS Technologies 256tbs TBS Technologies
257tcl Toby Churchill Ltd. 257tcl Toby Churchill Ltd.
258technexion TechNexion
258technologic Technologic Systems 259technologic Technologic Systems
259thine THine Electronics, Inc. 260thine THine Electronics, Inc.
260ti Texas Instruments 261ti Texas Instruments
@@ -269,6 +270,7 @@ tronsmart Tronsmart
269truly Truly Semiconductors Limited 270truly Truly Semiconductors Limited
270tyan Tyan Computer Corporation 271tyan Tyan Computer Corporation
271upisemi uPI Semiconductor Corp. 272upisemi uPI Semiconductor Corp.
273uniwest United Western Technologies Corp (UniWest)
272urt United Radiant Technology Corporation 274urt United Radiant Technology Corporation
273usi Universal Scientific Industrial Co., Ltd. 275usi Universal Scientific Industrial Co., Ltd.
274v3 V3 Semiconductor 276v3 V3 Semiconductor
diff --git a/MAINTAINERS b/MAINTAINERS
index 2ebe195951af..16700e4fcc4a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8407,10 +8407,9 @@ F: drivers/i2c/busses/i2c-ocores.c
8407OPEN FIRMWARE AND FLATTENED DEVICE TREE 8407OPEN FIRMWARE AND FLATTENED DEVICE TREE
8408M: Rob Herring <robh+dt@kernel.org> 8408M: Rob Herring <robh+dt@kernel.org>
8409M: Frank Rowand <frowand.list@gmail.com> 8409M: Frank Rowand <frowand.list@gmail.com>
8410M: Grant Likely <grant.likely@linaro.org>
8411L: devicetree@vger.kernel.org 8410L: devicetree@vger.kernel.org
8412W: http://www.devicetree.org/ 8411W: http://www.devicetree.org/
8413T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git 8412T: git git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git
8414S: Maintained 8413S: Maintained
8415F: drivers/of/ 8414F: drivers/of/
8416F: include/linux/of*.h 8415F: include/linux/of*.h
@@ -8418,12 +8417,10 @@ F: scripts/dtc/
8418 8417
8419OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS 8418OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
8420M: Rob Herring <robh+dt@kernel.org> 8419M: Rob Herring <robh+dt@kernel.org>
8421M: Pawel Moll <pawel.moll@arm.com>
8422M: Mark Rutland <mark.rutland@arm.com> 8420M: Mark Rutland <mark.rutland@arm.com>
8423M: Ian Campbell <ijc+devicetree@hellion.org.uk>
8424M: Kumar Gala <galak@codeaurora.org>
8425L: devicetree@vger.kernel.org 8421L: devicetree@vger.kernel.org
8426T: git git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git 8422T: git git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git
8423Q: http://patchwork.ozlabs.org/project/devicetree-bindings/list/
8427S: Maintained 8424S: Maintained
8428F: Documentation/devicetree/ 8425F: Documentation/devicetree/
8429F: arch/*/boot/dts/ 8426F: arch/*/boot/dts/
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 14f2f8c7c260..33daffc4392c 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -395,7 +395,7 @@ static int unflatten_dt_nodes(const void *blob,
395 struct device_node **nodepp) 395 struct device_node **nodepp)
396{ 396{
397 struct device_node *root; 397 struct device_node *root;
398 int offset = 0, depth = 0; 398 int offset = 0, depth = 0, initial_depth = 0;
399#define FDT_MAX_DEPTH 64 399#define FDT_MAX_DEPTH 64
400 unsigned int fpsizes[FDT_MAX_DEPTH]; 400 unsigned int fpsizes[FDT_MAX_DEPTH];
401 struct device_node *nps[FDT_MAX_DEPTH]; 401 struct device_node *nps[FDT_MAX_DEPTH];
@@ -405,11 +405,22 @@ static int unflatten_dt_nodes(const void *blob,
405 if (nodepp) 405 if (nodepp)
406 *nodepp = NULL; 406 *nodepp = NULL;
407 407
408 /*
409 * We're unflattening device sub-tree if @dad is valid. There are
410 * possibly multiple nodes in the first level of depth. We need
411 * set @depth to 1 to make fdt_next_node() happy as it bails
412 * immediately when negative @depth is found. Otherwise, the device
413 * nodes except the first one won't be unflattened successfully.
414 */
415 if (dad)
416 depth = initial_depth = 1;
417
408 root = dad; 418 root = dad;
409 fpsizes[depth] = dad ? strlen(of_node_full_name(dad)) : 0; 419 fpsizes[depth] = dad ? strlen(of_node_full_name(dad)) : 0;
410 nps[depth] = dad; 420 nps[depth] = dad;
421
411 for (offset = 0; 422 for (offset = 0;
412 offset >= 0 && depth >= 0; 423 offset >= 0 && depth >= initial_depth;
413 offset = fdt_next_node(blob, offset, &depth)) { 424 offset = fdt_next_node(blob, offset, &depth)) {
414 if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH)) 425 if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH))
415 continue; 426 continue;
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index e7bfc175b8e1..6ec743faabe8 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -386,13 +386,13 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
386EXPORT_SYMBOL_GPL(of_irq_to_resource); 386EXPORT_SYMBOL_GPL(of_irq_to_resource);
387 387
388/** 388/**
389 * of_irq_get - Decode a node's IRQ and return it as a Linux irq number 389 * of_irq_get - Decode a node's IRQ and return it as a Linux IRQ number
390 * @dev: pointer to device tree node 390 * @dev: pointer to device tree node
391 * @index: zero-based index of the irq 391 * @index: zero-based index of the IRQ
392 *
393 * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain
394 * is not yet created.
395 * 392 *
393 * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
394 * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
395 * of any other failure.
396 */ 396 */
397int of_irq_get(struct device_node *dev, int index) 397int of_irq_get(struct device_node *dev, int index)
398{ 398{
@@ -413,12 +413,13 @@ int of_irq_get(struct device_node *dev, int index)
413EXPORT_SYMBOL_GPL(of_irq_get); 413EXPORT_SYMBOL_GPL(of_irq_get);
414 414
415/** 415/**
416 * of_irq_get_byname - Decode a node's IRQ and return it as a Linux irq number 416 * of_irq_get_byname - Decode a node's IRQ and return it as a Linux IRQ number
417 * @dev: pointer to device tree node 417 * @dev: pointer to device tree node
418 * @name: irq name 418 * @name: IRQ name
419 * 419 *
420 * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain 420 * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
421 * is not yet created, or error code in case of any other failure. 421 * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
422 * of any other failure.
422 */ 423 */
423int of_irq_get_byname(struct device_node *dev, const char *name) 424int of_irq_get_byname(struct device_node *dev, const char *name)
424{ 425{
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index ed01c0172e4a..216648233874 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -127,8 +127,15 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
127 } 127 }
128 128
129 /* Need adjust the alignment to satisfy the CMA requirement */ 129 /* Need adjust the alignment to satisfy the CMA requirement */
130 if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool")) 130 if (IS_ENABLED(CONFIG_CMA)
131 align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order)); 131 && of_flat_dt_is_compatible(node, "shared-dma-pool")
132 && of_get_flat_dt_prop(node, "reusable", NULL)
133 && !of_get_flat_dt_prop(node, "no-map", NULL)) {
134 unsigned long order =
135 max_t(unsigned long, MAX_ORDER - 1, pageblock_order);
136
137 align = max(align, (phys_addr_t)PAGE_SIZE << order);
138 }
132 139
133 prop = of_get_flat_dt_prop(node, "alloc-ranges", &len); 140 prop = of_get_flat_dt_prop(node, "alloc-ranges", &len);
134 if (prop) { 141 if (prop) {
diff --git a/include/linux/of.h b/include/linux/of.h
index c7292e8ea080..74eb28cadbef 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -614,7 +614,7 @@ static inline struct device_node *of_parse_phandle(const struct device_node *np,
614 return NULL; 614 return NULL;
615} 615}
616 616
617static inline int of_parse_phandle_with_args(struct device_node *np, 617static inline int of_parse_phandle_with_args(const struct device_node *np,
618 const char *list_name, 618 const char *list_name,
619 const char *cells_name, 619 const char *cells_name,
620 int index, 620 int index,
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
index f6e9e85164e8..b969e9443962 100644
--- a/include/linux/of_pci.h
+++ b/include/linux/of_pci.h
@@ -8,7 +8,7 @@ struct pci_dev;
8struct of_phandle_args; 8struct of_phandle_args;
9struct device_node; 9struct device_node;
10 10
11#ifdef CONFIG_OF 11#ifdef CONFIG_OF_PCI
12int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq); 12int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq);
13struct device_node *of_pci_find_child_device(struct device_node *parent, 13struct device_node *of_pci_find_child_device(struct device_node *parent,
14 unsigned int devfn); 14 unsigned int devfn);
diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h
index ad2f67054372..c201060e0c6d 100644
--- a/include/linux/of_reserved_mem.h
+++ b/include/linux/of_reserved_mem.h
@@ -31,6 +31,13 @@ typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem);
31int of_reserved_mem_device_init(struct device *dev); 31int of_reserved_mem_device_init(struct device *dev);
32void of_reserved_mem_device_release(struct device *dev); 32void of_reserved_mem_device_release(struct device *dev);
33 33
34int early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
35 phys_addr_t align,
36 phys_addr_t start,
37 phys_addr_t end,
38 bool nomap,
39 phys_addr_t *res_base);
40
34void fdt_init_reserved_mem(void); 41void fdt_init_reserved_mem(void);
35void fdt_reserved_mem_save_node(unsigned long node, const char *uname, 42void fdt_reserved_mem_save_node(unsigned long node, const char *uname,
36 phys_addr_t base, phys_addr_t size); 43 phys_addr_t base, phys_addr_t size);