Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'devicetree-for-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull DeviceTree updates from Rob Herring:

- Rework and export the changeset API to make it available to users
other than DT overlays

- ARM secure devices binding

- OCTEON USB binding

- Clean-up of various SRAM binding docs

- Various other binding doc updates

* tag 'devicetree-for-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (21 commits)
drivers/of: Export OF changeset functions
Fix documentation for adp1653 DT
ARM: psci: Fix indentation in DT bindings
of/platform: export of_default_bus_match_table
of/unittest: Show broken behaviour in the platform bus
of: fix declaration of of_io_request_and_map
of/address: replace printk(KERN_ERR ...) with pr_err(...)
of/irq: optimize device node matching loop in of_irq_init()
dt-bindings: tda998x: Document the required 'port' node.
net/macb: bindings doc: Merge cdns-emac to macb
dt-bindings: Misc fix for the ATH79 DDR controllers
dt-bindings: Misc fix for the ATH79 MISC interrupt controllers
Documentation: dt: Add bindings for Secure-only devices
dt-bindings: ARM: add arm,cortex-a72 compatible string
ASoC: Atmel: ClassD: add GCK's parent clock in DT binding
DT: add Olimex to vendor prefixes
Documentation: fsl-quadspi: Add fsl,ls1021-qspi compatible string
Documentation/devicetree: document OCTEON USB bindings
usb: misc: usb3503: Describe better how to bind clock to the hub
dt-bindings: Consolidate SRAM bindings from all vendors
...

