[SerialICE] New patch to review for serialice: c754960 Move VX900 filters from epia_m_850.lua to via_bars.lua

Alexandru Gagniuc (mr.nuke.me@gmail.com) gerrit at coreboot.org
Mon Jul 22 23:34:13 CEST 2013


Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3803

-gerrit

commit c754960f6e32ff195d98e5a2e6f03841f93d1634
Author: Alexandru Gagniuc <mr.nuke.me at gmail.com>
Date:   Mon Jul 22 16:32:09 2013 -0500

    Move VX900 filters from epia_m_850.lua to via_bars.lua
    
    As the comment said, "MOVE THIS TO CHIPSET FILE". Now we can remove that
    comment and be happy that VX900 filtering is done properly.
    
    Change-Id: I47294211be073aad205c6727b2649ec0b38ba2c4
    Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
---
 SerialICE/simba/chipset/via_bars.lua         | 44 ++++++++++++++++++++++++++++
 SerialICE/simba/mainboard/via_epia_m_850.lua | 39 +-----------------------
 2 files changed, 45 insertions(+), 38 deletions(-)

diff --git a/SerialICE/simba/chipset/via_bars.lua b/SerialICE/simba/chipset/via_bars.lua
index 8bbff35..5610230 100644
--- a/SerialICE/simba/chipset/via_bars.lua
+++ b/SerialICE/simba/chipset/via_bars.lua
@@ -1,3 +1,32 @@
+-- SerialICE
+--
+-- Copyright (c) 2012 Kyösti Mälkki <kyosti.malkki at gmail.com>
+-- Copyright (c) 2013 Alexandru Gagniuc <mr.nuke.me at gmail.com>
+--
+-- Permission is hereby granted, free of charge, to any person obtaining a copy
+-- of this software and associated documentation files (the "Software"), to deal
+-- in the Software without restriction, including without limitation the rights
+-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-- copies of the Software, and to permit persons to whom the Software is
+-- furnished to do so, subject to the following conditions:
+--
+-- The above copyright notice and this permission notice shall be included in
+-- all copies or substantial portions of the Software.
+--
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+-- THE SOFTWARE.
+--
+
+
+-- **********************************************************
+--
+
+load_filter("intel_smbus")
 
 dev_nb_traf_ctl = {
 	pci_dev = pci_bdf(0,0,5,0),
@@ -22,6 +51,7 @@ dev_sb = {
 	name = "sb",
 	bar = {},
 	mmio = { f = nil },
+	acpi = { f = nil },
 }
 
 function sb_mmio_bar(f, action)
@@ -33,7 +63,21 @@ function sb_mmio_bar(f, action)
 	generic_mmio_bar(f.dev.mmio)
 end
 
+function pm_io_bar(f, action)
+	f.dev.acpi.name = "ACPI"
+	f.dev.acpi.val = bit32.band(action.data, 0xff80)
+	f.dev.acpi.size = 0x80
+	generic_io_bar(f.dev.acpi)
+end
+
+function smbus_bar_hook(f, action)
+	local base = bit32.band(action.data, 0xfff0)
+	intel_smbus_setup(base, 0x10)
+end
+
 function enable_hooks_vx900()
 	pci_cfg8_hook(dev_nb_traf_ctl, 0x61, "PCI", vx900_pcie_bar)
 	pci_cfg32_hook(dev_sb, 0xbc, "SB_MMIO", sb_mmio_bar)
+	pci_cfg16_hook(dev_sb, 0x88, "PM", pm_io_bar)
+	pci_cfg16_hook(dev_sb, 0xd0, "SMBus", smbus_bar_hook)
 end
diff --git a/SerialICE/simba/mainboard/via_epia_m_850.lua b/SerialICE/simba/mainboard/via_epia_m_850.lua
index fb908b2..4f5dc14 100644
--- a/SerialICE/simba/mainboard/via_epia_m_850.lua
+++ b/SerialICE/simba/mainboard/via_epia_m_850.lua
@@ -1,6 +1,7 @@
 -- SerialICE
 --
 -- Copyright (c) 2012 Kyösti Mälkki <kyosti.malkki at gmail.com>
+-- Copyright (c) 2013 Alexandru Gagniuc <mr.nuke.me at gmail.com>
 --
 -- Permission is hereby granted, free of charge, to any person obtaining a copy
 -- of this software and associated documentation files (the "Software"), to deal
@@ -104,43 +105,8 @@ filter_mainboard = {
 	size = 0x10000
 }
 
-
-
--- MOVE THIS TO CHIPSET FILE
-
-load_filter("intel_smbus")
 load_filter("via_bars")
 
-function smbus_bar_hook(f, action)
-	local base = bit32.band(action.data, 0xfff0)
-	intel_smbus_setup(base, 0x10)
-end
-
-dev_sb_lpc = {
-	pci_dev = pci_bdf(0x0,0x1f,0x3,0x0),
-	name = "Smbus",
-	bar = {},
-}
-
-dev_power = {
-	pci_dev = pci_bdf(0x0,0x11,0x0,0x0),
-	name = "SYS",
-	bar = {},
-	acpi = { f = nil },
-	tco = { f = nil },
-}
-
-function pm_io_bar(f, action)
-	f.dev.acpi.name = "ACPI"
-	f.dev.acpi.val = bit32.band(action.data, 0xff80)
-	f.dev.acpi.size = 0x80
-	generic_io_bar(f.dev.acpi)
-end
-
-
-
--- ****************
-
 function do_mainboard_setup()
 	enable_hook(io_hooks, filter_pci_io_cfg)
 	enable_hook(mem_hooks, filter_lapic)
@@ -155,10 +121,7 @@ function do_mainboard_setup()
 
 	enable_hook_pc80()
 	enable_hook_superio(0x4e, 0x07)
-
 	enable_hooks_vx900()
-	pci_cfg16_hook(dev_power, 0x88, "PM", pm_io_bar)
-	pci_cfg16_hook(dev_power, 0xd0, "SMBus", smbus_bar_hook)
 
 	-- Apply mainboard hooks last, so they are the first ones to check
 	enable_hook(io_hooks, filter_mainboard)



More information about the SerialICE mailing list