~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-omap2/prminst44xx.c

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * OMAP4 PRM instance 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 <plat/common.h>
 19 
 20 #include "prm44xx.h"
 21 #include "prminst44xx.h"
 22 #include "prm-regbits-44xx.h"
 23 #include "prcm44xx.h"
 24 #include "prcm_mpu44xx.h"
 25 
 26 static u32 _prm_bases[OMAP4_MAX_PRCM_PARTITIONS] = {
 27         [OMAP4430_INVALID_PRCM_PARTITION]       = 0,
 28         [OMAP4430_PRM_PARTITION]                = OMAP4430_PRM_BASE,
 29         [OMAP4430_CM1_PARTITION]                = 0,
 30         [OMAP4430_CM2_PARTITION]                = 0,
 31         [OMAP4430_SCRM_PARTITION]               = 0,
 32         [OMAP4430_PRCM_MPU_PARTITION]           = OMAP4430_PRCM_MPU_BASE,
 33 };
 34 
 35 /* Read a register in a PRM instance */
 36 u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx)
 37 {
 38         BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
 39                part == OMAP4430_INVALID_PRCM_PARTITION ||
 40                !_prm_bases[part]);
 41         return __raw_readl(OMAP2_L4_IO_ADDRESS(_prm_bases[part] + inst +
 42                                                idx));
 43 }
 44 
 45 /* Write into a register in a PRM instance */
 46 void omap4_prminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx)
 47 {
 48         BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
 49                part == OMAP4430_INVALID_PRCM_PARTITION ||
 50                !_prm_bases[part]);
 51         __raw_writel(val, OMAP2_L4_IO_ADDRESS(_prm_bases[part] + inst + idx));
 52 }
 53 
 54 /* Read-modify-write a register in PRM. Caller must lock */
 55 u32 omap4_prminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst,
 56                                    s16 idx)
 57 {
 58         u32 v;
 59 
 60         v = omap4_prminst_read_inst_reg(part, inst, idx);
 61         v &= ~mask;
 62         v |= bits;
 63         omap4_prminst_write_inst_reg(v, part, inst, idx);
 64 
 65         return v;
 66 }
 67 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp