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

[POWERPC] Document local bus nodes in the device tree, and update cuboot-pq2.

The localbus node is used to describe devices that are connected via a chip
select or similar mechanism. The advantages over placing the devices under
the root node are that it can be probed without probing other random things
under the root, and that the description of which chip select a given device
uses can be used to set up mappings if the firmware failed to do so in a
useful manner.

cuboot-pq2 is updated to match the binding; previously, it called itself
chipselect rather than localbus, and used phandle linkage between the
actual bus node and the control node (the current agreement is to simply use
the fully-qualified address of the control registers, and ignore the overlap
with the IMMR node).

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

authored by

Scott Wood and committed by
Kumar Gala
96fca1de 2d2294ae

+46 -21
+38
Documentation/powerpc/booting-without-of.txt
··· 2017 2017 fsl,cpm-command = <2e600000>; 2018 2018 }; 2019 2019 2020 + m) Chipselect/Local Bus 2021 + 2022 + Properties: 2023 + - name : Should be localbus 2024 + - #address-cells : Should be either two or three. The first cell is the 2025 + chipselect number, and the remaining cells are the 2026 + offset into the chipselect. 2027 + - #size-cells : Either one or two, depending on how large each chipselect 2028 + can be. 2029 + - ranges : Each range corresponds to a single chipselect, and cover 2030 + the entire access window as configured. 2031 + 2032 + Example: 2033 + localbus@f0010100 { 2034 + compatible = "fsl,mpc8272ads-localbus", 2035 + "fsl,mpc8272-localbus", 2036 + "fsl,pq2-localbus"; 2037 + #address-cells = <2>; 2038 + #size-cells = <1>; 2039 + reg = <f0010100 40>; 2040 + 2041 + ranges = <0 0 fe000000 02000000 2042 + 1 0 f4500000 00008000>; 2043 + 2044 + flash@0,0 { 2045 + compatible = "jedec-flash"; 2046 + reg = <0 0 2000000>; 2047 + bank-width = <4>; 2048 + device-width = <1>; 2049 + }; 2050 + 2051 + board-control@1,0 { 2052 + reg = <1 0 20>; 2053 + compatible = "fsl,mpc8272ads-bcsr"; 2054 + }; 2055 + }; 2056 + 2057 + 2020 2058 More devices will be defined as this spec matures. 2021 2059 2022 2060 VII - Specifying interrupt information for devices
+8 -21
arch/powerpc/boot/cuboot-pq2.c
··· 44 44 * some don't set up the PCI PIC at all, so we assume the device tree is 45 45 * sane and update the BRx registers appropriately. 46 46 * 47 - * For any node defined as compatible with fsl,pq2-chipselect, 48 - * #address/#size must be 2/1 for chipselect bus, 1/1 for parent bus, 49 - * and ranges must be for whole chip selects. 47 + * For any node defined as compatible with fsl,pq2-localbus, 48 + * #address/#size must be 2/1 for the localbus, and 1/1 for the parent bus. 49 + * Ranges must be for whole chip selects. 50 50 */ 51 51 static void update_cs_ranges(void) 52 52 { 53 - u32 ctrl_ph; 54 - void *ctrl_node, *bus_node, *parent_node; 53 + void *bus_node, *parent_node; 55 54 u32 *ctrl_addr; 56 55 unsigned long ctrl_size; 57 56 u32 naddr, nsize; 58 57 int len; 59 58 int i; 60 59 61 - bus_node = finddevice("/chipselect"); 62 - if (!bus_node || !dt_is_compatible(bus_node, "fsl,pq2-chipselect")) 60 + bus_node = finddevice("/localbus"); 61 + if (!bus_node || !dt_is_compatible(bus_node, "fsl,pq2-localbus")) 63 62 return; 64 63 65 64 dt_get_reg_format(bus_node, &naddr, &nsize); ··· 73 74 if (naddr != 1 || nsize != 1) 74 75 goto err; 75 76 76 - len = getprop(bus_node, "fsl,ctrl", &ctrl_ph, 4); 77 - if (len != 4) 78 - goto err; 79 - 80 - ctrl_node = find_node_by_prop_value(NULL, "linux,phandle", 81 - (char *)&ctrl_ph, 4); 82 - if (!ctrl_node) 83 - goto err; 84 - 85 - if (!dt_is_compatible(ctrl_node, "fsl,pq2-chipselect-ctrl")) 86 - goto err; 87 - 88 - if (!dt_xlate_reg(ctrl_node, 0, (unsigned long *)&ctrl_addr, 77 + if (!dt_xlate_reg(bus_node, 0, (unsigned long *)&ctrl_addr, 89 78 &ctrl_size)) 90 79 goto err; 91 80 ··· 110 123 return; 111 124 112 125 err: 113 - printf("Bad /chipselect or fsl,pq2-chipselect-ctrl node\r\n"); 126 + printf("Bad /localbus node\r\n"); 114 127 } 115 128 116 129 /* Older u-boots don't set PCI up properly. Update the hardware to match