From e4560c4c7d1a4fa828d345c10dfb5e6fae7dc167 Mon Sep 17 00:00:00 2001 From: schulz Date: Wed, 30 Jan 2019 19:59:23 +0000 Subject: [PATCH] add video framebuffer git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@55584 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/armeb-raspi/boot/bc/font8x14.c | 267 ++++++++++++++++++++++++++++++++++ arch/armeb-raspi/boot/bc/screen_fb.c | 215 +++++++++++++++++++++++++++ arch/armeb-raspi/boot/bc/vars.c | 23 +++ arch/armeb-raspi/boot/include/vc_fb.h | 21 +++ arch/armeb-raspi/boot/mmakefile.src | 25 ++-- arch/armeb-raspi/boot/vc_fb.c | 165 +++++++++++++++++++++ arch/armeb-raspi/boot/vc_mb.c | 10 +- 7 files changed, 712 insertions(+), 14 deletions(-) create mode 100644 arch/armeb-raspi/boot/bc/font8x14.c create mode 100644 arch/armeb-raspi/boot/bc/screen_fb.c create mode 100644 arch/armeb-raspi/boot/bc/vars.c create mode 100644 arch/armeb-raspi/boot/include/vc_fb.h create mode 100644 arch/armeb-raspi/boot/vc_fb.c diff --git a/arch/armeb-raspi/boot/bc/font8x14.c b/arch/armeb-raspi/boot/bc/font8x14.c new file mode 100644 index 0000000000..501d968fff --- /dev/null +++ b/arch/armeb-raspi/boot/bc/font8x14.c @@ -0,0 +1,267 @@ +/* + Copyright © 1995-2014, The AROS Development Team. All rights reserved. + $Id$ +*/ + +const unsigned int fontWidth = 8; +const unsigned int fontHeight = 14; + +const unsigned char fontData[256][14] = +{ + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x7c,0x82,0xaa,0x82,0x82,0xba,0x92,0x82,0x7c,0x00,0x00,0x00}, + {0x00,0x00,0x7c,0xfe,0xd6,0xfe,0xfe,0xc6,0xee,0xfe,0x7c,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x38,0x7c,0x7c,0x38,0xfe,0xfe,0x7c,0x10,0x7c,0x00,0x00,0x00}, + {0x00,0x00,0x10,0x38,0x7c,0xfe,0xfe,0x7c,0x10,0x10,0x7c,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x30,0x78,0x78,0x30,0x00,0x00,0x00,0x00,0x00}, + {0xfe,0xfe,0xfe,0xfe,0xfe,0xee,0xc6,0x82,0xc6,0xc6,0xfe,0xfe,0xfe,0xfe}, + {0x00,0x00,0x00,0x00,0x78,0xcc,0x84,0x84,0xcc,0x78,0x00,0x00,0x00,0x00}, + {0xfe,0xfe,0xfe,0xfe,0xc6,0x92,0xba,0xba,0x92,0xc6,0xfe,0xfe,0xfe,0xfe}, + {0x00,0x00,0x3e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00}, + {0x00,0x00,0x78,0xcc,0xcc,0xcc,0x78,0x30,0xfc,0x30,0x30,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x24,0x3c,0x20,0x20,0x20,0x60,0xe0,0xc0,0x00,0x00,0x00}, + {0x00,0x00,0x3e,0x22,0x3e,0x22,0x22,0x22,0x2e,0xee,0xec,0x60,0x00,0x00}, + {0x00,0x00,0x10,0x10,0xd6,0x38,0xee,0x38,0xd6,0x10,0x10,0x00,0x00,0x00}, + {0x00,0x00,0x40,0x60,0x70,0x78,0x7e,0x78,0x70,0x60,0x40,0x00,0x00,0x00}, + {0x00,0x00,0x02,0x06,0x0e,0x1e,0x7e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00}, + {0x00,0x00,0x30,0x78,0xfc,0x30,0x30,0x30,0xfc,0x78,0x30,0x00,0x00,0x00}, + {0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00}, + {0x00,0x00,0x7e,0xf6,0xf6,0xf6,0x76,0x36,0x36,0x36,0x36,0x00,0x00,0x00}, + {0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x7e,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0x10,0x38,0x7c,0x38,0x38,0x38,0x7c,0x38,0x10,0x00,0x00,0x00}, + {0x00,0x10,0x38,0x7c,0x38,0x38,0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x7c,0x38,0x10,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x7e,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x28,0x6c,0xfe,0x6c,0x28,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x18,0x18,0x3c,0x3c,0x7e,0x7e,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x7e,0x7e,0x3c,0x3c,0x18,0x18,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x30,0x78,0x78,0x78,0x30,0x30,0x00,0x30,0x30,0x00,0x00,0x00}, + {0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x24,0x24,0x7e,0x24,0x24,0x24,0x7e,0x24,0x24,0x00,0x00,0x00}, + {0x18,0x18,0x3c,0x66,0x62,0x60,0x3c,0x06,0x42,0x66,0x3c,0x18,0x18,0x00}, + {0x00,0x00,0x00,0x00,0x62,0x66,0x0c,0x18,0x30,0x66,0x46,0x00,0x00,0x00}, + {0x00,0x00,0x38,0x6c,0x6c,0x38,0x3a,0x6e,0x6c,0x6e,0x3a,0x00,0x00,0x00}, + {0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x0c,0x18,0x30,0x30,0x30,0x30,0x30,0x18,0x0c,0x00,0x00,0x00}, + {0x00,0x00,0x30,0x18,0x0c,0x0c,0x0c,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x6c,0x38,0xfe,0x38,0x6c,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x10,0x10,0x10,0xfe,0x10,0x10,0x10,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x6e,0x6e,0x7e,0x76,0x76,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x06,0x06,0x0c,0x18,0x30,0x66,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x06,0x06,0x3c,0x06,0x06,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x0c,0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x0c,0x1e,0x00,0x00,0x00}, + {0x00,0x00,0x7e,0x60,0x60,0x60,0x7c,0x06,0x06,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x1c,0x30,0x60,0x60,0x7c,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x7e,0x66,0x06,0x0c,0x0c,0x18,0x18,0x18,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x66,0x66,0x3c,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x66,0x66,0x3e,0x06,0x06,0x0c,0x78,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00}, + {0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x66,0x06,0x0c,0x18,0x00,0x18,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x66,0x66,0x6e,0x6e,0x6e,0x60,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x18,0x3c,0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x00,0x00,0x00}, + {0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0xfc,0x00,0x00,0x00}, + {0x00,0x00,0x1c,0x36,0x62,0x60,0x60,0x60,0x62,0x36,0x1c,0x00,0x00,0x00}, + {0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00,0x00,0x00}, + {0x00,0x00,0x7e,0x32,0x30,0x34,0x3c,0x34,0x30,0x32,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0x7e,0x32,0x30,0x34,0x3c,0x34,0x30,0x30,0x78,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x76,0x60,0x60,0x60,0x6e,0x66,0x76,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x66,0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x66,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0x78,0x00,0x00,0x00}, + {0x00,0x00,0xe6,0x66,0x6c,0x6c,0x78,0x6c,0x6c,0x66,0xe6,0x00,0x00,0x00}, + {0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0xc6,0xee,0xfe,0xd6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00}, + {0x00,0x00,0x66,0x66,0x76,0x76,0x7e,0x6e,0x6e,0x66,0x66,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0xf0,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x66,0x7e,0x6e,0x3c,0x06,0x07,0x00}, + {0x00,0x00,0xfc,0x66,0x66,0x66,0x7e,0x6c,0x66,0x66,0xf6,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x66,0x30,0x1c,0x06,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0xff,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x10,0x00,0x00,0x00}, + {0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xd6,0xd6,0xfe,0x6c,0x6c,0x00,0x00,0x00}, + {0x00,0x00,0xc6,0xc6,0x6c,0x38,0x38,0x38,0x6c,0xc6,0xc6,0x00,0x00,0x00}, + {0x00,0x00,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x38,0x38,0x7c,0x00,0x00,0x00}, + {0x00,0x00,0xfe,0xc6,0x8c,0x18,0x30,0x60,0xc2,0xc6,0xfe,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x40,0x60,0x70,0x38,0x1c,0x0e,0x06,0x02,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,0x00}, + {0x00,0x18,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00}, + {0x18,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0x76,0x00,0x00,0x00}, + {0x00,0x00,0xe0,0x60,0x60,0x7c,0x66,0x66,0x66,0x76,0xec,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x0e,0x06,0x06,0x1e,0x36,0x66,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x7e,0x60,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x1c,0x36,0x32,0x30,0x7c,0x30,0x30,0x30,0x78,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3b,0x66,0x66,0x66,0x3e,0x06,0x66,0x3c,0x00}, + {0x00,0x00,0xe0,0x60,0x60,0x60,0x7c,0x66,0x66,0x66,0xe6,0x00,0x00,0x00}, + {0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x06,0x06,0x00,0x0e,0x06,0x06,0x06,0x66,0x66,0x3c,0x00,0x00}, + {0x00,0x00,0xe0,0x60,0x60,0x66,0x6e,0x7c,0x6e,0x66,0xe6,0x00,0x00,0x00}, + {0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0xfe,0xd6,0xd6,0xd6,0xc6,0xc6,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3b,0x66,0x66,0x66,0x3e,0x06,0x06,0x0f,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x6e,0x33,0x33,0x30,0x30,0x78,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3e,0x62,0x38,0x0c,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x08,0x18,0x18,0x7e,0x18,0x18,0x18,0x1a,0x0e,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0x6c,0x38,0x10,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xd6,0xd6,0x7c,0x6c,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x66,0x3c,0x18,0x18,0x3c,0x66,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x3e,0x06,0x0c,0x38,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x7e,0x66,0x0c,0x18,0x36,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0x0e,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x0e,0x00,0x00,0x00}, + {0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x70,0x18,0x18,0x18,0x1c,0x18,0x18,0x18,0x70,0x00,0x00,0x00}, + {0x00,0x00,0x3b,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x66,0x66,0x66,0x7e,0x00,0x00}, + {0x00,0x00,0x1e,0x36,0x60,0x60,0x60,0x66,0x66,0x3e,0x06,0x03,0x3e,0x00}, + {0x00,0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x06,0x0c,0x18,0x00,0x3c,0x66,0x7e,0x60,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x08,0x1c,0x36,0x00,0x3c,0x06,0x3e,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x00,0x66,0x66,0x00,0x3c,0x06,0x3e,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x30,0x18,0x0c,0x00,0x3c,0x06,0x3e,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x1c,0x36,0x1c,0x00,0x3c,0x06,0x3e,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x66,0x3c,0x06,0x3c,0x00,0x00}, + {0x00,0x08,0x1c,0x36,0x00,0x3c,0x66,0x7e,0x60,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x66,0x66,0x00,0x3c,0x66,0x7e,0x60,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x30,0x18,0x0c,0x00,0x3c,0x66,0x7e,0x60,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x36,0x36,0x00,0x1c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00}, + {0x00,0x18,0x3c,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00}, + {0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00}, + {0x00,0x66,0x66,0x18,0x3c,0x66,0x66,0x66,0x7e,0x66,0x66,0x00,0x00,0x00}, + {0x3c,0x66,0x3c,0x00,0x3c,0x66,0x66,0x66,0x7e,0x66,0x66,0x00,0x00,0x00}, + {0x0c,0x18,0x30,0x00,0x7e,0x32,0x30,0x3c,0x30,0x32,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0xdc,0x76,0x36,0x7c,0xd8,0xdc,0x76,0x00,0x00}, + {0x00,0x00,0x1f,0x36,0x66,0x66,0x7f,0x66,0x66,0x66,0x67,0x00,0x00,0x00}, + {0x00,0x18,0x3c,0x66,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x66,0x66,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x30,0x18,0x0c,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x18,0x3c,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x30,0x18,0x0c,0x00,0x66,0x66,0x66,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x66,0x3e,0x06,0x0c,0x38,0x00}, + {0x00,0x62,0x62,0x3c,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x18,0x18,0x7e,0xc6,0xc0,0xc0,0xc6,0x7e,0x18,0x18,0x00,0x00,0x00}, + {0x00,0x1c,0x36,0x30,0x30,0x78,0x30,0x30,0x30,0x73,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0xc6,0x6c,0x38,0x10,0xfe,0x10,0xfe,0x10,0x10,0x00,0x00,0x00}, + {0x00,0xfc,0x66,0x66,0x7c,0x62,0x66,0x6f,0x66,0x66,0xf3,0x00,0x00,0x00}, + {0x00,0x0e,0x1b,0x18,0x18,0x18,0x7e,0x18,0x18,0x18,0x18,0xd8,0x70,0x00}, + {0x00,0x0c,0x18,0x30,0x00,0x3c,0x06,0x3e,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x0c,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00}, + {0x00,0x0c,0x18,0x30,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x0c,0x18,0x30,0x00,0x66,0x66,0x66,0x66,0x66,0x3b,0x00,0x00,0x00}, + {0x00,0x00,0x76,0xdc,0x00,0xdc,0x66,0x66,0x76,0x66,0x66,0x66,0x00,0x00}, + {0x76,0xdc,0x00,0x66,0x76,0x76,0x7e,0x6e,0x6e,0x66,0x66,0x00,0x00,0x00}, + {0x00,0x3c,0x6c,0x6c,0x3e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x38,0x6c,0x6c,0x38,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x18,0x18,0x00,0x18,0x30,0x66,0x66,0x3c,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x60,0x60,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x06,0x06,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x60,0xe0,0x62,0x64,0x68,0x10,0x20,0x5c,0x86,0x0c,0x18,0x3e,0x00}, + {0x00,0x60,0xe0,0x62,0x64,0x68,0x10,0x20,0x56,0xb6,0x3e,0x06,0x06,0x00}, + {0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x3c,0x3c,0x3c,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x36,0x6c,0xd8,0x6c,0x36,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x6c,0x36,0x1b,0x36,0x6c,0x00,0x00,0x00,0x00,0x00}, + {0x10,0x44,0x10,0x44,0x10,0x44,0x10,0x44,0x10,0x44,0x10,0x44,0x10,0x44}, + {0x54,0xaa,0x54,0xaa,0x54,0xaa,0x54,0xaa,0x54,0xaa,0x54,0xaa,0x54,0xaa}, + {0xdc,0x76,0xdc,0x76,0xdc,0x76,0xdc,0x76,0xdc,0x76,0xdc,0x76,0xdc,0x76}, + {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x18,0x18,0x18,0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,0x36,0x36,0x36}, + {0x18,0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,0x18,0x18,0x18}, + {0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}, + {0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0}, + {0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e}, + {0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x03,0x3e,0x6c,0x6c,0x6c,0x6e,0x3b,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x3c,0x66,0x7c,0x66,0x66,0x7c,0x60,0x60,0x20,0x00}, + {0x00,0x00,0x7e,0x66,0x66,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0xfe,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00}, + {0x00,0x00,0x7e,0x66,0x30,0x18,0x0c,0x18,0x30,0x66,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x3e,0x6c,0x6c,0x6c,0x6c,0x38,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x36,0x3c,0x30,0x30,0x60,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x76,0xdc,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x7e,0x18,0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x00,0x00,0x00}, + {0x00,0x00,0x18,0x3c,0x66,0x66,0x7e,0x66,0x66,0x3c,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x66,0x3c,0x66,0x66,0xe7,0x00,0x00}, + {0x00,0x00,0x1e,0x30,0x18,0x0c,0x3e,0x66,0x66,0x66,0x3c,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x7c,0xd6,0xd6,0x7c,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x02,0x06,0x7c,0xde,0xd6,0xf6,0x7c,0x60,0xc0,0x00,0x00,0x00}, + {0x00,0x00,0x1c,0x30,0x60,0x60,0x7c,0x60,0x60,0x30,0x1c,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x7e,0x00,0x7e,0x7e,0x00,0x7e,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x10,0x10,0x10,0xfe,0x10,0x10,0x10,0x00,0xfe,0x00,0x00,0x00}, + {0x00,0x00,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0xfe,0x00,0x00,0x00}, + {0x00,0x00,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0xfe,0x00,0x00,0x00}, + {0x00,0x00,0x0e,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}, + {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0x70,0x00,0x00,0x00}, + {0x00,0x00,0x18,0x18,0x00,0x00,0xfe,0x00,0x00,0x18,0x18,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x76,0xdc,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x38,0x6c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x1e,0x18,0x18,0x18,0x18,0x18,0xd8,0x78,0x38,0x18,0x00,0x00,0x00}, + {0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x70,0xd8,0x30,0x60,0xc8,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x00,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} +}; diff --git a/arch/armeb-raspi/boot/bc/screen_fb.c b/arch/armeb-raspi/boot/bc/screen_fb.c new file mode 100644 index 0000000000..c6eee55533 --- /dev/null +++ b/arch/armeb-raspi/boot/bc/screen_fb.c @@ -0,0 +1,215 @@ +/* + Copyright � 2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: Graphical framebuffer console. +*/ + +#include +#include + +/* + * Framebuffer access can be extremely slow, so we use a mirror buffer. + * Our mirror is a monochrome text-mode representation of the screen. + * Unused positions are filled with zero bytes, this helps to determine + * line lengths for faster scrolling. + * These variables need to survive accross warm reboot, so we explicitly place them in .data section. + */ +__attribute__((section(".data"))) char *fb_Mirror = NULL; + +__attribute__((section(".data"))) static unsigned int fb_BytesPerLine = 0; /* Bytes per line */ +__attribute__((section(".data"))) static unsigned int fb_BytesPerPix = 0; /* Bytes per pixel */ + +/* + * Calculate length of current line in the fb_Mirror buffer. + * Similar to strlen() but takes into account maximum line length. + */ +static unsigned int lineLen(const char *s) +{ + unsigned int len; + + for (len = 0; len < scr_Width; len++) + { + if (s[len] == 0) + break; + } + + return len; +} + +/* Render a character at (xc, yc) */ +static void RenderChar(unsigned char c, unsigned int xc, unsigned int yc) +{ + unsigned int x, y; + const unsigned char *font = &fontData[c * fontHeight]; + void *ptr = scr_FrameBuffer + fb_BytesPerLine * yc * fontHeight + fb_BytesPerPix * xc * fontWidth; + + /* Store our character in the mirror buffer */ + if (fb_Mirror) + fb_Mirror[scr_Width * yc + xc] = c; + + /* Render zero bytes as spaces (do not depend on particular font) */ + if (c == '\0') + c = ' '; + + /* Now render it on the screen */ + for (y = 0; y < fontHeight; y++) + { + unsigned char in = *font++; + void *p = ptr; + + for (x = 0; x < fontWidth; x++) + { + /* Get pixel from the font data */ + int val = (in & 0x80) ? -1 : 0; + + /* Draw the pixel. Do it in a single VRAM access, again to speed up */ + switch (fb_BytesPerPix) + { + case 4: + *((int *)p) = val; + break; + + case 3: + /* qemu's truecolor modes are known to be 3 bytes per pixel */ + *((short *)p) = val; + *((char *)p + 2) = val; + break; + + case 2: + *((short *)p) = val; + break; + + case 1: + *((char *)p) = val; + break; + } + + p += fb_BytesPerPix; + in <<= 1; + } + ptr += fb_BytesPerLine; + } +} + +void * malloc(size_t size); + +void fb_Init(unsigned int width, unsigned int height, unsigned int depth, unsigned int pitch) +{ + scr_Width = width / fontWidth; + fb_BytesPerPix = depth >> 3; + fb_BytesPerLine = pitch; + + fb_Mirror = malloc(scr_Width * (height + fontHeight - 1) / fontHeight); + + fb_Resize(height); +} + +void fb_Resize(unsigned int height) +{ + scr_Height = height / fontHeight; + + fb_Clear(); +} + +void fb_Clear(void) +{ + void *ptr = scr_FrameBuffer; + unsigned int i; + + /* Reset current position */ + scr_XPos = 0; + scr_YPos = 0; + + /* Clear the framebuffer, line by line */ + for (i = 0; i < scr_Height * fontHeight; i++) + { + memset(ptr, 0, fb_BytesPerPix * scr_Width * fontWidth); + ptr += fb_BytesPerLine; + } + + /* Clear mirror buffer */ + if (fb_Mirror) + memset(fb_Mirror, 0, scr_Width * scr_Height); +} + +void fb_Putc(char chr) +{ + /* Ignore null bytes, they are output by formatting routines as terminators */ + if (chr == 0) + return; + + if (chr == 0xFF) + { + fb_Clear(); + return; + } + + /* Reached end of line ? New line if so. */ + if ((chr == '\n') || (scr_XPos >= scr_Width)) + { + scr_XPos = 0; + scr_YPos++; + } + + if (scr_YPos >= scr_Height) + { + if (fb_Mirror) + { + /* destLen contains length of line being erased */ + unsigned int destLen = lineLen(fb_Mirror); + /* ptr contains address of line being scrolled */ + char *ptr = fb_Mirror + scr_Width; + unsigned int xc, yc; + + /* Reset line number */ + scr_YPos = scr_Height - 1; + + /* + * Reprint the whole fb_Mirror (starting from the second line) at (0, 0). + * Update only used parts in order to speed up the scrolling. + */ + for (yc = 0; yc < scr_YPos; yc++) + { + /* Calculate length of the line being scrolled */ + unsigned int srcLen = lineLen(ptr); + + /* + * The next line (being reprinted on top ot the current one) + * must completely cover it, so we must copy a minimum of 'destLen' bytes. + * Mirror buffer contains zero bytes at unused positions, they will be + * rendered as blank spaces, erasing the previous text. + */ + if (srcLen > destLen) + destLen = srcLen; + + for (xc = 0; xc < destLen; xc++) + RenderChar(ptr[xc], xc, yc); + + /* Go to the next line in fb_Mirror buffer */ + ptr += scr_Width; + /* Source becomes destination */ + destLen = srcLen; + } + + /* Clear the bottom line */ + for (xc = 0; xc < destLen; xc++) + RenderChar(0, xc, scr_YPos); + } + else + { + /* We dont have a mirror buffer */ + memmove((void *)scr_FrameBuffer, (void *)scr_FrameBuffer + (fontHeight * (fb_BytesPerPix * scr_Width * fontWidth)), (((scr_Height - 1) * fontHeight) * (fb_BytesPerPix * scr_Width * fontWidth))); + + /* Clear last line on screen */ + memset((void *)(scr_FrameBuffer + (((scr_Height - 1) * fontHeight) * (fb_BytesPerPix * scr_Width * fontWidth))), 0, fb_BytesPerPix * scr_Width * fontWidth * fontHeight); + scr_YPos = scr_Height - 1; + } + } + + if (chr == '\n') + return; + + /* Draw the character at current position and increment current column */ + RenderChar(chr, scr_XPos++, scr_YPos); +} diff --git a/arch/armeb-raspi/boot/bc/vars.c b/arch/armeb-raspi/boot/bc/vars.c new file mode 100644 index 0000000000..9c1904beb7 --- /dev/null +++ b/arch/armeb-raspi/boot/bc/vars.c @@ -0,0 +1,23 @@ +/* + Copyright © 2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: Common screen console variables. +*/ + +#include "bootconsole.h" + +/* + * Variables in this file are interntionally placed into .data section + * because they need to survive warm reboots. + */ + +/* Display buffer parameters. */ +__attribute__((section(".data"))) unsigned char scr_Type = SCR_UNKNOWN; +__attribute__((section(".data"))) void *scr_FrameBuffer = 0; /* VRAM address */ +__attribute__((section(".data"))) unsigned int scr_Width = 0; /* Display width in characters */ +__attribute__((section(".data"))) unsigned int scr_Height = 0; /* Display height in characters */ + +/* Current output position (in characters) */ +__attribute__((section(".data"))) unsigned int scr_XPos = 0; +__attribute__((section(".data"))) unsigned int scr_YPos = 0; diff --git a/arch/armeb-raspi/boot/include/vc_fb.h b/arch/armeb-raspi/boot/include/vc_fb.h new file mode 100644 index 0000000000..8c637d96b8 --- /dev/null +++ b/arch/armeb-raspi/boot/include/vc_fb.h @@ -0,0 +1,21 @@ +/* + Copyright � 2013, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef VC_FB_H +#define VC_FB_H + +#include + +extern int vcfb_init(void); +extern void fb_Putc(char chr); + +#if !defined(KRN_Dummy) +#define KRN_Dummy (TAG_USER + 0x03d00000) +#endif +#if !defined(KRN_FuncPutC) +#define KRN_FuncPutC (KRN_Dummy + 99) /* RAW FrameBuffer descriptor */ +#endif + +#endif /* VC_FB_H */ diff --git a/arch/armeb-raspi/boot/mmakefile.src b/arch/armeb-raspi/boot/mmakefile.src index 1032a52e26..8c727a2bd9 100644 --- a/arch/armeb-raspi/boot/mmakefile.src +++ b/arch/armeb-raspi/boot/mmakefile.src @@ -3,7 +3,8 @@ include $(SRCDIR)/config/aros.cfg TARGETDIR := $(GENDIR)/$(CURDIR) -FILES := boot mmu kprintf support vc_mb serialdebug elf devicetree +FILES := boot mmu kprintf support vc_mb serialdebug elf devicetree \ + bc/vars bc/font8x14 bc/screen_fb vc_fb USER_CFLAGS := -DUSE_UBOOT -ffixed-r8 -Wall -fno-builtin -O2 -mcpu=cortex-a7 KERNEL_LDFLAGS = USER_INCLUDES := -isystem $(SRCDIR)/$(CURDIR)/include @@ -29,15 +30,15 @@ RASPIFW_URI := https://github.com/raspberrypi/firmware/blob/$(RASPIFW_BRAN RASPIFW_FILES := LICENCE.broadcom bootcode.bin fixup.dat start.elf PKG_LIBS := dos -PKG_LIBS_ARCH := -PKG_RSRC := -PKG_RSRC_ARCH := -PKG_DEVS := -PKG_DEVS_ARCH := -PKG_HANDLERS := -PKG_HIDDS := -PKG_CLASSES := - +PKG_LIBS_ARCH := +PKG_RSRC := +PKG_RSRC_ARCH := +PKG_DEVS := +PKG_DEVS_ARCH := +PKG_HANDLERS := +PKG_HIDDS := +PKG_CLASSES := + %make_package mmake=kernel-package-raspi-armeb file=$(AROSDIR)/$(ARM_BSP) \ libs=$(PKG_LIBS) arch_libs=$(PKG_LIBS_ARCH) res=$(PKG_RSRC) \ arch_res=$(PKG_RSRC_ARCH) devs=$(PKG_DEVS) arch_devs=$(PKG_DEVS_ARCH) \ @@ -77,10 +78,10 @@ clean :: -$(RM) $(TESTS) $(TARGETDIR)/%.o : %.c - %compile_q + %compile_q $(TARGETDIR)/%.o : %.S - %compile_q + %compile_q $(TARGETDIR)/%.d : %.c %mkdepend_q diff --git a/arch/armeb-raspi/boot/vc_fb.c b/arch/armeb-raspi/boot/vc_fb.c new file mode 100644 index 0000000000..d5defd2c96 --- /dev/null +++ b/arch/armeb-raspi/boot/vc_fb.c @@ -0,0 +1,165 @@ +/* + Copyright � 2013-2015, The AROS Development Team. All rights reserved. + $Id$ + + Desc: VideoCore framebuffer routines + Lang: english +*/ + +#include + +#include +#include +#undef ARM_PERIIOBASE + +#include + +#include "bootconsole.h" +#include "vc_mb.h" +#include "vc_fb.h" +#include "boot.h" + +#undef ARM_PERIIOBASE +#define ARM_PERIIOBASE (__arm_periiobase) +extern uint32_t __arm_periiobase; + +int vcfb_init(void) +{ + unsigned int fb_width, fb_height, fb_depth, fb_pitch; + unsigned int count; + volatile unsigned int *vcmb_msg = (unsigned int *)BOOTMEMADDR(bm_mboxmsg); + scr_FrameBuffer = 0; + + kprintf("[VCFB] vcfb_init()\n"); + + scr_Type = SCR_UNKNOWN; + + /* query the display dimensions */ + { + vcmb_msg[0] = AROS_LONG2LE(8 * 4); + vcmb_msg[1] = AROS_LONG2LE(VCTAG_REQ); + vcmb_msg[2] = AROS_LONG2LE(VCTAG_GETRES); + vcmb_msg[3] = AROS_LONG2LE(8); + vcmb_msg[4] = 0; + vcmb_msg[5] = 0; + vcmb_msg[6] = 0; + vcmb_msg[7] = 0; // terminate tag + + vcmb_write(VCMB_BASE, VCMB_PROPCHAN, (void *)vcmb_msg); + vcmb_msg = vcmb_read(VCMB_BASE, VCMB_PROPCHAN); + + if (!vcmb_msg || (vcmb_msg[1] != AROS_LONG2LE(VCTAG_RESP))) + return 0; + + if (((fb_width = AROS_LE2LONG(vcmb_msg[5])) == 0) || ((fb_height = AROS_LE2LONG(vcmb_msg[6])) == 0)) + { + fb_width = 1024; + fb_height = 768; + } + + kprintf("[VCFB] fb_width=%d, fb_height=%d\n", fb_width, fb_height); + } + + /* fill in our framebuffer configuration/allocation request */ + { + unsigned int c = 1; + vcmb_msg[c++] = AROS_LONG2LE(VCTAG_REQ); + + vcmb_msg[c++] = AROS_LONG2LE(VCTAG_SETRES); + vcmb_msg[c++] = AROS_LONG2LE(8); + vcmb_msg[c++] = AROS_LONG2LE(0); + vcmb_msg[c++] = AROS_LONG2LE(fb_width); + vcmb_msg[c++] = AROS_LONG2LE(fb_height); + + vcmb_msg[c++] = AROS_LONG2LE(VCTAG_SETVRES); // duplicate physical size... + vcmb_msg[c++] = AROS_LONG2LE(8); + vcmb_msg[c++] = AROS_LONG2LE(0); + vcmb_msg[c++] = AROS_LONG2LE(fb_width); + vcmb_msg[c++] = AROS_LONG2LE(fb_height); + + vcmb_msg[c++] = AROS_LONG2LE(VCTAG_SETDEPTH); + vcmb_msg[c++] = AROS_LONG2LE(4); + vcmb_msg[c++] = AROS_LONG2LE(0); + + fb_depth = 16; + + vcmb_msg[c++] = AROS_LONG2LE(fb_depth); + + vcmb_msg[c++] = AROS_LONG2LE(VCTAG_FBALLOC); + vcmb_msg[c++] = AROS_LONG2LE(8); + vcmb_msg[c++] = AROS_LONG2LE(0); + vcmb_msg[c++] = AROS_LONG2LE(64); + vcmb_msg[c++] = AROS_LONG2LE(0); + + vcmb_msg[c++] = AROS_LONG2LE(0); // terminate tags + + vcmb_msg[0] = AROS_LONG2LE((c << 2)); // fill in request size + + vcmb_write(VCMB_BASE, VCMB_PROPCHAN, (void *)vcmb_msg); + vcmb_msg = vcmb_read(VCMB_BASE, VCMB_PROPCHAN); + + if (!vcmb_msg || (vcmb_msg[1] != AROS_LONG2LE(VCTAG_RESP))) + return 0; + + count = 2; // locate the allocation request + while((AROS_LE2LONG(vcmb_msg[count]))) + { + if (vcmb_msg[count] == AROS_LONG2LE(VCTAG_FBALLOC)) + break; + + count += 3 + (AROS_LE2LONG(vcmb_msg[count + 1]) >> 2); + + if (count > c) + return 0; + } + + if (AROS_LE2LONG(vcmb_msg[count + 2]) != (VCTAG_RESP + 8)) + return 0; + + kprintf("%p, %p, %p, %p, %p\n", AROS_LE2LONG(vcmb_msg[count]), AROS_LE2LONG(vcmb_msg[count+1]), AROS_LE2LONG(vcmb_msg[count+2]), + AROS_LE2LONG(vcmb_msg[count+3]),AROS_LE2LONG(vcmb_msg[count+4])); + + if (((scr_FrameBuffer = (void *)(AROS_LE2LONG(vcmb_msg[count + 3]))) == 0) || (AROS_LE2LONG(vcmb_msg[count + 4]) == 0)) + return 0; + + kprintf("[VCFB] scr_Framebuffer=%p, %p\n", scr_FrameBuffer, (intptr_t)scr_FrameBuffer & 0xc0000000); + + if (((intptr_t)scr_FrameBuffer & 0xc0000000) == 0x40000000) + { + kprintf("[VCFB] Buffer in L2 cache\n"); + } + else if (((intptr_t)scr_FrameBuffer & 0xc0000000) == 0xc0000000) + { + kprintf("[VCFB] Buffer uncached\n"); + } + scr_FrameBuffer = (void*)((intptr_t)scr_FrameBuffer & ~0xc0000000); + } + + /* query the framebuffer pitch */ + { + vcmb_msg[0] = AROS_LONG2LE(7 * 4); + vcmb_msg[1] = AROS_LONG2LE(VCTAG_REQ); + vcmb_msg[2] = AROS_LONG2LE(VCTAG_GETPITCH); + vcmb_msg[3] = AROS_LONG2LE(4); + vcmb_msg[4] = 0; + vcmb_msg[5] = 0; + vcmb_msg[6] = 0; // terminate tag + + vcmb_write(VCMB_BASE, VCMB_PROPCHAN, (void *)vcmb_msg); + vcmb_msg = vcmb_read(VCMB_BASE, VCMB_PROPCHAN); + + if (!vcmb_msg || (vcmb_msg[4] != AROS_LONG2LE(VCTAG_RESP + 4))) + return 0; + + if ((fb_pitch = AROS_LE2LONG(vcmb_msg[5])) == 0) + return 0; + + kprintf("[VCFB] fb_pitch=%d\n", fb_pitch); + } + + scr_Type = SCR_GFX; + + fb_Init(fb_width, fb_height, fb_depth, fb_pitch); + + return 1; +} diff --git a/arch/armeb-raspi/boot/vc_mb.c b/arch/armeb-raspi/boot/vc_mb.c index aaaed8a7ef..c50a944234 100644 --- a/arch/armeb-raspi/boot/vc_mb.c +++ b/arch/armeb-raspi/boot/vc_mb.c @@ -15,6 +15,7 @@ #include #include +#include "boot.h" #include "io.h" #define ARM_PERIIOBASE (__arm_periiobase) @@ -25,6 +26,8 @@ volatile unsigned int *vcmb_read(uintptr_t mb, unsigned int chan) unsigned int try = 0x20000000; unsigned int msg; + kprintf("[VCMB] vcmb_read(%p, %p)\n", mb, chan); + if (chan <= VCMB_CHAN_MAX) { while(1) @@ -43,7 +46,8 @@ volatile unsigned int *vcmb_read(uintptr_t mb, unsigned int chan) asm volatile ("mcr p15, #0, %[r], c7, c10, #5" : : [r] "r" (0) ); msg = rd32le(mb + VCMB_READ); - + kprintf("[VCMB] -> %p\n", msg); + asm volatile ("mcr p15, #0, %[r], c7, c10, #5" : : [r] "r" (0) ); if ((msg & VCMB_CHAN_MASK) == chan) @@ -55,8 +59,10 @@ volatile unsigned int *vcmb_read(uintptr_t mb, unsigned int chan) void vcmb_write(uintptr_t mb, unsigned int chan, void *msg) { + kprintf("[VCMB] vcmb_write(%p, %p, %p)\n", mb, chan, msg); + if ((((unsigned int)msg & VCMB_CHAN_MASK) == 0) && (chan <= VCMB_CHAN_MAX)) - { + { while ((rd32le(mb + VCMB_STATUS) & VCMB_STATUS_WRITEREADY) != 0) { /* Data synchronization barrier */ -- 2.11.4.GIT