mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
SM501 emulation for R2D-SH4
This patch adds minimum emulation of SM501 multifunction device, whose main feature is 2D graphics. It is one of the peripheral of R2D, the SH4 evaluation board. We can see TUX printed on the QEMU console. Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5632 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
5985eceeaa
commit
ffd3925701
5 changed files with 1247 additions and 3 deletions
12
hw/r2d.c
12
hw/r2d.c
|
@ -25,12 +25,15 @@
|
|||
|
||||
#include "hw.h"
|
||||
#include "sh.h"
|
||||
#include "devices.h"
|
||||
#include "sysemu.h"
|
||||
#include "boards.h"
|
||||
|
||||
#define SDRAM_BASE 0x0c000000 /* Physical location of SDRAM: Area 3 */
|
||||
#define SDRAM_SIZE 0x04000000
|
||||
|
||||
#define SM501_VRAM_SIZE 0x800000
|
||||
|
||||
#define PA_POWOFF 0x30
|
||||
#define PA_VERREG 0x32
|
||||
#define PA_OUTPORT 0x36
|
||||
|
@ -133,6 +136,7 @@ static void r2d_init(ram_addr_t ram_size, int vga_ram_size,
|
|||
{
|
||||
CPUState *env;
|
||||
struct SH7750State *s;
|
||||
ram_addr_t sdram_addr, sm501_vga_ram_addr;
|
||||
|
||||
if (!cpu_model)
|
||||
cpu_model = "SH7751R";
|
||||
|
@ -144,10 +148,14 @@ static void r2d_init(ram_addr_t ram_size, int vga_ram_size,
|
|||
}
|
||||
|
||||
/* Allocate memory space */
|
||||
cpu_register_physical_memory(SDRAM_BASE, SDRAM_SIZE, 0);
|
||||
sdram_addr = qemu_ram_alloc(SDRAM_SIZE);
|
||||
cpu_register_physical_memory(SDRAM_BASE, SDRAM_SIZE, sdram_addr);
|
||||
/* Register peripherals */
|
||||
r2d_fpga_init(0x04000000);
|
||||
s = sh7750_init(env);
|
||||
sm501_vga_ram_addr = qemu_ram_alloc(SM501_VRAM_SIZE);
|
||||
sm501_init(ds, 0x10000000, sm501_vga_ram_addr, SM501_VRAM_SIZE,
|
||||
serial_hds[2]);
|
||||
/* Todo: register on board registers */
|
||||
{
|
||||
int kernel_size;
|
||||
|
@ -167,5 +175,5 @@ QEMUMachine r2d_machine = {
|
|||
.name = "r2d",
|
||||
.desc = "r2d-plus board",
|
||||
.init = r2d_init,
|
||||
.ram_require = SDRAM_SIZE | RAMSIZE_FIXED,
|
||||
.ram_require = (SDRAM_SIZE + SM501_VRAM_SIZE) | RAMSIZE_FIXED,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue