linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@mips.com>
To: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
Cc: <linux-mips@linux-mips.org>,
	Miodrag Dinic <miodrag.dinic@mips.com>,
	"Goran Ferenc" <goran.ferenc@mips.com>,
	Aleksandar Markovic <aleksandar.markovic@mips.com>,
	"David S. Miller" <davem@davemloft.net>,
	Douglas Leung <douglas.leung@mips.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-kernel@vger.kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	Miodrag Dinic <miodrag.dinic@imgtec.com>,
	"Paul Burton" <paul.burton@imgtec.com>,
	Paul Burton <paul.burton@mips.com>,
	"Petar Jovanovic" <petar.jovanovic@mips.com>,
	Raghu Gandham <raghu.gandham@mips.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH v6 5/5] MIPS: ranchu: Add Ranchu as a new generic-based board
Date: Mon, 30 Oct 2017 16:45:24 +0000	[thread overview]
Message-ID: <20171030164523.GA15235@jhogan-linux> (raw)
In-Reply-To: <1509364642-21771-6-git-send-email-aleksandar.markovic@rt-rk.com>

On Mon, Oct 30, 2017 at 12:56:36PM +0100, Aleksandar Markovic wrote:
> From: Miodrag Dinic <miodrag.dinic@mips.com>
> 
> Provide amendments to the MIPS generic platform framework so that
> the new generic-based board Ranchu can be chosen to be built.

A bit more info about the board would be good here. What boot protocol
is used? Does QEMU generate the DT dynamically?

> 
> Signed-off-by: Miodrag Dinic <miodrag.dinic@mips.com>
> Signed-off-by: Goran Ferenc <goran.ferenc@mips.com>
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
> ---
>  MAINTAINERS                                   |  6 ++
>  arch/mips/configs/generic/board-ranchu.config | 30 ++++++++++
>  arch/mips/generic/Kconfig                     | 10 ++++
>  arch/mips/generic/Makefile                    |  1 +
>  arch/mips/generic/board-ranchu.c              | 79 +++++++++++++++++++++++++++
>  5 files changed, 126 insertions(+)
>  create mode 100644 arch/mips/configs/generic/board-ranchu.config
>  create mode 100644 arch/mips/generic/board-ranchu.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f1be016..e429cc2 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -11308,6 +11308,12 @@ S:	Maintained
>  F:	Documentation/blockdev/ramdisk.txt
>  F:	drivers/block/brd.c
>  
> +RANCHU VIRTUAL BOARD FOR MIPS
> +M:	Miodrag Dinic <miodrag.dinic@mips.com>
> +L:	linux-mips@linux-mips.org
> +S:	Supported
> +F:	arch/mips/generic/board-ranchu.c

Maybe worth adding arch/mips/configs/generic/board-ranchu.config too.

> +
>  RANDOM NUMBER DRIVER
>  M:	"Theodore Ts'o" <tytso@mit.edu>
>  S:	Maintained

> diff --git a/arch/mips/generic/Kconfig b/arch/mips/generic/Kconfig
> index e0436aa..93582be 100644
> --- a/arch/mips/generic/Kconfig
> +++ b/arch/mips/generic/Kconfig
> @@ -42,4 +42,14 @@ config FIT_IMAGE_FDT_NI169445
>  	  Enable this to include the FDT for the 169445 platform from
>  	  National Instruments in the FIT kernel image.
>  
> +config VIRT_BOARD_RANCHU
> +	bool "Ranchu platform for Android emulator"
> +	help
> +	  This enables support for the platform used by Android emulator.
> +
> +	  Ranchu platform consists of a set of virtual devices. This platform
> +	  enables emulation of variety of virtual configurations while using
> +	  Android emulator. Android emulator is based on Qemu, and contains
> +	  the support for the same set of virtual devices.

This is effectively in the section "FIT/UHI Boards", but it has a
platform file and no DT/FIT stuff in tree a bit like the boards in the
section "Legacy (non-UHI/non-FIT) Boards".

