File tree Expand file tree Collapse file tree 4 files changed +63
-6
lines changed Expand file tree Collapse file tree 4 files changed +63
-6
lines changed Original file line number Diff line number Diff line change 6
6
model-name = "microwatt";
7
7
compatible = "microwatt-soc";
8
8
9
+ aliases {
10
+ serial0 = &UART0;
11
+ };
12
+
9
13
reserved-memory {
10
14
#size-cells = <0x02>;
11
15
#address-cells = <0x02>;
89
93
};
90
94
};
91
95
92
- chosen {
93
- bootargs = "";
94
- ibm,architecture-vec-5 = [19 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00
95
- 00 00 00 00 00 00 00 00 40 00 40];
96
- };
97
-
98
96
soc@c0000000 {
99
97
compatible = "simple-bus";
100
98
#address-cells = <1>;
119
117
#interrupt-cells = <2>;
120
118
};
121
119
120
+ UART0: serial@2000 {
121
+ device_type = "serial";
122
+ compatible = "ns16550";
123
+ reg = <0x2000 0x8>;
124
+ clock-frequency = <100000000>;
125
+ current-speed = <115200>;
126
+ reg-shift = <2>;
127
+ fifo-size = <16>;
128
+ interrupts = <0x10 0x1>;
129
+ };
130
+ };
131
+
132
+ chosen {
133
+ bootargs = "";
134
+ ibm,architecture-vec-5 = [19 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00
135
+ 00 00 00 00 00 00 00 00 40 00 40];
136
+ stdout-path = &UART0;
122
137
};
123
138
};
Original file line number Diff line number Diff line change @@ -296,3 +296,42 @@ void __init udbg_init_40x_realmode(void)
296
296
}
297
297
298
298
#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
299
+
300
+ #ifdef CONFIG_PPC_EARLY_DEBUG_MICROWATT
301
+
302
+ #define UDBG_UART_MW_ADDR ((void __iomem *)0xc0002000)
303
+
304
+ static u8 udbg_uart_in_isa300_rm (unsigned int reg )
305
+ {
306
+ uint64_t msr = mfmsr ();
307
+ uint8_t c ;
308
+
309
+ mtmsr (msr & ~(MSR_EE |MSR_DR ));
310
+ isync ();
311
+ eieio ();
312
+ c = __raw_rm_readb (UDBG_UART_MW_ADDR + (reg << 2 ));
313
+ mtmsr (msr );
314
+ isync ();
315
+ return c ;
316
+ }
317
+
318
+ static void udbg_uart_out_isa300_rm (unsigned int reg , u8 val )
319
+ {
320
+ uint64_t msr = mfmsr ();
321
+
322
+ mtmsr (msr & ~(MSR_EE |MSR_DR ));
323
+ isync ();
324
+ eieio ();
325
+ __raw_rm_writeb (val , UDBG_UART_MW_ADDR + (reg << 2 ));
326
+ mtmsr (msr );
327
+ isync ();
328
+ }
329
+
330
+ void __init udbg_init_debug_microwatt (void )
331
+ {
332
+ udbg_uart_in = udbg_uart_in_isa300_rm ;
333
+ udbg_uart_out = udbg_uart_out_isa300_rm ;
334
+ udbg_use_uart ();
335
+ }
336
+
337
+ #endif /* CONFIG_PPC_EARLY_DEBUG_MICROWATT */
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ config PPC_MICROWATT
6
6
select PPC_ICS_NATIVE
7
7
select PPC_ICP_NATIVE
8
8
select PPC_NATIVE
9
+ select PPC_UDBG_16550
9
10
help
10
11
This option enables support for FPGA-based Microwatt implementations.
11
12
Original file line number Diff line number Diff line change 14
14
#include <asm/machdep.h>
15
15
#include <asm/time.h>
16
16
#include <asm/xics.h>
17
+ #include <asm/udbg.h>
17
18
18
19
static void __init microwatt_init_IRQ (void )
19
20
{
@@ -35,5 +36,6 @@ define_machine(microwatt) {
35
36
.name = "microwatt" ,
36
37
.probe = microwatt_probe ,
37
38
.init_IRQ = microwatt_init_IRQ ,
39
+ .progress = udbg_progress ,
38
40
.calibrate_decr = generic_calibrate_decr ,
39
41
};
You can’t perform that action at this time.
0 commit comments