Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sys/arm/ti/am335x/am335x_dmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ am335x_dmtimer_attach(device_t dev)
return (ENXIO);
}

err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin);
err = clk_get_by_name(dev, "sys_clkin_ck", &sys_clkin);
if (err != 0) {
device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err);
device_printf(dev, "Cant find sys_clkin_ck err: %d\n", err);
return (ENXIO);
}

Expand Down
4 changes: 2 additions & 2 deletions sys/arm/ti/am335x/am335x_dmtpps.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,9 @@ dmtpps_attach(device_t dev)
return (ENXIO);
}

err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin);
err = clk_get_by_name(dev, "sys_clkin_ck", &sys_clkin);
if (err != 0) {
device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err);
device_printf(dev, "Cant find sys_clkin_ck err: %d\n", err);
return (ENXIO);
}

Expand Down
6 changes: 3 additions & 3 deletions sys/arm/ti/am335x/am335x_musb.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@ musbotg_attach(device_t dev)
/* FIXME: The devicetree needs to be updated to get a handle to the gate
* usbotg_fck@47c. see TRM 8.1.12.2 CM_WKUP CM_CLKDCOLDO_DPLL_PER.
*/
err = clk_get_by_name(dev, "usbotg_fck@47c", &clk_usbotg_fck);
err = clk_get_by_name(dev, "usbotg_fck", &clk_usbotg_fck);
if (err) {
device_printf(dev, "Can not find usbotg_fck@47c\n");
device_printf(dev, "Can not find usbotg_fck\n");
return (ENXIO);
}

err = clk_enable(clk_usbotg_fck);
if (err) {
device_printf(dev, "Can not enable usbotg_fck@47c\n");
device_printf(dev, "Can not enable usbotg_fck\n");
return (ENXIO);
}

