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: Re: Looking for issues/features for my first contribution
Date: Sat, 9 Nov 2019 20:46:38 +0100
Message-ID: <CAL1e-=hNH6HaKsczgkUdgbt18E2V2Cm6oPhSQewvMKvVTnarbA@mail.gmail.com> (raw)
In-Reply-To: <f300806f-ced2-5926-40ff-4cdd29c5078e@cs.utexas.edu>

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

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

>
> On 07-11-2019 07:33, Aleksandar Markovic wrote:
>
>>
>> I did a quick Google search on datasheets of existing RTC
>> implemtations, and the result is:
>>
>> DS1338: https://datasheets.maximintegrated.com/en/ds/DS1338-DS1338Z.pdf
>> M41T80: https://www.st.com/resource/en/datasheet/m41t80.pdf
>> M48T59: http://www.elektronikjk.pl/elementy_czynne/IC/M48T59V.pdf
>> MC146818: https://www.nxp.com/docs/en/data-sheet/MC146818.pdf
>> PL031: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0224c/
>> real_time_clock_pl031_r1p3_technical_reference_manual_DDI0224C.pdf
>> TWL92230: https://datasheet.octopart.com/TWL92230C-Texas-Instruments-
>> datasheet-150321.pdf
>> Zynq RTC: https://www.xilinx.com/support/documentation/user_guides/
>> ug1085-zynq-ultrascale-trm.pdf
>> (chapter 7)
>>
>
> I have a few questions about this:
> [a] Is there any particular reason that you picked DS3231 ? Linux kernel
> has drivers for DS3232/34 only [1].


>
Hi, Rajath.

No, it doesn't. Linux kernel has a driver for DS3231. Take a closer look.

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.

Sincerely,
Aleksandar


>
>  I did read the datasheets of both 3232 & 3231 and found that they are
> quite similar except for the 236 bytes of SRAM support found only in 3232.
>
> [b] As per the datasheet, DS3231 has a built-in temperature sensor.
> Temperature can be read from a dedicated register. There can be two
> approaches to emulating this: (1) Return a constant temperature value on
> every read (2) Throw a not-supported exception/warning. What is the qemu
> convention for handling such features ?
>
> [c] DS3231 also has programmable square-wave output + 32 KHz output pin.
> M41T80 chip also supports this feature. However, qemu does not support
> emulation of these features [2]. Do I take the same approach ?
>
> Thanks!
> Rajath Shashidhara
>
> References:
> [1] https://elixir.bootlin.com/linux/v5.4-rc6/source/drivers/rtc
> /rtc-ds3232.c
> [2] https://git.qemu.org/?p=qemu.git;a=blob;f=hw/rtc/m41t80.c;h=
> 914ecac8f4db418633d6daf92608cb50f6b89052;hb=HEAD
>

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

<br><br>On Friday, November 8, 2019, Rajath Shashidhara &lt;<a href="mailto:rajaths@cs.utexas.edu">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>
On 07-11-2019 07:33, Aleksandar Markovic wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I did a quick Google search on datasheets of existing RTC<br>
implemtations, and the result is:<br>
<br>
DS1338: <a href="https://datasheets.maximintegrated.com/en/ds/DS1338-DS1338Z.pdf" target="_blank">https://datasheets.maximintegr<wbr>ated.com/en/ds/DS1338-DS1338Z.<wbr>pdf</a><br>
M41T80: <a href="https://www.st.com/resource/en/datasheet/m41t80.pdf" target="_blank">https://www.st.com/resource/en<wbr>/datasheet/m41t80.pdf</a><br>
M48T59: <a href="http://www.elektronikjk.pl/elementy_czynne/IC/M48T59V.pdf" target="_blank">http://www.elektronikjk.pl/ele<wbr>menty_czynne/IC/M48T59V.pdf</a><br>
MC146818: <a href="https://www.nxp.com/docs/en/data-sheet/MC146818.pdf" target="_blank">https://www.nxp.com/docs/en/da<wbr>ta-sheet/MC146818.pdf</a><br>
PL031: <a href="http://infocenter.arm.com/help/topic/com.arm.doc.ddi0224c/real_time_clock_pl031_r1p3_technical_reference_manual_DDI0224C.pdf" target="_blank">http://infocenter.arm.com/help<wbr>/topic/com.arm.doc.ddi0224c/<wbr>real_time_clock_pl031_r1p3_<wbr>technical_reference_manual_<wbr>DDI0224C.pdf</a><br>
TWL92230: <a href="https://datasheet.octopart.com/TWL92230C-Texas-Instruments-datasheet-150321.pdf" target="_blank">https://datasheet.octopart.com<wbr>/TWL92230C-Texas-Instruments-<wbr>datasheet-150321.pdf</a><br>
Zynq RTC: <a href="https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf" target="_blank">https://www.xilinx.com/support<wbr>/documentation/user_guides/<wbr>ug1085-zynq-ultrascale-trm.pdf</a><br>
(chapter 7)<br>
</blockquote>
<br>
I have a few questions about this:<br>
[a] Is there any particular reason that you picked DS3231 ? Linux kernel has drivers for DS3232/34 only [1].</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><div><br></div><div>Hi, Rajath.</div><div><br></div><div>No, it doesn&#39;t. Linux kernel has a driver for DS3231. Take a closer look.</div><div><br></div><div>But, in any case, you base your QEMU emulation on the *datasheet*.</div><div><br></div><div>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.</div><div><br></div><div>Sincerely,</div><div>Aleksandar</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I did read the datasheets of both 3232 &amp; 3231 and found that they are quite similar except for the 236 bytes of SRAM support found only in 3232.<br>
<br>
[b] As per the datasheet, DS3231 has a built-in temperature sensor. Temperature can be read from a dedicated register. There can be two approaches to emulating this: (1) Return a constant temperature value on every read (2) Throw a not-supported exception/warning. What is the qemu convention for handling such features ?<br>
<br>
[c] DS3231 also has programmable square-wave output + 32 KHz output pin. M41T80 chip also supports this feature. However, qemu does not support emulation of these features [2]. Do I take the same approach ?<br>
<br>
Thanks!<br>
Rajath Shashidhara<br>
<br>
References:<br>
[1] <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>
[2] <a href="https://git.qemu.org/?p=qemu.git;a=blob;f=hw/rtc/m41t80.c;h=914ecac8f4db418633d6daf92608cb50f6b89052;hb=HEAD" target="_blank">https://git.qemu.org/?p=qemu.g<wbr>it;a=blob;f=hw/rtc/m41t80.c;h=<wbr>914ecac8f4db418633d6daf92608cb<wbr>50f6b89052;hb=HEAD</a><br>
</blockquote>

  parent 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 [this message]
2019-11-09 21:33         ` Rajath Shashidhara
2019-11-09 23:55           ` Aleksandar Markovic
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-=hNH6HaKsczgkUdgbt18E2V2Cm6oPhSQewvMKvVTnarbA@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