~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to sound/soc/omap/abe/abe_mem.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
  This file is provided under a dual BSD/GPLv2 license.  When using or
 
4
  redistributing this file, you may do so under either license.
 
5
 
 
6
  GPL LICENSE SUMMARY
 
7
 
 
8
  Copyright(c) 2010-2011 Texas Instruments Incorporated,
 
9
  All rights reserved.
 
10
 
 
11
  This program is free software; you can redistribute it and/or modify
 
12
  it under the terms of version 2 of the GNU General Public License as
 
13
  published by the Free Software Foundation.
 
14
 
 
15
  This program is distributed in the hope that it will be useful, but
 
16
  WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
18
  General Public License for more details.
 
19
 
 
20
  You should have received a copy of the GNU General Public License
 
21
  along with this program; if not, write to the Free Software
 
22
  Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 
23
  The full GNU General Public License is included in this distribution
 
24
  in the file called LICENSE.GPL.
 
25
 
 
26
  BSD LICENSE
 
27
 
 
28
  Copyright(c) 2010-2011 Texas Instruments Incorporated,
 
29
  All rights reserved.
 
30
 
 
31
  Redistribution and use in source and binary forms, with or without
 
32
  modification, are permitted provided that the following conditions
 
33
  are met:
 
34
 
 
35
    * Redistributions of source code must retain the above copyright
 
36
      notice, this list of conditions and the following disclaimer.
 
37
    * Redistributions in binary form must reproduce the above copyright
 
38
      notice, this list of conditions and the following disclaimer in
 
39
      the documentation and/or other materials provided with the
 
40
      distribution.
 
41
    * Neither the name of Texas Instruments Incorporated nor the names of
 
42
      its contributors may be used to endorse or promote products derived
 
43
      from this software without specific prior written permission.
 
44
 
 
45
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
46
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
47
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
48
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
49
  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
50
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
51
  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
52
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
53
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
54
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
55
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
56
 
 
57
*/
 
58
 
 
59
#ifndef _ABE_MEM_H_
 
60
#define _ABE_MEM_H_
 
61
 
 
62
#define OMAP_ABE_DMEM 0
 
63
#define OMAP_ABE_CMEM 1
 
64
#define OMAP_ABE_SMEM 2
 
65
#define OMAP_ABE_PMEM 3
 
66
#define OMAP_ABE_AESS 4
 
67
 
 
68
/* Distinction between Read and Write from/to ABE memory
 
69
 * is useful for simulation tool */
 
70
static inline void omap_abe_mem_write(struct omap_abe *abe, int bank,
 
71
                                u32 offset, u32 *src, size_t bytes)
 
72
{
 
73
        memcpy((abe->io_base[bank] + offset), src, bytes);
 
74
}
 
75
 
 
76
static inline void omap_abe_mem_read(struct omap_abe *abe, int bank,
 
77
                                u32 offset, u32 *dest, size_t bytes)
 
78
{
 
79
        memcpy(dest, (abe->io_base[bank] + offset), bytes);
 
80
}
 
81
 
 
82
static inline u32 omap_abe_reg_readl(struct omap_abe *abe, u32 offset)
 
83
{
 
84
        return __raw_readl(abe->io_base[OMAP_ABE_AESS] + offset);
 
85
}
 
86
 
 
87
static inline void omap_abe_reg_writel(struct omap_abe *abe,
 
88
                                u32 offset, u32 val)
 
89
{
 
90
        __raw_writel(val, (abe->io_base[OMAP_ABE_AESS] + offset));
 
91
}
 
92
 
 
93
static inline void *omap_abe_reset_mem(struct omap_abe *abe, int bank,
 
94
                        u32 offset, size_t bytes)
 
95
{
 
96
        return memset(abe->io_base[bank] + offset, 0, bytes);
 
97
}
 
98
 
 
99
#endif /*_ABE_MEM_H_*/