1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef _SPARC_IO_H
24#define _SPARC_IO_H
25
26
27#define sync()
28
29
30
31
32
33
34
35#ifndef CONFIG_SYS_HAS_NO_CACHE
36#define READ_BYTE(var) SPARC_NOCACHE_READ_BYTE((unsigned int)(var))
37#define READ_HWORD(var) SPARC_NOCACHE_READ_HWORD((unsigned int)(var))
38#define READ_WORD(var) SPARC_NOCACHE_READ((unsigned int)(var))
39#define READ_DWORD(var) SPARC_NOCACHE_READ_DWORD((unsigned int)(var))
40#else
41#define READ_BYTE(var) (var)
42#define READ_HWORD(var) (var)
43#define READ_WORD(var) (var)
44#define READ_DWORD(var) (var)
45#endif
46
47
48
49
50#define __arch_getb(a) (READ_BYTE(a))
51#define __arch_getw(a) (READ_HWORD(a))
52#define __arch_getl(a) (READ_WORD(a))
53#define __arch_getq(a) (READ_DWORD(a))
54
55#define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v))
56#define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v))
57#define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v))
58
59#define __raw_writeb(v,a) __arch_putb(v,a)
60#define __raw_writew(v,a) __arch_putw(v,a)
61#define __raw_writel(v,a) __arch_putl(v,a)
62
63#define __raw_readb(a) __arch_getb(a)
64#define __raw_readw(a) __arch_getw(a)
65#define __raw_readl(a) __arch_getl(a)
66#define __raw_readq(a) __arch_getq(a)
67
68
69
70
71
72
73
74#define MAP_NOCACHE (0)
75#define MAP_WRCOMBINE (0)
76#define MAP_WRBACK (0)
77#define MAP_WRTHROUGH (0)
78
79static inline void *map_physmem(phys_addr_t paddr, unsigned long len,
80 unsigned long flags)
81{
82 return (void *)paddr;
83}
84
85
86
87
88static inline void unmap_physmem(void *vaddr, unsigned long flags)
89{
90
91}
92
93static inline phys_addr_t virt_to_phys(void * vaddr)
94{
95 return (phys_addr_t)(vaddr);
96}
97
98#endif
99