1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: #include <sys/machine.h>
15: #ifdef IOTE_M367
16:
17: 18: 19: 20:
21:
22: #include "kernel.h"
23: #include <tm/tmonitor.h>
24:
25: #include "sysdepend.h"
26:
27: 28: 29:
30: typedef struct {
31: UW addr;
32: UW data;
33: } T_SETUP_REG;
34:
35: LOCAL const T_SETUP_REG setup_regs[] = {
36:
37: #if !USE_SDEV_DRV
38:
39:
40: {PORT_FR1(A), 0x0000000F},
41: {PORT_FR2(A), 0x000000F0},
42: {PORT_PUP(A), 0x0000000A},
43: {PORT_CR(A), 0x00000053},
44: {PORT_IE(A), 0x000000AE},
45:
46: #else
47:
48:
49: {PORT_FR1(A), 0x0000000F},
50: {PORT_FR2(A), 0x000000F0},
51: {PORT_PUP(A), 0x0000000A},
52: {PORT_CR(A), 0x00000053},
53: {PORT_IE(A), 0x000000AE},
54:
55:
56: {PORT_FR4(F), 0x000000c0},
57: {PORT_OD(F), 0x000000c0},
58: {PORT_CR(F), 0x000000c0},
59: {PORT_IE(F), 0x000000C0},
60:
61:
62: {PORT_DATA(L), 0x00000000},
63: {PORT_CR(L), 0x00000002},
64:
65: #endif
66:
67: {0, 0}
68: };
69:
70: 71: 72:
73: EXPORT void knl_startup_hw(void)
74: {
75: const T_SETUP_REG *p;
76:
77:
78: *(_UW*)WDOG_WDMOD &= ~0x00000080;
79: *(_UW*)WDOG_WDCR = WDOG_WDCR_DISABLE;
80:
81: startup_clock(PLL_MODE_6X);
82:
83:
84: for(p = setup_regs; p->addr != 0; p++) {
85: *(_UW*)(p->addr) = p->data;
86: }
87: }
88:
89: #if USE_SHUTDOWN
90: 91: 92:
93: EXPORT void knl_shutdown_hw( void )
94: {
95: disint();
96: while(1);
97: }
98: #endif
99:
100: 101: 102: 103: 104: 105:
106: EXPORT ER knl_restart_hw( W mode )
107: {
108: switch(mode) {
109: case -1:
110: SYSTEM_MESSAGE("\n<< SYSTEM RESET & RESTART >>\n");
111: return E_NOSPT;
112: case -2:
113: SYSTEM_MESSAGE("\n<< SYSTEM FAST RESTART >>\n");
114: return E_NOSPT;
115: case -3:
116: SYSTEM_MESSAGE("\n<< SYSTEM RESTART >>\n");
117: return E_NOSPT;
118: default:
119: return E_PAR;
120: }
121: }
122:
123:
124: #endif