public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board
@ 2012-04-12 14:39 bugzilla-daemon
  2012-04-12 17:43 ` [Bug 1001561] " bugzilla-daemon
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-12 14:39 UTC (permalink / raw)
  To: unassigned

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

           Summary: Internal flash driver for Freescale TWR-K60N512 board
           Product: eCos
           Version: CVS
          Platform: Other (please specify)
        OS/Version: Cortex-M
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: low
         Component: Patches and contributions
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: nau@csm-instruments.com
                CC: ecos-patches@ecos.sourceware.org
             Class: Advice Request


Created an attachment (id=1697)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1697)
Ecos patch for twr-k60n512 flash driver

Here is what I have done so far with my work on the freescale TWR_K60N512 flash
driver. 

I thought it would be a good idea to share it even if it is not completely
finished :
I have been successfully able to launch the "flash1" test given by ecos on some
flash blocks but not on the entire flash : I have some errors if I run the
flash test between 0x00040000 - ~0x00045000 and near 0x0000000.

When I compile redboot with Flash support, I have a strange error if I check
either "keep redboot configuration data in flash" or "redboot flash image
system support" in the redboot configuration. Otherwise, redboot give me a
working prompt.

I will keep working on it but any help or ideas for possible solutions are, of
course, very welcome.

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
@ 2012-04-12 17:43 ` bugzilla-daemon
  2012-04-19 13:12 ` bugzilla-daemon
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-12 17:43 UTC (permalink / raw)
  To: unassigned

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

Ilija Kocho <ilijak@siva.com.mk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1697|                            |assignment?
               Flag|                            |
   Attachment #1697|application/octet-stream    |text/plain
          mime type|                            |
   Attachment #1697|0                           |1
           is patch|                            |

--- Comment #1 from Ilija Kocho <ilijak@siva.com.mk> 2012-04-12 18:43:07 BST ---
(From update of attachment 1697)
Hi Nicolas

Thank you for your contribution, it would be nice to have Kinetis flash support
in eCos.

In order to include your code in the official eCos repository we need your
copyright assignment. Please visit http://ecos.sourceware.org/assign.html for
explanation of the reasons for copyright assignment as well as the procedure
instructions.

The copyright assignment process will take some time, but in meantime we can
prepare your code for inclusion. Apart from notes below, I would start with
code review as soon as you inform me that you have started with copyright
assignment (that means you have sent materials to FSF).

Now some general notes on your flash driver:

1. I imagine that all Kinetis parts have identical or similar Flash modules so
the driver, especially code, should be common at variant level. Platforms then
would mostly have configuration CDL.

1.a. It would help if you break the patch in several files, typically: driver,
variant, platform, ecos.db, etc). Regarding ecos.db it is sometimes better to
submit packages as plain text file rather than diff.

2. I can notice some temporary files left by your editor. Please try to keep
your code clean.

That's all for now.

Ilija

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board 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
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-19 13:12 UTC (permalink / raw)
  To: unassigned

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

Nicolas Aujoux <nau@csm-instruments.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1697|assignment?                 |
               Flag|                            |
   Attachment #1697|0                           |1
        is obsolete|                            |

--- Comment #2 from Nicolas Aujoux <nau@csm-instruments.com> 2012-04-19 14:11:27 BST ---
Created an attachment (id=1702)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1702)
Driver part of the flash

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board 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
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-19 13:13 UTC (permalink / raw)
  To: unassigned

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

--- Comment #3 from Nicolas Aujoux <nau@csm-instruments.com> 2012-04-19 14:12:31 BST ---
Created an attachment (id=1703)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1703)
Hal part of the patch

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (2 preceding siblings ...)
  2012-04-19 13:13 ` bugzilla-daemon
@ 2012-04-19 13:14 ` bugzilla-daemon
  2012-04-19 13:35 ` bugzilla-daemon
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-19 13:14 UTC (permalink / raw)
  To: unassigned

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

