linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: Re: [PATCH 6/15] hypervisor console driver for Celleb
Date: Tue, 12 Dec 2006 15:09:26 +1100	[thread overview]
Message-ID: <1165896566.14839.3.camel@concordia.ozlabs.ibm.com> (raw)
In-Reply-To: <200612120331.kBC3VUIZ016091@toshiba.co.jp>

[-- Attachment #1: Type: text/plain, Size: 4675 bytes --]

On Tue, 2006-12-12 at 12:31 +0900, Ishizaki Kou wrote:
> This patch adds hypervisor console driver for Celleb platform.
> 
> Signed-off-by: Kou Ishizaki <kou.ishizaki.co.jp>
> ---
> 
> Index: linux-powerpc-git/drivers/char/Kconfig
> diff -u linux-powerpc-git/drivers/char/Kconfig:1.1.1.1 linux-powerpc-git/drivers/char/Kconfig:1.2
> --- linux-powerpc-git/drivers/char/Kconfig:1.1.1.1	Wed Dec  6 08:24:08 2006
> +++ linux-powerpc-git/drivers/char/Kconfig	Wed Dec  6 08:43:15 2006
> @@ -595,6 +595,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-powerpc-git/drivers/char/Makefile
> diff -u linux-powerpc-git/drivers/char/Makefile:1.1.1.1 linux-powerpc-git/drivers/char/Makefile:1.2
> --- linux-powerpc-git/drivers/char/Makefile:1.1.1.1	Wed Dec  6 08:24:08 2006
> +++ linux-powerpc-git/drivers/char/Makefile	Wed Dec  6 08:43:15 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-powerpc-git/drivers/char/hvc_beat.c
> diff -u /dev/null linux-powerpc-git/drivers/char/hvc_beat.c:1.1
> --- /dev/null	Mon Dec 11 20:37:34 2006
> +++ linux-powerpc-git/drivers/char/hvc_beat.c	Wed Dec  6 08:43:15 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;
> +}

Why do you need hvc_beat_useit? You don't want the driver loaded at all
sometimes? Is console=blah not enough?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-12-12  4:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12  3:31 [PATCH 6/15] hypervisor console driver for Celleb Ishizaki Kou
2006-12-12  4:09 ` Michael Ellerman [this message]
2006-12-12 11:27   ` Ishizaki Kou
2006-12-12 11:30   ` Ishizaki Kou
2006-12-12 12:03     ` Ishizaki Kou
2006-12-12 19:41 ` Linas Vepstas
2006-12-14  1:42   ` Ishizaki Kou
2006-12-14 17:36     ` Linas Vepstas
2006-12-20  8:37       ` Ishizaki Kou

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=1165896566.14839.3.camel@concordia.ozlabs.ibm.com \
    --to=michael@ellerman.id.au \
    --cc=kou.ishizaki@toshiba.co.jp \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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).