public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugs.ecos.sourceware.org
To: ecos-patches@ecos.sourceware.org
Subject: [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
Date: Wed, 11 Jul 2012 05:14:00 -0000	[thread overview]
Message-ID: <20120711051353.20E332F78005@mail.ecoscentric.com> (raw)
In-Reply-To: <bug-1001561-104@http.bugs.ecos.sourceware.org/>

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001561

--- Comment #33 from Jonathan Larmour <jifl@ecoscentric.com> 2012-07-11 06:13:40 BST ---
Hi Nicolas,

As well as Ilija's comments, I also have a few comments too before this is
committed:

- The Flash package needs a ChangeLog file

- The whitespace could be tidied a little in the CDL file. Just line things up
and so on.

- There's an unnecessary couple of blank lines added in var_io.h just at the
end of the FMC definitions.

- Do not include pkgconf/redboot.h. RedBoot is not the only thing that can use
the flash driver.

- I don't think the flash driver should be instantiated in kinetis_misc.c. It
should either go in kinetis_flash.c along with everything else, or go in
individual platform HALs, to allow them the ability to override or disable
(like the STM32 does with its internal flash driver).

- The cyg_kinetis_flash_dev structure can be completely empty. Its contents are
not needed unless you are dynamically working out the sizes like the STM32 does
(see below).

- There's no need to re-declare hal_kinetis_flash_conf_p in kinetis_flash.c.
Just include var_io.h.

- kinetis_flashEraseAllBlocks and kinetis_flashEraseBlock are not used. They
should be either removed or put in #if 0 to silence warnings.

Although if you do want to keep flashEraseBlock, then I suggest checking the
requested address is block aligned first.

- I know you copied kinetis_flash_query() from somewhere else (STM32), but
nevertheless the query string can be 'const' (which the STM32 driver should
have as well). And add the 'e' onto 'Freescal'. Or better still, just use
something shorter like "Internal" or "On-chip", to save a little flash.
Also it would seem better to change this:
    memcpy( data, query, sizeof(query));
to:
    if ( sizeof(query) < len )
        len = sizeof(query);
    memcpy( data, query, len );

- In flashCommandSequence(), please either add a comment on the empty while
loops, or use CYG_EMPTY_STATEMENT; instead.

- In response to Ilija's comments, for his point (2) I don't think there's
anything that can sensibly be done. All flash drivers run the risk of messing
things up so you can't boot the board. And for his point (3), I agree it would
be better to make it more like the STM32 driver, and work things out from the
part. Although I disagree with Ilija and wouldn't say to check it against the
hardware (unless CYGPKG_INFRA_DEBUG is defined maybe).

Thanks for working through this and contributing Nicolas!

Jifl

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

  parent reply	other threads:[~2012-07-11  5:14 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 14:39 [Bug 1001561] New: " bugzilla-daemon
2012-04-12 17:43 ` [Bug 1001561] " bugzilla-daemon
2012-04-19 13:12 ` bugzilla-daemon
2012-04-19 13:13 ` bugzilla-daemon
2012-04-19 13:14 ` bugzilla-daemon
2012-04-19 13:35 ` bugzilla-daemon
2012-04-19 15:37 ` bugzilla-daemon
2012-04-22 16:34 ` bugzilla-daemon
2012-04-22 16:34 ` bugzilla-daemon
2012-05-02  7:39 ` bugzilla-daemon
2012-05-02  7:39 ` bugzilla-daemon
2012-05-02  8:27 ` bugzilla-daemon
2012-05-02 15:13 ` bugzilla-daemon
2012-05-02 15:18 ` bugzilla-daemon
2012-05-02 15:20 ` bugzilla-daemon
2012-05-02 16:02 ` bugzilla-daemon
2012-05-10 13:52 ` bugzilla-daemon
2012-05-10 14:26 ` bugzilla-daemon
2012-05-10 17:08 ` bugzilla-daemon
2012-05-15  6:22 ` bugzilla-daemon
2012-05-15  8:42 ` bugzilla-daemon
2012-05-15 12:09 ` bugzilla-daemon
2012-05-21 15:01 ` bugzilla-daemon
2012-05-29  6:53 ` bugzilla-daemon
2012-06-20  7:49 ` bugzilla-daemon
2012-06-20 14:11 ` bugzilla-daemon
2012-06-20 14:34 ` bugzilla-daemon
2012-06-21  7:01 ` bugzilla-daemon
2012-06-23 16:39 ` bugzilla-daemon
2012-06-26  9:31 ` bugzilla-daemon
2012-06-28  7:56 ` bugzilla-daemon
2012-06-28  7:57 ` bugzilla-daemon
2012-07-10  9:02 ` bugzilla-daemon
2012-07-10 13:21 ` bugzilla-daemon
2012-07-10 13:21 ` bugzilla-daemon
2012-07-10 13:25 ` bugzilla-daemon
2012-07-10 15:47 ` bugzilla-daemon
2012-07-11  5:14 ` bugzilla-daemon [this message]
2012-07-11  7:12 ` bugzilla-daemon
2012-07-11 11:42 ` bugzilla-daemon
2012-07-11 14:41 ` bugzilla-daemon
2012-07-14 16:26 ` bugzilla-daemon
2012-07-18 14:11 ` bugzilla-daemon
2012-07-18 14:11 ` bugzilla-daemon
2012-07-18 14:28 ` bugzilla-daemon
2012-07-20 11:26 ` bugzilla-daemon
2012-08-07 13:16 ` bugzilla-daemon
2012-08-07 13:19 ` bugzilla-daemon
2012-08-07 13:23 ` bugzilla-daemon
2012-09-24 14:34 ` bugzilla-daemon
2012-09-25 16:23 ` bugzilla-daemon
2012-09-25 20:17 ` bugzilla-daemon
2012-09-26 12:30 ` bugzilla-daemon
2012-09-26 12:30 ` bugzilla-daemon
2012-09-26 14:42 ` bugzilla-daemon
2012-09-26 15:49 ` bugzilla-daemon
2012-09-27  8:06 ` bugzilla-daemon
2012-09-27 18:26 ` bugzilla-daemon
2012-09-27 18:29 ` bugzilla-daemon
2012-09-27 18:39 ` bugzilla-daemon
2012-09-28 16:15 ` bugzilla-daemon
2012-09-28 19:06 ` bugzilla-daemon
2012-11-04 14:33 ` bugzilla-daemon
2012-11-04 14:34 ` bugzilla-daemon
2012-11-04 14:35 ` bugzilla-daemon
2012-11-04 14:36 ` bugzilla-daemon
2012-11-04 14:39 ` bugzilla-daemon
2013-02-11 15:01 ` bugzilla-daemon
2017-02-15  7:24 ` bugzilla-daemon

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=20120711051353.20E332F78005@mail.ecoscentric.com \
    --to=bugzilla-daemon@bugs.ecos.sourceware.org \
    --cc=ecos-patches@ecos.sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).