[SeaBIOS] Re: [PATCH v2] csm: Fix boot priority translation
On 20.06.19 14:07, David Woodhouse wrote: For CSM, the highest priority for a boot entry is zero. SeaBIOS doesn't use zero, and the highest priority is 1. Make the results of csm_bootprio_*() conform to that convention. Also explicitly handle the BBS_DO_NOT_BOOT_FROM and BBS_IGNORE_ENTRY values. Signed-off-by: David Woodhouse --- v2: No code change, just correct the commit message. src/fw/csm.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/fw/csm.c b/src/fw/csm.c index 3fcc252..7663d31 100644 --- a/src/fw/csm.c +++ b/src/fw/csm.c @@ -319,6 +319,20 @@ handle_csm(struct bregs *regs) csm_return(regs); } +static int csm_prio_to_seabios(u16 csm_prio) +{ +switch (csm_prio) { +case BBS_DO_NOT_BOOT_FROM: +case BBS_IGNORE_ENTRY: +return -1; + +case BBS_LOWEST_PRIORITY: +case BBS_UNPRIORITIZED_ENTRY: +default: +return csm_prio + 1; Can you please add an inline comment for this to explain why exactly the + 1 is needed? It's non-obvious enough that the git log is too far as information source. Alex ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH v3] csm: Fix boot priority translation
On Fri, Jun 28, 2019 at 02:57:47PM +0100, David Woodhouse wrote: > Explicitly handle the BBS_DO_NOT_BOOT_FROM and BBS_IGNORE_ENTRY values. > > Also add one to the other priority values, as find_prio() does for > entries from bootorder. SeaBIOS uses zero for an item explicitly > selected in interactive_bootmenu(). Thanks, I committed this change. -Kevin ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] [PATCH] Specify Python version
Change Python version to 3 because /usr/bin/python is removed in Ubuntu 19.04 and python3 is already used in older Linux distros. I tested in coreboot and it still works. Signed-off-by: Eloy Degen --- Makefile | 17 - scripts/acpi_extract.py| 2 +- scripts/acpi_extract_preprocess.py | 2 +- scripts/buildrom.py| 2 +- scripts/buildversion.py| 2 +- scripts/checkrom.py| 2 +- scripts/checkstack.py | 2 +- scripts/checksum.py| 2 +- scripts/encodeint.py | 2 +- scripts/layoutrom.py | 2 +- scripts/readserial.py | 2 +- scripts/transdump.py | 2 +- scripts/vgafixup.py| 2 +- 13 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index d2d11db..a0c2f2f 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,6 @@ LD=$(CROSS_PREFIX)ld OBJCOPY=$(CROSS_PREFIX)objcopy OBJDUMP=$(CROSS_PREFIX)objdump STRIP=$(CROSS_PREFIX)strip -PYTHON=python CPP=cpp IASL:=iasl LD32BIT_FLAG:=-melf_i386 @@ -160,14 +159,14 @@ $(OUT)romlayout.o: src/romlayout.S $(OUT)autoconf.h $(OUT)asm-offsets.h $(OUT)romlayout16.lds: $(OUT)ccode32flat.o $(OUT)code32seg.o $(OUT)ccode16.o $(OUT)romlayout.o src/version.c scripts/layoutrom.py scripts/buildversion.py @echo " Building ld scripts" -$(Q)$(PYTHON) ./scripts/buildversion.py -e "$(EXTRAVERSION)" -t "$(CC);$(AS);$(LD);$(OBJCOPY);$(OBJDUMP);$(STRIP)" $(OUT)autoversion.h +$(Q) ./scripts/buildversion.py -e "$(EXTRAVERSION)" -t "$(CC);$(AS);$(LD);$(OBJCOPY);$(OBJDUMP);$(STRIP)" $(OUT)autoversion.h $(Q)$(CC) $(CFLAGS32FLAT) -c src/version.c -o $(OUT)version.o $(Q)$(LD) $(LD32BIT_FLAG) -r $(OUT)ccode32flat.o $(OUT)version.o -o $(OUT)code32flat.o $(Q)$(LD) $(LD32BIT_FLAG) -r $(OUT)ccode16.o $(OUT)romlayout.o -o $(OUT)code16.o $(Q)$(OBJDUMP) -thr $(OUT)code32flat.o > $(OUT)code32flat.o.objdump $(Q)$(OBJDUMP) -thr $(OUT)code32seg.o > $(OUT)code32seg.o.objdump $(Q)$(OBJDUMP) -thr $(OUT)code16.o > $(OUT)code16.o.objdump -$(Q)$(PYTHON) ./scripts/layoutrom.py $(OUT)code16.o.objdump $(OUT)code32seg.o.objdump $(OUT)code32flat.o.objdump $(OUT)$(KCONFIG_AUTOHEADER) $(OUT)romlayout16.lds $(OUT)romlayout32seg.lds $(OUT)romlayout32flat.lds +$(Q) ./scripts/layoutrom.py $(OUT)code16.o.objdump $(OUT)code32seg.o.objdump $(OUT)code32flat.o.objdump $(OUT)$(KCONFIG_AUTOHEADER) $(OUT)romlayout16.lds $(OUT)romlayout32seg.lds $(OUT)romlayout32flat.lds # These are actually built by scripts/layoutrom.py above, but by pulling them # into an extra rule we prevent make -j from spawning layoutrom.py 4 times. @@ -190,7 +189,7 @@ $(OUT)bios.bin.prep: $(OUT)rom.o scripts/checkrom.py $(Q)rm -f $(OUT)bios.bin $(OUT)Csm16.bin $(OUT)bios.bin.elf $(Q)$(OBJDUMP) -thr $< > $<.objdump $(Q)$(OBJCOPY) -O binary $< $(OUT)bios.bin.raw -$(Q)$(PYTHON) ./scripts/checkrom.py $<.objdump $(CONFIG_ROM_SIZE) $(OUT)bios.bin.raw $(OUT)bios.bin.prep +$(Q) ./scripts/checkrom.py $<.objdump $(CONFIG_ROM_SIZE) $(OUT)bios.bin.raw $(OUT)bios.bin.prep $(OUT)bios.bin: $(OUT)bios.bin.prep @echo " Creating $@" @@ -220,7 +219,7 @@ $(OUT)vgaccode16.raw.s: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRCVGA)) ; $(OUT)vgaccode16.o: $(OUT)vgaccode16.raw.s scripts/vgafixup.py @echo " Fixup VGA rom assembler" -$(Q)$(PYTHON) ./scripts/vgafixup.py $< $(OUT)vgaccode16.s +$(Q) ./scripts/vgafixup.py $< $(OUT)vgaccode16.s $(Q)$(AS) --32 src/code16gcc.s $(OUT)vgaccode16.s -o $@ else $(OUT)vgaccode16.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRCVGA)) ; $(call whole-compile, $(CFLAGS16) -Isrc, $(SRCVGA),$@) @@ -232,7 +231,7 @@ $(OUT)vgaentry.o: vgasrc/vgaentry.S $(OUT)autoconf.h $(OUT)asm-offsets.h $(OUT)vgarom.o: $(OUT)vgaccode16.o $(OUT)vgaentry.o $(OUT)vgasrc/vgalayout.lds vgasrc/vgaversion.c scripts/buildversion.py @echo " Linking $@" -$(Q)$(PYTHON) ./scripts/buildversion.py -e "$(EXTRAVERSION)" -t "$(CC);$(AS);$(LD);$(OBJCOPY);$(OBJDUMP);$(STRIP)" $(OUT)autovgaversion.h +$(Q) ./scripts/buildversion.py -e "$(EXTRAVERSION)" -t "$(CC);$(AS);$(LD);$(OBJCOPY);$(OBJDUMP);$(STRIP)" $(OUT)autovgaversion.h $(Q)$(CC) $(CFLAGS16) -c vgasrc/vgaversion.c -o $(OUT)vgaversion.o $(Q)$(LD) --gc-sections -T $(OUT)vgasrc/vgalayout.lds $(OUT)vgaccode16.o $(OUT)vgaentry.o $(OUT)vgaversion.o -o $@ @@ -242,7 +241,7 @@ $(OUT)vgabios.bin.raw: $(OUT)vgarom.o $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw scripts/buildrom.py @echo " Finalizing rom $@" -$(Q)$(PYTHON) ./scripts/buildrom.py $< $@ +$(Q) ./scripts/buildrom.py $< $@ DSDT build rules @@ -253,9 +252,9 @@ iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \ %.hex: %.dsl ./scripts/acpi_extract_preprocess.py ./scripts/acpi_extract.py @echo " Compiling IASL $@" $(Q)$(CPP) $(CPPFLAGS) $< -o $(OUT)$*.dsl.i.orig -
[SeaBIOS] [PATCH v3] csm: Fix boot priority translation
Explicitly handle the BBS_DO_NOT_BOOT_FROM and BBS_IGNORE_ENTRY values. Also add one to the other priority values, as find_prio() does for entries from bootorder. SeaBIOS uses zero for an item explicitly selected in interactive_bootmenu(). Signed-off-by: David Woodhouse --- v2: No code change, just correct the commit message. v3: Add comment in code as requested by agraf, update commit message more. src/fw/csm.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/fw/csm.c b/src/fw/csm.c index 3fcc252..8359bcb 100644 --- a/src/fw/csm.c +++ b/src/fw/csm.c @@ -319,6 +319,23 @@ handle_csm(struct bregs *regs) csm_return(regs); } +static int csm_prio_to_seabios(u16 csm_prio) +{ +switch (csm_prio) { +case BBS_DO_NOT_BOOT_FROM: +case BBS_IGNORE_ENTRY: +return -1; + +case BBS_LOWEST_PRIORITY: +case BBS_UNPRIORITIZED_ENTRY: +default: +// SeaBIOS default priorities start at 1, with 0 being used for +// an item explicitly selected from interactive_bootmenu(). +// As in find_prio(), add 1 to the value being returned. +return csm_prio + 1; +} +} + int csm_bootprio_ata(struct pci_device *pci, int chanid, int slave) { if (!csm_boot_table) @@ -327,7 +344,7 @@ int csm_bootprio_ata(struct pci_device *pci, int chanid, int slave) int index = 1 + (chanid * 2) + slave; dprintf(3, "CSM bootprio for ATA%d,%d (index %d) is %d\n", chanid, slave, index, bbs[index].BootPriority); -return bbs[index].BootPriority; +return csm_prio_to_seabios(bbs[index].BootPriority); } int csm_bootprio_fdc(struct pci_device *pci, int port, int fdid) @@ -336,7 +353,7 @@ int csm_bootprio_fdc(struct pci_device *pci, int port, int fdid) return -1; BBS_TABLE *bbs = (void *)csm_boot_table->BbsTable; dprintf(3, "CSM bootprio for FDC is %d\n", bbs[0].BootPriority); -return bbs[0].BootPriority; +return csm_prio_to_seabios(bbs[0].BootPriority); } int csm_bootprio_pci(struct pci_device *pci) @@ -350,7 +367,7 @@ int csm_bootprio_pci(struct pci_device *pci) if (pci->bdf == pci_to_bdf(bbs[i].Bus, bbs[i].Device, bbs[i].Function)) { dprintf(3, "CSM bootprio for PCI(%d,%d,%d) is %d\n", bbs[i].Bus, bbs[i].Device, bbs[i].Function, bbs[i].BootPriority); -return bbs[i].BootPriority; +return csm_prio_to_seabios(bbs[i].BootPriority); } } return -1; smime.p7s Description: S/MIME cryptographic signature ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH 1/5] ati-vga: make less verbose
On Mon, Jun 24, 2019 at 08:52:27AM -0400, Kevin O'Connor wrote: > On Mon, Jun 24, 2019 at 02:44:00PM +0200, Gerd Hoffmann wrote: > > Reduce loglevel for mode line removals from 1 to 3. > > > > Signed-off-by: Gerd Hoffmann > > Thanks. I don't know enough about the ati code to provide much > feedback, but for what it's worth, the series looks fine to me. Pushed to master. cheers, Gerd ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org