Hi Patrick,

You are right that from machine view the granularity is just an index to 
a table.
Original author of driver selected indices along SFx suffix from 
reference manual name
and we should continue the good practice.
Here is draft of "flash granularities" I researched from Freescale 
technical docs 5 months ago:

static const struct {
         unsigned pflash_sector_size_bytes;
         unsigned pflash_prog_section_size_bytes;
         unsigned nvm_sector_size_bytes;
         unsigned num_blocks;
} kinetis_flash_params[6] = {
         { 1<<10, 1<<10, 1<<10, 2 },
         { 2<<10, 1<<10, 1<<10, 2 },
         { 2<<10, 2<<10, 2<<10, 2 },
         { 4<<10, 4<<10, 4<<10, 4 },
         { 0 }, // SF4: K11_M50 K12_M50 K21_M50...128-512k, 2 blocks, 2k 
sectors
         // KL16_M48 SF4 Supports MKL16Z256Vxxx
         // KL26_121P_M48 SF4 Supports MKL26Z256Vxxx, MKL26Z128xxx. 
32-256k, 1k sectors, 1 or 2 blocks

         { 4<<10, 1<<10, 4<<10, 2 }  // SF5: K21_M120 K22_M50 K22_M120 
K24_M120 K63 K64 max 1 kbyte pflash program section

         // KL16_M48 SF5 Supports MKL16Z32Vxxx, MKL16Z64Vxxx, MKL16Z128Vxxx.
         // KL26_M48 SF5 Supports MKL26Z32Vxxx, MKL26Z64Vxxx, 
MKL26Z128Vxxx.  128-256k, 1k sectors, 1 or 2 blocks

         //      { 1<<10, 1<<10, 2 } // SF6 KL17
         // KL17_M48 SF6 MKL17Z128Vxxx
         // KL27_M48 SF6 MKL27Z128Vxxx

         // SF7: K22_M120 (MK22FN512V) KV31_M120 Supports 
MKV31F512VLxxx... 512KB Flash, 2k sectors, 2 blocks, FTFA
         // SF8: K22_M120 (MK22FN256V.., MK22FN128CAH12R, 
MK22FN256CAH12R) KV31_M120...128-256KB Flash, 2k sectors, 1 block, FTFA

         // SF9: K22_M100 KV31_M100 Supports MKV31F128VLL10 and 
MKV31F128VLH10.
         // SFA: K02_M100 KV30_M100 Supports MKV30F128Vxx10 and 
MKV30F64Vxx10...64-128k 1 block 2k sectors
};

All KL MCUs probably belongs to flash granularity 0. I listed them here 
just by "SFx" number in reference manual file name.
K and KV MCUs are really grouped to SFx according to flash parameters AFAIK.

Hope that helps.

Tom

On 14.07.2015 18:40, Patrick Stewart (Code Review) wrote:
> Patrick Stewart has posted comments on this change.
>
> Change subject: Kinetis: Add K24 support
> ......................................................................
>
>
> Patch Set 2:
>
> granularity = 5 would be off the end of the granularity array. As far as I'm 
> aware 'granularity' doesn't mean anything beyond an array index in the 
> openOCD code base.
> You're right on the other two points, it should be two blocks and I'm abusing 
> the nvm sector size to reduce the flash size, as the K24 I'm using doesn't 
> have any flexNVM.
> I'm working on a nicer patchset, which I'll upload soon.
>


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to