1 #include <arch/romcc_io.h>
4 #define PM_DEV PNP_DEV(0x2e, PC97317_PM)
7 /* The pc97317 needs clocks to be set up before the serial port will operate */
9 static void pc97317_enable_serial(device_t dev, unsigned iobase)
11 /* Set base address of power management unit */
13 pnp_set_logical_device(PM_DEV);
14 pnp_set_enable(dev, 0);
15 pnp_set_iobase(dev, PNP_IDX_IO0, PM_BASE);
16 pnp_set_enable(dev, 1);
18 /* Use on-chip clock multiplier */
21 outb(inb(PM_BASE + 1) | 0x07, PM_BASE + 1);
23 /* Wait for the clock to stabilise */
24 while(!inb(PM_BASE + 1 & 0x80))
27 /* Set the base address of the port */
29 pnp_set_logical_device(dev);
30 pnp_set_enable(dev, 0);
31 pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
32 pnp_set_enable(dev, 1);