Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8082
-gerrit
commit 3e523bf17f14e376791ffedd223bf3597851030b
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sun Jan 4 16:28:37 2015 +1100
src/superio/smsc/lpc47m10x/superio.c: Remove dead code
Remove dead debug code, we have superiotool for this reason.
Restructure file to be consistent with other superio's thereby
avoiding forward declarations of functions.
Change-Id: Ief60d3f54c508cbb7795b284b59710d2c0e3018b
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/superio/smsc/lpc47m10x/superio.c | 90 +++++++++---------------------------
1 file changed, 22 insertions(+), 68 deletions(-)
diff --git a/src/superio/smsc/lpc47m10x/superio.c b/src/superio/smsc/lpc47m10x/superio.c
index 8530056..4cd9a8b 100644
--- a/src/superio/smsc/lpc47m10x/superio.c
+++ b/src/superio/smsc/lpc47m10x/superio.c
@@ -33,15 +33,25 @@
#include <stdlib.h>
#include "lpc47m10x.h"
-/* Forward declarations */
-static void enable_dev(struct device *dev);
-static void lpc47m10x_init(struct device *dev);
-// static void dump_pnp_device(struct device *dev);
+/**
+ * Initialize the specified Super I/O device.
+ *
+ * Devices other than COM ports and the keyboard controller are ignored.
+ * For COM ports, we configure the baud rate.
+ *
+ * @param dev Pointer to structure describing a Super I/O device.
+ */
+static void lpc47m10x_init(struct device *dev)
+{
+ if (!dev->enabled)
+ return;
-struct chip_operations superio_smsc_lpc47m10x_ops = {
- CHIP_NAME("SMSC LPC47M10x Super I/O")
- .enable_dev = enable_dev
-};
+ switch(dev->path.pnp.device) {
+ case LPC47M10X2_KBC:
+ pc_keyboard_init();
+ break;
+ }
+}
static struct device_operations ops = {
.read_resources = pnp_read_resources,
@@ -73,63 +83,7 @@ static void enable_dev(struct device *dev)
pnp_dev_info);
}
-/**
- * Initialize the specified Super I/O device.
- *
- * Devices other than COM ports and the keyboard controller are ignored.
- * For COM ports, we configure the baud rate.
- *
- * @param dev Pointer to structure describing a Super I/O device.
- */
-static void lpc47m10x_init(struct device *dev)
-{
-
- if (!dev->enabled)
- return;
-
- switch(dev->path.pnp.device) {
- case LPC47M10X2_KBC:
- pc_keyboard_init();
- break;
- }
-}
-
-#if 0
-/**
- * Print the values of all of the LPC47M10X2's configuration registers.
- *
- * NOTE: The LPC47M10X2 must be in config mode when this function is called.
- *
- * @param dev Pointer to structure describing a Super I/O device.
- */
-static void dump_pnp_device(struct device *dev)
-{
- int i;
- print_debug("\n");
-
- for (i = 0; i <= LPC47M10X2_MAX_CONFIG_REGISTER; i++) {
- u8 register_value;
-
- if ((i & 0x0f) == 0) {
- print_debug_hex8(i);
- print_debug_char(':');
- }
-
- /*
- * Skip over 'register' that would cause exit from
- * configuration mode.
- */
- if (i == 0xaa)
- register_value = 0xaa;
- else
- register_value = pnp_read_config(dev, i);
-
- print_debug_char(' ');
- print_debug_hex8(register_value);
- if ((i & 0x0f) == 0x0f)
- print_debug("\n");
- }
-
- print_debug("\n");
-}
-#endif
+struct chip_operations superio_smsc_lpc47m10x_ops = {
+ CHIP_NAME("SMSC LPC47M10x Super I/O")
+ .enable_dev = enable_dev
+};
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8083
-gerrit
commit 649b4c58381de9ba9b763681522591b4ac270ec5
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sun Jan 4 16:35:43 2015 +1100
superio/smsc/lpc47b272/superio.c: Remove dead code
Remove dead debug code, we have superiotool for this reason.
Restructure file to be consistent with other superio's thereby
avoiding forward declarations of functions.
Change-Id: I44272b4e30a2bc8c3a719df17b837432cd38429c
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/superio/smsc/lpc47b272/superio.c | 91 +++++++++---------------------------
1 file changed, 23 insertions(+), 68 deletions(-)
diff --git a/src/superio/smsc/lpc47b272/superio.c b/src/superio/smsc/lpc47b272/superio.c
index 4fac022..ef00cc7 100644
--- a/src/superio/smsc/lpc47b272/superio.c
+++ b/src/superio/smsc/lpc47b272/superio.c
@@ -34,15 +34,26 @@
#include <stdlib.h>
#include "lpc47b272.h"
-/* Forward declarations */
-static void enable_dev(struct device *dev);
-static void lpc47b272_init(struct device *dev);
-// static void dump_pnp_device(struct device *dev);
+/**
+ * Initialize the specified Super I/O device.
+ *
+ * Devices other than COM ports and the keyboard controller are ignored.
+ * For COM ports, we configure the baud rate.
+ *
+ * @param dev Pointer to structure describing a Super I/O device.
+ */
+static void lpc47b272_init(struct device *dev)
+{
-struct chip_operations superio_smsc_lpc47b272_ops = {
- CHIP_NAME("SMSC LPC47B272 Super I/O")
- .enable_dev = enable_dev
-};
+ if (!dev->enabled)
+ return;
+
+ switch(dev->path.pnp.device) {
+ case LPC47B272_KBC:
+ pc_keyboard_init();
+ break;
+ }
+}
static struct device_operations ops = {
.read_resources = pnp_read_resources,
@@ -74,63 +85,7 @@ static void enable_dev(struct device *dev)
pnp_dev_info);
}
-/**
- * Initialize the specified Super I/O device.
- *
- * Devices other than COM ports and the keyboard controller are ignored.
- * For COM ports, we configure the baud rate.
- *
- * @param dev Pointer to structure describing a Super I/O device.
- */
-static void lpc47b272_init(struct device *dev)
-{
-
- if (!dev->enabled)
- return;
-
- switch(dev->path.pnp.device) {
- case LPC47B272_KBC:
- pc_keyboard_init();
- break;
- }
-}
-
-#if 0
-/**
- * Print the values of all of the LPC47B272's configuration registers.
- *
- * NOTE: The LPC47B272 must be in config mode when this function is called.
- *
- * @param dev Pointer to structure describing a Super I/O device.
- */
-static void dump_pnp_device(struct device *dev)
-{
- int i;
- print_debug("\n");
-
- for (i = 0; i <= LPC47B272_MAX_CONFIG_REGISTER; i++) {
- u8 register_value;
-
- if ((i & 0x0f) == 0) {
- print_debug_hex8(i);
- print_debug_char(':');
- }
-
- /*
- * Skip over 'register' that would cause exit from
- * configuration mode.
- */
- if (i == 0xaa)
- register_value = 0xaa;
- else
- register_value = pnp_read_config(dev, i);
-
- print_debug_char(' ');
- print_debug_hex8(register_value);
- if ((i & 0x0f) == 0x0f)
- print_debug("\n");
- }
-
- print_debug("\n");
-}
-#endif
+struct chip_operations superio_smsc_lpc47b272_ops = {
+ CHIP_NAME("SMSC LPC47B272 Super I/O")
+ .enable_dev = enable_dev
+};
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8084
-gerrit
commit ea0e207cbd9245b2d797660886e78d29a9d9344b
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sun Jan 4 17:21:52 2015 +1100
superio/smsc/lpc47n207: What the even..***.. do I write..
Change-Id: I451c3a81c4b5beca1ed65e27467a7393d2521dae
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/mainboard/samsung/lumpy/Kconfig | 1 +
src/mainboard/samsung/lumpy/romstage.c | 1 -
src/mainboard/samsung/stumpy/Kconfig | 1 +
src/mainboard/samsung/stumpy/romstage.c | 1 -
src/superio/smsc/Kconfig | 2 ++
src/superio/smsc/Makefile.inc | 1 +
src/superio/smsc/lpc47n207/Makefile.inc | 21 +++++++++++++++++++++
src/superio/smsc/lpc47n207/early_serial.c | 5 +++++
src/superio/smsc/lpc47n207/lpc47n207.h | 11 +++++++----
9 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/src/mainboard/samsung/lumpy/Kconfig b/src/mainboard/samsung/lumpy/Kconfig
index baf0eee..768875a 100644
--- a/src/mainboard/samsung/lumpy/Kconfig
+++ b/src/mainboard/samsung/lumpy/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select NORTHBRIDGE_INTEL_SANDYBRIDGE
select SOUTHBRIDGE_INTEL_BD82X6X
select SUPERIO_SMSC_MEC1308
+ select SUPERIO_SMSC_LPC47N207
select DRIVERS_GENERIC_IOAPIC
select INTEL_INT15
select HAVE_MRC
diff --git a/src/mainboard/samsung/lumpy/romstage.c b/src/mainboard/samsung/lumpy/romstage.c
index b356fa8..8568f84 100644
--- a/src/mainboard/samsung/lumpy/romstage.c
+++ b/src/mainboard/samsung/lumpy/romstage.c
@@ -45,7 +45,6 @@
#include "gpio.h"
#if CONFIG_DRIVERS_UART_8250IO
#include <superio/smsc/lpc47n207/lpc47n207.h>
-#include "superio/smsc/lpc47n207/early_serial.c"
#endif
#if CONFIG_CHROMEOS
#include <vendorcode/google/chromeos/chromeos.h>
diff --git a/src/mainboard/samsung/stumpy/Kconfig b/src/mainboard/samsung/stumpy/Kconfig
index 17484a9..e249c40 100644
--- a/src/mainboard/samsung/stumpy/Kconfig
+++ b/src/mainboard/samsung/stumpy/Kconfig
@@ -11,6 +11,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select NORTHBRIDGE_INTEL_SANDYBRIDGE
select SOUTHBRIDGE_INTEL_BD82X6X
select SUPERIO_ITE_IT8772F
+ select SUPERIO_SMSC_LPC47N207
select HAVE_MRC
select INTEL_INT15
diff --git a/src/mainboard/samsung/stumpy/romstage.c b/src/mainboard/samsung/stumpy/romstage.c
index 1462132..2ed185b 100644
--- a/src/mainboard/samsung/stumpy/romstage.c
+++ b/src/mainboard/samsung/stumpy/romstage.c
@@ -45,7 +45,6 @@
#include "gpio.h"
#if CONFIG_DRIVERS_UART_8250IO
#include <superio/smsc/lpc47n207/lpc47n207.h>
-#include "superio/smsc/lpc47n207/early_serial.c"
#endif
#if CONFIG_CHROMEOS
#include <vendorcode/google/chromeos/chromeos.h>
diff --git a/src/superio/smsc/Kconfig b/src/superio/smsc/Kconfig
index 6aaa112..34bc60c 100644
--- a/src/superio/smsc/Kconfig
+++ b/src/superio/smsc/Kconfig
@@ -30,6 +30,8 @@ config SUPERIO_SMSC_LPC47M10X
bool
config SUPERIO_SMSC_LPC47M15X
bool
+config SUPERIO_SMSC_LPC47N207
+ bool
config SUPERIO_SMSC_LPC47N217
bool
config SUPERIO_SMSC_LPC47N227
diff --git a/src/superio/smsc/Makefile.inc b/src/superio/smsc/Makefile.inc
index a89b6ac..caa2c72 100644
--- a/src/superio/smsc/Makefile.inc
+++ b/src/superio/smsc/Makefile.inc
@@ -24,6 +24,7 @@ subdirs-y += lpc47b272
subdirs-y += lpc47b397
subdirs-y += lpc47m10x
subdirs-y += lpc47m15x
+subdirs-y += lpc47n207
subdirs-y += lpc47n217
subdirs-y += lpc47n227
subdirs-y += sio10n268
diff --git a/src/superio/smsc/lpc47n207/Makefile.inc b/src/superio/smsc/lpc47n207/Makefile.inc
new file mode 100644
index 0000000..08e1387
--- /dev/null
+++ b/src/superio/smsc/lpc47n207/Makefile.inc
@@ -0,0 +1,21 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+romstage-$(CONFIG_SUPERIO_SMSC_LPC47N207) += early_serial.c
diff --git a/src/superio/smsc/lpc47n207/early_serial.c b/src/superio/smsc/lpc47n207/early_serial.c
index e2ae49d..fedc27a 100644
--- a/src/superio/smsc/lpc47n207/early_serial.c
+++ b/src/superio/smsc/lpc47n207/early_serial.c
@@ -17,6 +17,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <arch/io.h>
+#include <device/pnp.h>
+#include <stdint.h>
+#include "lpc47n207.h"
+
/*
* This code tries to discover the SMSC LPC47N207 superio chip which can be
* connected over an LPC dongle. The chip could be bootstrap mapped to one of
diff --git a/src/superio/smsc/lpc47n207/lpc47n207.h b/src/superio/smsc/lpc47n207/lpc47n207.h
index 69689a4..a122465 100644
--- a/src/superio/smsc/lpc47n207/lpc47n207.h
+++ b/src/superio/smsc/lpc47n207/lpc47n207.h
@@ -17,9 +17,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef SUPERIO_SMSC_LPC47N207_LPC47N207_H
-#define SUPERIO_SMSC_LPC47N207_LPC47N207_H
+#ifndef SUPERIO_SMSC_LPC47N207_H
+#define SUPERIO_SMSC_LPC47N207_H
-extern void try_enabling_LPC47N207_uart(void);
+#include <arch/io.h>
+#include <stdint.h>
-#endif
+void try_enabling_LPC47N207_uart(void);
+
+#endif /* SUPERIO_SMSC_LPC47N207_H */