diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2010-06-04 19:05:39 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2010-06-04 19:05:39 +0000 |
commit | b5b161b260b119d90a7f22e1c8ec1174de5eacf9 (patch) | |
tree | ac20b472a8408769c2a9956b28a2ea72fcc4b469 /internal.c | |
parent | 2db77a03ef8b6b3cb980b9aba7e5009d778f62da (diff) | |
download | flashrom-b5b161b260b119d90a7f22e1c8ec1174de5eacf9.tar.gz flashrom-b5b161b260b119d90a7f22e1c8ec1174de5eacf9.tar.bz2 flashrom-b5b161b260b119d90a7f22e1c8ec1174de5eacf9.zip |
Internal: introduce processor enables and abort if top/bottom alignment is unknown
The internal programmer needs correct information about flash_base and
chip window top/bottom alignment on non-x86 before it can be used. Abort
any internal programmer action for now until the code is fixed.
Add the concept of a processor enable for systems where flashing is
impacted by processor settings or processor model.
Corresponding to flashrom svn r1031.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'internal.c')
-rw-r--r-- | internal.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/internal.c b/internal.c index d0eb78288..961961878 100644 --- a/internal.c +++ b/internal.c @@ -165,16 +165,28 @@ int internal_init(void) pci_init(pacc); /* Initialize the PCI library */ pci_scan_bus(pacc); /* We want to get the list of devices */ - /* We look at the lbtable first to see if we need a + if (processor_flash_enable()) { + msg_perr("Processor detection/init failed.\n" + "Aborting.\n"); + return 1; + } + +#if defined(__i386__) || defined(__x86_64__) + /* We look at the cbtable first to see if we need a * mainboard specific flash enable sequence. */ coreboot_init(); -#if defined(__i386__) || defined(__x86_64__) dmi_init(); /* Probe for the Super I/O chip and fill global struct superio. */ probe_superio(); +#else + /* FIXME: Enable cbtable searching on all non-x86 platforms supported + * by coreboot. + * FIXME: Find a replacement for DMI on non-x86. + * FIXME: Enable Super I/O probing once port I/O is possible. + */ #endif /* Warn if a laptop is detected. */ @@ -200,6 +212,7 @@ int internal_init(void) } } +#if __FLASHROM_LITTLE_ENDIAN__ /* try to enable it. Failure IS an option, since not all motherboards * really need this to be done, etc., etc. */ @@ -220,7 +233,26 @@ int internal_init(void) * The error code might have been a warning only. * Besides that, we don't check the board enable return code either. */ +#if defined(__i386__) || defined(__x86_64__) return 0; +#else + msg_perr("Your platform is not supported yet for the internal " + "programmer due to missing\n" + "flash_base and top/bottom alignment information.\n" + "Aborting.\n"); + return 1; +#endif +#else + /* FIXME: Remove this unconditional abort once all PCI drivers are + * converted to use little-endian accesses for memory BARs. + */ + msg_perr("Your platform is not supported yet for the internal " + "programmer because it has\n" + "not been converted from native endian to little endian " + "access yet.\n" + "Aborting.\n"); + return 1; +#endif } int internal_shutdown(void) |