]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/linkstation/hwctl.c
mx6: Revert "mx6: soc: Disable VDDPU regulator"
[karo-tx-uboot.git] / board / linkstation / hwctl.c
1 /*
2  * hwctl.c
3  *
4  * LinkStation HW Control Driver
5  *
6  * Copyright (C) 2001-2004  BUFFALO INC.
7  *
8  * This software may be used and distributed according to the terms of
9  * the GNU General Public License (GPL), incorporated herein by reference.
10  * Drivers based on or derived from this code fall under the GPL and must
11  * retain the authorship, copyright and license notice.  This file is not
12  * a complete program and may only be used when the entire operating
13  * system is licensed under the GPL.
14  *
15  */
16
17 #include <config.h>
18 #include <common.h>
19 #include <command.h>
20 #include <asm/io.h>
21
22 #define AVR_PORT CONFIG_SYS_NS16550_COM2
23
24 /* 2005.5.10 BUFFALO add */
25 /*--------------------------------------------------------------*/
26 static inline void miconCntl_SendUart(unsigned char dat)
27 {
28         out_8((unsigned char *)AVR_PORT, dat);
29         mdelay(1);
30 }
31
32 /*--------------------------------------------------------------*/
33 void miconCntl_SendCmd(unsigned char dat)
34 {
35         int i;
36
37         for (i=0; i<4; i++){
38                 miconCntl_SendUart(dat);
39         }
40 }
41
42 /*--------------------------------------------------------------*/
43 void miconCntl_FanLow(void)
44 {
45 #ifdef CONFIG_HTGL
46         miconCntl_SendCmd(0x5C);
47 #endif
48 }
49
50 /*--------------------------------------------------------------*/
51 void miconCntl_FanHigh(void)
52 {
53 #ifdef CONFIG_HTGL
54         miconCntl_SendCmd(0x5D);
55 #endif
56 }
57
58 /*--------------------------------------------------------------*/
59 /* 1000Mbps */
60 void miconCntl_Eth1000M(int up)
61 {
62 #ifdef CONFIG_HTGL
63         if (up)
64                 miconCntl_SendCmd(0x93);
65         else
66                 miconCntl_SendCmd(0x92);
67 #else
68         if (up)
69                 miconCntl_SendCmd(0x5D);
70         else
71                 miconCntl_SendCmd(0x5C);
72 #endif
73 }
74
75 /*--------------------------------------------------------------*/
76 /* 100Mbps */
77 void miconCntl_Eth100M(int up)
78 {
79 #ifdef CONFIG_HTGL
80         if (up)
81                 miconCntl_SendCmd(0x91);
82         else
83                 miconCntl_SendCmd(0x90);
84 #else
85         if (up)
86                 miconCntl_SendCmd(0x5C);
87 #endif
88 }
89
90 /*--------------------------------------------------------------*/
91 /* 10Mbps */
92 void miconCntl_Eth10M(int up)
93 {
94 #ifdef CONFIG_HTGL
95         if (up)
96                 miconCntl_SendCmd(0x8F);
97         else
98                 miconCntl_SendCmd(0x8E);
99 #else
100         if (up)
101                 miconCntl_SendCmd(0x5C);
102 #endif
103 }
104
105 /*--------------------------------------------------------------*/
106 /*  */
107 void miconCntl_5f(void)
108 {
109         miconCntl_SendCmd(0x5F);
110         mdelay(100);
111 }
112
113 /*--------------------------------------------------------------*/
114 /* "reboot start" signal */
115 void miconCntl_Reboot(void)
116 {
117         miconCntl_SendCmd(0x43);
118 }
119
120 /*--------------------------------------------------------------*/
121 /* Disable watchdog timer */
122 void miconCntl_DisWDT(void)
123 {
124         miconCntl_SendCmd(0x41); /* A */
125         miconCntl_SendCmd(0x46); /* F */
126         miconCntl_SendCmd(0x4A); /* J */
127         miconCntl_SendCmd(0x3E); /* > */
128         miconCntl_SendCmd(0x56); /* V */
129         miconCntl_SendCmd(0x3E); /* > */
130         miconCntl_SendCmd(0x5A); /* Z */
131         miconCntl_SendCmd(0x56); /* V */
132         miconCntl_SendCmd(0x4B); /* K */
133 }