[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH rc1 12/15] hw/rx: Register R5F562N7 and R5F562N8 MCUs
From: |
Richard Henderson |
Subject: |
Re: [PATCH rc1 12/15] hw/rx: Register R5F562N7 and R5F562N8 MCUs |
Date: |
Sat, 20 Jun 2020 10:31:19 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
On 6/17/20 12:15 PM, Philippe Mathieu-Daudé wrote:
> + /* XTAL range: 8-14 MHz */
> + if (s->xtal_freq_hz < 8e6 || s->xtal_freq_hz > 14e6) {
> + error_setg(errp, "\"xtal-frequency-hz\" property in incorrect
> range.");
> + return;
> + }
> + /* Use a 4x fixed multiplier */
> + s->pclk_freq_hz = 4 * s->xtal_freq_hz;
> + /* PCLK range: 8-50 MHz */
> + assert(s->pclk_freq_hz <= 50e6);
It's just startup, so it's not vital, but forcing floating-point comparisons
just because the notation is shorter isn't ideal.
Perhaps just a local "const uint32_t MHz = 10000000;", and some multiplies.
Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
- [PATCH rc1 03/15] hw/sh4: Use MemoryRegion typedef, (continued)
- [PATCH rc1 03/15] hw/sh4: Use MemoryRegion typedef, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 05/15] hw/timer/sh_timer: Remove unused 'qemu/timer.h' include, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 04/15] hw/sh4: Extract timer definitions to 'hw/timer/tmu012.h', Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 06/15] hw/intc: RX62N interrupt controller (ICUa), Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 07/15] hw/timer: RX62N 8-Bit timer (TMR), Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 08/15] hw/timer: RX62N compare match timer (CMT), Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 09/15] hw/char: RX62N serial communication interface (SCI), Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 11/15] hw/rx: Honor -accel qtest, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 10/15] hw/rx: RX62N microcontroller (MCU), Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 12/15] hw/rx: Register R5F562N7 and R5F562N8 MCUs, Philippe Mathieu-Daudé, 2020/06/17
- Re: [PATCH rc1 12/15] hw/rx: Register R5F562N7 and R5F562N8 MCUs,
Richard Henderson <=
- [PATCH rc1 13/15] hw/rx: Add RX GDB simulator, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 14/15] BootLinuxConsoleTest: Test the RX GDB simulator, Philippe Mathieu-Daudé, 2020/06/17
- [PATCH rc1 15/15] docs: Document the RX target, Philippe Mathieu-Daudé, 2020/06/17
- Re: [PATCH rc1 00/15] hw: Renesas patches (SH4 and RX), no-reply, 2020/06/17
- Re: [PATCH rc1 00/15] hw: Renesas patches (SH4 and RX), Yoshinori Sato, 2020/06/18