Recent Raspberry Pi firmware acts on the pixel order requested through
the mailbox, which older firmware ignored. The order that ends up in
the framebuffer is the requested one combined with framebuffer_swap in
config.txt: when they are the same the red component is in bits 0-7 of
a 32 bpp pixel, when they differ it is in bits 16-23. framebuffer_swap
defaults to on and the firmware reports it as bcm2708_fb.fbswap=1 in
the bootargs.
U-Boot always requests RGB, so with the default config.txt the pixels
have red in bits 0-7. The driver however always configured vt(4) with
red in bits 16-23 for 32 bpp, so red and blue were swapped on the
console.
The firmware does not report the resulting order, only the requested
one, so read the pixel order with GET_PIXEL_ORDER and combine it with
fbswap. If the pixel order cannot be read the previous behavior is
kept. The 24 bpp case is unchanged.
Print the pixel order in the attach message.
Tested on: Raspberry Pi 4 Model B Rev 1.4 (U-Boot 2026.10, firmware
of 2026-05-21, 32 bpp), with the default config.txt and with framebuffer_swap=0