1 From 9760aafa716292050a96d71a4bd7bd4e66053975 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Tue, 21 May 2013 10:24:48 -0300
4 Subject: [PATCH 037/203] memory: mvebu-devbus: Remove address decoding window
7 Now that mbus device tree binding has been introduced, remove the address
8 decoding window management from this driver.
9 A suitable 'ranges' entry should be added to the devbus-compatible node in
10 the device tree, as described by the mbus binding documentation.
12 Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
14 Tested-by: Andrew Lunn <andrew@lunn.ch>
15 Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
17 drivers/memory/mvebu-devbus.c | 64 ++-----------------------------------------
18 1 file changed, 2 insertions(+), 62 deletions(-)
20 --- a/drivers/memory/mvebu-devbus.c
21 +++ b/drivers/memory/mvebu-devbus.c
22 @@ -208,16 +208,11 @@ static int mvebu_devbus_probe(struct pla
24 struct device *dev = &pdev->dev;
25 struct device_node *node = pdev->dev.of_node;
26 - struct device_node *parent;
27 struct devbus *devbus;
31 - const __be32 *ranges;
33 - int addr_cells, p_addr_cells, size_cells;
34 - int ranges_len, tuple_len;
38 devbus = devm_kzalloc(&pdev->dev, sizeof(struct devbus), GFP_KERNEL);
40 @@ -248,68 +243,13 @@ static int mvebu_devbus_probe(struct pla
44 - * Allocate an address window for this device.
45 - * If the device probing fails, then we won't be able to
46 - * remove the allocated address decoding window.
48 - * FIXME: This is only a temporary hack! We need to do this here
49 - * because we still don't have device tree bindings for mbus.
50 - * Once that support is added, we will declare these address windows
51 - * statically in the device tree, and remove the window configuration
56 - * Get the CS to choose the window string.
57 - * This is a bit hacky, but it will be removed once the
58 - * address windows are declared in the device tree.
60 - cs = (((unsigned long)devbus->base) % 0x400) / 8;
63 - * Parse 'ranges' property to obtain a (base,size) window tuple.
64 - * This will be removed once the address windows
65 - * are declared in the device tree.
67 - parent = of_get_parent(node);
71 - p_addr_cells = of_n_addr_cells(parent);
72 - of_node_put(parent);
74 - addr_cells = of_n_addr_cells(node);
75 - size_cells = of_n_size_cells(node);
76 - tuple_len = (p_addr_cells + addr_cells + size_cells) * sizeof(__be32);
78 - ranges = of_get_property(node, "ranges", &ranges_len);
79 - if (ranges == NULL || ranges_len != tuple_len)
82 - base = of_translate_address(node, ranges + addr_cells);
83 - if (base == OF_BAD_ADDR)
85 - size = of_read_number(ranges + addr_cells + p_addr_cells, size_cells);
88 - * Create an mbus address windows.
89 - * FIXME: Remove this, together with the above code, once the
90 - * address windows are declared in the device tree.
92 - err = mvebu_mbus_add_window(devbus_wins[cs], base, size);
97 * We need to create a child device explicitly from here to
98 * guarantee that the child will be probed after the timing
99 * parameters for the bus are written.
101 err = of_platform_populate(node, NULL, NULL, dev);
103 - mvebu_mbus_del_window(base, size);