Page MenuHomeFreeBSD

D60205.id188329.diff
No OneTemporary

D60205.id188329.diff

diff --git a/sys/arm/ti/ti_sysc.c b/sys/arm/ti/ti_sysc.c
--- a/sys/arm/ti/ti_sysc.c
+++ b/sys/arm/ti/ti_sysc.c
@@ -48,7 +48,6 @@
#include <dev/clk/clk.h>
#include <arm/ti/ti_sysc.h>
-#include <arm/ti/clk/clock_common.h>
#define DEBUG_SYSC 0
@@ -129,8 +128,6 @@
};
struct ti_sysc_softc {
- bool attach_done;
-
device_t dev;
int device_type;
@@ -383,52 +380,6 @@
idle[i] = -1;
}
-static int
-ti_sysc_attach_clocks(struct ti_sysc_softc *sc) {
- clk_t *clk;
- struct clk_list *clkp;
- int index, err;
-
- clk = malloc(sc->num_clocks*sizeof(clk_t), M_DEVBUF, M_WAITOK | M_ZERO);
-
- /* Check if all clocks can be found */
- for (index = 0; index < sc->num_clocks; index++) {
- err = clk_get_by_ofw_index(sc->dev, 0, index, &clk[index]);
-
- if (err != 0) {
- free(clk, M_DEVBUF);
- return (1);
- }
- }
-
- /* All clocks are found, add to list */
- for (index = 0; index < sc->num_clocks; index++) {
- clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO);
- clkp->clk = clk[index];
- TAILQ_INSERT_TAIL(&sc->clk_list, clkp, next);
- }
-
- /* Release the clk array */
- free(clk, M_DEVBUF);
- return (0);
-}
-
-static int
-ti_sysc_simplebus_attach_child(device_t dev) {
- device_t cdev;
- phandle_t node, child;
- struct ti_sysc_softc *sc = device_get_softc(dev);
-
- node = ofw_bus_get_node(sc->dev);
-
- for (child = OF_child(node); child > 0; child = OF_peer(child)) {
- cdev = simplebus_add_device(sc->dev, child, 0, NULL, -1, NULL);
- if (cdev != NULL)
- device_probe_and_attach(cdev);
- }
- return (0);
-}
-
/* Device interface */
static int
ti_sysc_probe(device_t dev)
@@ -456,6 +407,7 @@
sc = device_get_softc(dev);
sc->dev = dev;
sc->device_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
+ sc->num_clocks = -1;
node = ofw_bus_get_node(sc->dev);
@@ -522,32 +474,6 @@
sc->ti_no_idle_on_init,
sc->ti_no_idle);
- if (OF_hasprop(node, "clocks")) {
- struct clock_cell_info cell_info;
- read_clock_cells(sc->dev, &cell_info);
- free(cell_info.clock_cells, M_DEVBUF);
- free(cell_info.clock_cells_ncells, M_DEVBUF);
-
- sc->num_clocks = cell_info.num_real_clocks;
- TAILQ_INIT(&sc->clk_list);
-
- err = ti_sysc_attach_clocks(sc);
- if (err) {
- DPRINTF(sc->dev, "Failed to attach clocks\n");
- bus_attach_children(sc->dev);
- return (0);
- }
- }
-
- err = ti_sysc_simplebus_attach_child(sc->dev);
- if (err) {
- DPRINTF(sc->dev, "ti_sysc_simplebus_attach_child %d\n",
- err);
- return (err);
- }
-
- sc->attach_done = true;
-
bus_attach_children(sc->dev);
return (0);
}
@@ -558,50 +484,12 @@
return (EBUSY);
}
-/* Bus interface */
-static void
-ti_sysc_new_pass(device_t dev)
-{
- struct ti_sysc_softc *sc;
- int err;
- phandle_t node;
-
- sc = device_get_softc(dev);
-
- if (sc->attach_done) {
- bus_generic_new_pass(sc->dev);
- return;
- }
-
- node = ofw_bus_get_node(sc->dev);
- if (OF_hasprop(node, "clocks")) {
- err = ti_sysc_attach_clocks(sc);
- if (err) {
- DPRINTF(sc->dev, "Failed to attach clocks\n");
- return;
- }
- }
-
- err = ti_sysc_simplebus_attach_child(sc->dev);
- if (err) {
- DPRINTF(sc->dev,
- "ti_sysc_simplebus_attach_child failed %d\n", err);
- return;
- }
- sc->attach_done = true;
-
- bus_attach_children(sc->dev);
-}
-
static device_method_t ti_sysc_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ti_sysc_probe),
DEVMETHOD(device_attach, ti_sysc_attach),
DEVMETHOD(device_detach, ti_sysc_detach),
- /* Bus interface */
- DEVMETHOD(bus_new_pass, ti_sysc_new_pass),
-
DEVMETHOD_END
};
@@ -609,4 +497,4 @@
sizeof(struct ti_sysc_softc), simplebus_driver);
EARLY_DRIVER_MODULE(ti_sysc, simplebus, ti_sysc_driver, 0, 0,
- BUS_PASS_BUS + BUS_PASS_ORDER_FIRST);
+ BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 3, 2:16 PM (12 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40090657
Default Alt Text
D60205.id188329.diff (3 KB)

Event Timeline