Showing with 33 additions and 6 deletions.
  1. +6 −1 CHANGELOG.md
  2. +1 −1 Makefile
  3. +9 −4 README.md
  4. +17 −0 sortbootorder.c
7 changes: 6 additions & 1 deletion CHANGELOG.md
Expand Up @@ -7,6 +7,10 @@ Releases 4.5.x and 4.6.x are based on mainline support submitted in
[this gerrit ref](https://review.coreboot.org/#/c/14138/).

## [Unreleased]
## [v4.6.18] - 2020-04-26
### Added
- PCI Express power management features runtime configuration

## [v4.6.17] - 2020-01-28
### Changed
- disabled PS2 keyboard and mouse by default, not supported on apu platforms
Expand Down Expand Up @@ -184,7 +188,8 @@ initial commit based on [coreboot_140908](http://pcengines.ch/tmp/coreboot_14090
### Fixed
- used proper way to access extended SPI registers

[Unreleased]: https://github.com/pcengines/sortbootorder/compare/v4.6.17...master
[Unreleased]: https://github.com/pcengines/sortbootorder/compare/v4.6.18...master
[v4.6.18]: https://github.com/pcengines/sortbootorder/compare/v4.6.17...v4.6.18
[v4.6.17]: https://github.com/pcengines/sortbootorder/compare/v4.6.16...v4.6.17
[v4.6.16]: https://github.com/pcengines/sortbootorder/compare/v4.6.15...v4.6.16
[v4.6.15]: https://github.com/pcengines/sortbootorder/compare/v4.6.14...v4.6.15
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -95,7 +95,7 @@ endif
real-all: version $(TARGET)

version:
sed -e "s/@version@/\"$(VERSION)\"/" version.h.in > version.h
sed -e "s/@version@/\"$(lastword $(subst /, ,$(VERSION)))\"/" version.h.in > version.h

$(TARGET): $(OBJS) libpayload $(DIRS)
printf " LPCC $(subst $(CURDIR)/,,$(@)) (LINK)\n"
Expand Down
13 changes: 9 additions & 4 deletions README.md
Expand Up @@ -6,8 +6,6 @@ saves boot order in flash.

## Contents

<!-- TOC -->

- [Sortbootorder](#sortbootorder)
- [Contents](#contents)
- [Theory of operation](#theory-of-operation)
Expand All @@ -19,13 +17,13 @@ saves boot order in flash.
- [BIOS WP option](#bios-wp-option)
- [Hidden security registers menu](#hidden-security-registers-menu)
- [Example](#example)
- [Hidden flash lockdown menu](#hidden-flash-lockdown-menu)
- [Example](#example-1)
- [Building](#building)
- [Manual build](#manual-build)
- [Adding sortbootorder to coreboot.rom file](#adding-sortbootorder-to-corebootrom-file)
- [Recent automated building process](#recent-automated-building-process)

<!-- /TOC -->

## Theory of operation

### Example menu view
Expand All @@ -52,6 +50,7 @@ saves boot order in flash.
h EHCI0 controller - Currently Disabled
l Core Performance Boost - Currently Enabled
v IOMMU - Currently Disabled
u PCIe power management features - Currently Disabled
w Enable BIOS write protect - Currently Disabled
x Exit setup without save
s Save configuration and exit
Expand Down Expand Up @@ -92,6 +91,11 @@ key.
* `j SD 3.0 mode` - enable SD controller in 3.0 mode to allow achieving full
speeds with UHS-I SD cards
* `v IOMMU` - enables/disables input–output memory management unit
* `u PCIe power management features` - enables/disables PCI Express power
management features like: ASPM, Common Clock, Clock Power Management (if
supported by PCI Express endpoints). **Enabling this option will reduce the**
**power consumption at the cost of performance drop of Ethenet controllers**
**and WiFi cards**
* `w Enable BIOS write protect` - enables/disables BIOS WP functionality. For
details, see descritption in [BIOS WP option](#bios-wp-option).
* `x Exit setup without save` - exits setup menu without saving the settings
Expand Down Expand Up @@ -174,6 +178,7 @@ file is used to match device letter and description with corresponding node from
Watchdog - Disabled
SD 3.0 mode - Disabled
IOMMU - Disabled
PCIe power management features - Disabled
Redirect console output to COM2 - Disabled
BIOS write protect - Disabled
```
Expand Down
17 changes: 17 additions & 0 deletions sortbootorder.c
Expand Up @@ -95,6 +95,7 @@ static u8 boost_toggle;
static u8 sd3_toggle;
#ifndef COREBOOT_LEGACY
static u8 iommu_toggle;
static u8 pciepm_toggle;
#endif
static u16 wdg_timeout;
#endif
Expand Down Expand Up @@ -221,6 +222,10 @@ int main(void) {
token = strstr(bootorder_data, "iommu");
token += strlen("iommu");
iommu_toggle = token ? strtoul(token, NULL, 10) : 0;

token = strstr(bootorder_data, "pciepm");
token += strlen("pciepm");
pciepm_toggle = token ? strtoul(token, NULL, 10) : 0;
#endif
token = strstr(bootorder_data, "watchdog");
token += strlen("watchdog");
Expand Down Expand Up @@ -311,6 +316,10 @@ int main(void) {
case 'V':
iommu_toggle ^= 0x1;
break;
case 'y':
case 'Y':
pciepm_toggle ^= 0x1;
break;
#endif
case 'Q':
handle_spi_lock_menu();
Expand Down Expand Up @@ -451,6 +460,8 @@ static void show_boot_device_list(char buffer[MAX_DEVICES][MAX_LENGTH],
#ifndef COREBOOT_LEGACY
printf(" v IOMMU - Currently %s\n",
(iommu_toggle) ? "Enabled" : "Disabled");
printf(" y PCIe power management features - Currently %s\n",
(pciepm_toggle) ? "Enabled" : "Disabled");
#endif
#endif
printf(" w Enable BIOS write protect - Currently %s\n",
Expand Down Expand Up @@ -626,6 +637,7 @@ static void update_tags(char bootlist[MAX_DEVICES][MAX_LENGTH], u8 *max_lines)
update_tag_value(bootlist, max_lines, "sd3mode", sd3_toggle + '0');
#ifndef COREBOOT_LEGACY
update_tag_value(bootlist, max_lines, "iommu", iommu_toggle + '0');
update_tag_value(bootlist, max_lines, "pciepm", pciepm_toggle + '0');
#endif
update_wdg_timeout(bootlist, max_lines, wdg_timeout);
#endif
Expand Down Expand Up @@ -699,6 +711,11 @@ static void refresh_tag_values(u8 max_lines)
token += strlen("iommu");
iommu_toggle = strtoul(token, NULL, 10);
}
token = strstr(&(bootlist_def[i][0]), "pciepm");
if(token) {
token += strlen("pciepm");
pciepm_toggle = strtoul(token, NULL, 10);
}
#endif
token = strstr(&(bootlist_def[i][0]), "watchdog");
if(token) {
Expand Down