QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Aleksandar Markovic <aleksandar.m.mail@gmail.com>
To: Rajath Shashidhara <rajaths@cs.utexas.edu>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Looking for issues/features for my first contribution
Date: Sun, 10 Nov 2019 00:55:15 +0100
Message-ID: <CAL1e-=hR6KGRzZ+tz0YnvT2fy1TJ1eP-HHAPAcxBCLQWEgoVGw@mail.gmail.com> (raw)
In-Reply-To: <1ec3ea6a-6a75-15eb-086c-d8f5e33bc0dc@cs.utexas.edu>

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

On Saturday, November 9, 2019, Rajath Shashidhara <rajaths@cs.utexas.edu>
wrote:

>
>
> On 11/9/19 1:46 PM, Aleksandar Markovic wrote:
>
> >
> >
> > Hi, Rajath.
> >
> > No, it doesn't. Linux kernel has a driver for DS3231. Take a closer look.
>
> Kernel driver found here:
> https://elixir.bootlin.com/linux/v5.4-rc6/source/drivers/rtc/rtc-ds3232.c
> did register NVMEM of 236 bytes with the kernel. As long as this NVMEM
> is never accessed, the same driver should work for both DS3231 and DS3232.
>
> Is there any other driver you are referring to ? Please let me know if I
> missed something here.
>
>
The official DS3231 driver is (hidden) in:

https://elixir.bootlin.com/linux/v5.4-rc6/source/drivers/rtc/rtc-ds1307.c

This driver actually supports around 15 RTC chips, and DS3231 among them.
It contains fairly sophisticated "feature control" that enables it to
support multiple RTC chips.



> >
> > But, in any case, you base your QEMU emulation on the *datasheet*.
> >
> > The OS drivers may be helpful, but they are not a reference you base
> > your solution on. The drivers may be obsolete, incorrect, incomplete, or
> > just plain wrong. Additionally, as QEMU, of course, supports emulation
> > of systems running variety of OSs, the existence of the Linux kernel
> > driver is not a necessary condition for QEMU implementation. QEMU
> > emulates many systems that Linux never ran on, and could not be run at
> all.
> >
>
> I was only looking at the Kernel drivers to setup a test framework. I
> plan to test my implementation using a Raspi emulation with qemu,
> configure it with a DS3231 device. After this, I should be able to use
> ioctl() on /dev/rtc to test the functionality:
> https://linux.die.net/man/4/rtc
>
> If you have a better approach to testing, do let me know.
>
>
Your method sounds good to me. Hopefully it won't be too difficult to you
to execute it.

Best wishes,
Aleksandar


> Thanks,
> Rajath Shashidhara
>

[-- Attachment #2: Type: text/html, Size: 3021 bytes --]

<br><br>On Saturday, November 9, 2019, Rajath Shashidhara &lt;<a href="mailto:rajaths@cs.utexas.edu" target="_blank">rajaths@cs.utexas.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 11/9/19 1:46 PM, Aleksandar Markovic wrote:<br>
<br>
&gt; <br>
&gt; <br>
&gt; Hi, Rajath.<br>
&gt; <br>
&gt; No, it doesn&#39;t. Linux kernel has a driver for DS3231. Take a closer look.<br>
<br>
Kernel driver found here:<br>
<a href="https://elixir.bootlin.com/linux/v5.4-rc6/source/drivers/rtc/rtc-ds3232.c" target="_blank">https://elixir.bootlin.com/lin<wbr>ux/v5.4-rc6/source/drivers/rtc<wbr>/rtc-ds3232.c</a><br>
did register NVMEM of 236 bytes with the kernel. As long as this NVMEM<br>
is never accessed, the same driver should work for both DS3231 and DS3232.<br>
<br>
Is there any other driver you are referring to ? Please let me know if I<br>
missed something here.<br>
<br></blockquote><div><br></div><div>The official DS3231 driver is (hidden) in:</div><div><br></div><div><a href="https://elixir.bootlin.com/linux/v5.4-rc6/source/drivers/rtc/rtc-ds1307.c" target="_blank">https://elixir.bootlin.com/<wbr>linux/v5.4-rc6/source/drivers/<wbr>rtc/rtc-ds1307.c</a><br></div><div><br></div><div>This driver actually supports around 15 RTC chips, and DS3231 among them. It contains fairly sophisticated &quot;feature control&quot; that enables it to support multiple RTC chips.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&gt; <br>
&gt; But, in any case, you base your QEMU emulation on the *datasheet*.<br>
&gt; <br>
&gt; The OS drivers may be helpful, but they are not a reference you base<br>
&gt; your solution on. The drivers may be obsolete, incorrect, incomplete, or<br>
&gt; just plain wrong. Additionally, as QEMU, of course, supports emulation<br>
&gt; of systems running variety of OSs, the existence of the Linux kernel<br>
&gt; driver is not a necessary condition for QEMU implementation. QEMU<br>
&gt; emulates many systems that Linux never ran on, and could not be run at all.<br>
&gt; <br>
<br>
I was only looking at the Kernel drivers to setup a test framework. I<br>
plan to test my implementation using a Raspi emulation with qemu,<br>
configure it with a DS3231 device. After this, I should be able to use<br>
ioctl() on /dev/rtc to test the functionality:<br>
<a href="https://linux.die.net/man/4/rtc" target="_blank">https://linux.die.net/man/4/rt<wbr>c</a><br>
<br>
If you have a better approach to testing, do let me know.<br>
<br></blockquote><div><br></div><div>Your method sounds good to me. Hopefully it won&#39;t be too difficult to you to execute it.</div><div><br></div><div>Best wishes,</div><div>Aleksandar</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks,<br>
Rajath Shashidhara<br>
</blockquote>

  reply index

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 23:50 Rajath Shashidhara
2019-11-07 10:37 ` Aleksandar Markovic
2019-11-07 13:33   ` Aleksandar Markovic
2019-11-07 18:49     ` Rajath Shashidhara
2019-11-08  2:39     ` Rajath Shashidhara
2019-11-08  9:08       ` Alex Bennée
2019-11-08 13:05         ` Richard Henderson
2019-11-08 19:31       ` Aleksandar Markovic
2019-11-09 16:01         ` Peter Maydell
2019-11-09 21:08           ` Aleksandar Markovic
2019-11-10 14:33             ` Peter Maydell
2019-11-08 19:36       ` Aleksandar Markovic
2019-11-08 21:54         ` BALATON Zoltan
2019-11-09 19:46       ` Aleksandar Markovic
2019-11-09 21:33         ` Rajath Shashidhara
2019-11-09 23:55           ` Aleksandar Markovic [this message]
2019-11-07 11:18 ` Alex Bennée
2019-11-07 13:54 ` Stefan Hajnoczi
2019-11-07 18:51   ` Rajath Shashidhara

Reply instructions:

You may reply publically 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='CAL1e-=hR6KGRzZ+tz0YnvT2fy1TJ1eP-HHAPAcxBCLQWEgoVGw@mail.gmail.com' \
    --to=aleksandar.m.mail@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rajaths@cs.utexas.edu \
    /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

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git