--- Comment #4 from Nicolas Aujoux <nau@csm-instruments.com> 2012-04-19 14:13:28 BST ---
Created an attachment (id=1704)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1704)
Database including kinetis flash component

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (3 preceding siblings ...)
  2012-04-19 13:14 ` bugzilla-daemon
@ 2012-04-19 13:35 ` bugzilla-daemon
  2012-04-19 15:38 ` bugzilla-daemon
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-19 13:35 UTC (permalink / raw)
  To: unassigned

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

--- Comment #5 from Nicolas Aujoux <nau@csm-instruments.com> 2012-04-19 14:34:17 BST ---
Hi Ilija

I sent the e-mail requested for the copyright assignment and I am waiting for
their answer.

I updated the attachments :

- I move the common code to the variant level.

- I separated them as you recommended.

- I deleted the temporary files (sorry about that).

Also I figured out why I wasn't able to access some part of the flash. In fact
speculation logic and cache aliasing (which are enable by default) are not
supported on some tower boards. See there for more informations :
http://forums.freescale.com/t5/Kinetis-ARM-Cortex-M4/Accessing-the-FLASH-causing-BUS-fault/m-p/78873#M509

I added an option to disable these options in the cdl file. The driver should
now work properly.

Nicolas


(In reply to comment #1)
> (From update of attachment 1697 [details])
> Hi Nicolas
> 
> Thank you for your contribution, it would be nice to have Kinetis flash support
> in eCos.
> 
> In order to include your code in the official eCos repository we need your
> copyright assignment. Please visit http://ecos.sourceware.org/assign.html for
> explanation of the reasons for copyright assignment as well as the procedure
> instructions.
> 
> The copyright assignment process will take some time, but in meantime we can
> prepare your code for inclusion. Apart from notes below, I would start with
> code review as soon as you inform me that you have started with copyright
> assignment (that means you have sent materials to FSF).
> 
> Now some general notes on your flash driver:
> 
> 1. I imagine that all Kinetis parts have identical or similar Flash modules so
> the driver, especially code, should be common at variant level. Platforms then
> would mostly have configuration CDL.
> 
> 1.a. It would help if you break the patch in several files, typically: driver,
> variant, platform, ecos.db, etc). Regarding ecos.db it is sometimes better to
> submit packages as plain text file rather than diff.
> 
> 2. I can notice some temporary files left by your editor. Please try to keep
> your code clean.
> 
> That's all for now.
> 
> Ilija

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (4 preceding siblings ...)
  2012-04-19 13:35 ` bugzilla-daemon
@ 2012-04-19 15:38 ` bugzilla-daemon
  2012-04-22 16:34 ` bugzilla-daemon
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-19 15:38 UTC (permalink / raw)
  To: unassigned

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

Ilija Kocho <ilijak@siva.com.mk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1704|application/octet-stream    |text/plain
          mime type|                            |

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (5 preceding siblings ...)
  2012-04-19 15:38 ` bugzilla-daemon
@ 2012-04-22 16:34 ` bugzilla-daemon
  2012-04-22 16:34 ` bugzilla-daemon
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-22 16:34 UTC (permalink / raw)
  To: unassigned

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

Ilija Kocho <ilijak@siva.com.mk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ilijak@siva.com.mk

--- Comment #6 from Ilija Kocho <ilijak@siva.com.mk> 2012-04-22 17:34:01 BST ---
(In reply to comment #5)
> Hi Ilija
> 
> I sent the e-mail requested for the copyright assignment and I am waiting for
> their answer.

Thanks, then, let's begin and prepare your code for commit while paperware is
traveling.

> I updated the attachments :
> 
> - I move the common code to the variant level.
> 
> - I separated them as you recommended.
> 
> - I deleted the temporary files (sorry about that).
> 
> Also I figured out why I wasn't able to access some part of the flash. In fact
> speculation logic and cache aliasing (which are enable by default) are not
> supported on some tower boards. See there for more informations :
> http://forums.freescale.com/t5/Kinetis-ARM-Cortex-M4/Accessing-the-FLASH-causing-BUS-fault/m-p/78873#M509

Thank you for the pointer.

> 
> I added an option to disable these options in the cdl file. The driver should
> now work properly.

Good usage of eCos configureability.

I haven't yet tried the driver on target, here are some notes based on code
review.

First some formal notes:

I should have pointed this earlier (sory), here you will find some guidance how
to prepare eCos code:
http://ecos.sourceware.org/patches-criteria.html

That being said here are few notes:

Update ChangeLog in existing packages (i.e. Kinetis HAL) and add one to new
ones (the driver).

Convert tabs to spaces (tab size 4 is OK).

Make sure that Copyright banners are accurate. This includes year(s) in
Copyright line.

Line length should be typically less than 78 characters. This is a soft rule
but please try to reformat your code accordingly.

In file devs/flash/freescale/kinetis/current/src/kinetis_flash.c:

function kinetis_flash_init(): Your code seems correct, but FYI eCos provides a
set of hardware abstraction macros such as HAL_READ_UINT32() HAL_WRITE_UINT32()
for hardware abstraction. Device registers are typically accessed either
structured (as you do for cyghwr_hal_kinetis_flash_t) or by means of HAL macro.
Would you mind editing this part?

Example:

    cyg_uint32 regval;

    HAL_READ_UINT32(CYGHWR_HAL_KINETIS_FMC_PFB0CR, regval);
    regval &= ~CYGHWR_HAL_KINETIS_FMC_PFBCR_BIPE;
    HAL_WRITE_UINT32(CYGHWR_HAL_KINETIS_FMC_PFB0CR, regval);

Lines like following:
    CYGHWR_HAL_KINETIS_SIM_P->scgc6 |= 0x01UL;

There are macros for SCGS bit fields in var_io.h that you could use (If some
macro is missing feel free to add)

Note: FTFL clock is already being enabled during system init (all clock are)
but do not remove this line from FTFL driver, in some future upgrade all
drivers should have such and I intend to remove general clock enabling.

I guess that flashCommandSequence() could be static. eCos is being linked to
application(s) so let's keep exported names to minimum.

Could query[] be more general: "Freescale Kinetis internal flash" or "Kinetis
FTFL" ?

In file devs/flash/freescale/kinetis/current/src/kinetis_flash.h:

KINETIS_FLASH_BLOCK_SIZE: There are some devices with block size of 4KiB so it
should be configurable or inferred from device type. I have been informed that
there is some ambiguity in K60 devices as there are devices with both 2 KiB and
4 KiB block size, so to be on a safe side I would provide a CDL:

    cdl_option CYGNUM_DEVS_KINETIS_FLASH_BLOCK_SIZE {
        display "Block size"
        legal_values { 0 0x800 0x1000 }
        default_value 0
        description ".... 0 - Auto ...."
   }

In addition the platform HAL can override. Also check if some other value can
be configurable/inferred or read from Kinetis registers.

Regarding configuration options it would be good to cross-reference other
device manuals, typically K40 and K70 (that we have or will have soon in eCos).

Ilija

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (6 preceding siblings ...)
  2012-04-22 16:34 ` bugzilla-daemon
