qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Jean-Christophe Dubois <jcd@tribudubois.net>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v12 17/19] i.MX: Add the i.MX25 PDK plateform
Date: Fri, 7 Aug 2015 14:55:55 +0100	[thread overview]
Message-ID: <CAFEAcA_xXJEJd2VWbMWHmBnEGZvb88vD9Y09mcH1cLCH_HDCaw@mail.gmail.com> (raw)
In-Reply-To: <fe23751e1986f9692b3b53eb28baa61b7aa593ec.1436563183.git.jcd@tribudubois.net>

On 11 July 2015 at 00:31, Jean-Christophe Dubois <jcd@tribudubois.net> wrote:
> Tested by booting a minimal Linux system on the emulated platform
> Tested by booting the Xvisor hyprvisor on the emulated platform

Typo in subject: "platform".

This commit message could probably use a little elaboration.
What is a PDK board?
> +    /* initialize our memory */
> +    for (i=0, ram_size = machine->ram_size; (i<2) && ram_size; i++) {
> +        unsigned int size;
> +        char ram_name[20];
> +        static const struct {
> +            hwaddr addr;
> +            unsigned int size;
> +        } ram[2] = {
> +            { FSL_IMX25_SDRAM0_ADDR, FSL_IMX25_SDRAM0_SIZE },
> +            { FSL_IMX25_SDRAM1_ADDR, FSL_IMX25_SDRAM1_SIZE },
> +        };
> +
> +        if (ram_size > ram[i].size) {
> +            size = ram[i].size;
> +        } else {
> +            size = ram_size;
> +        }
> +
> +        sprintf(ram_name, "imx25.ram%d", i);
> +
> +        ram_size -= size;
> +
> +        memory_region_allocate_system_memory(&s->ram[i], NULL, ram_name, size);

This has the same 'calls this function twice' issues as the other patch.

> +        memory_region_add_subregion(get_system_memory(), ram[i].addr,
> +                                    &s->ram[i]);
> +        if (size < ram[i].size) {
> +            memory_region_init_alias(&s->ram_alias, NULL, "ram.alias",
> +                                     &s->ram[i], 0, ram[i].size - size);
> +            memory_region_add_subregion(get_system_memory(),
> +                                        ram[i].addr + size, &s->ram_alias);
> +        }
> +    }
> +
> +    imx25_pdk_binfo.ram_size = machine->ram_size;
> +    imx25_pdk_binfo.kernel_filename = machine->kernel_filename;
> +    imx25_pdk_binfo.kernel_cmdline = machine->kernel_cmdline;
> +    imx25_pdk_binfo.initrd_filename = machine->initrd_filename;
> +    imx25_pdk_binfo.loader_start = IMX25_PDK_ADDRESS;
> +    imx25_pdk_binfo.board_id = 1771,
> +    imx25_pdk_binfo.nb_cpus = 1;
> +
> +    /*
> +     * We test explicitly for qtest here as it is not done (yet?) in
> +     * arm_load_kernel(). Without this the "make check" command would
> +     * fail.
> +     */
> +    if (!qtest_enabled()) {
> +        arm_load_kernel(&s->soc.cpu, &imx25_pdk_binfo);
> +    } else {
> +        /*
> +         * This I2C device doesn't exist on the real board.
> +         * We add it here (only on qtest usage) to be able to do a bit
> +         * of simple qtest. See "make check" for details.
> +         */
> +        i2c_create_slave((I2CBus *)qdev_get_child_bus(DEVICE(&s->soc.i2c[0]),
> +                                                      "i2c"),
> +                         "ds1338", 0x68);
> +    }

This is kind of ugly. It's a shame you can't add an I2C device
via -device...

thanks
-- PMM

  reply	other threads:[~2015-08-07 13:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 23:31 [Qemu-devel] [PATCH v12 00/19] i.MX: Add i.MX25 support through the PDK evaluation board Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 01/19] i.MX: Split UART emulator in a header file and a source file Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 02/19] i.MX: Move serial initialization to init/realize of DeviceClass Jean-Christophe Dubois
2015-07-15  7:38   ` Peter Crosthwaite
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 03/19] i.MX:Fix Coding style for UART emulator Jean-Christophe Dubois
2015-07-15  7:43   ` Peter Crosthwaite
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 04/19] i.MX: Split AVIC emulator in a header file and a source file Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 05/19] i.MX: Fix Coding style for AVIC emulator Jean-Christophe Dubois
2015-07-15  7:44   ` Peter Crosthwaite
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 06/19] i.MX: Split CCM emulator in a header file and a source file Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 07/19] i.MX: Fix Coding style for CCM emulator Jean-Christophe Dubois
2015-07-15  7:48   ` Peter Crosthwaite
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 08/19] i.MX: Split EPIT emulator in a header file and a source file Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 09/19] i.MX: Fix Coding style for EPIT emulator Jean-Christophe Dubois
2015-07-15  7:51   ` Peter Crosthwaite
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 10/19] i.MX: Split GPT emulator in a header file and a source file Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 11/19] i.MX: Fix Coding style for GPT emulator Jean-Christophe Dubois
2015-07-15  7:53   ` Peter Crosthwaite
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 12/19] i.MX: Add SOC support for i.MX31 Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 13/19] i.MX: KZM now uses the standalone i.MX31 SOC support Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 14/19] i.MX: Add I2C controller emulator Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 15/19] i.MX: Add FEC Ethernet Emulator Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 16/19] i.MX: Add SOC support for i.MX25 Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 17/19] i.MX: Add the i.MX25 PDK plateform Jean-Christophe Dubois
2015-08-07 13:55   ` Peter Maydell [this message]
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 18/19] i.MX: Add qtest support for I2C device emulator Jean-Christophe Dubois
2015-07-10 23:31 ` [Qemu-devel] [PATCH v12 19/19] i.MX: Adding i2C devices to i.MX31 SOC Jean-Christophe Dubois

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=CAFEAcA_xXJEJd2VWbMWHmBnEGZvb88vD9Y09mcH1cLCH_HDCaw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=jcd@tribudubois.net \
    --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 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).