| 1 |
|
| 2 |
|
| 3 |
#include <bootblock_common.h> |
| 4 |
#include <arch/io.h> |
| 5 |
#include <device/pnp_ops.h> |
| 6 |
#include <superio/smsc/lpc47n227/lpc47n227.h> |
| 7 |
|
| 8 |
#define SERIAL_DEV PNP_DEV(0x2e, LPC47N227_SP1) |
| 9 |
|
| 10 |
void bootblock_mainboard_early_init(void) |
| 11 |
{ |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
const pnp_devfn_t sio = PNP_DEV(0x2e, 0); |
| 22 |
|
| 23 |
|
| 24 |
pnp_enter_conf_state(sio); |
| 25 |
|
| 26 |
|
| 27 |
pnp_write_config(sio, 0x30, 0x600 >> 4); |
| 28 |
|
| 29 |
|
| 30 |
pnp_write_config(sio, 0x33, 0x40); |
| 31 |
|
| 32 |
|
| 33 |
pnp_write_config(sio, 0x35, 0xff); |
| 34 |
|
| 35 |
|
| 36 |
pnp_write_config(sio, 0x37, 0xe0); |
| 37 |
|
| 38 |
|
| 39 |
pnp_write_config(sio, 0x39, 0x80); |
| 40 |
|
| 41 |
|
| 42 |
pnp_exit_conf_state(sio); |
| 43 |
|
| 44 |
|
| 45 |
outb(0x88, 0x600 + 0xb + 3); |
| 46 |
outb(0x10, 0x600 + 0xb + 4); |
| 47 |
|
| 48 |
lpc47n227_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); |
| 49 |
} |