From c3e77fc95380560f21dba7923b4aaa4ec35864c8 Mon Sep 17 00:00:00 2001
From: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Date: Sun, 4 Jan 2015 16:24:14 +1100
Subject: superio/smsc/lpc47m10x: Use link-time symbols over .c inclusion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: I4a3639c05231eacd016ec3873330f9844befd448
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-on: http://review.coreboot.org/8080
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
---
 src/mainboard/aopen/dxplplusu/romstage.c  |  3 +--
 src/superio/smsc/lpc47m10x/Makefile.inc   |  1 +
 src/superio/smsc/lpc47m10x/early_serial.c |  4 +++-
 src/superio/smsc/lpc47m10x/lpc47m10x.h    | 11 ++++++++---
 4 files changed, 13 insertions(+), 6 deletions(-)

(limited to 'src')

diff --git a/src/mainboard/aopen/dxplplusu/romstage.c b/src/mainboard/aopen/dxplplusu/romstage.c
index 86470b3257..8bb179aee5 100644
--- a/src/mainboard/aopen/dxplplusu/romstage.c
+++ b/src/mainboard/aopen/dxplplusu/romstage.c
@@ -29,8 +29,7 @@
 #include "northbridge/intel/e7505/raminit.h"
 
 #include <device/pnp_def.h>
-#include "superio/smsc/lpc47m10x/early_serial.c"
-
+#include <superio/smsc/lpc47m10x/lpc47m10x.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, LPC47M10X2_SP1)
 
diff --git a/src/superio/smsc/lpc47m10x/Makefile.inc b/src/superio/smsc/lpc47m10x/Makefile.inc
index c5dd31049a..876cb0c64d 100644
--- a/src/superio/smsc/lpc47m10x/Makefile.inc
+++ b/src/superio/smsc/lpc47m10x/Makefile.inc
@@ -22,4 +22,5 @@
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 ##
 
+romstage-$(CONFIG_SUPERIO_SMSC_LPC47M10X) += early_serial.c
 ramstage-$(CONFIG_SUPERIO_SMSC_LPC47M10X) += superio.c
diff --git a/src/superio/smsc/lpc47m10x/early_serial.c b/src/superio/smsc/lpc47m10x/early_serial.c
index 1174120136..59a53f289a 100644
--- a/src/superio/smsc/lpc47m10x/early_serial.c
+++ b/src/superio/smsc/lpc47m10x/early_serial.c
@@ -19,6 +19,8 @@
  */
 
 #include <arch/io.h>
+#include <device/pnp.h>
+#include <stdint.h>
 #include "lpc47m10x.h"
 
 static void pnp_enter_conf_state(pnp_devfn_t dev)
@@ -40,7 +42,7 @@ static void pnp_exit_conf_state(pnp_devfn_t dev)
  * @param dev High 8 bits = Super I/O port, low 8 bits = logical device number.
  * @param iobase Processor I/O port address to assign to this serial device.
  */
-static void lpc47m10x_enable_serial(pnp_devfn_t dev, u16 iobase)
+void lpc47m10x_enable_serial(pnp_devfn_t dev, u16 iobase)
 {
 	pnp_enter_conf_state(dev);
 	pnp_set_logical_device(dev);
diff --git a/src/superio/smsc/lpc47m10x/lpc47m10x.h b/src/superio/smsc/lpc47m10x/lpc47m10x.h
index e85104884c..9814c8e56f 100644
--- a/src/superio/smsc/lpc47m10x/lpc47m10x.h
+++ b/src/superio/smsc/lpc47m10x/lpc47m10x.h
@@ -20,8 +20,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
  */
 
-#ifndef SUPERIO_SMSC_LPC47M10X_LPC47M10X_H
-#define SUPERIO_SMSC_LPC47M10X_LPC47M10X_H
+#ifndef SUPERIO_SMSC_LPC47M10X_H
+#define SUPERIO_SMSC_LPC47M10X_H
 
 #define LPC47M10X2_FDC              0   /* Floppy */
 #define LPC47M10X2_PP               3   /* Parallel Port */
@@ -34,4 +34,9 @@
 
 #define LPC47M10X2_MAX_CONFIG_REGISTER	0x5F
 
-#endif
+#include <arch/io.h>
+#include <stdint.h>
+
+void lpc47m10x_enable_serial(pnp_devfn_t dev, u16 iobase);
+
+#endif /* SUPERIO_SMSC_LPC47M10X_H */
-- 
cgit v1.2.3