9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] pcc limitation?
Date: Mon,  8 Nov 2010 01:16:09 +0100	[thread overview]
Message-ID: <4CD74149.70406@gmx.net> (raw)
In-Reply-To: <cd0fa0ecfdb6663d86cf23330307fd16@plug.quanstro.net>

On 07.11.2010 20:42, erik quanstrom wrote:
>> In practice:
>> Right now (with incomplete support for some chips):
>> writearr: 260 bytes
>> readarr: 16777217 bytes
>>
>> In the near future (maybe 2 weeks from now):
>> writearr: 1056 bytes
>> readarr: 16777217 bytes
>>
>
> so you're saying that you have > 16777217 bytes of spi data for a single
> command in your program?

You asked for "the largest sequence of commands in practice". That's why
I assumed you wanted to know about the largest command in all environments.


> i think i'm missing something.  you couldn't
> fit that much data in 32kb of ram.
>

Correct. Please see the following quote from my mail:

>> we determine readarr size at runtime based on resource constraints.

In hosted environments with sufficient resources (e.g. Plan 9), the
largest command response can indeed be ~16 MBytes. In
resource-constrained environments we limit command+response size to 260
bytes or even less. And depending on the programmer hardware, there may
be additional constraints (e.g. commands having exactly 1,2,4 or 5 bytes
and no other lengths) regardless of available resources.

If you want to take a look at the context of the code which prompted
this mail thread, please see
http://www.flashrom.org/trac/flashrom/browser/trunk/spi25.c#L594
spi_chip_erase_c7, spi_block_erase_52 and spi_nbyte_program all use the
spi_send_multicommand interface which takes an array of struct
spi_command as parameter (submission of multiple commands at once).
spi_nbyte_read uses the spi_send_command interface which takes the
individual members of struct spi_command as parameters (submission of a
single command).
We would love to use a common interface for command submission
regardless of the number of commands being sent (and we had such an
interface in the past), but sadly some supported hardware enforces
combined commands and other hardware enforces separate commands. The
individual programmer drivers take care of translating the requests to
the format usable by the programmer hardware.

Hardware programming is fun. Side effects include nausea and vomiting.

I hope this answers your questions.

Regards,
Carl-Daniel

--
http://www.hailfinger.org/




  reply	other threads:[~2010-11-08  0:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-07  0:56 Carl-Daniel Hailfinger
2010-11-07  4:02 ` Federico G. Benavento
2010-11-07 12:32   ` Carl-Daniel Hailfinger
2010-11-07 14:46     ` erik quanstrom
2010-11-07 16:22       ` Carl-Daniel Hailfinger
2010-11-07 18:26         ` erik quanstrom
2010-11-07 19:36           ` Carl-Daniel Hailfinger
2010-11-07 19:42             ` erik quanstrom
2010-11-08  0:16               ` Carl-Daniel Hailfinger [this message]
2010-11-08  0:56                 ` erik quanstrom
2010-11-08  9:39                   ` Julius Schmidt
2010-11-08 14:00                     ` erik quanstrom
2010-11-08 15:17                       ` Anthony Sorace
2010-11-08  2:58         ` Russ Cox

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=4CD74149.70406@gmx.net \
    --to=c-d.hailfinger.devel.2006@gmx.net \
    --cc=9fans@9fans.net \
    /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).