fbdev/arm: Export acorndata_8x8 font symbol for bootloader
Subsystems (3)
Helge Deller
maintainerPATCH 1/1 fbdev/arm: Export acorndata_8x8 font symbol for bootloader
The text display code used in the Risc PC kernel image decompression code uses arch/arm/boot/compressed/font.c, which includes lib/fonts/font_acorn_8x8.c, which further includes <linux/font.h>.
Since commit 97df8960240a ("lib/fonts: Provide helpers for calculating glyph pitch and size") <linux/font.h> contains inline functions that require __do_div64, which is not linked into the ARM kernel decompressor. This makes Risc PC zImages fail to build.
Resolve this issue by defining the BOOTLOADER symbol and use it to avoid a static declaration of the acorndata_8x8 symbol. That way it can be referenced by the arm bootloader, and other static math functions and symbols (like __do_div64) stay static and don't get unneccesary included in the ARM kernel bootloader decompressor object file.
--- arch/arm/boot/compressed/Makefile | 2 +- lib/fonts/font_acorn_8x8.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arm/boot/compressed/Makefile +1 -1
@@ -157,4 +157,4 @@ $(obj)/piggy_data: $(obj)/../Image FORCE $(obj)/piggy.o: $(obj)/piggy_data -CFLAGS_font.o := -Dstatic= +CFLAGS_font.o := -DBOOTLOADER
lib/fonts/font_acorn_8x8.c +5 -0
@@ -5,7 +5,12 @@#define FONTDATAMAX 2048 +#ifdef BOOTLOADER +/* The acorndata_8x8 symbol is needed by the ARM bootloader too. */ +const struct font_data acorndata_8x8 = { +#else static const struct font_data acorndata_8x8 = { +#endif { 0, 0, FONTDATAMAX, 0 }, { /* 00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */ /* 01 */ 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, /* ^A */
Signature · 1 line
2.54.0
Russell King (Oracle)
maintainerQuoted 9 lines · Helge Deller
The text display code used in the Risc PC kernel image decompression code uses
arch/arm/boot/compressed/font.c, which includeslib/fonts/font_acorn_8x8.c, which further includes <linux/font.h>.Since commit
97df8960240a("lib/fonts: Provide helpers for calculating glyph pitch and size") <linux/font.h> contains inline functions that require__do_div64, which is not linked into the ARM kernel decompressor. This makes Risc PC zImages fail to build.
Quoted 5 lines
Resolve this issue by defining the BOOTLOADER symbol and use it to avoid a static declaration of the
acorndata_8x8symbol. That way it can be referenced by the arm bootloader, and other static math functions and symbols (like__do_div64) stay static and don't get unneccesary included in the ARM kernel bootloader decompressor object file.
The decompressor font support has actually been broken since:
commit 6735b4632def0640dbdf4eb9f99816aca18c4f16
Author: Peilin Ye <[email protected]> Date: Thu Sep 24 09:42:22 2020 -0400
Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts
which added extra data to the beginning of the array of font information:
ENTRY(ll_write_char)
stmfd sp!, {r4 - r7, lr}
...
/*
* calculate offset into character table
*/
mov r1, r1, lsl #3r1 is the character, this multiplies the character value by 8.
adr ip, LC0
ldmia ip, {r3, r4, r5, r6, lr}
sub ip, ip, r3
add r6, r6, ipin conjunction with the data table:
LC0: .word LC0
.word bytes_per_char_h
.word video_size_row
.word acorndata_8x8
.word con_charconvtableresults in r6 pointing at acorndata_8x8. We then index this using the modified character value above:
orr r1, r1, #7
ldrb r7, [r6, r1]This breaks if extra data is added to the start, and thus has been broken since the above commit.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!