From: David Gibson <david@gibson.dropbear.id.au>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/8] sam460ex: Clean up SPD EEPROM creation
Date: Thu, 3 Jan 2019 12:54:57 +1100 [thread overview]
Message-ID: <20190103015457.GI10853@umbus.fritz.box> (raw)
In-Reply-To: <alpine.BSF.2.21.9999.1901021336130.78010@zero.eik.bme.hu>
[-- Attachment #1: Type: text/plain, Size: 2377 bytes --]
On Wed, Jan 02, 2019 at 01:49:44PM +0100, BALATON Zoltan wrote:
> On Wed, 2 Jan 2019, David Gibson wrote:
> > On Wed, Jan 02, 2019 at 03:06:38AM +0100, BALATON Zoltan wrote:
> > > + /* IIC controllers and devices */
> > > dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600700, uic[0][2]);
> > > - i2c[0] = PPC4xx_I2C(dev);
> > > - object_property_set_bool(OBJECT(dev), true, "realized", NULL);
> > > - smbus_eeprom_init(i2c[0]->bus, 8, smbus_eeprom_buf, smbus_eeprom_size);
> > > - g_free(smbus_eeprom_buf);
> > > - i2c_create_slave(i2c[0]->bus, "m41t80", 0x68);
> > > + i2c = PPC4xx_I2C(dev)->bus;
> > > + /* SPD EEPROM on RAM module */
> > > + spd_data = spd_data_generate(DDR2, ram_sizes[0]);
> > > + if (spd_data) {
> > > + spd_data[20] = 4; /* SO-DIMM module */
> > > + smbus_eeprom_init_one(i2c, 0x50, spd_data);
> >
> > Any specific reason this case is handled outside spd_data_generate()?
>
> As explained in previous reply I tried to keep number of options to the
> function to minimum and not handle every board specific case in that
> function. This board has SO-DIMM instead of regular DIMM socket but most of
> the SPD data is the same so it's easy enough to patch it here to match what
> real hardware may have. Otherwise spd_data_generate should have a lot of
> options for all different possibilites different boards might have.
Ok, fair enough.
>
> (Also this is an example that unexpected configs might still work:
>
> $ qemu-system-ppc -M sam460ex -m 64 -serial stdio
> qemu-system-ppc: warning: Memory size is too small for SDRAM type, adjusting type
> [...]
> DRAM: 64 MiB (ECC not enabled, 460 MHz, CL0)
>
> This SoC has a DRAM controller which accepts both DDR and DDR2 and the
> firmware does not care either so it works even if this cannot happen on real
> hardware. The spd_data[20] is different for DDR2 and DDR/SDR but in the
> latter it's ~WE latency which does not matter either so it can be set
> unconditionally. If this was not working the board code could check
> spd_data[2] != DDR2 and then abort itself.)
>
> Regards,
> BALATON Zoltan
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-01-03 2:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 2:06 [Qemu-devel] [PATCH 0/8] Misc sam460ex related patches BALATON Zoltan
2019-01-02 2:06 ` [Qemu-devel] [PATCH 4/8] ppc4xx: Use ram_addr_t in ppc4xx_sdram_adjust() BALATON Zoltan
2019-01-02 4:15 ` David Gibson
2019-01-03 14:03 ` BALATON Zoltan
2019-01-04 5:17 ` David Gibson
2019-01-07 22:00 ` BALATON Zoltan
2019-01-02 2:06 ` [Qemu-devel] [PATCH 7/8] sam460ex: Fix support for memory larger than 1GB BALATON Zoltan
2019-01-02 2:06 ` [Qemu-devel] [PATCH 2/8] sam460ex: Clean up SPD EEPROM creation BALATON Zoltan
2019-01-02 4:11 ` David Gibson
2019-01-02 12:49 ` BALATON Zoltan
2019-01-03 1:54 ` David Gibson [this message]
2019-01-02 2:06 ` [Qemu-devel] [PATCH 3/8] ppc4xx: Disable debug logging by default BALATON Zoltan
2019-01-02 4:27 ` David Gibson
2019-01-02 2:06 ` [Qemu-devel] [PATCH 6/8] ppc4xx: Pass array index to function instead of pointer into the array BALATON Zoltan
2019-01-02 4:17 ` David Gibson
2019-01-02 2:06 ` [Qemu-devel] [PATCH 8/8] MAINTAINERS: Add more files to sam460ex BALATON Zoltan
2019-01-02 4:29 ` David Gibson
2019-01-02 2:06 ` [Qemu-devel] [PATCH 5/8] ppc4xx: Rename ppc4xx_sdram_t in ppc440_uc.c to ppc440_sdram_t BALATON Zoltan
2019-01-02 4:15 ` David Gibson
2019-01-02 2:06 ` [Qemu-devel] [PATCH 1/8] smbus: Add a helper to generate SPD EEPROM data BALATON Zoltan
2019-01-02 4:09 ` David Gibson
2019-01-02 12:36 ` BALATON Zoltan
2019-01-03 1:54 ` David Gibson
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=20190103015457.GI10853@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=balaton@eik.bme.hu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).