Expand Down
10 changes: 6 additions & 4 deletions sys/arm/ti/clk/ti_dpll_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ parse_dpll_reg(struct ti_dpll_softc *sc) {
ssize_t numbytes_regs;
uint32_t num_regs;
phandle_t node;
cell_t reg_cells[4];
cell_t reg_cells[6];

if (sc->dpll_type == TI_AM3_DPLL_X2_CLOCK ||
sc->dpll_type == TI_OMAP4_DPLL_X2_CLOCK) {
Expand All @@ -172,7 +172,7 @@ parse_dpll_reg(struct ti_dpll_softc *sc) {
num_regs = numbytes_regs / sizeof(cell_t);

/* Sanity check */
if (num_regs > 4)
if (num_regs > 6)
return (ENXIO);

OF_getencprop(node, "reg", reg_cells, numbytes_regs);
Expand All @@ -184,21 +184,23 @@ parse_dpll_reg(struct ti_dpll_softc *sc) {
case TI_AM3_DPLL_CLOCK:
case TI_AM3_DPLL_CORE_CLOCK:
case TI_AM3_DPLL_X2_CLOCK:
if (num_regs != 3)
if (num_regs < 3)
return (ENXIO);
sc->dpll_def.ti_clkmode_offset = reg_cells[0];
sc->dpll_def.ti_idlest_offset = reg_cells[1];
sc->dpll_def.ti_clksel_offset = reg_cells[2];
break;

case TI_OMAP2_DPLL_CORE_CLOCK:
if (num_regs != 2)
if (num_regs < 2)
return (ENXIO);
sc->dpll_def.ti_clkmode_offset = reg_cells[0];
sc->dpll_def.ti_clksel_offset = reg_cells[1];
break;

default:
if (num_regs < 4)
return (ENXIO);
sc->dpll_def.ti_clkmode_offset = reg_cells[0];
sc->dpll_def.ti_idlest_offset = reg_cells[1];
sc->dpll_def.ti_clksel_offset = reg_cells[2];
Expand Down
6 changes: 3 additions & 3 deletions sys/arm/ti/clk/ti_gate_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ ti_gate_attach(device_t dev)
if (err) {
/* free_clkdef will be called in ti_gate_new_pass */
DPRINTF(sc->sc_dev, "find_parent_clock_names failed\n");
bus_attach_children(sc->dev);
bus_attach_children(sc->sc_dev);
return (0);
}

Expand All @@ -194,15 +194,15 @@ ti_gate_attach(device_t dev)
if (err) {
/* free_clkdef will be called in ti_gate_new_pass */
DPRINTF(sc->sc_dev, "register_clk failed\n");
bus_attach_children(sc->dev);
bus_attach_children(sc->sc_dev);
return (0);
}

sc->attach_done = true;

free_clkdef(&sc->gate_def.clkdef);

bus_attach_children(sc->dev);
bus_attach_children(sc->sc_dev);
return (0);
}

Expand Down
6 changes: 3 additions & 3 deletions sys/arm/ti/clk/ti_mux_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ ti_mux_attach(device_t dev)
if (err) {
/* free_clkdef will be called in ti_mux_new_pass */
DPRINTF(sc->sc_dev, "find_parent_clock_names failed\n");
bus_attach_children(sc->dev);
bus_attach_children(sc->sc_dev);
return (0);
}

Expand All @@ -176,15 +176,15 @@ ti_mux_attach(device_t dev)
if (err) {
/* free_clkdef will be called in ti_mux_new_pass */
DPRINTF(sc->sc_dev, "register_clk failed\n");
bus_attach_children(sc->dev);
bus_attach_children(sc->sc_dev);
return (0);
}

sc->attach_done = true;

free_clkdef(&sc->mux_def.clkdef);

bus_attach_children(sc->dev);
bus_attach_children(sc->sc_dev);
return (0);
}

Expand Down
2 changes: 2 additions & 0 deletions sys/arm/ti/ti_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#ifndef TI_GPIO_H
#define TI_GPIO_H

#include <sys/intr.h>

/* The maximum number of banks for any SoC */
#define MAX_GPIO_BANKS 6

Expand Down
1 change: 1 addition & 0 deletions sys/conf/options.arm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ PLATFORM opt_global.h
SOCDEV_PA opt_global.h
SOCDEV_VA opt_global.h
PV_STATS opt_pmap.h
FORCE_SIMPLE_PM_BUS opt_global.h # Allow 'simple-bus' code to handle 'simple-pm-bus' DT nodes
SOC_ALLWINNER_A10 opt_global.h
SOC_ALLWINNER_A13 opt_global.h
SOC_ALLWINNER_A20 opt_global.h
Expand Down
9 changes: 7 additions & 2 deletions sys/dev/fdt/simplebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@
static int
simplebus_probe(device_t dev)
{

bool is_simple_bus = false;

if (!ofw_bus_status_okay(dev))
return (ENXIO);
/*
Expand All @@ -166,7 +167,11 @@
* have children but aren't really buses in our world. Without a
* ranges property we will fail to attach, so just fail to probe too.
*/
if (!(ofw_bus_is_compatible(dev, "simple-bus") &&
is_simple_bus = ofw_bus_is_compatible(dev, "simple-bus");
#ifdef FORCE_SIMPLE_PM_BUS
is_simple_bus = is_simple_bus || ofw_bus_is_compatible(dev, "simple-pm-bus");

Check warning on line 172 in sys/dev/fdt/simplebus.c

View workflow job for this annotation

GitHub Actions / Style Checker

line over 80 characters
#endif
if (!(is_simple_bus &&
ofw_bus_has_prop(dev, "ranges")) &&
(ofw_bus_get_type(dev) == NULL || strcmp(ofw_bus_get_type(dev),
"soc") != 0))
Expand Down
8 changes: 7 additions & 1 deletion sys/dev/syscon/syscon_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
{
struct syscon_generic_softc *sc;
int rid, rv;
bool is_simple_bus = false;

sc = device_get_softc(dev);
sc->dev = dev;
Expand All @@ -184,7 +185,12 @@
syscon_generic_detach(dev);
return (ENXIO);
}
if (ofw_bus_is_compatible(dev, "simple-bus")) {

is_simple_bus = ofw_bus_is_compatible(dev, "simple-bus");
#ifdef FORCE_SIMPLE_PM_BUS
is_simple_bus = is_simple_bus || ofw_bus_is_compatible(dev, "simple-pm-bus");

Check warning on line 191 in sys/dev/syscon/syscon_generic.c

View workflow job for this annotation

GitHub Actions / Style Checker

line over 80 characters
#endif
if (is_simple_bus) {
rv = simplebus_attach_impl(sc->dev);
if (rv != 0) {
device_printf(dev, "Failed to create simplebus\n");
Expand Down
Loading