summaryrefslogtreecommitdiff
path: root/util
AgeCommit message (Collapse)Author
6 daysutil/nvmutil: Update AUTHORS and COPYING filesLeah Rowe
Mention Riku's copyright in the COPYING file, and update my years in that file. Add Riku to the AUTHORS file. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Describe nvmutil in help outputLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Remove the correct binary on uninstallLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/spkmodem-recv: More correct MakefileLeah Rowe
Set up the DESTDIR variable properly. Otherwise, this is just style changes. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Honour the INSTALL variableLeah Rowe
Don't assume "install" is the correct command. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Don't clean when doing uninstallLeah Rowe
The user might wish to uninstall, but not remove the build that they just did. The user can still do make clean if they wish. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Proper DESTDIR/PREFIX handlingLeah Rowe
DESTDIR is the root directory where it goes, which is normally an empty string; PREFIX is where the bin directory is located, relative to DESTDIR Default to /usr/local for PREFIX, not /usr, because /usr/bin is for system utilities. nvmutil is a local utility. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Set CC and CFLAGS only if unsetLeah Rowe
We don't want to clobber anything that the user set themselves. Instead, we should respect the user's choice. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Capitalise BABALeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Add uninstall to MakefileLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Add distclean to MakefileLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: Make the GbE checksum a defineLeah Rowe
This makes the code easier to understand. All 2-byte words, stored in little endian order within the 128-byte GbE NVM area, must add up to 0xBABA. If it doesn't, then software is supposed to reject that GbE config. The nvmutil software works on that basis. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: nicer hexdump displayLeah Rowe
make it look like hexdump -C, where individual bytes are spaced, and there is an additional space after 8 bytes, per row. i won't bother with a character display, since that is meaningless on gbe nvm words. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysutil/nvmutil: show the correct hexdump orderLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysutil/nvmutil: Obey the 79-character per line limitLeah Rowe
Must not exceed 79 lines. Some variables and functions have been renamed, and there has been some minor re-factoring. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysutil/nvmutil: Tidy up copyright headerLeah Rowe
I don't like using SPDX for actual copyright declarations. I only want it to be used for the license identifier. Also: I made a *single* change to nvmutil.c in 2024, which means that I have copyright in all years since and including 2022; the file said 2022, 2023, 2025, but it's actually 2022-2025. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysutil/nvmutil: Fix another stragglerLeah Rowe
I don't like using strings this way, it looks unclean. Once again, use good old fashioned if/else. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysutil/nvmutil: Tidy up pledge callsLeah Rowe
I wasn't too happy using shorthand for strings like that. Tidy it up and use good old fashioned if/else. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-16remove util/autoportLeah Rowe
upstream has merged all of the changes that it contained, so we don't need this anymore. we'll have the newer upstream changes on the next general revision updates for coreboot, within config/coreboot/ Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-01dell-flash-unlock: Remove dependency on GNU MakeNicholas Chin
Use shell scripting in the recipe instead of GNU make's conditional syntax. This allows the Makefile to work with the default implementations of make on the BSDs. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-05-01dell-flash-unlock: Update README for BSDNicholas Chin
Add FreeBSD to the README as it is now supported. Make a note about using gmake instead of make as the makefile currently uses GNU extensions to determine build flags based on the OS. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-05-01dell_flash_unlock: Add support for FreeBSDNicholas Chin
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-05-01dell_flash_unlock: Set iopl level back to 0 when doneNicholas Chin
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-05-01dell_flash_unlock: Fix ec_set_fdo() signatureNicholas Chin
Set argument list as void. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-04-28dell-flash-unlock: Remove unnecessary includes for NetBSDNicholas Chin
The pio.h header, although present on NetBSD, is not necessary, as it only declares x86 port IO inx()/outx() functions which are not actually implemented. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-04-28dell-flash-unlock: Remove memory clobber from inline assemblyNicholas Chin
The x86 port IO instructions do not access memory so it is not needed in the clobber list. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-04-26Merge pull request 'dell-flash-unlock: add NetBSD support' (#194) from ↵Leah Rowe
linear/lbmk:master into master Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/194
2024-03-18util: Import autoport with Haswell patchesNicholas Chin
This is a copy of coreboot's autoport utility, with a patch applied to support Haswell/Lynx Point platforms. That patch is currently in review on coreboot's Gerrit. https://review.coreboot.org/c/coreboot/+/30890 Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-03-16dell-flash-unlock: add NetBSD supportlinear cannon
2024-01-27remove remaining flashrom remnants (use flashprog)Leah Rowe
we use flashprog now! Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-05README.md: Add Latitude E7270 as supportedNicholas Chin
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-01-05README.md: Add notes about iopl and AC adapter requirementNicholas Chin
In order for the EC to maintain the state of whether or not to set the flash descriptor override across a power cycle, the AC adapter must be connected, as the system leaves the voltage rail that the EC uses powered under this condition. Without this, the utility may fail, continually asking the user to power off and on. On Linux, CONFIG_X86_IOPL_IOPERM must be set for the kernel, or else the iopl call will error with "Function not implemented". Make a note of this in case a user runs into this issue. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-01-05README.md: List E6520, E5530, and M4800 as supportedNicholas Chin
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2023-12-17README.md: Add possibly not working systemsNicholas Chin
These systems have a report that the unlock utility does not work. Until there are multiple reports of failed unlocks and a technical determination of why it doesn't work, they will not be listed as explicitly unsupported.
2023-12-17README.md: Add E6500, E6420, and E6530 as supportedNicholas Chin
2023-12-17README.md: Add instructions for relaxing memory permissionsNicholas Chin
As this utility requires access to /dev/mem, the default protections of Linux and OpenBSD must be relaxed to allow this. Make a note of this in the instructions.
2023-12-17README.md: Add references to Open Security TrainingNicholas Chin
The old Open Security Training site had a course called Advanced x86: BIOS and SMM Internals, which had a set of slides outlining the method to supress SMIs by changing the GBL_SMI_EN bit. Add a reference to it as this is where I originally learned of this method.
2023-11-06nvmutil: print usageRiku Viitanen
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-11-06nvmutil: fix makefileRiku Viitanen
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-11-06nvmutil: make installRiku Viitanen
make install is nice to have. now respects$(PREFIX) as well. Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-10-17util/spkmodem-recv: detailed copyright historyLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12util/e6400-flash-unlock: Rename to dell-flash-unlockNicholas Chin
This more accurately describes the scope of the utility. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2023-10-12nvmutil: simplify endianness handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12nvmutil: don't reset errno before writeLeah Rowe
under the current logic, errno would be ECANCELED if neither checksum is valid, or I/O related if pwrite fails; alternatively, the for loop exits and the file has been written, where it is quite correctly reset already. ergo, the errno reset at the start of writeGbeFile is superfluous. remove this bloat. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12nvmutil: reset errno on successful writeLeah Rowe
previously, a bad checksum would have caused a non-zero exit, even if the other checksum was correct (observed when using the swap command) Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12nvmutil: simplify prototype declarationsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-09util/e6400-flash-unlock: Update to upstream versionNicholas Chin
This updates lbmk's copy of e6400-flash-unlock to commit c5567fece479 (README.md: Update with info about broader device support) in my upstream repo. Changes: - Theoretical support for any Dell system that implements that flash descriptor override command. This is done by reading base address registers at runtime instead of hard coding them for specific devices. Tested on the Latitude E6400 and Latitude E6430. - Support for OpenBSD. It compiles, runs, and behaves as expected, though I have not actually tested internally flashing with flashrom yet. It should work though, as the program checks if the descriptor override is set and the BIOS Write Enable is able to be set to 1, which is all that is needed to internal flash. - Integrated changes made in the lbmk copy - Moved operating system accessor implementations to their own file It should be fully functional, though minor formatting and cleanup changes are still planned. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2023-09-25util/: use SPDX license and copyright headersLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25Update email address for Leah Rowe copyrightsLeah Rowe
also, some of them were out of date; years now updated. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-19util/nvmutil: remove xorswap() macroLeah Rowe
it's only used once, so just do it once. Signed-off-by: Leah Rowe <leah@libreboot.org>