outb(value, SIO_DATA);
}
-/* Enable the peripheral devices on the IT8712F Super I/O chip. */
-static void it8712f_enable_serial(device_t dev, unsigned iobase)
+
+static void it8712f_enter_conf(void)
{
- /* (1) Enter the configuration state (MB PnP mode). */
+ /* Enter the configuration state (MB PnP mode). */
/* Perform MB PnP setup to put the SIO chip at 0x2e. */
/* Base address 0x2e: 0x87 0x01 0x55 0x55. */
outb(0x01, IT8712F_CONFIGURATION_PORT);
outb(0x55, IT8712F_CONFIGURATION_PORT);
outb(0x55, IT8712F_CONFIGURATION_PORT);
+}
+
+static void it8712f_exit_conf(void)
+{
+ /* Exit the configuration state (MB PnP mode). */
+ it8712f_sio_write(0x00, IT8712F_CONFIG_REG_CC, 0x02);
+}
+
+
+static void it8712f_24mhz_clkin(void)
+{
+ it8712f_enter_conf();
+
+ /* Select 24MHz CLKIN (48MHZ default)*/
+ it8712f_sio_write(0x00, IT8712F_CONFIG_REG_CLOCKSEL, 0x1);
+
+ it8712f_exit_conf();
+
+}
+
+/* Enable the peripheral devices on the IT8712F Super I/O chip. */
+static void it8712f_enable_serial(device_t dev, unsigned iobase)
+{
+
+ /* (1) Enter the configuration state (MB PnP mode). */
+ it8712f_enter_conf();
/* (2) Modify the data of configuration registers. */
it8712f_sio_write(IT8712F_SP1, 0x30, 0x1); /* Serial port 1 */
it8712f_sio_write(IT8712F_SP2, 0x30, 0x1); /* Serial port 2 */
- /* Select 24MHz CLKIN (set bit 0). */
- it8712f_sio_write(0x00, IT8712F_CONFIG_REG_CLOCKSEL, 0x01);
-
/* Clear software suspend mode (clear bit 0). TODO: Needed? */
/* it8712f_sio_write(0x00, IT8712F_CONFIG_REG_SWSUSP, 0x00); */
/* (3) Exit the configuration state (MB PnP mode). */
- it8712f_sio_write(0x00, IT8712F_CONFIG_REG_CC, 0x02);
+ it8712f_exit_conf();
}
-