[PATCH 2/3] gpmc: Add reset to gpmc_generic_init
Sascha Hauer
s.hauer at pengutronix.de
Wed Jul 18 18:10:03 EDT 2012
Hi Jan,
On Wed, Jul 18, 2012 at 02:37:12PM +0200, Jan Weitzel wrote:
> Add reset to gpmc_generic_init as proposed by TRM.
> This also fixes some strange timing issue while GPMC Initialization for
> NAND OMAP4460
>
> Signed-off-by: Jan Weitzel <j.weitzel at phytec.de>
> ---
> arch/arm/mach-omap/gpmc.c | 10 +++++++++-
> 1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c
> index 399f68a..4649a1d 100644
> --- a/arch/arm/mach-omap/gpmc.c
> +++ b/arch/arm/mach-omap/gpmc.c
> @@ -28,6 +28,7 @@
> * MA 02111-1307 USA
> */
> #include <common.h>
> +#include <clock.h>
> #include <init.h>
> #include <io.h>
> #include <mach/silicon.h>
> @@ -48,13 +49,20 @@
> */
> void gpmc_generic_init(unsigned int cfg)
> {
> + uint64_t start;
> unsigned int reg = GPMC_REG(CONFIG7_0);
> char x = 0;
>
> debug("gpmccfg=%x\n", cfg);
> /* Generic Configurations */
> + /* reset gpmc */
> + start = get_time_ns();
> /* No idle, L3 clock free running */
> - writel(0x10, GPMC_REG(SYS_CONFIG));
> + writel(0x12, GPMC_REG(SYS_CONFIG));
> + while (!readl(GPMC_REG(SYS_STATUS)))
> + if (is_timeout(start, MSECOND))
> + printf("timeout on gpmc reset\n");
This will hang forever in the printk on timeout.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list