59fb659b06
In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific. This process also requires the #includes in each of these files to be changed to reference the new file name. As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so. Thanks to Felipe Contreras <felipe.contreras@gmail.com> for comments on this patch. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Jarkko Nikula <jhnikula@gmail.com> Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Omar Ramirez Luna <omar.ramirez@ti.com> Acked-by: Omar Ramirez Luna <omar.ramirez@ti.com> Cc: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Cc: Greg Kroah-Hartman <greg@kroah.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Rajendra Nayak <rnayak@ti.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
63 lines
1.7 KiB
C
63 lines
1.7 KiB
C
/*
|
|
* OMAP4 CM module functions
|
|
*
|
|
* Copyright (C) 2009 Nokia Corporation
|
|
* Paul Walmsley
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/module.h>
|
|
#include <linux/types.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/spinlock.h>
|
|
#include <linux/list.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/err.h>
|
|
#include <linux/io.h>
|
|
|
|
#include <asm/atomic.h>
|
|
|
|
#include <plat/common.h>
|
|
|
|
#include "cm44xx.h"
|
|
#include "cm-regbits-44xx.h"
|
|
|
|
/**
|
|
* omap4_cm_wait_module_ready - wait for a module to be in 'func' state
|
|
* @clkctrl_reg: CLKCTRL module address
|
|
*
|
|
* Wait for the module IDLEST to be functional. If the idle state is in any
|
|
* the non functional state (trans, idle or disabled), module and thus the
|
|
* sysconfig cannot be accessed and will probably lead to an "imprecise
|
|
* external abort"
|
|
*
|
|
* Module idle state:
|
|
* 0x0 func: Module is fully functional, including OCP
|
|
* 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep
|
|
* abortion
|
|
* 0x2 idle: Module is in Idle mode (only OCP part). It is functional if
|
|
* using separate functional clock
|
|
* 0x3 disabled: Module is disabled and cannot be accessed
|
|
*
|
|
*/
|
|
int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
|
|
{
|
|
int i = 0;
|
|
|
|
if (!clkctrl_reg)
|
|
return 0;
|
|
|
|
omap_test_timeout((
|
|
((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) == 0) ||
|
|
(((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) >>
|
|
OMAP4430_IDLEST_SHIFT) == 0x2)),
|
|
MAX_MODULE_READY_TIME, i);
|
|
|
|
return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
|
|
}
|
|
|