@ 2012-04-22 16:34 ` bugzilla-daemon
  2012-05-02  7:39 ` bugzilla-daemon
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-04-22 16:34 UTC (permalink / raw)
  To: unassigned

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

Ilija Kocho <ilijak@siva.com.mk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1702|                            |assignment?
               Flag|                            |

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (8 preceding siblings ...)
  2012-05-02  7:39 ` bugzilla-daemon
@ 2012-05-02  7:39 ` bugzilla-daemon
  2012-05-02  8:27 ` bugzilla-daemon
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-02  7:39 UTC (permalink / raw)
  To: unassigned

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

Nicolas Aujoux <nau@csm-instruments.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1702|assignment?                 |
               Flag|                            |
   Attachment #1702|0                           |1
        is obsolete|                            |

--- Comment #7 from Nicolas Aujoux <nau@csm-instruments.com> 2012-05-02 08:38:44 BST ---
Created an attachment (id=1723)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1723)
Devs part of the patch

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (7 preceding siblings ...)
  2012-04-22 16:34 ` bugzilla-daemon
@ 2012-05-02  7:39 ` bugzilla-daemon
  2012-05-02  7:39 ` bugzilla-daemon
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-02  7:39 UTC (permalink / raw)
  To: unassigned

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

Nicolas Aujoux <nau@csm-instruments.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1703|0                           |1
        is obsolete|                            |

