Nishanth Menon <[email protected]> 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 <[email protected]>
> Cc: Jon Hunter <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Madhusudhan Chikkature Rajashekar <[email protected]>
> Cc: Paul Walmsley <[email protected]>
> Cc: Romit Dasgupta <[email protected]>
> Cc: Sanjeev Premi <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
> Cc: Sergio Alberto Aguirre Rodriguez <[email protected]>
> Cc: SuiLun Lam <[email protected]>
> Cc: Thara Gopinath <[email protected]>
> Cc: Vishwanath Sripathy <[email protected]>
>
> Signed-off-by: Nishanth Menon <[email protected]>
[...]
> +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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html