Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
6a6d349f
Commit
6a6d349f
authored
Jun 22, 2006
by
Komal Shah
Committed by
Kevin Hilman
Aug 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: DaVinci: Add read/write[bwl] and _REG* macros.
Signed-off-by:
Komal Shah
<
komal_shah802003@yahoo.com
>
parent
bdf49c72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
9 deletions
+46
-9
include/asm-arm/arch-davinci/io.h
include/asm-arm/arch-davinci/io.h
+46
-9
No files found.
include/asm-arm/arch-davinci/io.h
View file @
6a6d349f
...
@@ -35,13 +35,12 @@
...
@@ -35,13 +35,12 @@
* I/O mapping
* I/O mapping
* ----------------------------------------------------------------------------
* ----------------------------------------------------------------------------
*/
*/
#define IO_PHYS 0x01c00000
#define IO_PHYS 0x01c00000
#define IO_VIRT 0xe1000000
#define IO_VIRT 0xe1000000
#define IO_SIZE 0x00400000
#define IO_SIZE 0x00400000
#define io_p2v(pa) (((pa) & (IO_SIZE-1)) + IO_VIRT)
#define io_p2v(pa) (((pa) & (IO_SIZE-1)) + IO_VIRT)
#define io_v2p(va) (((va) & (IO_SIZE-1)) + IO_PHYS)
#define io_v2p(va) (((va) & (IO_SIZE-1)) + IO_PHYS)
#define IO_ADDRESS(x) io_p2v(x)
#define IO_ADDRESS(x) io_p2v(x)
#define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
/*
/*
* We don't actually have real ISA nor PCI buses, but there is so many
* We don't actually have real ISA nor PCI buses, but there is so many
...
@@ -53,9 +52,47 @@
...
@@ -53,9 +52,47 @@
#define __mem_isa(a) (a)
#define __mem_isa(a) (a)
#ifndef __ASSEMBLER__
#ifndef __ASSEMBLER__
/*
* Functions to access the OMAP IO region
*
* NOTE: - Use davinci_read/write[bwl] for physical register addresses
* - Use __raw_read/write[bwl]() for virtual register addresses
* - Use IO_ADDRESS(phys_addr) to convert registers to virtual addresses
* - DO NOT use hardcoded virtual addresses to allow changing the
* IO address space again if needed
*/
#define davinci_readb(a) (*(volatile unsigned char *)IO_ADDRESS(a))
#define davinci_readw(a) (*(volatile unsigned short *)IO_ADDRESS(a))
#define davinci_readl(a) (*(volatile unsigned int *)IO_ADDRESS(a))
#define davinci_writeb(v,a) (*(volatile unsigned char *)IO_ADDRESS(a) = (v))
#define davinci_writew(v,a) (*(volatile unsigned short *)IO_ADDRESS(a) = (v))
#define davinci_writel(v,a) (*(volatile unsigned int *)IO_ADDRESS(a) = (v))
/* 16 bit uses LDRH/STRH, base +/- offset_8 */
typedef
struct
{
volatile
u16
offset
[
256
];
}
__regbase16
;
#define __REGV16(vaddr) ((__regbase16 *)((vaddr)&~0xff)) \
->offset[((vaddr)&0xff)>>1]
#define __REG16(paddr) __REGV16(io_p2v(paddr))
/* 8/32 bit uses LDR/STR, base +/- offset_12 */
typedef
struct
{
volatile
u8
offset
[
4096
];
}
__regbase8
;
#define __REGV8(vaddr) ((__regbase8 *)((vaddr)&~4095)) \
->offset[((vaddr)&4095)>>0]
#define __REG8(paddr) __REGV8(io_p2v(paddr))
typedef
struct
{
volatile
u32
offset
[
4096
];
}
__regbase32
;
#define __REGV32(vaddr) ((__regbase32 *)((vaddr)&~4095)) \
->offset[((vaddr)&4095)>>2]
/* FIXME: Just for compilation sake changed from __REG32 to __REG */
#define __REG(paddr) __REGV32(io_p2v(paddr))
extern
void
davinci_map_common_io
(
void
);
extern
void
davinci_map_common_io
(
void
);
#e
ndif
#e
lse
#
endif
/* __ASM_ARCH_IO_H */
#
define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
#endif
#endif
/* __ASM_ARCH_IO_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment