Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * OMAP4 PRCM_MPU module functions
0004  *
0005  * Copyright (C) 2009 Nokia Corporation
0006  * Paul Walmsley
0007  */
0008 
0009 #include <linux/kernel.h>
0010 #include <linux/types.h>
0011 #include <linux/errno.h>
0012 #include <linux/err.h>
0013 #include <linux/io.h>
0014 
0015 #include "iomap.h"
0016 #include "common.h"
0017 #include "prcm_mpu44xx.h"
0018 #include "cm-regbits-44xx.h"
0019 
0020 /*
0021  * prcm_mpu_base: the virtual address of the start of the PRCM_MPU IP
0022  *   block registers
0023  */
0024 struct omap_domain_base prcm_mpu_base;
0025 
0026 /* PRCM_MPU low-level functions */
0027 
0028 u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg)
0029 {
0030     return readl_relaxed(OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
0031 }
0032 
0033 void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 reg)
0034 {
0035     writel_relaxed(val, OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
0036 }
0037 
0038 u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
0039 {
0040     u32 v;
0041 
0042     v = omap4_prcm_mpu_read_inst_reg(inst, reg);
0043     v &= ~mask;
0044     v |= bits;
0045     omap4_prcm_mpu_write_inst_reg(v, inst, reg);
0046 
0047     return v;
0048 }
0049 
0050 /**
0051  * omap2_set_globals_prcm_mpu - set the MPU PRCM base address (for early use)
0052  * @prcm_mpu: PRCM_MPU base virtual address
0053  *
0054  * XXX Will be replaced when the PRM/CM drivers are completed.
0055  */
0056 void __init omap2_set_globals_prcm_mpu(void __iomem *prcm_mpu)
0057 {
0058     prcm_mpu_base.va = prcm_mpu;
0059 }