Nishanth Menon <n...@ti.com> 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-cous...@ti.com>
> Cc: Jon Hunter <jon-hun...@ti.com>
> Cc: Kevin Hilman <khil...@deeprootsystems.com>
> Cc: Madhusudhan Chikkature Rajashekar <madhu...@ti.com>
> Cc: Paul Walmsley <p...@pwsan.com>
> Cc: Romit Dasgupta <ro...@ti.com>
> Cc: Sanjeev Premi <pr...@ti.com>
> Cc: Santosh Shilimkar <santosh.shilim...@ti.com>
> Cc: Sergio Alberto Aguirre Rodriguez <saagui...@ti.com>
> Cc: SuiLun Lam <s-...@ti.com>
> Cc: Thara Gopinath <th...@ti.com>
> Cc: Vishwanath Sripathy <vishwanath...@ti.com>
>
> Signed-off-by: Nishanth Menon <n...@ti.com>

[...]

> +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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to