From: dmlist@openright.org
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Patch: arm versatile video mode support
Date: Thu, 08 Mar 2007 17:44:31 -0800 [thread overview]
Message-ID: <1173404671.28414.1178523823@webmail.messagingengine.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 539 bytes --]
Hi,
The attached patch examines the kernel command line passed to
qemu-system-arm,
and changes the clcd register to match the CLCD video modes currently
supported by then linux kernel:
video=640x480
video=240x320
video=320x240
Perhaps someone has a more general or a better way of doing this.
Before this patch, the only ways I found to change the video mode of
qemu versatile was to
change the default clcd mode in the kernel code or change the clcd mode
in the qemu code.
The patch applies to 0.9.0 and current CVS.
-Don Mahurin
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: qemu-0.9.0-arm-vga.patch --]
[-- Type: text/x-patch; name="qemu-0.9.0-arm-vga.patch", Size: 3148 bytes --]
diff -ru qemu-0.9.0/hw/arm_sysctl.c qemu-0.9.0-arm-vga/hw/arm_sysctl.c
--- qemu-0.9.0/hw/arm_sysctl.c 2007-02-05 15:01:54.000000000 -0800
+++ qemu-0.9.0-arm-vga/hw/arm_sysctl.c 2007-03-08 11:56:48.000000000 -0800
@@ -22,6 +22,7 @@
uint32_t flags;
uint32_t nvflags;
uint32_t resetlevel;
+ uint32_t clcd;
} arm_sysctl_state;
static uint32_t arm_sysctl_read(void *opaque, target_phys_addr_t offset)
@@ -65,7 +66,7 @@
case 0x4c: /* FLASH */
return 0;
case 0x50: /* CLCD */
- return 0x1000;
+ return s->clcd;
case 0x54: /* CLCDSER */
return 0;
case 0x58: /* BOOTCS */
@@ -157,6 +158,8 @@
break;
case 0x4c: /* FLASH */
case 0x50: /* CLCD */
+ s->clcd = val;
+ break;
case 0x54: /* CLCDSER */
case 0x64: /* DMAPSR0 */
case 0x68: /* DMAPSR1 */
@@ -190,6 +193,35 @@
arm_sysctl_write
};
+static int arm_clcd = -1;
+
+void arm_sysctl_parse_video_preinit(const char *kernel_cmdline)
+{
+#ifndef NO_ARM_VIDEO_PARSE
+ int video = -1;
+ char *video_cmd;
+
+ video_cmd = strstr(kernel_cmdline, "video=");
+ if(video_cmd != NULL)
+ {
+ int video_cmd_len;
+ char *end_video_cmd;
+ video_cmd+=6;
+ end_video_cmd = strchr(video_cmd, ' ');
+ if(end_video_cmd != NULL)
+ video_cmd_len = (int) (end_video_cmd - video_cmd);
+ else
+ video_cmd_len = strlen(video_cmd);
+ if(!strncmp(video_cmd, "320x240", video_cmd_len))
+ arm_clcd = 0x0;
+ else if(!strncmp(video_cmd, "240x320", video_cmd_len))
+ arm_clcd = 0x700;
+ else if(!strncmp(video_cmd, "640x480", video_cmd_len))
+ arm_clcd = 0x1f00;
+ }
+#endif
+}
+
void arm_sysctl_init(uint32_t base, uint32_t sys_id)
{
arm_sysctl_state *s;
@@ -200,6 +232,7 @@
return;
s->base = base;
s->sys_id = sys_id;
+ s->clcd = (arm_clcd >= 0) ? arm_clcd : 0x1000;
iomemtype = cpu_register_io_memory(0, arm_sysctl_readfn,
arm_sysctl_writefn, s);
cpu_register_physical_memory(base, 0x00000fff, iomemtype);
diff -ru qemu-0.9.0/hw/versatilepb.c qemu-0.9.0-arm-vga/hw/versatilepb.c
--- qemu-0.9.0/hw/versatilepb.c 2007-02-05 15:01:54.000000000 -0800
+++ qemu-0.9.0-arm-vga/hw/versatilepb.c 2007-03-08 11:56:34.000000000 -0800
@@ -171,6 +171,10 @@
/* SDRAM at address zero. */
cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
+#ifndef NO_ARM_VIDEO_PARSE
+ arm_sysctl_parse_video_preinit(kernel_cmdline);
+#endif
+
arm_sysctl_init(0x10000000, 0x41007004);
pic = arm_pic_init_cpu(env);
pic = pl190_init(0x10140000, pic, ARM_PIC_CPU_IRQ, ARM_PIC_CPU_FIQ);
diff -ru qemu-0.9.0/vl.h qemu-0.9.0-arm-vga/vl.h
--- qemu-0.9.0/vl.h 2007-02-05 15:01:54.000000000 -0800
+++ qemu-0.9.0-arm-vga/vl.h 2007-03-08 11:56:24.000000000 -0800
@@ -1327,6 +1327,7 @@
void icp_pit_init(uint32_t base, void *pic, int irq);
/* arm_sysctl.c */
+void arm_sysctl_parse_video_preinit(const char *kernel_cmdline);
void arm_sysctl_init(uint32_t base, uint32_t sys_id);
/* arm_gic.c */
next reply other threads:[~2007-03-09 1:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-09 1:44 dmlist [this message]
2007-03-09 2:08 ` [Qemu-devel] Patch: arm versatile video mode support Paul Brook
2007-03-09 17:22 ` dmlist
-- strict thread matches above, loose matches on Subject: below --
2007-03-09 0:48 dmlist
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1173404671.28414.1178523823@webmail.messagingengine.com \
--to=dmlist@openright.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).