--- Comment #8 from Nicolas Aujoux <nau@csm-instruments.com> 2012-05-02 08:39:39 BST ---
Created an attachment (id=1724)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1724)
Hal part of the patch

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (9 preceding siblings ...)
  2012-05-02  7:39 ` bugzilla-daemon
@ 2012-05-02  8:27 ` bugzilla-daemon
  2012-05-02 15:13 ` bugzilla-daemon
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-02  8:27 UTC (permalink / raw)
  To: unassigned

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

--- Comment #9 from Nicolas Aujoux <nau@csm-instruments.com> 2012-05-02 09:27:12 BST ---
(In reply to comment #6)

Hi Ilija,

If I am not mistaken, the last patches should implement what you pointed out.

For the block size thing, I did some quick research but it seems that there is
no way to know the size by reading registers. 
For the k60, it looks like 100Mhz devices have 2KB block size and 120,150 MHz
have 4KB block size.

It also looks like the block size has an impact on how to program the flash : I
use the program longword command in my driver for the k60 100 MHz but this
command doesn't exist in the k60 120 or 150 MHz.

Nicolas

> (In reply to comment #5)
> > Hi Ilija
> > 
> > I sent the e-mail requested for the copyright assignment and I am waiting for
> > their answer.
> 
> Thanks, then, let's begin and prepare your code for commit while paperware is
> traveling.
> 
> > I updated the attachments :
> > 
> > - I move the common code to the variant level.
> > 
> > - I separated them as you recommended.
> > 
> > - I deleted the temporary files (sorry about that).
> > 
> > Also I figured out why I wasn't able to access some part of the flash. In fact
> > speculation logic and cache aliasing (which are enable by default) are not
> > supported on some tower boards. See there for more informations :
> > http://forums.freescale.com/t5/Kinetis-ARM-Cortex-M4/Accessing-the-FLASH-causing-BUS-fault/m-p/78873#M509
> 
> Thank you for the pointer.
> 
> > 
> > I added an option to disable these options in the cdl file. The driver should
> > now work properly.
> 
> Good usage of eCos configureability.
> 
> I haven't yet tried the driver on target, here are some notes based on code
> review.
> 
> First some formal notes:
> 
> I should have pointed this earlier (sory), here you will find some guidance how
> to prepare eCos code:
> http://ecos.sourceware.org/patches-criteria.html
> 
> That being said here are few notes:
> 
> Update ChangeLog in existing packages (i.e. Kinetis HAL) and add one to new
> ones (the driver).
> 
> Convert tabs to spaces (tab size 4 is OK).
> 
> Make sure that Copyright banners are accurate. This includes year(s) in
> Copyright line.
> 
> Line length should be typically less than 78 characters. This is a soft rule
> but please try to reformat your code accordingly.
> 
> In file devs/flash/freescale/kinetis/current/src/kinetis_flash.c:
> 
> function kinetis_flash_init(): Your code seems correct, but FYI eCos provides a
> set of hardware abstraction macros such as HAL_READ_UINT32() HAL_WRITE_UINT32()
> for hardware abstraction. Device registers are typically accessed either
> structured (as you do for cyghwr_hal_kinetis_flash_t) or by means of HAL macro.
> Would you mind editing this part?
> 
> Example:
> 
>     cyg_uint32 regval;
> 
>     HAL_READ_UINT32(CYGHWR_HAL_KINETIS_FMC_PFB0CR, regval);
>     regval &= ~CYGHWR_HAL_KINETIS_FMC_PFBCR_BIPE;
>     HAL_WRITE_UINT32(CYGHWR_HAL_KINETIS_FMC_PFB0CR, regval);
> 
> Lines like following:
>     CYGHWR_HAL_KINETIS_SIM_P->scgc6 |= 0x01UL;
> 
> There are macros for SCGS bit fields in var_io.h that you could use (If some
> macro is missing feel free to add)
> 
> Note: FTFL clock is already being enabled during system init (all clock are)
> but do not remove this line from FTFL driver, in some future upgrade all
> drivers should have such and I intend to remove general clock enabling.
> 
> I guess that flashCommandSequence() could be static. eCos is being linked to
> application(s) so let's keep exported names to minimum.
> 
> Could query[] be more general: "Freescale Kinetis internal flash" or "Kinetis
> FTFL" ?
> 
> In file devs/flash/freescale/kinetis/current/src/kinetis_flash.h:
> 
> KINETIS_FLASH_BLOCK_SIZE: There are some devices with block size of 4KiB so it
> should be configurable or inferred from device type. I have been informed that
> there is some ambiguity in K60 devices as there are devices with both 2 KiB and
> 4 KiB block size, so to be on a safe side I would provide a CDL:
> 
>     cdl_option CYGNUM_DEVS_KINETIS_FLASH_BLOCK_SIZE {
>         display "Block size"
>         legal_values { 0 0x800 0x1000 }
>         default_value 0
>         description ".... 0 - Auto ...."
>    }
> 
> In addition the platform HAL can override. Also check if some other value can
> be configurable/inferred or read from Kinetis registers.
> 
> Regarding configuration options it would be good to cross-reference other
> device manuals, typically K40 and K70 (that we have or will have soon in eCos).
> 
> Ilija

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (10 preceding siblings ...)
  2012-05-02  8:27 ` bugzilla-daemon
@ 2012-05-02 15:13 ` bugzilla-daemon
  2012-05-02 15:18 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-02 15:13 UTC (permalink / raw)
  To: unassigned

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

Jonathan Larmour <jifl@ecoscentric.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jifl@ecoscentric.com

--- Comment #10 from Jonathan Larmour <jifl@ecoscentric.com> 2012-05-02 16:12:44 BST ---
Hi Nicolas,

Does the fact you cancelled the request for assignment mean you have filled in
the paperwork and we just need to wait for the FSF? Or does it mean there will
not be a copyright assignment for this contribution after all?

Jifl

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (11 preceding siblings ...)
  2012-05-02 15:13 ` bugzilla-daemon
