Nishanth Menon <nm@xxxxxx> writes: > OPP tables have been used as static arrays till now this causes > limitations in terms of ability to dynamically making decisions > for cpu types and populating it with the right values. This > implementation is based on the discussions in the thread: > http://marc.info/?l=linux-omap&m=125482970102327&w=2 > inputs from Romit, Benoit, Kevin, Sanjeev, Santosh acked. > > omap3_pm_init_opp_table is introduced here, and the default omap3 > tables have been renamed to omap34xx_ tables, original omap3_xx > tables are now dynamically allocated and populated. > > Corresponding board files calling omap2_init_common_hw with the > active opp table params have been updated with this patch. > > This now paves way to introduce 3630 OPP tables. > > Tested on: SDP3430 - SDP3630 boot breaks with this patch > (as SDP3630 needs corresponding correct VDD2 freq w.r.t SDRC clk. > The next patch in this series fixes things) > > Cc: Benoit Cousson <b-cousson@xxxxxx> > Cc: Jon Hunter <jon-hunter@xxxxxx> > Cc: Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx> > Cc: Madhusudhan Chikkature Rajashekar <madhu.cr@xxxxxx> > Cc: Paul Walmsley <paul@xxxxxxxxx> > Cc: Romit Dasgupta <romit@xxxxxx> > Cc: Sanjeev Premi <premi@xxxxxx> > Cc: Santosh Shilimkar <santosh.shilimkar@xxxxxx> > Cc: Sergio Alberto Aguirre Rodriguez <saaguirre@xxxxxx> > Cc: SuiLun Lam <s-lam@xxxxxx> > Cc: Thara Gopinath <thara@xxxxxx> > Cc: Vishwanath Sripathy <vishwanath.bs@xxxxxx> > > Signed-off-by: Nishanth Menon <nm@xxxxxx> [...] > +void __init omap3_pm_init_opp_table(void) > +{ > + /* Populate the base CPU rate tables here */ > + omap3_mpu_rate_table = kmalloc(sizeof(omap34xx_mpu_rate_table), > + GFP_KERNEL); > + omap3_dsp_rate_table = kmalloc(sizeof(omap34xx_dsp_rate_table), > + GFP_KERNEL); > + omap3_l3_rate_table = kmalloc(sizeof(omap34xx_l3_rate_table), > + GFP_KERNEL); > + > + BUG_ON(!omap3_mpu_rate_table || !omap3_dsp_rate_table || > + !omap3_l3_rate_table); > + > + memcpy(omap3_mpu_rate_table, omap34xx_mpu_rate_table, > + sizeof(omap34xx_mpu_rate_table)); > + memcpy(omap3_dsp_rate_table, omap34xx_dsp_rate_table, > + sizeof(omap34xx_dsp_rate_table)); > + memcpy(omap3_l3_rate_table, omap34xx_l3_rate_table, > + sizeof(omap34xx_l3_rate_table)); > +} > + Minor issue, but FYI... rather than the kmalloc + memcpy, you can use kmemdup() to do the same thing. Kevin -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html