]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/arm/mach-omap2/control.c
Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap...
[mirror_ubuntu-artful-kernel.git] / arch / arm / mach-omap2 / control.c
CommitLineData
69d88a00
PW
1/*
2 * OMAP2/3 System Control Module register access
3 *
4 * Copyright (C) 2007 Texas Instruments, Inc.
5 * Copyright (C) 2007 Nokia Corporation
6 *
7 * Written by Paul Walmsley
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#undef DEBUG
14
15#include <linux/kernel.h>
a58caad1 16#include <linux/io.h>
69d88a00 17
a58caad1 18#include <asm/arch/common.h>
69d88a00
PW
19#include <asm/arch/control.h>
20
a58caad1 21static void __iomem *omap2_ctrl_base;
69d88a00 22
a58caad1 23#define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg))
69d88a00 24
a58caad1 25void __init omap2_set_globals_control(struct omap_globals *omap2_globals)
69d88a00 26{
a58caad1 27 omap2_ctrl_base = omap2_globals->ctrl;
69d88a00
PW
28}
29
a58caad1 30void __iomem *omap_ctrl_base_get(void)
69d88a00
PW
31{
32 return omap2_ctrl_base;
33}
34
35u8 omap_ctrl_readb(u16 offset)
36{
37 return __raw_readb(OMAP_CTRL_REGADDR(offset));
38}
39
40u16 omap_ctrl_readw(u16 offset)
41{
42 return __raw_readw(OMAP_CTRL_REGADDR(offset));
43}
44
45u32 omap_ctrl_readl(u16 offset)
46{
47 return __raw_readl(OMAP_CTRL_REGADDR(offset));
48}
49
50void omap_ctrl_writeb(u8 val, u16 offset)
51{
69d88a00
PW
52 __raw_writeb(val, OMAP_CTRL_REGADDR(offset));
53}
54
55void omap_ctrl_writew(u16 val, u16 offset)
56{
69d88a00
PW
57 __raw_writew(val, OMAP_CTRL_REGADDR(offset));
58}
59
60void omap_ctrl_writel(u32 val, u16 offset)
61{
69d88a00
PW
62 __raw_writel(val, OMAP_CTRL_REGADDR(offset));
63}
64