@ 2012-05-02 15:18 ` bugzilla-daemon
  2012-05-02 15:20 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-02 15:18 UTC (permalink / raw)
  To: unassigned

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

--- Comment #11 from Nicolas Aujoux <nau@csm-instruments.com> 2012-05-02 16:18:27 BST ---
(In reply to comment #10)
> Hi Nicolas,
> 
> Does the fact you cancelled the request for assignment mean you have filled in
> the paperwork and we just need to wait for the FSF? Or does it mean there will
> not be a copyright assignment for this contribution after all?
> 
> Jifl

Hi Jifl,

Sorry if I cancelled the request for assignment, I did not do it on purpose.
The paperwork went to my manager (he was not available until now) and should
leave within the week.

Nicolas

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (12 preceding siblings ...)
  2012-05-02 15:18 ` bugzilla-daemon
@ 2012-05-02 15:20 ` bugzilla-daemon
  2012-05-02 16:02 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-02 15:20 UTC (permalink / raw)
  To: unassigned

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

--- Comment #12 from Jonathan Larmour <jifl@ecoscentric.com> 2012-05-02 16:19:51 BST ---
Thanks Nicolas, that's fine, I just wanted to know what the situation was.
Thanks for contributing!

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (13 preceding siblings ...)
  2012-05-02 15:20 ` bugzilla-daemon
@ 2012-05-02 16:02 ` bugzilla-daemon
  2012-05-10 13:52 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-02 16:02 UTC (permalink / raw)
  To: unassigned

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

--- Comment #13 from Ilija Kocho <ilijak@siva.com.mk> 2012-05-02 17:02:38 BST ---
(In reply to comment #12)
> Thanks Nicolas, that's fine, I just wanted to know what the situation was.
> Thanks for contributing!

Jifl

This unintentional cancellation seems to happen when the marked attachment is
being obsoleted.

Ilija

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (14 preceding siblings ...)
  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
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-10 13:52 UTC (permalink / raw)
  To: unassigned

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

--- Comment #14 from Nicolas Aujoux <nau@csm-instruments.com> 2012-05-10 14:51:38 BST ---
Now that I have Redboot with flash support running in the k60, is there any
memory mapping configuration to make in order to be able to load an launch an
eCos app via Redboot ?
I tried to launch a SRAM startup type eCos application frome a ROM startup type
RedBoot application but without success.

Thanks for your help,

Nicolas

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (15 preceding siblings ...)
  2012-05-10 13:52 ` bugzilla-daemon
@ 2012-05-10 14:26 ` bugzilla-daemon
  2012-05-10 17:08 ` bugzilla-daemon
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-10 14:26 UTC (permalink / raw)
  To: unassigned

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

--- Comment #15 from Ilija Kocho <ilijak@siva.com.mk> 2012-05-10 15:26:29 BST ---
(In reply to comment #14)
> Now that I have Redboot with flash support running in the k60, is there any
> memory mapping configuration to make in order to be able to load an launch an
> eCos app via Redboot ?
> I tried to launch a SRAM startup type eCos application frome a ROM startup type
> RedBoot application but without success.
> 
> Thanks for your help,
> 
> Nicolas

SRAM startup is intended for loading with JTAG. It does complete system
initialization as ROM startup (twr_k60n512_misc.c). For Redboot you need RAM
startup. I would recommend to look at TWR-K70F120M platform (just checked in)
for example. Probably you can make RAM startup with K60 SRAM alone but you may
have practical limitation with memory resources. We have built a Tower memory
module with FlexBus RAM (TWR-FXM) with which we can use Redboot.

I hope this helps
Ilija

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
  2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board bugzilla-daemon
                   ` (16 preceding siblings ...)
  2012-05-10 14:26 ` bugzilla-daemon
@ 2012-05-10 17:08 ` bugzilla-daemon
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla-daemon @ 2012-05-10 17:08 UTC (permalink / raw)
  To: unassigned

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

Ilija Kocho <ilijak@siva.com.mk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned@bugs.ecos.source |ilijak@siva.com.mk
                   |ware.org                    |

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-05-10 17:08 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 14:39 [Bug 1001561] New: Internal flash driver for Freescale TWR-K60N512 board 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:38 ` 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

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).