Under the ti,clksel binding the parent node holds the register offset and
a child's "reg" is an index matching its unit address rather than an
address. Reading the child's "reg" as an offset produced unaligned syscon
accesses and a fatal alignment fault while registering mux clocks on
am335x:
ti_clksel0: <TI CLKSEL> on ofw_clkbus0 ti_mux12: <TI Mux Clock> on ti_clksel0 Fatal kernel mode data abort: 'Alignment Fault' on read FSR=00000001, FAR=ffd00001
ti_mux_clock.c, ti_divider_clock.c and ti_gate_clock.c all test the
child's "reg" first and fall back to the parent, so fixing only the mux
hits the same fault twice more. All three are changed the same way: if the
parent is ti,clksel, take the offset from the parent; otherwise use the
child's "reg"; otherwise fail attach rather than silently using a wrong
offset.
The existing comment "assume parent is clksel..." suggests the expectation
was that clksel children carry no "reg" property. The shipped device tree
gives them one.
Depends on D41888 (introduces ti_clksel_get_reg) and D46723 (introduces
the code being corrected).
Found by booting a BeagleBone Black Rev B3.