File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,10 +173,23 @@ static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np)
173173 if (IS_ERR (regmap_pmc ))
174174 return ;
175175
176- /* SFR node missing is not necessarily an issue. */
177- regmap_sfr = syscon_regmap_lookup_by_compatible ("atmel,sama5d2-sfr" );
178- if (IS_ERR (regmap_sfr ))
179- regmap_sfr = NULL ;
176+ /*
177+ * If the device supports different mainck rates, this value has to be
178+ * set in the UTMI Clock Trimming register.
179+ * - 9x5: mainck supports several rates but it is indicated that a
180+ * 12 MHz is needed in case of USB.
181+ * - sama5d3 and sama5d2: mainck supports several rates. Configuring
182+ * the FREQ field of the UTMI Clock Trimming register is mandatory.
183+ * - sama5d4: mainck is at 12 MHz.
184+ *
185+ * We only need to retrieve sama5d3 or sama5d2 sfr regmap.
186+ */
187+ regmap_sfr = syscon_regmap_lookup_by_compatible ("atmel,sama5d3-sfr" );
188+ if (IS_ERR (regmap_sfr )) {
189+ regmap_sfr = syscon_regmap_lookup_by_compatible ("atmel,sama5d2-sfr" );
190+ if (IS_ERR (regmap_sfr ))
191+ regmap_sfr = NULL ;
192+ }
180193
181194 hw = at91_clk_register_utmi (regmap_pmc , regmap_sfr , name , parent_name );
182195 if (IS_ERR (hw ))
You can’t perform that action at this time.
0 commit comments