Nico Huber has restored this change. ( https://review.coreboot.org/23024 )
Change subject: test_v2.sh: Copy layout to local tempdir in local-layout mode
......................................................................
Restored
--
To view, visit https://review.coreboot.org/23024
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: restore
Gerrit-Change-Id: Ia2328d367ee3df5ac1c481c16e4502a81d69fd98
Gerrit-Change-Number: 23024
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/19387 )
Change subject: make args for -r/-w/-v non-positional and optional
......................................................................
Patch Set 8: Verified+1
Build Successful
https://qa.coreboot.org/job/flashrom_gerrit/855/ : SUCCESS
https://qa.coreboot.org/job/flashrom-customrules/1005/ : SUCCESS
--
To view, visit https://review.coreboot.org/19387
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: comment
Gerrit-Change-Id: Iefbcb7dc4fefe26f5afd1292dfd5c1687fa62803
Gerrit-Change-Number: 19387
Gerrit-PatchSet: 8
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Louis Yung-Chieh Lo <yjlou(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 06 Jan 2018 22:59:31 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
Arthur Heymans has uploaded a new patch set (#8) to the change originally created by David Hendricks. ( https://review.coreboot.org/19387 )
Change subject: make args for -r/-w/-v non-positional and optional
......................................................................
make args for -r/-w/-v non-positional and optional
Ported from chromiumos:
https://chromium-review.googlesource.com/#/c/60515/
This makes a filename following -r, -w, and -v operations non-
positional. The first argument that does not begin with a hyphen (-)
is the filename for -r/-w/-v. If no such argument exists, then
-r/-w/-v options apply to files specified for individually included
regions via -i.
This has a few side-effects:
1. It allows us to omit the ROM-sized filename entirely when a
filename is provided for a particular region when using -i. For
example, "flashrom -i FOO:foo.bin -r".
2. It allows, for better or worse, the filename be specified anywhere
on the command line after the program name. Our scripts and docs
should still specify the file after -r/-w/-v for clarity.
For our purposes, if a filename is given for every included region
(-i region:filename) then the user does not need to specify a filename
after -r/-w/-v. However, if any -i option does not specify a filename,
then a file must be specified after -r/-w/-v.
The syntax will be backwards compatible for now so that one can still
mix -i options with and without the added filename specifier for each
region.
BUG=chromium:263495
BRANCH=none
TEST=manual (see notes below)
1. Write random data to RW_UNUSED region (on snow in this case)
without requiring an argument to -w. See that only RW_UNUSED
is erased and written, and that verify works:
dd if=/dev/urandom of=rw_unused.bin bs=1k count=1 conv=notrunc
flashrom -p host -i RW_UNUSED:rw_unused.bin -w -V
flashrom -p host -i RW_UNUSED:rw_unused.bin -v -V
2. Same as above, but specify a dummy file to test syntax
backwards compatibility:
dd if=/dev/urandom of=rw_unused.bin bs=1k count=1 conv=notrunc
dd if=/dev/urandom of=random_4M.bin bs=1M count=4
flashrom -p host -i RW_UNUSED:rw_unused.bin -w random_4M.bin -V
flashrom -p host -i RW_UNUSED:rw_unused.bin -v random_4M.bin -V
3. Test that dumping RW_UNUSED and GBB regions without -r arg dumps
two files and that they can be used to verify the content:
flashrom -p host -i RW_UNUSED:rw_unused.bin -i GBB:gbb.bin -r
flashrom -p host -i RW_UNUSED:rw_unused.bin -i GBB:gbb.bin -v
4. Same as above, but with dummy file:
flashrom -p host -i RW_UNUSED:rw_unused.bin -i GBB:gbb.bin -r x.bin
flashrom -p host -i RW_UNUSED:rw_unused.bin -i GBB:gbb.bin -v x.bin
Change-Id: Iefbcb7dc4fefe26f5afd1292dfd5c1687fa62803
Reviewed-on: https://gerrit.chromium.org/gerrit/60515
Reviewed-by: Yung-Chieh Lo <yjlou(a)chromium.org>
Commit-Queue: David Hendricks <dhendrix(a)chromium.org>
Tested-by: David Hendricks <dhendrix(a)chromium.org>
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M cli_classic.c
M flashrom.8.tmpl
2 files changed, 97 insertions(+), 23 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/87/19387/8
--
To view, visit https://review.coreboot.org/19387
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iefbcb7dc4fefe26f5afd1292dfd5c1687fa62803
Gerrit-Change-Number: 19387
Gerrit-PatchSet: 8
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Louis Yung-Chieh Lo <yjlou(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23039 )
Change subject: Fix the documentation and DOS port
......................................................................
Patch Set 6:
Build Successful
https://qa.coreboot.org/job/flashrom-customrules/1003/ : SUCCESS
--
To view, visit https://review.coreboot.org/23039
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I909c5635aec5076440d2fde73d943f8ad10b8051
Gerrit-Change-Number: 23039
Gerrit-PatchSet: 6
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Rudolf Marek <r.marek(a)assembler.cz>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 06 Jan 2018 22:39:08 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/23039 )
Change subject: Fix the documentation and DOS port
......................................................................
Fix the documentation and DOS port
Update the DOS cross-compile documentation,
and workaround issue with valloc() with the
latest DJGPP.
Change-Id: I909c5635aec5076440d2fde73d943f8ad10b8051
Signed-off-by: Rudolf Marek <r.marek(a)assembler.cz>
Reviewed-on: https://review.coreboot.org/23039
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M README
M physmap.c
2 files changed, 53 insertions(+), 26 deletions(-)
Approvals:
Nico Huber: Looks good to me, approved
build bot (Jenkins): Verified
diff --git a/README b/README
index 449103d..b5ed946 100644
--- a/README
+++ b/README
@@ -97,27 +97,43 @@
Get packages of the DJGPP cross compiler and install them:
djgpp-filesystem djgpp-gcc djgpp-cpp djgpp-runtime djgpp-binutils
As an alternative, the DJGPP web site offers packages for download as well:
- djcross-binutils-2.19.1-10ap.i386.rpm
- djcross-gcc-4.3.2-8ap.i686.rpm
- djcrx-2.04pre_20090725-13ap.i386.rpm
+ djcross-binutils-2.29.1-1ap.x86_64.rpm
+ djcross-gcc-7.2.0-1ap.x86_64.rpm
+ djcrx-2.05-5.x86_64.rpm
The cross toolchain packages for your distribution may have slightly different
names (look for packages named *djgpp*).
- You will need the following library source trees containing their compiled
- static libraries either in the parent directory of the flashrom source or
- specify the base folder on compile time with the LIBS_BASE parameter.
- The default as described above is equal to calling
- 'make djgpp-dos LIBS_BASE=..'
+ Alternatively, you could use a script to build it from scratch:
+ https://github.com/andrewwutw/build-djgpp
- To get and build said libraries...
- Download pciutils 3.1.5 and apply http://flashrom.org/File:Pciutils.patch.gz
- Compile pciutils, see README.DJGPP for instructions.
- Download and compile http://flashrom.org/File:Libgetopt.tar.gz
+ You will need the libpci and libgetopt library source trees and
+ their compiled static libraries and header files installed in some
+ directory say libpci-libgetopt/, which will be later specified with
+ LIBS_BASE parameter during flashrom compilation. Easiest way to
+ handle it is to put pciutils, libgetopt and flashrom directories
+ in one subdirectory. There will be an extra subdirectory libpci-libgetopt
+ created, which will contain compiled libpci and libgetopt.
+
+ Download pciutils 3.5.6 and apply http://flashrom.org/File:Pciutils-3.5.6.patch.gz
+ Compile pciutils, using following command line:
+
+ make ZLIB=no DNS=no HOST=i386-djgpp-djgpp CROSS_COMPILE=i586-pc-msdosdjgpp- \
+ PREFIX=/ DESTDIR=$PWD/../libpci-libgetopt \
+ STRIP="--strip-program=i586-pc-msdosdjgpp-strip -s" install install-lib
+
+ Download and compile with 'make' http://flashrom.org/File:Libgetopt.tar.gz
+
+ Copy the libgetopt.a to ../libpci-libgetopt/lib and
+ getopt.h to ../libpci-libgetopt/include
+
Enter the flashrom directory.
- Run either (change settings where appropriate)
- make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
- or (above settings hardcoded)
- make djgpp-dos
+
+ make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip LIBS_BASE=../libpci-libgetopt/ strip
+
+ If you like, you can compress the resulting executable with UPX:
+
+ upx -9 flashrom.exe
+
To run flashrom.exe, download http://flashrom.org/File:Csdpmi7b.zip and
unpack CWSDPMI.EXE into the current directory or one in PATH.
diff --git a/physmap.c b/physmap.c
index a261ccd..3338b62 100644
--- a/physmap.c
+++ b/physmap.c
@@ -38,29 +38,40 @@
#ifdef __DJGPP__
#include <dpmi.h>
+#include <malloc.h>
#include <sys/nearptr.h>
+#define ONE_MEGABYTE (1024 * 1024)
#define MEM_DEV "dpmi"
-static void *realmem_map;
+static void *realmem_map_aligned;
static void *map_first_meg(uintptr_t phys_addr, size_t len)
{
- if (realmem_map)
- return realmem_map + phys_addr;
+ void *realmem_map;
+ size_t pagesize;
- realmem_map = valloc(1024 * 1024);
+ if (realmem_map_aligned)
+ return realmem_map_aligned + phys_addr;
+
+ /* valloc() from DJGPP 2.05 does not work properly */
+ pagesize = getpagesize();
+
+ realmem_map = malloc(ONE_MEGABYTE + pagesize);
if (!realmem_map)
return ERROR_PTR;
- if (__djgpp_map_physical_memory(realmem_map, (1024 * 1024), 0)) {
+ realmem_map_aligned = (void *)(((size_t) realmem_map +
+ (pagesize - 1)) & ~(pagesize - 1));
+
+ if (__djgpp_map_physical_memory(realmem_map_aligned, ONE_MEGABYTE, 0)) {
free(realmem_map);
- realmem_map = NULL;
+ realmem_map_aligned = NULL;
return ERROR_PTR;
}
- return realmem_map + phys_addr;
+ return realmem_map_aligned + phys_addr;
}
static void *sys_physmap(uintptr_t phys_addr, size_t len)
@@ -72,7 +83,7 @@
if (!__djgpp_nearptr_enable())
return ERROR_PTR;
- if ((phys_addr + len - 1) < (1024 * 1024)) {
+ if ((phys_addr + len - 1) < ONE_MEGABYTE) {
/* We need to use another method to map first 1MB. */
return map_first_meg(phys_addr, len);
}
@@ -97,8 +108,8 @@
/* There is no known way to unmap the first 1 MB. The DPMI server will
* do this for us on exit.
*/
- if ((virt_addr >= realmem_map) &&
- ((virt_addr + len) <= (realmem_map + (1024 * 1024)))) {
+ if ((virt_addr >= realmem_map_aligned) &&
+ ((virt_addr + len) <= (realmem_map_aligned + ONE_MEGABYTE))) {
return;
}
--
To view, visit https://review.coreboot.org/23039
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I909c5635aec5076440d2fde73d943f8ad10b8051
Gerrit-Change-Number: 23039
Gerrit-PatchSet: 6
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Rudolf Marek <r.marek(a)assembler.cz>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23039 )
Change subject: Fix the documentation and DOS port
......................................................................
Patch Set 5: Verified+1
Build Successful
https://qa.coreboot.org/job/flashrom-customrules/1002/ : SUCCESS
--
To view, visit https://review.coreboot.org/23039
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I909c5635aec5076440d2fde73d943f8ad10b8051
Gerrit-Change-Number: 23039
Gerrit-PatchSet: 5
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Rudolf Marek <r.marek(a)assembler.cz>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 06 Jan 2018 22:36:49 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes