Author: mcayland Date: Sat Jul 27 12:14:53 2013 New Revision: 1185 URL: http://tracker.coreboot.org/trac/openbios/changeset/1185
Log: sbus.c: fix TCX24 initialisation
Even though we boot in 24-bit enabled mode, OpenBIOS only uses the 8-bit framebuffer. Hence we need to override the depth/linebytes obtained from QEMU to force the graphics subsystem into 8-bit mode, which was what seems to have been happening before this patch series.
Note: it seems strange that we have to update the package linebytes property too, however Debian etch freezes if we don't set it to match the 8-bit framebuffer even though it correctly switches to 24-bit mode.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/drivers/sbus.c
Modified: trunk/openbios-devel/drivers/sbus.c ============================================================================== --- trunk/openbios-devel/drivers/sbus.c Sat Jul 27 12:14:50 2013 (r1184) +++ trunk/openbios-devel/drivers/sbus.c Sat Jul 27 12:14:53 2013 (r1185) @@ -17,6 +17,7 @@ #include "libc/vsprintf.h" #include "drivers/drivers.h" #include "libopenbios/ofmem.h" +#include "libopenbios/video.h"
#define SBUS_REGS 0x28 #define SBUS_SLOTS 16 @@ -329,6 +330,17 @@ fword("property"); }
+ /* Even with a 24-bit enabled TCX card, the control plane is + used in 8-bit mode. So force the video subsystem into 8-bit + mode before initialisation. */ + if (graphic_depth == 24) { + VIDEO_DICT_VALUE(video.depth) = 8; + VIDEO_DICT_VALUE(video.rb) = VIDEO_DICT_VALUE(video.w); + + chosen = get_cur_dev(); + set_int_property(chosen, "linebytes", VIDEO_DICT_VALUE(video.rb)); + } + bind_func("hw-set-color", tcx_hw_set_color); feval("['] qemu-tcx-driver-init is-install");