+250 -96
+1 -1
Documentation/devicetree/bindings/arm/arm,scpi.txt
··· 63 63 - compatible : should be "arm,juno-sram-ns" for Non-secure SRAM on Juno 64 64 65 65 The rest of the properties should follow the generic mmio-sram description 66 - found in ../../misc/sysram.txt 66 + found in ../../sram/sram.txt 67 67 68 68 Each sub-node represents the reserved area for SCPI. 69 69
+1
Documentation/devicetree/bindings/arm/cpus.txt
··· 157 157 "arm,cortex-a17" 158 158 "arm,cortex-a53" 159 159 "arm,cortex-a57" 160 + "arm,cortex-a72" 160 161 "arm,cortex-m0" 161 162 "arm,cortex-m0+" 162 163 "arm,cortex-m1"
+1 -1
Documentation/devicetree/bindings/arm/exynos/smp-sysram.txt Documentation/devicetree/bindings/sram/samsung-sram.txt
··· 15 15 "samsung,exynos4210-sysram-ns" : for Non-secure SYSRAM 16 16 17 17 The rest of the properties should follow the generic mmio-sram discription 18 - found in ../../misc/sysram.txt 18 + found in Documentation/devicetree/bindings/sram/sram.txt 19 19 20 20 Example: 21 21
+12 -9
Documentation/devicetree/bindings/arm/psci.txt
··· 23 23 24 24 - compatible : should contain at least one of: 25 25 26 - * "arm,psci" : for implementations complying to PSCI versions prior to 27 - 0.2. For these cases function IDs must be provided. 26 + * "arm,psci" : For implementations complying to PSCI versions prior 27 + to 0.2. 28 + For these cases function IDs must be provided. 28 29 29 - * "arm,psci-0.2" : for implementations complying to PSCI 0.2. Function 30 - IDs are not required and should be ignored by an OS with PSCI 0.2 31 - support, but are permitted to be present for compatibility with 32 - existing software when "arm,psci" is later in the compatible list. 30 + * "arm,psci-0.2" : For implementations complying to PSCI 0.2. 31 + Function IDs are not required and should be ignored by 32 + an OS with PSCI 0.2 support, but are permitted to be 33 + present for compatibility with existing software when 34 + "arm,psci" is later in the compatible list. 33 35 34 - * "arm,psci-1.0" : for implementations complying to PSCI 1.0. PSCI 1.0 is 35 - backward compatible with PSCI 0.2 with minor specification updates, 36 - as defined in the PSCI specification[2]. 36 + * "arm,psci-1.0" : For implementations complying to PSCI 1.0. 37 + PSCI 1.0 is backward compatible with PSCI 0.2 with 38 + minor specification updates, as defined in the PSCI 39 + specification[2]. 37 40 38 41 - method : The method of calling the PSCI firmware. Permitted 39 42 values are:
Documentation/devicetree/bindings/arm/rockchip/pmu-sram.txt Documentation/devicetree/bindings/sram/rockchip-pmu-sram.txt
+1 -1
Documentation/devicetree/bindings/arm/rockchip/smp-sram.txt Documentation/devicetree/bindings/sram/rockchip-smp-sram.txt
··· 12 12 - compatible : should be "rockchip,rk3066-smp-sram" 13 13 14 14 The rest of the properties should follow the generic mmio-sram discription 15 - found in ../../misc/sram.txt 15 + found in Documentation/devicetree/bindings/sram/sram.txt 16 16 17 17 Example: 18 18
+53
Documentation/devicetree/bindings/arm/secure.txt
··· 1 + * ARM Secure world bindings 2 + 3 + ARM CPUs with TrustZone support have two distinct address spaces, 4 + "Normal" and "Secure". Most devicetree consumers (including the Linux 5 + kernel) are not TrustZone aware and run entirely in either the Normal 6 + world or the Secure world. However some devicetree consumers are 7 + TrustZone aware and need to be able to determine whether devices are 8 + visible only in the Secure address space, only in the Normal address 9 + space, or visible in both. (One example of that situation would be a 10 + virtual machine which boots Secure firmware and wants to tell the 11 + firmware about the layout of the machine via devicetree.) 12 + 13 + The general principle of the naming scheme for Secure world bindings 14 + is that any property that needs a different value in the Secure world 15 + can be supported by prefixing the property name with "secure-". So for 16 + instance "secure-foo" would override "foo". For property names with 17 + a vendor prefix, the Secure variant of "vendor,foo" would be 18 + "vendor,secure-foo". If there is no "secure-" property then the Secure 19 + world value is the same as specified for the Normal world by the 20 + non-prefixed property. However, only the properties listed below may 21 + validly have "secure-" versions; this list will be enlarged on a 22 + case-by-case basis. 23 + 24 + Defining the bindings in this way means that a device tree which has 25 + been annotated to indicate the presence of Secure-only devices can 26 + still be processed unmodified by existing Non-secure software (and in 27 + particular by the kernel). 28 + 29 + Note that it is still valid for bindings intended for purely Secure 30 + world consumers (like kernels that run entirely in Secure) to simply 31 + describe the view of Secure world using the standard bindings. These 32 + secure- bindings only need to be used where both the Secure and Normal 33 + world views need to be described in a single device tree. 34 + 35 + Valid Secure world properties: 36 + 37 + - secure-status : specifies whether the device is present and usable 38 + in the secure world. The combination of this with "status" allows 39 + the various possible combinations of device visibility to be 40 + specified. If "secure-status" is not specified it defaults to the 41 + same value as "status"; if "status" is not specified either then 42 + both default to "okay". This means the following combinations are 43 + possible: 44 + 45 + /* Neither specified: default to visible in both S and NS */ 46 + secure-status = "okay"; /* visible in both */ 47 + status = "okay"; /* visible in both */ 48 + status = "okay"; secure-status = "okay"; /* visible in both */ 49 + secure-status = "disabled"; /* NS-only */ 50 + status = "okay"; secure-status = "disabled"; /* NS-only */ 51 + status = "disabled"; secure-status = "okay"; /* S-only */ 52 + status = "disabled"; /* disabled in both */ 53 + status = "disabled"; secure-status = "disabled"; /* disabled in both */
+4
Documentation/devicetree/bindings/display/bridge/tda998x.txt
··· 5 5 6 6 - reg: I2C address 7 7 8 + Required node: 9 + - port: Input port node with endpoint definition, as described 10 + in Documentation/devicetree/bindings/graph.txt 11 + 8 12 Optional properties: 9 13 - interrupts: interrupt number and trigger type 10 14 default: polling
+1 -1
Documentation/devicetree/bindings/interrupt-controller/qca,ath79-misc-intc.txt
··· 22 22 Example: 23 23 24 24 interrupt-controller@18060010 { 25 - compatible = "qca,ar9132-misc-intc", qca,ar7100-misc-intc"; 25 + compatible = "qca,ar9132-misc-intc", "qca,ar7100-misc-intc"; 26 26 reg = <0x18060010 0x4>; 27 27 28 28 interrupt-parent = <&cpuintc>;
+4 -3
Documentation/devicetree/bindings/media/i2c/adp1653.txt
··· 12 12 represented by one child node, nodes need to be named "flash" and "indicator". 13 13 14 14 Required properties of the LED child node: 15 - - max-microamp : see Documentation/devicetree/bindings/leds/common.txt 15 + - led-max-microamp : see Documentation/devicetree/bindings/leds/common.txt 16 16 17 17 Required properties of the flash LED child node: 18 18 19 19 - flash-max-microamp : see Documentation/devicetree/bindings/leds/common.txt 20 20 - flash-timeout-us : see Documentation/devicetree/bindings/leds/common.txt 21 + - led-max-microamp : see Documentation/devicetree/bindings/leds/common.txt 21 22 22 23 Example: 23 24 ··· 30 29 flash { 31 30 flash-timeout-us = <500000>; 32 31 flash-max-microamp = <320000>; 33 - max-microamp = <50000>; 32 + led-max-microamp = <50000>; 34 33 }; 35 34 indicator { 36 - max-microamp = <17500>; 35 + led-max-microamp = <17500>; 37 36 }; 38 37 };
+4 -4
Documentation/devicetree/bindings/memory-controllers/ath79-ddr-controller.txt
··· 1 1 Binding for Qualcomm Atheros AR7xxx/AR9xxx DDR controller 2 2 3 - The DDR controller of the ARxxx and AR9xxx families provides an interface 3 + The DDR controller of the AR7xxx and AR9xxx families provides an interface 4 4 to flush the FIFO between various devices and the DDR. This is mainly used 5 5 by the IRQ controller to flush the FIFO before running the interrupt handler 6 6 of such devices. ··· 11 11 "qca,[ar7100|ar7240]-ddr-controller" as fallback. 12 12 On SoC with PCI support "qca,ar7100-ddr-controller" should be used as 13 13 fallback, otherwise "qca,ar7240-ddr-controller" should be used. 14 - - reg: Base address and size of the controllers memory area 15 - - #qca,ddr-wb-channel-cells: has to be 1, the index of the write buffer 16 - channel 14 + - reg: Base address and size of the controller's memory area 15 + - #qca,ddr-wb-channel-cells: Specifies the number of cells needed to encode 16 + the write buffer channel index, should be 1. 17 17 18 18 Example: 19 19
Documentation/devicetree/bindings/misc/sram.txt Documentation/devicetree/bindings/sram/sram.txt
+2 -1
Documentation/devicetree/bindings/mtd/fsl-quadspi.txt
··· 2 2 3 3 Required properties: 4 4 - compatible : Should be "fsl,vf610-qspi", "fsl,imx6sx-qspi", 5 - "fsl,imx7d-qspi", "fsl,imx6ul-qspi" 5 + "fsl,imx7d-qspi", "fsl,imx6ul-qspi", 6 + "fsl,ls1021-qspi" 6 7 - reg : the first contains the register location and length, 7 8 the second contains the memory mapping address and length 8 9 - reg-names: Should contain the reg names "QuadSPI" and "QuadSPI-memory"
-20
Documentation/devicetree/bindings/net/cdns-emac.txt
··· 1 - * Cadence EMAC Ethernet controller 2 - 3 - Required properties: 4 - - compatible: Should be "cdns,[<chip>-]{emac}" 5 - Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC. 6 - Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC. 7 - Or the generic form: "cdns,emac". 8 - - reg: Address and length of the register set for the device 9 - - interrupts: Should contain macb interrupt 10 - - phy-mode: see ethernet.txt file in the same directory. 11 - 12 - Examples: 13 - 14 - macb0: ethernet@fffc4000 { 15 - compatible = "cdns,at91rm9200-emac"; 16 - reg = <0xfffc4000 0x4000>; 17 - interrupts = <21>; 18 - phy-mode = "rmii"; 19 - local-mac-address = [3a 0e 03 04 05 06]; 20 - };
+3
Documentation/devicetree/bindings/net/macb.txt
··· 2 2 3 3 Required properties: 4 4 - compatible: Should be "cdns,[<chip>-]{macb|gem}" 5 + Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC. 5 6 Use "cdns,at91sam9260-macb" for Atmel at91sam9 SoCs or the 10/100Mbit IP 6 7 available on sama5d3 SoCs. 7 8 Use "cdns,np4-macb" for NP4 SoC devices. ··· 12 11 Use "atmel,sama5d2-gem" for the GEM IP (10/100) available on Atmel sama5d2 SoCs. 13 12 Use "atmel,sama5d3-gem" for the Gigabit IP available on Atmel sama5d3 SoCs. 14 13 Use "atmel,sama5d4-gem" for the GEM IP (10/100) available on Atmel sama5d4 SoCs. 14 + Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC. 15 15 Use "cdns,zynqmp-gem" for Zynq Ultrascale+ MPSoC. 16 + Or the generic form: "cdns,emac". 16 17 - reg: Address and length of the register set for the device 17 18 - interrupts: Should contain macb interrupt 18 19 - phy-mode: See ethernet.txt file in the same directory.
+1 -1
Documentation/devicetree/bindings/soc/sunxi/sram.txt Documentation/devicetree/bindings/sram/sunxi-sram.txt
··· 16 16 ---------- 17 17 18 18 Each SRAM is described using the mmio-sram bindings documented in 19 - Documentation/devicetree/bindings/misc/sram.txt 19 + Documentation/devicetree/bindings/sram/sram.txt 20 20 21 21 Each SRAM will have SRAM sections that are going to be handled by the 22 22 SRAM controller as subnodes. These sections are represented following
+6
Documentation/devicetree/bindings/sound/atmel-classd.txt
··· 16 16 Required elements: "pclk", "gclk" and "aclk". 17 17 - clocks 18 18 Please refer to clock-bindings.txt. 19 + - assigned-clocks 20 + Should be <&classd_gclk>. 21 + - assigned-clock-parents 22 + Should be <&audio_pll_pmc>. 19 23 20 24 Optional properties: 21 25 - pinctrl-names, pinctrl-0 ··· 47 43 dma-names = "tx"; 48 44 clocks = <&classd_clk>, <&classd_gclk>, <&audio_pll_pmc>; 49 45 clock-names = "pclk", "gclk", "aclk"; 46 + assigned-clocks = <&classd_gclk>; 47 + assigned-clock-parents = <&audio_pll_pmc>; 50 48 51 49 pinctrl-names = "default"; 52 50 pinctrl-0 = <&pinctrl_classd_default>;
+62
Documentation/devicetree/bindings/usb/octeon-usb.txt
··· 1 + OCTEON/OCTEON+ USB BLOCK 2 + 3 + 1) Main node 4 + 5 + Required properties: 6 + 7 + - compatible: must be "cavium,octeon-5750-usbn" 8 + 9 + - reg: specifies the physical base address of the USBN block and 10 + the length of the memory mapped region. 11 + 12 + - #address-cells: specifies the number of cells needed to encode an 13 + address. The value must be 2. 14 + 15 + - #size-cells: specifies the number of cells used to represent the size 16 + of an address. The value must be 2. 17 + 18 + - ranges: specifies the translation between child address space and parent 19 + address space. 20 + 21 + - clock-frequency: speed of the USB reference clock. Allowed values are 22 + 12000000, 24000000 or 48000000. 23 + 24 + - cavium,refclk-type: type of the USB reference clock. Allowed values are 25 + "crystal" or "external". 26 + 27 + - refclk-frequency: deprecated, use "clock-frequency". 28 + 29 + - refclk-type: deprecated, use "cavium,refclk-type". 30 + 31 + 2) Child node 32 + 33 + The main node must have one child node which describes the built-in 34 + USB controller. 35 + 36 + Required properties: 37 + 38 + - compatible: must be "cavium,octeon-5750-usbc" 39 + 40 + - reg: specifies the physical base address of the USBC block and 41 + the length of the memory mapped region. 42 + 43 + - interrupts: specifies the interrupt number for the USB controller. 44 + 45 + 3) Example: 46 + 47 + usbn: usbn@1180068000000 { 48 + compatible = "cavium,octeon-5750-usbn"; 49 + reg = <0x11800 0x68000000 0x0 0x1000>; 50 + ranges; /* Direct mapping */ 51 + #address-cells = <2>; 52 + #size-cells = <2>; 53 + clock-frequency = <12000000>; 54 + cavium,refclk-type = "crystal"; 55 + 56 + usbc@16f0010000000 { 57 + compatible = "cavium,octeon-5750-usbc"; 58 + reg = <0x16f00 0x10000000 0x0 0x80000>; 59 + interrupts = <0 56>; 60 + }; 61 + }; 62 +
+4 -1
Documentation/devicetree/bindings/usb/usb3503.txt
··· 18 18 - refclk: Clock used for driving REFCLK signal (optional, if not provided 19 19 the driver assumes that clock signal is always available, its 20 20 rate is specified by REF_SEL pins and a value from the primary 21 - reference clock frequencies table is used) 21 + reference clock frequencies table is used). Use clocks and 22 + clock-names in order to assign it 22 23 - refclk-frequency: Frequency of the REFCLK signal as defined by REF_SEL 23 24 pins (optional, if not provided, driver will not set rate of the 24 25 REFCLK signal and assume that a value from the primary reference ··· 34 33 intn-gpios = <&gpx3 4 1>; 35 34 reset-gpios = <&gpx3 5 1>; 36 35 initial-mode = <1>; 36 + clocks = <&clks 80>; 37 + clock-names = "refclk"; 37 38 };
+1
Documentation/devicetree/bindings/vendor-prefixes.txt
··· 161 161 nvidia NVIDIA 162 162 nxp NXP Semiconductors 163 163 okaya Okaya Electric America, Inc. 164 + olimex OLIMEX Ltd. 164 165 onnn ON Semiconductor Corp. 165 166 opencores OpenCores.org 166 167 option Option NV
+1 -1
drivers/of/address.c
··· 597 597 pbus = of_match_bus(parent); 598 598 pbus->count_cells(dev, &pna, &pns); 599 599 if (!OF_CHECK_COUNTS(pna, pns)) { 600 - printk(KERN_ERR "prom_parse: Bad cell count for %s\n", 600 + pr_err("prom_parse: Bad cell count for %s\n", 601 601 of_node_full_name(dev)); 602 602 break; 603 603 }
+46 -19
drivers/of/dynamic.c
··· 646 646 memset(ocs, 0, sizeof(*ocs)); 647 647 INIT_LIST_HEAD(&ocs->entries); 648 648 } 649 + EXPORT_SYMBOL_GPL(of_changeset_init); 649 650 650 651 /** 651 652 * of_changeset_destroy - Destroy a changeset ··· 663 662 list_for_each_entry_safe_reverse(ce, cen, &ocs->entries, node) 664 663 __of_changeset_entry_destroy(ce); 665 664 } 665 + EXPORT_SYMBOL_GPL(of_changeset_destroy); 666 666 667 - /** 668 - * of_changeset_apply - Applies a changeset 669 - * 670 - * @ocs: changeset pointer 671 - * 672 - * Applies a changeset to the live tree. 673 - * Any side-effects of live tree state changes are applied here on 674 - * sucess, like creation/destruction of devices and side-effects 675 - * like creation of sysfs properties and directories. 676 - * Returns 0 on success, a negative error value in case of an error. 677 - * On error the partially applied effects are reverted. 678 - */ 679 - int of_changeset_apply(struct of_changeset *ocs) 667 + int __of_changeset_apply(struct of_changeset *ocs) 680 668 { 681 669 struct of_changeset_entry *ce; 682 670 int ret; ··· 694 704 } 695 705 696 706 /** 697 - * of_changeset_revert - Reverts an applied changeset 707 + * of_changeset_apply - Applies a changeset 698 708 * 699 709 * @ocs: changeset pointer 700 710 * 701 - * Reverts a changeset returning the state of the tree to what it 702 - * was before the application. 703 - * Any side-effects like creation/destruction of devices and 704 - * removal of sysfs properties and directories are applied. 711 + * Applies a changeset to the live tree. 712 + * Any side-effects of live tree state changes are applied here on 713 + * success, like creation/destruction of devices and side-effects 714 + * like creation of sysfs properties and directories. 705 715 * Returns 0 on success, a negative error value in case of an error. 716 + * On error the partially applied effects are reverted. 706 717 */ 707 - int of_changeset_revert(struct of_changeset *ocs) 718 + int of_changeset_apply(struct of_changeset *ocs) 719 + { 720 + int ret; 721 + 722 + mutex_lock(&of_mutex); 723 + ret = __of_changeset_apply(ocs); 724 + mutex_unlock(&of_mutex); 725 + 726 + return ret; 727 + } 728 + EXPORT_SYMBOL_GPL(of_changeset_apply); 729 + 730 + int __of_changeset_revert(struct of_changeset *ocs) 708 731 { 709 732 struct of_changeset_entry *ce; 710 733 int ret; ··· 743 740 744 741 return 0; 745 742 } 743 + 744 + /** 745 + * of_changeset_revert - Reverts an applied changeset 746 + * 747 + * @ocs: changeset pointer 748 + * 749 + * Reverts a changeset returning the state of the tree to what it 750 + * was before the application. 751 + * Any side-effects like creation/destruction of devices and 752 + * removal of sysfs properties and directories are applied. 753 + * Returns 0 on success, a negative error value in case of an error. 754 + */ 755 + int of_changeset_revert(struct of_changeset *ocs) 756 + { 757 + int ret; 758 + 759 + mutex_lock(&of_mutex); 760 + ret = __of_changeset_revert(ocs); 761 + mutex_unlock(&of_mutex); 762 + 763 + return ret; 764 + } 765 + EXPORT_SYMBOL_GPL(of_changeset_revert); 746 766 747 767 /** 748 768 * of_changeset_action - Perform a changeset action ··· 805 779 list_add_tail(&ce->node, &ocs->entries); 806 780 return 0; 807 781 } 782 + EXPORT_SYMBOL_GPL(of_changeset_action);
+13 -14
drivers/of/irq.c
··· 473 473 474 474 struct of_intc_desc { 475 475 struct list_head list; 476 + of_irq_init_cb_t irq_init_cb; 476 477 struct device_node *dev; 477 478 struct device_node *interrupt_parent; 478 479 }; ··· 487 486 */ 488 487 void __init of_irq_init(const struct of_device_id *matches) 489 488 { 489 + const struct of_device_id *match; 490 490 struct device_node *np, *parent = NULL; 491 491 struct of_intc_desc *desc, *temp_desc; 492 492 struct list_head intc_desc_list, intc_parent_list; ··· 495 493 INIT_LIST_HEAD(&intc_desc_list); 496 494 INIT_LIST_HEAD(&intc_parent_list); 497 495 498 - for_each_matching_node(np, matches) { 496 + for_each_matching_node_and_match(np, matches, &match) { 499 497 if (!of_find_property(np, "interrupt-controller", NULL) || 500 498 !of_device_is_available(np)) 501 499 continue; 500 + 501 + if (WARN(!match->data, "of_irq_init: no init function for %s\n", 502 + match->compatible)) 503 + continue; 504 + 502 505 /* 503 506 * Here, we allocate and populate an of_intc_desc with the node 504 507 * pointer, interrupt-parent device_node etc. ··· 514 507 goto err; 515 508 } 516 509 510 + desc->irq_init_cb = match->data; 517 511 desc->dev = of_node_get(np); 518 512 desc->interrupt_parent = of_irq_find_parent(np); 519 513 if (desc->interrupt_parent == np) ··· 534 526 * The assumption is that NULL parent means a root controller. 535 527 */ 536 528 list_for_each_entry_safe(desc, temp_desc, &intc_desc_list, list) { 537 - const struct of_device_id *match; 538 529 int ret; 539 - of_irq_init_cb_t irq_init_cb; 540 530 541 531 if (desc->interrupt_parent != parent) 542 532 continue; 543 533 544 534 list_del(&desc->list); 545 - match = of_match_node(matches, desc->dev); 546 - if (WARN(!match->data, 547 - "of_irq_init: no init function for %s\n", 548 - match->compatible)) { 549 - kfree(desc); 550 - continue; 551 - } 552 535 553 - pr_debug("of_irq_init: init %s @ %p, parent %p\n", 554 - match->compatible, 536 + pr_debug("of_irq_init: init %s (%p), parent %p\n", 537 + desc->dev->full_name, 555 538 desc->dev, desc->interrupt_parent); 556 - irq_init_cb = (of_irq_init_cb_t)match->data; 557 - ret = irq_init_cb(desc->dev, desc->interrupt_parent); 539 + ret = desc->irq_init_cb(desc->dev, 540 + desc->interrupt_parent); 558 541 if (ret) { 559 542 kfree(desc); 560 543 continue;
+2
drivers/of/of_private.h
··· 45 45 extern int of_property_notify(int action, struct device_node *np, 46 46 struct property *prop, struct property *old_prop); 47 47 extern void of_node_release(struct kobject *kobj); 48 + extern int __of_changeset_apply(struct of_changeset *ocs); 49 + extern int __of_changeset_revert(struct of_changeset *ocs); 48 50 #else /* CONFIG_OF_DYNAMIC */ 49 51 static inline int of_property_notify(int action, struct device_node *np, 50 52 struct property *prop, struct property *old_prop)
+4 -4
drivers/of/overlay.c
··· 379 379 } 380 380 381 381 /* apply the changeset */ 382 - err = of_changeset_apply(&ov->cset); 382 + err = __of_changeset_apply(&ov->cset); 383 383 if (err) { 384 - pr_err("%s: of_changeset_apply() failed for tree@%s\n", 384 + pr_err("%s: __of_changeset_apply() failed for tree@%s\n", 385 385 __func__, tree->full_name); 386 386 goto err_revert_overlay; 387 387 } ··· 511 511 512 512 513 513 list_del(&ov->node); 514 - of_changeset_revert(&ov->cset); 514 + __of_changeset_revert(&ov->cset); 515 515 of_free_overlay_info(ov); 516 516 idr_remove(&ov_idr, id); 517 517 of_changeset_destroy(&ov->cset); ··· 542 542 /* the tail of list is guaranteed to be safe to remove */ 543 543 list_for_each_entry_safe_reverse(ov, ovn, &ov_list, node) { 544 544 list_del(&ov->node); 545 - of_changeset_revert(&ov->cset); 545 + __of_changeset_revert(&ov->cset); 546 546 of_free_overlay_info(ov); 547 547 idr_remove(&ov_idr, ov->id); 548 548 kfree(ov);
+1
drivers/of/platform.c
··· 31 31 #endif /* CONFIG_ARM_AMBA */ 32 32 {} /* Empty terminated list */ 33 33 }; 34 + EXPORT_SYMBOL(of_default_bus_match_table); 34 35 35 36 static int of_dev_node_match(struct device *dev, void *data) 36 37 {
+14 -4
drivers/of/unittest.c
··· 530 530 unittest(!of_changeset_add_property(&chgset, parent, ppadd), "fail add prop\n"); 531 531 unittest(!of_changeset_update_property(&chgset, parent, ppupdate), "fail update prop\n"); 532 532 unittest(!of_changeset_remove_property(&chgset, parent, ppremove), "fail remove prop\n"); 533 - mutex_lock(&of_mutex); 534 533 unittest(!of_changeset_apply(&chgset), "apply failed\n"); 535 - mutex_unlock(&of_mutex); 536 534 537 535 /* Make sure node names are constructed correctly */ 538 536 unittest((np = of_find_node_by_path("/testcase-data/changeset/n2/n21")), 539 537 "'%s' not added\n", n21->full_name); 540 538 of_node_put(np); 541 539 542 - mutex_lock(&of_mutex); 543 540 unittest(!of_changeset_revert(&chgset), "revert failed\n"); 544 - mutex_unlock(&of_mutex); 545 541 546 542 of_changeset_destroy(&chgset); 547 543 #endif ··· 753 757 } 754 758 } 755 759 760 + static struct resource test_bus_res = { 761 + .start = 0xfffffff8, 762 + .end = 0xfffffff9, 763 + .flags = IORESOURCE_MEM, 764 + }; 756 765 static const struct platform_device_info test_bus_info = { 757 766 .name = "unittest-bus", 758 767 }; ··· 800 799 if (rc) 801 800 return; 802 801 test_bus->dev.of_node = np; 802 + 803 + /* 804 + * Add a dummy resource to the test bus node after it is 805 + * registered to catch problems with un-inserted resources. The 806 + * DT code doesn't insert the resources, and it has caused the 807 + * kernel to oops in the past. This makes sure the same bug 808 + * doesn't crop up again. 809 + */ 810 + platform_device_add_resources(test_bus, &test_bus_res, 1); 803 811 804 812 of_platform_populate(np, match, NULL, &test_bus->dev); 805 813 for_each_child_of_node(np, child) {
+8 -11
include/linux/of_address.h
··· 3 3 #include <linux/ioport.h> 4 4 #include <linux/errno.h> 5 5 #include <linux/of.h> 6 + #include <linux/io.h> 6 7 7 8 struct of_pci_range_parser { 8 9 struct device_node *node; ··· 37 36 const struct of_device_id *matches, 38 37 u64 base_address); 39 38 extern void __iomem *of_iomap(struct device_node *device, int index); 39 + void __iomem *of_io_request_and_map(struct device_node *device, 40 + int index, const char *name); 40 41 41 42 /* Extract an address from a device, returns the region size and 42 43 * the address space flags too. The PCI version uses a BAR number ··· 60 57 u64 *paddr, u64 *size); 61 58 extern bool of_dma_is_coherent(struct device_node *np); 62 59 #else /* CONFIG_OF_ADDRESS */ 60 + static inline void __iomem *of_io_request_and_map(struct device_node *device, 61 + int index, const char *name) 62 + { 63 + return IOMEM_ERR_PTR(-EINVAL); 64 + } 63 65 64 66 static inline u64 of_translate_address(struct device_node *np, 65 67 const __be32 *addr) ··· 120 112 extern int of_address_to_resource(struct device_node *dev, int index, 121 113 struct resource *r); 122 114 void __iomem *of_iomap(struct device_node *node, int index); 123 - void __iomem *of_io_request_and_map(struct device_node *device, 124 - int index, const char *name); 125 115 #else 126 - 127 - #include <linux/io.h> 128 - 129 116 static inline int of_address_to_resource(struct device_node *dev, int index, 130 117 struct resource *r) 131 118 { ··· 130 127 static inline void __iomem *of_iomap(struct device_node *device, int index) 131 128 { 132 129 return NULL; 133 - } 134 - 135 - static inline void __iomem *of_io_request_and_map(struct device_node *device, 136 - int index, const char *name) 137 - { 138 - return IOMEM_ERR_PTR(-EINVAL); 139 130 } 140 131 #endif 141 132