qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Peter A. G. Crosthwaite" <peter.crosthwaite@petalogix.com>
Cc: i.mitsyanko@samsung.com, e.voevodin@samsung.com,
	qemu-devel@nongnu.org, kyungmin.park@samsung.com,
	d.solodkiy@samsung.com, edgar.iglesias@gmail.com,
	m.kozlov@samsung.com, john.williams@petalogix.com
Subject: Re: [Qemu-devel] [PATCH v6 1/4] hw: introduce standard SD host controller
Date: Mon, 6 Aug 2012 11:30:24 +0100	[thread overview]
Message-ID: <CAFEAcA9F25AssxwDYrW2tH_SMyPYJuMeRgxm30d5BLHymPH=DQ@mail.gmail.com> (raw)
In-Reply-To: <a3cd1ec7a7010f5bc00b6fb7bae00a084d16d310.1344223191.git.peter.crosthwaite@petalogix.com>

On 6 August 2012 04:25, Peter A. G. Crosthwaite
<peter.crosthwaite@petalogix.com> wrote:

> +static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s)
> +{
> +    bool page_aligned = false;
> +    unsigned int n, begin;
> +    const uint16_t block_size = s->blksize & 0x0fff;
> +    uint32_t boundary_chk = 1 << (((s->blksize & 0xf000) >> 12) + 12);
> +    uint32_t boundary_count = boundary_chk - (s->sdmasysad % boundary_chk);
> +
> +    /* XXX: Some sd/mmc drivers (for example, u-boot-slp) do not account for
> +     * possible stop at page boundary if initial address is not page aligned,
> +     * allow them to work properly */
> +    if ((s->sdmasysad % boundary_chk) == 0) {
> +        page_aligned = true;
> +    }

It's not quite clear to me what this comment is indicating. Is it
a bit of behaviour which is "not specified but behave as hardware
happens to do because software is accidentally relying on it", or
are we behaving differently from hardware here?

> +static void get_adma_description(SDHCIState *s, ADMADescr *dscr)
> +{
> +    uint32_t adma1 = 0;
> +    uint64_t adma2 = 0;
> +    target_phys_addr_t entry_addr = (target_phys_addr_t)s->admasysaddr;
> +
> +    switch (SDHC_DMA_TYPE(s->hostctl)) {
> +    case SDHC_CTRL_ADMA2_32:
> +        cpu_physical_memory_read(entry_addr, (uint8_t *)&adma2, sizeof(adma2));
> +        dscr->addr = (target_phys_addr_t)((adma2 >> 32) & 0xfffffffc);
> +        dscr->length = (uint16_t)((adma2 >> 16) & 0xFFFF);
> +        dscr->attr = (uint8_t)(adma2 & 0x3F);

Does the SDHCI spec define that these words are interpreted like
this regardless of system endianness, or is this an accidental
assumption of little-endian behaviour?

-- PMM

  reply	other threads:[~2012-08-06 10:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-06  3:25 [Qemu-devel] [PATCH v6 0/4] Standard SD host controller model Peter A. G. Crosthwaite
2012-08-06  3:25 ` [Qemu-devel] [PATCH v6 1/4] hw: introduce standard SD host controller Peter A. G. Crosthwaite
2012-08-06 10:30   ` Peter Maydell [this message]
2012-08-06 11:28     ` Igor Mitsyanko
2012-08-06 11:29       ` Peter Maydell
2012-08-06 11:15   ` Peter Maydell
2012-08-06 11:45     ` Igor Mitsyanko
2012-08-07  6:31       ` Peter Crosthwaite
2012-08-10 11:56         ` Peter Crosthwaite
2012-08-06 12:35   ` Igor Mitsyanko
2012-08-06  3:25 ` [Qemu-devel] [PATCH v6 2/4] exynos4210: Added SD host controller model Peter A. G. Crosthwaite
2012-08-06 10:56   ` Peter Maydell
2012-08-06 12:29     ` Igor Mitsyanko
2012-09-18  2:41       ` Peter Crosthwaite
2012-09-18  6:42         ` Igor Mitsyanko
2012-08-06  3:25 ` [Qemu-devel] [PATCH v6 3/4] vl.c: allow for repeated -sd arguments Peter A. G. Crosthwaite
2012-08-06  3:25 ` [Qemu-devel] [PATCH v6 4/4] xilinx_zynq: Added SD controllers Peter A. G. Crosthwaite

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='CAFEAcA9F25AssxwDYrW2tH_SMyPYJuMeRgxm30d5BLHymPH=DQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=d.solodkiy@samsung.com \
    --cc=e.voevodin@samsung.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=i.mitsyanko@samsung.com \
    --cc=john.williams@petalogix.com \
    --cc=kyungmin.park@samsung.com \
    --cc=m.kozlov@samsung.com \
    --cc=peter.crosthwaite@petalogix.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 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).