4 * lpc47b272_early_serial.c: Pre-RAM driver for SMSC LPC47B272 Super I/O chip
\r
6 * Copyright (C) 2005 Digital Design Corporation
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License
\r
19 * along with this program; if not, write to the Free Software
\r
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
26 #include <arch/romcc_io.h>
27 #include "lpc47b272.h"
29 //----------------------------------------------------------------------------------
\r
30 // Function: pnp_enter_conf_state
\r
31 // Parameters: dev - high 8 bits = Super I/O port
\r
32 // Return Value: None
\r
33 // Description: Enable access to the LPC47B272's configuration registers.
\r
35 static inline void pnp_enter_conf_state(device_t dev) {
36 unsigned port = dev>>8;
40 //----------------------------------------------------------------------------------
\r
41 // Function: pnp_exit_conf_state
\r
42 // Parameters: dev - high 8 bits = Super I/O port
\r
43 // Return Value: None
\r
44 // Description: Disable access to the LPC47B272's configuration registers.
\r
46 static void pnp_exit_conf_state(device_t dev) {
47 unsigned port = dev>>8;
51 //----------------------------------------------------------------------------------
\r
52 // Function: lpc47b272_enable_serial
\r
53 // Parameters: dev - high 8 bits = Super I/O port,
\r
54 // low 8 bits = logical device number (per lpc47b272.h)
\r
55 // iobase - processor I/O port address to assign to this serial device
\r
56 // Return Value: bool
\r
57 // Description: Configure the base I/O port of the specified serial device
\r
58 // and enable the serial device.
\r
60 static void lpc47b272_enable_serial(device_t dev, unsigned iobase)
62 pnp_enter_conf_state(dev);
63 pnp_set_logical_device(dev);
64 pnp_set_enable(dev, 0);
65 pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
66 pnp_set_enable(dev, 1);
67 pnp_exit_conf_state(dev);