From: Basheer, Mansoor Ahamed Date: Mon, 22 Oct 2012 04:51:11 +0000 (+0530) Subject: ARM: AM335X: Split hwmod data accessible only on GP devices X-Git-Url: https://git.ti.com/gitweb?p=sitara-epos%2Fsitara-epos-kernel.git;a=commitdiff_plain;h=HEAD;hp=df0b1034e11a9b9ad6bccb5930cf58d353907679 ARM: AM335X: Split hwmod data accessible only on GP devices On HS/EMU devices, some peripherals are marked secure and cannot be accessed in the pulic world - unless firewall is configured to allow such an access. Create an array of HWMODs for the peripherals that are accessible only on GP devices. If PPA is used to restrict public access for any other peripheral, it must be added to this list. With default PPA, attempt to access Timer0 in public world causes an exception leading to crash during kernel boot. Therefore, its HWMOD data is moved to am33xx_hwmods_gp[]. Signed-off-by: Sanjeev Premi --- diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c index 2f9982cc32ca..a78ddb4358be 100644 --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c @@ -3463,6 +3463,9 @@ static struct omap_hwmod am33xx_pruss_hwmod = { .rst_lines_cnt = ARRAY_SIZE(am33xx_pruss_resets), }; +/** + * HWMOD data for devices accessible across GP and HS/EMU devices. + */ static __initdata struct omap_hwmod *am33xx_hwmods[] = { /* l3 class */ &am33xx_l3_instr_hwmod, @@ -3553,7 +3556,6 @@ static __initdata struct omap_hwmod *am33xx_hwmods[] = { &am33xx_uart5_hwmod, &am33xx_uart6_hwmod, /* timer class */ - &am33xx_timer0_hwmod, &am33xx_timer1_hwmod, &am33xx_timer2_hwmod, &am33xx_timer3_hwmod, @@ -3586,7 +3588,22 @@ static __initdata struct omap_hwmod *am33xx_hwmods[] = { NULL, }; + +/** + * HWMOD data for devices common accessible only on GP devices. + */ +static __initdata struct omap_hwmod *am33xx_hwmods_gp[] = { + /* timer class */ + &am33xx_timer0_hwmod, + NULL, +}; + int __init am33xx_hwmod_init(void) { - return omap_hwmod_register(am33xx_hwmods); + int ret = omap_hwmod_register(am33xx_hwmods); + + if (!ret && (OMAP2_DEVICE_TYPE_GP == omap_type())) + ret = omap_hwmod_register(am33xx_hwmods_gp); + + return ret; }