Previously the internal programmer used its own code to initialize pcilib.
This patch extracts the common code from the internal programmer and
pcidev_init() into pcidev_init_common().
This fixes the non-existent PCI cleanup of the internal programmer.
Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
---
internal.c | 6 ++----
pcidev.c | 15 +++++++++++----
programmer.h | 1 +
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/internal.c b/…
[View More]internal.c
index eda4d59..9b34715 100644
--- a/internal.c
+++ b/internal.c
@@ -245,10 +245,8 @@ int internal_init(void)
internal_buses_supported = BUS_NONSPI;
/* Initialize PCI access for flash enables */
- pacc = pci_alloc(); /* Get the pci_access structure */
- /* Set all options you want -- here we stick with the defaults */
- pci_init(pacc); /* Initialize the PCI library */
- pci_scan_bus(pacc); /* We want to get the list of devices */
+ if(pci_init_common() != 0)
+ return 1;
if (processor_flash_enable()) {
msg_perr("Processor detection/init failed.\n"
diff --git a/pcidev.c b/pcidev.c
index 37bcc22..a5a7088 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -162,6 +162,16 @@ static int pcidev_shutdown(void *data)
return 0;
}
+int pci_init_common(void)
+{
+ pacc = pci_alloc(); /* Get the pci_access structure */
+ pci_init(pacc); /* Initialize the PCI library */
+ if (register_shutdown(pcidev_shutdown, NULL))
+ return 1;
+ pci_scan_bus(pacc); /* We want to get the list of devices */
+ return 0;
+}
+
uintptr_t pcidev_init(int bar, const struct dev_entry *devs)
{
struct pci_dev *dev;
@@ -172,11 +182,8 @@ uintptr_t pcidev_init(int bar, const struct dev_entry *devs)
int i;
uintptr_t addr = 0, curaddr = 0;
- pacc = pci_alloc(); /* Get the pci_access structure */
- pci_init(pacc); /* Initialize the PCI library */
- if (register_shutdown(pcidev_shutdown, NULL))
+ if(pci_init_common() != 0)
return 1;
- pci_scan_bus(pacc); /* We want to get the list of devices */
pci_filter_init(pacc, &filter);
/* Filter by bb:dd.f (if supplied by the user). */
diff --git a/programmer.h b/programmer.h
index 8de42bc..4302809 100644
--- a/programmer.h
+++ b/programmer.h
@@ -238,6 +238,7 @@ void internal_delay(int usecs);
extern uint32_t io_base_addr;
extern struct pci_access *pacc;
extern struct pci_dev *pcidev_dev;
+int pci_init_common(void);
uintptr_t pcidev_readbar(struct pci_dev *dev, int bar);
uintptr_t pcidev_init(int bar, const struct dev_entry *devs);
/* rpci_write_* are reversible writes. The original PCI config space register
--
Kind regards, Stefan Tauner
[View Less]
Hi, I've tried to make some sense out of the ME documents, and after some
study, I've put together a list of the ways mentioned in Intel sheets to
disable/stop the ME, and what chipsets they apply to/don't apply to.
I've then included some observations I've made.
If you find this useful (and think it's more likely valid than not), reply,
and I'll send a sign-off so it can be put in a patch.
ME disabling methods (all from section 4.5 or section on FPT (Flash
Programming Tool):
Manufacturer mode …
[View More]jumper (GPIO 33) (also Flash Descriptor Override)
Works on:
Montevina (Oct 2007 guide) (1), (3)
Intel 3 series chipset (2)
Ibex Peak (4), (7)
Intel 6 series chipset (5), (6)
Remove all memory from Bank 0 (1), (2), (3)
>From (2):
This causes the ME to boot up in an error state, which is saved on the
flash device.
Once the OS has booted, you can program the flash device.
Works on:
Montevina (ICH9M) (Oct 2007 guide) (1), (3)
Intel 3 series chipset (2)
Doesn't work on:
Ibex Peak (4)
Intel 6 series chipset (5), (6)
or presumably anything after Ibex Peak.
HMRFPO message
Works on:
Ibex Peak (4)
Intel 6 series chipset (5), (6)
Set ME disable bits (2)
>From (2):
Set ME disable bits in the strap sections of the descriptor region- see ICH
EDS for more info
Works on:
Intel 3 series chipset (2)
Security override strap? (2)
Temporarily stop ME thru MEbx? (4), (5)
(7) says this:
Temporarily disable the Intel® ME through the MEBX. Power off or cold
reset. -
This option is only applicable to non-Intel ME Ignition firmware.
(4), (5) says Stopping ME is not a requirement when writing to the fixed
offset region.
(6) says FPT will stop ME SPI accessing automatically if it try to write
data into the ME region.
Customers do not have to do extra step to stop ME if using FPT tool to
update ME
region. (5) does not mention this note.
Section 8 (Update Parameter Tool) of (4),(5),(6) is interesting-
the tool will work with ME manufacturing mode bit set, and a locked
Descriptor region.
References:
(1) Montevina SW/FW OEM Bring up Guide, October 2007, Rev 0.4
(2) System Tools User Guide, July 2007, Rev 0.92 (Intel 3 series chipset )
(3) Intel Management Engine, System Tools User Guide, October 2007, Rev
0.60
(4) (Ibex Peak) System Tools User Guide for Intel® Management Engine
Firmware 6.0 (Corporate),
User Guide, June 2009, Revision 0.60
(5) System Tools for Intel® 6 Series Chipset Family Intel® Management
Engine,
Firmware 7.0 SKU’s, User Guide, May 2010, Revision: 0.81
(6) (Cougar Point) System Tools for Intel® 6 Series Chipset Family Intel®
Management Engine,
Firmware 7.0 SKU’s, User Guide, December 2010, Revision: 1.08
(7) Ibex Peak SPI Programming Guide, Application Note,
January 2009, Revision 1.3
In theory, pre-Ibex Peak chipsets should be able to take advantage of the
removing memory method, which would be fairly easy to do.
The Update Parameters tool is interesting, especially if it works, but
since it's a separate tool, it's not of real use.
[View Less]