All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niteesh G. S." <niteesh.gs@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Michael Rolnik <mrolnik@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 08/11] hw/avr/arduino: Add D13 LED
Date: Sat, 13 Mar 2021 22:51:39 +0530	[thread overview]
Message-ID: <CAN6ztm-cbybJ7VzaghQ3EZLXiy7D+4E7ZctCcUBeczhzQq7P1w@mail.gmail.com> (raw)
In-Reply-To: <CAN6ztm-oO-4=W-uRNw0cBtkXuF0+RCxsi7M+BYscu4R-twVxVA@mail.gmail.com>

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

Reviewed-by: Niteesh G S <niteesh.gs@gmail.com>

On Sat, Mar 13, 2021 at 10:32 PM Niteesh G. S. <niteesh.gs@gmail.com> wrote:

> Hii Phil,
>
> Just a few mins earlier than me :)
>
> Thanks,
> Niteesh
>
> On Sat, Mar 13, 2021 at 10:25 PM Philippe Mathieu-Daudé <f4bug@amsat.org>
> wrote:
>
>> From: G S Niteesh Babu <niteesh.gs@gmail.com>
>>
>> Signed-off-by: G S Niteesh Babu <niteesh.gs@gmail.com>
>> Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
>> Message-Id: <20210311135539.10206-4-niteesh.gs@gmail.com>
>> [PMD: Added ArduinoMachineClass::d13_led_portb_bit]
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  hw/avr/arduino.c | 18 ++++++++++++++++++
>>  hw/avr/Kconfig   |  1 +
>>  2 files changed, 19 insertions(+)
>>
>> diff --git a/hw/avr/arduino.c b/hw/avr/arduino.c
>> index 3ff31492fa6..73563a35d0d 100644
>> --- a/hw/avr/arduino.c
>> +++ b/hw/avr/arduino.c
>> @@ -13,6 +13,7 @@
>>  #include "qemu/osdep.h"
>>  #include "qapi/error.h"
>>  #include "hw/boards.h"
>> +#include "hw/misc/led.h"
>>  #include "atmega.h"
>>  #include "boot.h"
>>  #include "qom/object.h"
>> @@ -22,6 +23,8 @@ struct ArduinoMachineState {
>>      MachineState parent_obj;
>>      /*< public >*/
>>      AtmegaMcuState mcu;
>> +
>> +    LEDState *onboard_led;
>>  };
>>  typedef struct ArduinoMachineState ArduinoMachineState;
>>
>> @@ -31,6 +34,7 @@ struct ArduinoMachineClass {
>>      /*< public >*/
>>      const char *mcu_type;
>>      uint64_t xtal_hz;
>> +    unsigned d13_led_portb_bit; /* PORTB GPIO for D13 yellow LED */
>>  };
>>  typedef struct ArduinoMachineClass ArduinoMachineClass;
>>
>> @@ -49,6 +53,16 @@ static void arduino_machine_init(MachineState *machine)
>>                               amc->xtal_hz, &error_abort);
>>      sysbus_realize(SYS_BUS_DEVICE(&ams->mcu), &error_abort);
>>
>> +    /* Onboard led connected to digital header PIN 13 */
>> +    ams->onboard_led = led_create_simple(OBJECT(ams),
>> +                                         GPIO_POLARITY_ACTIVE_HIGH,
>> +                                         LED_COLOR_YELLOW,
>> +                                         "D13 LED");
>> +
>> +    qdev_connect_gpio_out(DEVICE(&ams->mcu.gpio[1]),
>> +                          amc->d13_led_portb_bit,
>> +                          qdev_get_gpio_in(DEVICE(ams->onboard_led), 0));
>> +
>>      if (machine->firmware) {
>>          if (!avr_load_firmware(&ams->mcu.cpu, machine,
>>                                 &ams->mcu.flash, machine->firmware)) {
>> @@ -83,6 +97,7 @@ static void arduino_duemilanove_class_init(ObjectClass
>> *oc, void *data)
>>      mc->alias       = "2009";
>>      amc->mcu_type   = TYPE_ATMEGA168_MCU;
>>      amc->xtal_hz    = 16 * 1000 * 1000;
>> +    amc->d13_led_portb_bit = 5;
>>  };
>>
>>  static void arduino_uno_class_init(ObjectClass *oc, void *data)
>> @@ -98,6 +113,7 @@ static void arduino_uno_class_init(ObjectClass *oc,
>> void *data)
>>      mc->alias       = "uno";
>>      amc->mcu_type   = TYPE_ATMEGA328_MCU;
>>      amc->xtal_hz    = 16 * 1000 * 1000;
>> +    amc->d13_led_portb_bit = 5;
>>  };
>>
>>  static void arduino_mega_class_init(ObjectClass *oc, void *data)
>> @@ -113,6 +129,7 @@ static void arduino_mega_class_init(ObjectClass *oc,
>> void *data)
>>      mc->alias       = "mega";
>>      amc->mcu_type   = TYPE_ATMEGA1280_MCU;
>>      amc->xtal_hz    = 16 * 1000 * 1000;
>> +    amc->d13_led_portb_bit = 7;
>>  };
>>
>>  static void arduino_mega2560_class_init(ObjectClass *oc, void *data)
>> @@ -128,6 +145,7 @@ static void arduino_mega2560_class_init(ObjectClass
>> *oc, void *data)
>>      mc->alias       = "mega2560";
>>      amc->mcu_type   = TYPE_ATMEGA2560_MCU;
>>      amc->xtal_hz    = 16 * 1000 * 1000; /* CSTCE16M0V53-R0 */
>> +    amc->d13_led_portb_bit = 7;
>>  };
>>
>>  static const TypeInfo arduino_machine_types[] = {
>> diff --git a/hw/avr/Kconfig b/hw/avr/Kconfig
>> index 16a57ced11f..e0d4fc5537a 100644
>> --- a/hw/avr/Kconfig
>> +++ b/hw/avr/Kconfig
>> @@ -8,3 +8,4 @@ config AVR_ATMEGA_MCU
>>  config ARDUINO
>>      select AVR_ATMEGA_MCU
>>      select UNIMP
>> +    select LED
>> --
>> 2.26.2
>>
>>

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

  reply	other threads:[~2021-03-13 17:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13 16:54 [PATCH 00/11] AVR patch queue for QEMU 6.0 Philippe Mathieu-Daudé
2021-03-13 16:54 ` [PATCH 01/11] hw/misc/led: Add yellow LED Philippe Mathieu-Daudé
2021-03-13 19:51   ` Richard Henderson
2021-03-13 16:54 ` [PATCH 02/11] hw/avr/arduino: List board schematic links Philippe Mathieu-Daudé
2021-03-13 19:51   ` Richard Henderson
2021-03-13 16:54 ` [PATCH 03/11] hw/avr: Add limited support for avr gpio registers Philippe Mathieu-Daudé
2021-03-13 19:55   ` Richard Henderson
2021-03-14 10:26   ` Mark Cave-Ayland
2021-03-14 23:41     ` Philippe Mathieu-Daudé
2021-03-15 13:15   ` Sarah Harris
2021-03-13 16:54 ` [PATCH 04/11] hw/gpio/avr_gpio: Add migration VMstate Philippe Mathieu-Daudé
2021-03-13 19:57   ` Richard Henderson
2021-03-13 16:54 ` [PATCH 05/11] hw/gpio/avr_gpio: Add 'id' field in AVRGPIOState Philippe Mathieu-Daudé
2021-03-13 19:58   ` Richard Henderson
2021-03-13 16:54 ` [PATCH 06/11] hw/gpio/avr_gpio: Simplify avr_gpio_write_port using extract32() Philippe Mathieu-Daudé
2021-03-13 19:59   ` Richard Henderson
2021-03-13 16:54 ` [PATCH 07/11] hw/gpio/avr_gpio: Add tracing for reads and writes Philippe Mathieu-Daudé
2021-03-13 17:21   ` Niteesh G. S.
2021-03-23  2:42     ` Niteesh G. S.
2021-03-23  8:39       ` Philippe Mathieu-Daudé
2021-03-13 16:54 ` [PATCH 08/11] hw/avr/arduino: Add D13 LED Philippe Mathieu-Daudé
2021-03-13 17:02   ` Niteesh G. S.
2021-03-13 17:21     ` Niteesh G. S. [this message]
2021-03-13 16:54 ` [PATCH 09/11] hw/avr/arduino: Replace magic number by gpio_port_index() call Philippe Mathieu-Daudé
2021-03-13 20:02   ` Richard Henderson
2021-03-13 22:20     ` Philippe Mathieu-Daudé
2021-03-13 16:54 ` [PATCH 10/11] target/avr: Fix some comment spelling errors Philippe Mathieu-Daudé
2021-03-13 16:54 ` [PATCH 11/11] target/avr: Fix interrupt execution Philippe Mathieu-Daudé
2021-03-13 22:16 ` [PATCH 00/11] AVR patch queue for QEMU 6.0 Michael Rolnik
2021-03-14 23:42 ` Philippe Mathieu-Daudé

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=CAN6ztm-cbybJ7VzaghQ3EZLXiy7D+4E7ZctCcUBeczhzQq7P1w@mail.gmail.com \
    --to=niteesh.gs@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=mrolnik@gmail.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.