Linux Audio

Check our new training course

Linux kernel drivers training

Mar 31-Apr 9, 2025, special US time zones
Register
Loading...
v3.5.6
 
 1/*
 2 * OMAP4 PRCM_MPU module functions
 3 *
 4 * Copyright (C) 2009 Nokia Corporation
 5 * Paul Walmsley
 6 *
 7 * This program is free software; you can redistribute it and/or modify
 8 * it under the terms of the GNU General Public License version 2 as
 9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16#include <linux/io.h>
17
18#include "iomap.h"
19#include "common.h"
20#include "prcm_mpu44xx.h"
21#include "cm-regbits-44xx.h"
22
 
 
 
 
 
 
23/* PRCM_MPU low-level functions */
24
25u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg)
26{
27	return __raw_readl(OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
28}
29
30void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 reg)
31{
32	__raw_writel(val, OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
33}
34
35u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
36{
37	u32 v;
38
39	v = omap4_prcm_mpu_read_inst_reg(inst, reg);
40	v &= ~mask;
41	v |= bits;
42	omap4_prcm_mpu_write_inst_reg(v, inst, reg);
43
44	return v;
 
 
 
 
 
 
 
 
 
 
 
45}
v5.9
 1// SPDX-License-Identifier: GPL-2.0-only
 2/*
 3 * OMAP4 PRCM_MPU module functions
 4 *
 5 * Copyright (C) 2009 Nokia Corporation
 6 * Paul Walmsley
 
 
 
 
 7 */
 8
 9#include <linux/kernel.h>
10#include <linux/types.h>
11#include <linux/errno.h>
12#include <linux/err.h>
13#include <linux/io.h>
14
15#include "iomap.h"
16#include "common.h"
17#include "prcm_mpu44xx.h"
18#include "cm-regbits-44xx.h"
19
20/*
21 * prcm_mpu_base: the virtual address of the start of the PRCM_MPU IP
22 *   block registers
23 */
24struct omap_domain_base prcm_mpu_base;
25
26/* PRCM_MPU low-level functions */
27
28u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg)
29{
30	return readl_relaxed(OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
31}
32
33void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 reg)
34{
35	writel_relaxed(val, OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
36}
37
38u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
39{
40	u32 v;
41
42	v = omap4_prcm_mpu_read_inst_reg(inst, reg);
43	v &= ~mask;
44	v |= bits;
45	omap4_prcm_mpu_write_inst_reg(v, inst, reg);
46
47	return v;
48}
49
50/**
51 * omap2_set_globals_prcm_mpu - set the MPU PRCM base address (for early use)
52 * @prcm_mpu: PRCM_MPU base virtual address
53 *
54 * XXX Will be replaced when the PRM/CM drivers are completed.
55 */
56void __init omap2_set_globals_prcm_mpu(void __iomem *prcm_mpu)
57{
58	prcm_mpu_base.va = prcm_mpu;
59}