Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BIOS: disable splash screen and console to prevent unnecessary screen…

… flickering

The BIOS now disables the video output completely unless one of the following conditions is met:
* Boot in rescue mode
* Boot failure
* Boot aborted by user
* Power button pressed for more than 1 second (approx.)
  • Loading branch information...
commit 00eea7cd4bfd2a9c4b1d96f2558e611272cbf37c 1 parent e39899e
@sbourdeauducq sbourdeauducq authored
View
2  software/bios/boot.c
@@ -46,7 +46,7 @@ extern void boot_helper(unsigned int r1, unsigned int r2, unsigned int r3, unsig
static void __attribute__((noreturn)) boot(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int r4, unsigned int addr)
{
- vga_disable();
+ vga_blank();
uart_force_sync(1);
irq_setmask(0);
irq_enable(0);
View
3  software/bios/main.c
@@ -602,7 +602,7 @@ int main(int i, char **c)
irq_setmask(0);
irq_enable(1);
uart_init();
- vga_init();
+ vga_init(!(rescue || (CSR_GPIO_IN & GPIO_BTN2)));
putsnonl(banner);
crcbios();
brd_init();
@@ -616,6 +616,7 @@ int main(int i, char **c)
splash_display();
print_mac();
boot_sequence();
+ vga_unblank();
vga_set_console(1);
while(1) {
putsnonl("\e[1mBIOS>\e[0m ");
View
4 software/demo/main.c
@@ -1,6 +1,6 @@
/*
* Milkymist VJ SoC (Software)
- * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
+ * Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -65,7 +65,7 @@ int main()
irq_setmask(0);
irq_enable(1);
uart_init();
- vga_init();
+ vga_init(0);
vga_set_console(1);
banner();
brd_init();
View
8 software/include/hal/vga.h
@@ -1,6 +1,6 @@
/*
* Milkymist VJ SoC (Software)
- * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
+ * Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
extern int vga_hres;
extern int vga_vres;
+extern int vga_blanked;
extern unsigned short int *vga_frontbuffer;
extern unsigned short int *vga_backbuffer;
extern unsigned short int *vga_lastbuffer;
@@ -30,8 +31,9 @@ enum {
VGA_MODE_1024_768
};
-void vga_init();
-void vga_disable();
+void vga_init(int blanked);
+void vga_blank();
+void vga_unblank();
void vga_swap_buffers();
void vga_set_console(int console);
int vga_get_console();
View
27 software/libhal/vga.c
@@ -1,6 +1,6 @@
/*
* Milkymist VJ SoC (Software)
- * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
+ * Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,6 +38,7 @@ static unsigned short int framebufferA[1024*768] __attribute__((aligned(32)));
static unsigned short int framebufferB[1024*768] __attribute__((aligned(32)));
static unsigned short int framebufferC[1024*768] __attribute__((aligned(32)));
+int vga_blanked;
int vga_hres;
int vga_vres;
@@ -55,8 +56,10 @@ static int console_mode;
static void write_hook(char c);
-void vga_init()
+void vga_init(int blanked)
{
+ vga_blanked = blanked;
+
vga_frontbuffer = framebufferA;
vga_backbuffer = framebufferB;
vga_lastbuffer = framebufferC;
@@ -75,16 +78,27 @@ void vga_init()
console_set_write_hook(write_hook);
}
-void vga_disable()
+void vga_blank()
{
- CSR_VGA_RESET = VGA_RESET;
+ if(!vga_blanked) {
+ CSR_VGA_RESET = VGA_RESET;
+ vga_blanked = 1;
+ }
+}
+
+void vga_unblank()
+{
+ if(vga_blanked) {
+ CSR_VGA_RESET = 0;
+ vga_blanked = 0;
+ }
}
void vga_swap_buffers()
{
unsigned short int *p;
- if(!console_mode) {
+ if(!console_mode && !vga_blanked) {
/*
* Make sure last buffer swap has been executed.
*/
@@ -302,7 +316,8 @@ void vga_set_mode(int mode)
text_line_len = vga_hres/8;
CSR_VGA_BURST_COUNT = vga_hres*vga_vres/16;
printf("VGA: mode set to %dx%d\n", vga_hres, vga_vres);
- CSR_VGA_RESET = 0;
+ if(!vga_blanked)
+ CSR_VGA_RESET = 0;
}
extern const unsigned char fontdata_8x16[];
Please sign in to comment.
Something went wrong with that request. Please try again.