linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/16] hypervisor console for Celleb
@ 2006-11-15  9:41 Ishizaki Kou
  2006-11-15 17:28 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Ishizaki Kou @ 2006-11-15  9:41 UTC (permalink / raw)
  To: linuxppc-dev

This patch adds hypervisor console driver for Celleb platform.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
---

Index: linux-2.6.19/drivers/char/Kconfig
diff -u linux-2.6.19/drivers/char/Kconfig:1.1.1.2 linux-2.6.19/drivers/char/Kconfig:1.3
--- linux-2.6.19/drivers/char/Kconfig:1.1.1.2	Tue Oct 24 13:36:46 2006
+++ linux-2.6.19/drivers/char/Kconfig	Tue Nov  7 13:27:03 2006
@@ -603,6 +603,13 @@
 	help
 	  IBM Console device driver which makes use of RTAS
 
+config HVC_BEAT
+	bool "Toshiba's Beat Hypervisor Console support"
+	depends on PPC_CELLEB
+	select HVC_DRIVER
+	help
+	  Toshiba's Cell Reference Set Beat Console device driver
+
 config HVCS
 	tristate "IBM Hypervisor Virtual Console Server support"
 	depends on PPC_PSERIES
Index: linux-2.6.19/drivers/char/Makefile
diff -u linux-2.6.19/drivers/char/Makefile:1.1.1.1 linux-2.6.19/drivers/char/Makefile:1.2
--- linux-2.6.19/drivers/char/Makefile:1.1.1.1	Fri Oct  6 10:40:57 2006
+++ linux-2.6.19/drivers/char/Makefile	Fri Oct  6 12:26:35 2006
@@ -44,6 +44,7 @@
 obj-$(CONFIG_HVC_CONSOLE)	+= hvc_vio.o hvsi.o
 obj-$(CONFIG_HVC_ISERIES)	+= hvc_iseries.o
 obj-$(CONFIG_HVC_RTAS)		+= hvc_rtas.o
+obj-$(CONFIG_HVC_BEAT)		+= hvc_beat.o
 obj-$(CONFIG_HVC_DRIVER)	+= hvc_console.o
 obj-$(CONFIG_RAW_DRIVER)	+= raw.o
 obj-$(CONFIG_SGI_SNSC)		+= snsc.o snsc_event.o
Index: linux-2.6.19/drivers/char/hvc_beat.c
diff -u /dev/null linux-2.6.19/drivers/char/hvc_beat.c:1.2
--- /dev/null	Thu Nov  9 18:40:51 2006
+++ linux-2.6.19/drivers/char/hvc_beat.c	Mon Nov  6 22:04:23 2006
@@ -0,0 +1,106 @@
+/*
+ * Beat hypervisor console driver
+ *
+ * (C) Copyright 2006 TOSHIBA CORPORATION
+ *
+ * This code is based on drivers/char/hvc_rtas.c:
+ * (C) Copyright IBM Corporation 2001-2005
+ * (C) Copyright Red Hat, Inc. 2005
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/string.h>
+#include <linux/console.h>
+#include <asm/prom.h>
+#include <asm/hvconsole.h>
+
+#include "hvc_console.h"
+
+extern int64_t beat_get_term_char(uint64_t, uint64_t *, uint64_t *, uint64_t *);
+extern int64_t beat_put_term_char(uint64_t, uint64_t, uint64_t, uint64_t);
+
+struct hvc_struct *hvc_beat_dev = NULL;
+
+static int hvc_beat_get_chars(uint32_t vtermno, char *buf, int cnt)
+{
+	unsigned long kb[2];
+	unsigned long got;
+
+	if (beat_get_term_char(vtermno, &got, &kb[0], &kb[1]) == 0) {
+		memcpy(buf, kb, got);
+		return got;
+	} else {
+		return 0;
+	}
+}
+
+static int hvc_beat_put_chars(uint32_t vtermno, const char *buf, int cnt)
+{
+	unsigned long kb[2];
+
+	memcpy(kb, buf, sizeof(kb));
+	beat_put_term_char(vtermno, cnt, kb[0], kb[1]);
+	return cnt;
+}
+
+static struct hv_ops hvc_beat_get_put_ops = {
+	.get_chars = hvc_beat_get_chars,
+	.put_chars = hvc_beat_put_chars,
+};
+
+static int hvc_beat_useit = 1;
+
+static int hvc_beat_config(char *p)
+{
+	hvc_beat_useit = simple_strtoul(p, NULL, 0);
+	return 0;
+}
+
+static int hvc_beat_console_init(void)
+{
+	if (hvc_beat_useit && machine_is_compatible("Beat")) {
+		hvc_instantiate(0, 0, &hvc_beat_get_put_ops);
+	}
+	return 0;
+}
+
+/* temp */
+static int hvc_beat_init(void)
+{
+	struct hvc_struct *hp;
+
+	hp = hvc_alloc(0, NO_IRQ, &hvc_beat_get_put_ops, 16);
+	if (IS_ERR(hp))
+		return PTR_ERR(hp);
+	hvc_beat_dev = hp;
+	return 0;
+}
+
+static void __exit hvc_beat_exit(void)
+{
+	if (hvc_beat_dev)
+		hvc_remove(hvc_beat_dev);
+}
+
+module_init(hvc_beat_init);
+module_exit(hvc_beat_exit);
+
+__setup("hvc_beat=", hvc_beat_config);
+
+console_initcall(hvc_beat_console_init);

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [PATCH 7/16] hypervisor console for Celleb
@ 2006-11-17 10:07 Ishizaki Kou
  0 siblings, 0 replies; 3+ messages in thread
From: Ishizaki Kou @ 2006-11-17 10:07 UTC (permalink / raw)
  To: linuxppc-dev

Hi Arnd-san,

> On Wednesday 15 November 2006 10:41, Ishizaki Kou wrote:
> > This patch adds hypervisor console driver for Celleb platform.
> > 
> Nice small driver. Still, I'd like to know why there is no support
> for interrupts to notify the kernel of incoming characters. This seems
> to have the same (mis-)design as the IBM blade with the rtas console
> that uses no interrupts.

This is caused because the design goal of "console" I/O for Beat is
for debugging Guest OSes that cannot handle interrupts. Adding to that,
the "console" I/O for Beat is deeply inspired by pSeries's one.

Thank you,
Kou Ishizaki
Toshiba

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-17 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-15  9:41 [PATCH 7/16] hypervisor console for Celleb Ishizaki Kou
2006-11-15 17:28 ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2006-11-17 10:07 Ishizaki Kou

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).