1
2
3
4
5
6
7
8
9
10
11
12#include <mach/ep93xx-regs.h>
13
14static unsigned char __raw_readb(unsigned int ptr)
15{
16 return *((volatile unsigned char *)ptr);
17}
18
19static unsigned int __raw_readl(unsigned int ptr)
20{
21 return *((volatile unsigned int *)ptr);
22}
23
24static void __raw_writeb(unsigned char value, unsigned int ptr)
25{
26 *((volatile unsigned char *)ptr) = value;
27}
28
29static void __raw_writel(unsigned int value, unsigned int ptr)
30{
31 *((volatile unsigned int *)ptr) = value;
32}
33
34#define PHYS_UART_DATA (CONFIG_DEBUG_UART_PHYS + 0x00)
35#define PHYS_UART_FLAG (CONFIG_DEBUG_UART_PHYS + 0x18)
36#define UART_FLAG_TXFF 0x20
37
38static inline void putc(int c)
39{
40 int i;
41
42 for (i = 0; i < 10000; i++) {
43
44 if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF))
45 break;
46 }
47
48 __raw_writeb(c, PHYS_UART_DATA);
49}
50
51static inline void flush(void)
52{
53}
54
55
56
57
58
59
60
61
62#define PHYS_ETH_SELF_CTL 0x80010020
63#define ETH_SELF_CTL_RESET 0x00000001
64
65static void ethernet_reset(void)
66{
67 unsigned int v;
68
69
70 v = __raw_readl(PHYS_ETH_SELF_CTL);
71 __raw_writel(v | ETH_SELF_CTL_RESET, PHYS_ETH_SELF_CTL);
72
73
74 while (__raw_readl(PHYS_ETH_SELF_CTL) & ETH_SELF_CTL_RESET)
75 ;
76}
77
78
79static void arch_decomp_setup(void)
80{
81 ethernet_reset();
82}
83