~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/u-boot/arch/avr32/include/asm/io.h

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2006 Atmel Corporation
 
3
 *
 
4
 * SPDX-License-Identifier:     GPL-2.0+
 
5
 */
 
6
#ifndef __ASM_AVR32_IO_H
 
7
#define __ASM_AVR32_IO_H
 
8
 
 
9
#include <asm/types.h>
 
10
 
 
11
#ifdef __KERNEL__
 
12
 
 
13
/*
 
14
 * Generic IO read/write.  These perform native-endian accesses.  Note
 
15
 * that some architectures will want to re-define __raw_{read,write}w.
 
16
 */
 
17
extern void __raw_writesb(unsigned int addr, const void *data, int bytelen);
 
18
extern void __raw_writesw(unsigned int addr, const void *data, int wordlen);
 
19
extern void __raw_writesl(unsigned int addr, const void *data, int longlen);
 
20
 
 
21
extern void __raw_readsb(unsigned int addr, void *data, int bytelen);
 
22
extern void __raw_readsw(unsigned int addr, void *data, int wordlen);
 
23
extern void __raw_readsl(unsigned int addr, void *data, int longlen);
 
24
 
 
25
#define __raw_writeb(v,a)       (*(volatile unsigned char  *)(a) = (v))
 
26
#define __raw_writew(v,a)       (*(volatile unsigned short *)(a) = (v))
 
27
#define __raw_writel(v,a)       (*(volatile unsigned int   *)(a) = (v))
 
28
 
 
29
#define __raw_readb(a)          (*(volatile unsigned char  *)(a))
 
30
#define __raw_readw(a)          (*(volatile unsigned short *)(a))
 
31
#define __raw_readl(a)          (*(volatile unsigned int   *)(a))
 
32
 
 
33
/* As long as I/O is only performed in P4 (or possibly P3), we're safe */
 
34
#define writeb(v,a)             __raw_writeb(v,a)
 
35
#define writew(v,a)             __raw_writew(v,a)
 
36
#define writel(v,a)             __raw_writel(v,a)
 
37
 
 
38
#define readb(a)                __raw_readb(a)
 
39
#define readw(a)                __raw_readw(a)
 
40
#define readl(a)                __raw_readl(a)
 
41
 
 
42
/*
 
43
 * Bad read/write accesses...
 
44
 */
 
45
extern void __readwrite_bug(const char *fn);
 
46
 
 
47
#define IO_SPACE_LIMIT  0xffffffff
 
48
 
 
49
/*
 
50
 * All I/O is memory mapped, so these macros doesn't make very much sense
 
51
 */
 
52
#define outb(v,p)               __raw_writeb(v, p)
 
53
#define outw(v,p)               __raw_writew(cpu_to_le16(v),p)
 
54
#define outl(v,p)               __raw_writel(cpu_to_le32(v),p)
 
55
 
 
56
#define inb(p)  ({ unsigned int __v = __raw_readb(p); __v; })
 
57
#define inw(p)  ({ unsigned int __v = __le16_to_cpu(__raw_readw(p)); __v; })
 
58
#define inl(p)  ({ unsigned int __v = __le32_to_cpu(__raw_readl(p)); __v; })
 
59
 
 
60
#include <asm/arch/addrspace.h>
 
61
/* Provides virt_to_phys, phys_to_virt, cached, uncached, map_physmem */
 
62
 
 
63
#endif /* __KERNEL__ */
 
64
 
 
65
static inline void sync(void)
 
66
{
 
67
}
 
68
 
 
69
/*
 
70
 * Take down a mapping set up by map_physmem().
 
71
 */
 
72
static inline void unmap_physmem(void *vaddr, unsigned long len)
 
73
{
 
74
 
 
75
}
 
76
 
 
77
#endif /* __ASM_AVR32_IO_H */