[SerialICE] Patch set updated for serialice: dd557e0 Add Commell LV-672

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Fri Feb 22 19:27:16 CET 2013


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2478

-gerrit

commit dd557e02c9232444d7b22f0c7683f150daced321
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Tue Feb 19 23:50:10 2013 +0200

    Add Commell LV-672
    
    Change-Id: I56a2eb48a53c20a055670cab06683a938ec18d5a
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 SerialICE/Kconfig                    |  4 ++
 SerialICE/mainboard/commell_lv_672.c | 72 ++++++++++++++++++++++++++++++++++++
 SerialICE/simba/commell_lv_672.lua   | 58 +++++++++++++++++++++++++++++
 3 files changed, 134 insertions(+)

diff --git a/SerialICE/Kconfig b/SerialICE/Kconfig
index 57c8af3..3d5fa9c 100644
--- a/SerialICE/Kconfig
+++ b/SerialICE/Kconfig
@@ -121,6 +121,9 @@ config BOARD_INTEL_D845GBV2
 config BOARD_ASROCK_775I65G
 	bool "ASRock 775i65G"
 
+config BOARD_COMMELL_LV_672
+	bool "Commell LV-672"
+
 endchoice
 
 config BOARD_INIT
@@ -153,6 +156,7 @@ config BOARD_INIT
 	default "via_epia_m850.c" if BOARD_VIA_EPIA_M850
 	default "intel_d845gbv2.c" if BOARD_INTEL_D845GBV2
 	default "asrock_775i65g.c" if BOARD_ASROCK_775I65G
+	default "commell_lv_672.c" if BOARD_COMMELL_LV_672
 
 config SOUTHBRIDGE_INIT
 	string
diff --git a/SerialICE/mainboard/commell_lv_672.c b/SerialICE/mainboard/commell_lv_672.c
new file mode 100644
index 0000000..8f81e8e
--- /dev/null
+++ b/SerialICE/mainboard/commell_lv_672.c
@@ -0,0 +1,72 @@
+/*
+ * SerialICE
+ *
+ * Copyright (C) 2013 Kyösti Mälkki <kyosti.malkki at gmail.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; version 2 of the License.
+ *
+ * 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
+ */
+
+const char boardname[33]="Commell LV-672                  ";
+
+#define SUPERIO_CONFIG_PORT	0x2e
+
+/* Hardware specific functions */
+static void southbridge_init(void)
+{
+	u16 reg16;
+
+	/* Disable watchdog */
+#define PMBASE 0x500
+#define TCOBASE (PMBASE + 0x60)
+	pci_write_config32(PCI_ADDR(0, 0x1f, 0, 0x40), PMBASE | 1);
+	pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0x44), 0x80);
+	reg16 = inw(TCOBASE + 0x08);
+	reg16 |= (1 << 11);
+	outw(reg16, TCOBASE + 0x08);
+	outw(0x0008, TCOBASE + 0x04);
+	outw(0x0002, TCOBASE + 0x06);
+
+	/* Select COM1 COM2 I/O ranges. */
+	pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0x80), 0x10);
+
+	/* Enable COM1, COM2, KBD, SIO config registers 0x2e. */
+	pci_write_config16(PCI_ADDR(0, 0x1f, 0, 0x82), 0x1403);
+
+	/* Enable Serial IRQ */
+	pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0x64), 0xd0);
+}
+
+static void superio_init(void)
+{
+	pnp_enter_ext_func_mode(SUPERIO_CONFIG_PORT);
+
+	/* Settings for Winbond W83627THF/THG */
+	pnp_set_logical_device(SUPERIO_CONFIG_PORT, 0);
+	pnp_write_register(SUPERIO_CONFIG_PORT, 0x24, 0xc2); /* Select oscillator */
+
+	pnp_set_logical_device(SUPERIO_CONFIG_PORT, 2); /* COM1 */
+	pnp_set_enable(SUPERIO_CONFIG_PORT, 0);
+	pnp_set_iobase0(SUPERIO_CONFIG_PORT, 0x3f8);
+	pnp_set_irq0(SUPERIO_CONFIG_PORT, 4);
+	pnp_set_enable(SUPERIO_CONFIG_PORT, 1);
+
+	pnp_exit_ext_func_mode(SUPERIO_CONFIG_PORT);
+}
+
+static void chipset_init(void)
+{
+	southbridge_init();
+	superio_init();
+}
+
diff --git a/SerialICE/simba/commell_lv_672.lua b/SerialICE/simba/commell_lv_672.lua
new file mode 100644
index 0000000..9ebf6ea
--- /dev/null
+++ b/SerialICE/simba/commell_lv_672.lua
@@ -0,0 +1,58 @@
+
+function mainboard_io_read(f, action)
+	-- IO slowdown
+	if action.addr == 0xeb then
+		ignore_action(f, action)
+		return drop_action(f, action, 0)
+	end
+
+	return skip_filter(f, action)
+end
+
+
+function mainboard_io_write(f, action)
+	-- IO slowdown
+	if action.addr == 0xeb then
+		ignore_action(f, action)
+		return drop_action(f, action, 0)
+	end
+
+	return skip_filter(f, action)
+end
+
+function mainboard_io_pre(f, action)
+	if action.write then
+		return mainboard_io_write(f, action)
+	else
+		return mainboard_io_read(f, action)
+	end
+end
+
+function mainboard_io_post(f, action)
+	if action.addr == 0x80 and not action.write then
+		return true
+	end
+end
+
+filter_mainboard = {
+	id = -1,
+	name = "test",
+	pre = mainboard_io_pre,
+	post = mainboard_io_post,
+	hide = hide_mainboard_io,
+	base = 0x0,
+	size = 0x10000
+}
+
+dofile("i82801.lua")
+dofile("intel_bars.lua")
+
+function do_mainboard_setup()
+	do_default_setup()
+
+	enable_hook_i82801fx()
+	northbridge_i915()
+
+	-- Apply mainboard hooks last, so they are the first ones to check
+	enable_hook(io_hooks, filter_mainboard)
+end



More information about the SerialICE mailing list