I'm guessing it might be something in between, with UHI + platform code,
but DT provided by QEMU (i.e. FIT support makes no sense)?

If it uses UHI I suppose it doesn't belong in the legacy section, but I
think a consistent prompt would be beneficial, e.g.

+config VIRT_BOARD_RANCHU
+	bool "Support Ranchu platform for Android emulator"
...

> diff --git a/arch/mips/generic/board-ranchu.c b/arch/mips/generic/board-ranchu.c
> new file mode 100644
> index 0000000..0397752
> --- /dev/null
> +++ b/arch/mips/generic/board-ranchu.c
> @@ -0,0 +1,79 @@
> +/*
> + * Support code for virtual Ranchu board for MIPS.
> + *
> + * Author: Miodrag Dinic <miodrag.dinic@mips.com>
> + *
> + * 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.
> + */
> +
> +#include <linux/of_address.h>
> +
> +#include <asm/machine.h>
> +#include <asm/time.h>
> +
> +#define GOLDFISH_TIMER_LOW		0x00
> +#define GOLDFISH_TIMER_HIGH		0x04
> +
> +static __init uint64_t read_rtc_time(void __iomem *base)
> +{
> +	u64 time_low;
> +	u64 time_high;
> +
> +	time_low = readl(base + GOLDFISH_TIMER_LOW);
> +	time_high = readl(base + GOLDFISH_TIMER_HIGH);
> +
> +	return (time_high << 32) | time_low;

What if high changes while reading this?

E.g.
TIMER_LOW	 0x00000000 *0xffffffff*
TIMER_HIGH	*0x00000001* 0x00000000

You'd presumably get 0x00000001ffffffff.

Perhaps it should read HIGH before too, and retry if it has changed.

Cheers
James

  reply	other threads:[~2017-10-30 16:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 11:56 [PATCH v6 0/5] MIPS: Add virtual Ranchu board as a generic-based board Aleksandar Markovic
2017-10-30 11:56 ` [PATCH v6 1/5] Documentation: Add device tree binding for Goldfish PIC driver Aleksandar Markovic
2017-10-30 11:56 ` [PATCH v6 2/5] irqchip/irq-goldfish-pic: Add " Aleksandar Markovic
2017-10-31  2:26   ` Marc Zyngier
2017-11-01 14:34     ` Miodrag Dinic
2017-10-30 11:56 ` [PATCH v6 3/5] Documentation: Add device tree binding for Goldfish FB driver Aleksandar Markovic
2017-10-30 11:56 ` [PATCH v6 4/5] video: goldfishfb: Add support for device tree bindings Aleksandar Markovic
2017-10-30 11:56 ` [PATCH v6 5/5] MIPS: ranchu: Add Ranchu as a new generic-based board Aleksandar Markovic
2017-10-30 16:45   ` James Hogan [this message]
2017-11-02 12:47     ` Miodrag Dinic
2017-11-02 12:53       ` James Hogan
2017-11-01 17:58   ` Paul Burton
2017-11-02 13:47     ` Miodrag Dinic
2017-11-02 20:49       ` Paul Burton
2017-11-03 14:04         ` Miodrag Dinic

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=20171030164523.GA15235@jhogan-linux \
    --to=james.hogan@mips.com \
    --cc=aleksandar.markovic@mips.com \
    --cc=aleksandar.markovic@rt-rk.com \
    --cc=davem@davemloft.net \
    --cc=douglas.leung@mips.com \
    --cc=goran.ferenc@mips.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mchehab@kernel.org \
    --cc=miodrag.dinic@imgtec.com \
    --cc=miodrag.dinic@mips.com \
    --cc=paul.burton@imgtec.com \
    --cc=paul.burton@mips.com \
    --cc=petar.jovanovic@mips.com \
    --cc=raghu.gandham@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=rdunlap@infradead.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).