summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/ipu_utility.c
blob: b16b5ad891d56f35e0becff99e5beea59c9839e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * OMAP IPU_PM utility
 *
 * Copyright (C) 2010 Texas Instruments Inc.
 *
 * Written by Paul Hunt <hunt@ti.com>
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/io.h>
#include <asm/io.h>
#include <plat/io.h>

#define ICONT1_ITCM_BASE	0x5A008000
#define ICONT2_ITCM_BASE	0x5A018000

static void __iomem *icont_itcm_ptr;

/* Op-codes for simple boot sequence ending in WFI */
static const u32 ICONT_Boot_WFI[] = {
	0xEA000006,
	0xEAFFFFFE,
	0xEAFFFFFE,
	0xEAFFFFFE,
	0xEAFFFFFE,
	0xEAFFFFFE,
	0xEAFFFFFE,
	0xEAFFFFFE,
	0xE3A00000,
	0xEE070F9A,
	0xEE070F90,
	0xE3A00000,
	0xEAFFFFFE,
	0xEAFFFFF1,
};

static const u32 ICONT_Boot_WFI_length = ARRAY_SIZE(ICONT_Boot_WFI);

static void load_ivahd_idle_boot_code(void)
{
	int i;

	icont_itcm_ptr = ioremap((u32) ICONT1_ITCM_BASE, 0x1000);
	for (i = 0; i < ICONT_Boot_WFI_length; i++)
		__raw_writel(ICONT_Boot_WFI[i], (icont_itcm_ptr + i));
	iounmap(icont_itcm_ptr);

	icont_itcm_ptr = ioremap((u32) ICONT2_ITCM_BASE, 0x1000);
	for (i = 0; i < ICONT_Boot_WFI_length; i++)
		__raw_writel(ICONT_Boot_WFI[i], (icont_itcm_ptr + i));
	iounmap(icont_itcm_ptr);
}
EXPORT_SYMBOL(load_ivahd_idle_boot_code);