FreeCalypso > hg > freecalypso-sw
comparison target-utils/libcommon/uartsel.c @ 11:40f607bb0a2c
target-utils refactored
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Wed, 01 May 2013 07:39:35 +0000 |
parents | |
children | a7b0b426f9ca |
comparison
equal
deleted
inserted
replaced
10:e2e80a09338e | 11:40f607bb0a2c |
---|---|
1 /* | |
2 * uart_select_init() figures out which UART was used to load us | |
3 * through the boot ROM, and sets things up for us to use the same | |
4 * UART for our communication. | |
5 */ | |
6 | |
7 #include "types.h" | |
8 #include "romvars.h" | |
9 #include "ns16550.h" | |
10 #include "halt.h" | |
11 | |
12 extern struct boot_rom_vars rom_vars; | |
13 | |
14 struct ns16550_regs *uart_base; | |
15 char *uart_name; | |
16 | |
17 uart_select_init() | |
18 { | |
19 switch (rom_vars.uart_id) { | |
20 case 0: | |
21 uart_base = (struct ns16550_regs *) 0xFFFF5800; | |
22 uart_name = "MODEM"; | |
23 break; | |
24 case 1: | |
25 uart_base = (struct ns16550_regs *) 0xFFFF5000; | |
26 uart_name = "IrDA"; | |
27 break; | |
28 default: | |
29 _exit(HALTCODE_INVALIDUART); | |
30 } | |
31 } |