Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - flashio and resource manager questions...: (9 Items)
   
flashio and resource manager questions...  
Hi, 

My group recently moved up to QNX 6.5.0 SP1 use.  Prior to that, we were using QNX 6.4.1 (prior to that QNX 6.3.2, and 
so forth...).   

I am trying to trace a FLASH i/f failure message I am getting now with QNX 6.5.0 SP1:

DCMD_F3S_ULOCKDOWN failed (errno 25 Inappropriate I/O control operation)


1. What does the error mean? 
2. Can I access the flashio lib and/or flashio resourcemgr code to understand the code flow?
3. How can I determine what FLASH interface f3s_start is using for my FLASH?  

Wrt question 3: I have been told I have a spansion S29GL128P or similar device.  However at startup, I see the following
 from devf-generic: 

f3s_s29glxxxs_ident - process_technology 0x14

Based on the devf-generic driver spansion interface f3s_s29glxxxs_ident(), this means the spansion interface does not 
support my device...

I hope this is the correct thread. :)  Parts of my question can only be resolved through understanding the flashio lib 
and resource manager which I think are part of the kernel..?

 


Re: flashio and resource manager questions...  
Not a reply, just more information on my situation.  At startup, I get the following information from devf-generic using
 -vvv:


Flash Development Library - HEAD
Build: Jun 20 2012 13:26:54
MTD Build: Jun 20 2012, 13:43:04

(devf  t1::f3s_flash_probe:107) trying device width = 4

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 2

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 1

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 8
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 1, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 4

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 2

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 1

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 8
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 1, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 4

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 2

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 1

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 8
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 1, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 4

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 2

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 1

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 8
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 1, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 4

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 1

(devf  t1::f3s_flash_probe:107) trying device width = 2

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 2
(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 1
f3s_s29glxxxs_ident - process_technology 0x14

(devf  t1::f3s_flash_probe:107) trying device width = 1

(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 8
(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 4
(devf  t1::f3s_flash_probe:118) bus width  = 2,...
View Full Message
Re: flashio and resource manager questions...  
Hi Maurice,

1 - The lockdown feature has been disabled in newer builds including 6.5.0
SP1. My understanding is that the lockdown feature was used to access the
OTP area of the flash device. This feature was disabled by default after
we introduced new devctls (see below) to access OTP area. In this case I
think the best to plan is one of the following:
A) Request a custom build which still includes the lockdown feature
B) Use the alternative mechanism that was developed, e.g.
#define DCMD_F3S_READSSR __DIOTF(_DCMD_F3S, F3S_READSSR, uint32_t)
#define DCMD_F3S_WRITESSR __DIOTF(_DCMD_F3S, F3S_WRITESSR, uint32_t)
#define DCMD_F3S_LOCKSSR __DIOTF(_DCMD_F3S, F3S_LOCKSSR, uint32_t)
#define DCMD_F3S_STATSSR __DIOTF(_DCMD_F3S, F3S_STATSSR, uint32_t)

C) Remove devctls which use the lockdown feature if your project no longer
needs to access the OTP area.


2 - I’m not too sure about how we would distribute the libfs-flash3 source
code, although I think you could submit a source request. I would check
with your FAE or support contact.

3 - Based on the text from devf-generic you mentioned it looks like
mtd-flash/spansion/s29glxxxs_* code is being used…I think this makes sense
since you mentioned you’re using a Spansion S29GL part. You might be able
to instrument the s29glxxxs_ident.c code to get a model number too, but I
haven’t tried this.

Also to confirm, I’m assuming you’re able to read/write to NOR it’s just
the lockdown mechanism that didn’t work?

--
Mark Wakim
Embedded Software Developer, QNX Software Systems Limited
613-591-0836 x24683 <tel:613-591-0836%20x24683>






On 2014-10-09, 6:45 PM, "maurice gibbs" <community-noreply@qnx.com> wrote:

>Not a reply, just more information on my situation.  At startup, I get
>the following information from devf-generic using -vvv:
>
>
>Flash Development Library - HEAD
>Build: Jun 20 2012 13:26:54
>MTD Build: Jun 20 2012, 13:43:04
>
>(devf  t1::f3s_flash_probe:107) trying device width = 4
>
>(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 2
>(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 1
>
>(devf  t1::f3s_flash_probe:107) trying device width = 2
>
>(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 4
>(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 2
>(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 1
>
>(devf  t1::f3s_flash_probe:107) trying device width = 1
>
>(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 8
>(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 4
>(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 2
>(devf  t1::f3s_flash_probe:118) bus width  = 1, interleave = 1
>
>(devf  t1::f3s_flash_probe:107) trying device width = 4
>
>(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 2
>(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 1
>
>(devf  t1::f3s_flash_probe:107) trying device width = 2
>
>(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 4
>(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 2
>(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 1
>
>(devf  t1::f3s_flash_probe:107) trying device width = 1
>
>(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 8
>(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 4
>(devf  t1::f3s_flash_probe:118) bus width  = 2, interleave = 2
>(devf  t1::f3s_flash_probe:118) bus width  = 1, interleave = 1
>
>(devf  t1::f3s_flash_probe:107) trying device width = 4
>
>(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave = 2
>(devf  t1::f3s_flash_probe:118) bus width  = 4, interleave = 1
>
>(devf  t1::f3s_flash_probe:107) trying device width = 2
>
>(devf  t1::f3s_flash_probe:118) bus width  = 8, interleave =...
View Full Message
Re: flashio and resource manager questions...  
Mark! Hello!

I'm investigating this because we are having some failures writing to Flash (~30% of write attempts).  The "
DCMD_F3S_ULOCKDOWN failed" message consistently happened %100 all the time (%100), so I am following up to determine if 
the unlocking failure is a part of the problem or a symptom of our larger problem. 

1. Can you re-confirm that it is the Spansion interfaces from the devf-generic we are using?  I see the following from 
the devf-generic startup:

... f3s_s29glxxxs_ident - process_technology 0x14

However, I also see the following code snippet from the devf-generic code I downloaded from Foundry27 in file
patches/650-3766/RS4767_devf-all_src/src/hardware/flash/mtd-flash/spansion/s29glxxxs_ident.c:

line 174: if (process_technology < 0x1C) return (ENOTSUP);


Based on line 174, my assumption is the devf-generic spansion interface does not support our FLASH with 
process_technology = 0x14.  If so, which devf-generic interface from the patch directory is actually being used?

maurice
R&D Software, JDSU
Re: flashio and resource manager questions...  
Just expanding on the last code snippet:


	/* This driver is for 65nm or smaller only (S29GL-R, S29GL-S, ....) */
        process_technology = (readmem(memory + (0x45 * amd_mult)) / flashcfg.device_mult);
	if (verbose > 1) {
		printf("%s - process_technology 0x%x \n", __func__, process_technology);
	}
	if (process_technology < 0x1C) return (ENOTSUP);



Based on my device process_technology = 0x14 (90nm S29GL-P), what are the devf-generic interface used for my device?
Re: flashio and resource manager questions...  
Another question: 

1) can you send us documentation (or references for documentation) for the alternative DCMD set you sent me?

#define DCMD_F3S_READSSR __DIOTF(_DCMD_F3S, F3S_READSSR, uint32_t)
#define DCMD_F3S_WRITESSR __DIOTF(_DCMD_F3S, F3S_WRITESSR, uint32_t)
#define DCMD_F3S_LOCKSSR __DIOTF(_DCMD_F3S, F3S_LOCKSSR, uint32_t)
#define DCMD_F3S_STATSSR __DIOTF(_DCMD_F3S, F3S_STATSSR, uint32_t)

2) Can we unlock the partitions using new DCMD set?  We actually are trying to unlock. Locking is not a requirement.
Re: flashio and resource manager questions...  
Hey Maurice!

I took a closer look at the log and you’re right the f3s_s29glxxxs_ident
fails since the process technology check failing.

It looks like devf-generic then tries to use f3s_aCFI_ident and the
identification succeeds (see the loop in f3s_flash_probe() where the ident
callbacks get called). If the following check hadn’t succeeded you would
see devf-generic attempt to use device width 4,2,1 with the next block. It
looks like these functions are used:
  {
			sizeof(f3s_flash_v2_t),
			f3s_aCFI_ident,			/* Common Ident             */
			f3s_a29f040_reset,		/* Common Reset             */

			/* v1 ReadWrite/Erase/Suspend/Resume/Sync (Unused)  */
			NULL, NULL, NULL, NULL, NULL, NULL,

			NULL,					/* v2 Read    (Use default) */
			f3s_aCFI_v2write,		/* v2 Write                 */
			f3s_a29f100_v2erase,	/* v2 Erase                 */
			f3s_a29f040_v2suspend,	/* v2 Suspend               */
			f3s_a29f040_v2resume,	/* v2 Resume                */
			f3s_a29f040_v2sync,		/* v2 Sync                  */
			f3s_aCFI_v2islock,
			f3s_aCFI_v2lock,
			f3s_aCFI_v2unlock,
			f3s_aCFI_v2unlockall,
			f3s_aMB_v2ssrop
		},

But you can instrument f3s_aCFI_ident to be totally sure. Normally you
would then see more info about the part, e.g. something like this: "(devf
t1::f3s_skt_attach:135) fs0 array Numonyx CFI U: 100 S: 020000” but in
your case the extra details are not printed…not sure why.

I couldn’t find any docs for the new devctl commands but I did find some
sample code, see attached.

I’m not that familiar with the NOR flash locking mechanism but could you
just use F3S_LOCK / F3S_UNLOCK? Or do you need to specifically access the
OTP section of the chip?


Hope you’re doing well, have a great long weekend!

--
Mark Wakim
Embedded Software Developer, QNX Software Systems Limited
613-591-0836 x24683 <tel:613-591-0836%20x24683>






On 2014-10-10, 2:20 PM, "maurice gibbs" <community-noreply@qnx.com> wrote:

>Another question: 
>
>1) can you send us documentation (or references for documentation) for
>the alternative DCMD set you sent me?
>
>#define DCMD_F3S_READSSR __DIOTF(_DCMD_F3S, F3S_READSSR, uint32_t)
>#define DCMD_F3S_WRITESSR __DIOTF(_DCMD_F3S, F3S_WRITESSR, uint32_t)
>#define DCMD_F3S_LOCKSSR __DIOTF(_DCMD_F3S, F3S_LOCKSSR, uint32_t)
>#define DCMD_F3S_STATSSR __DIOTF(_DCMD_F3S, F3S_STATSSR, uint32_t)
>
>2) Can we unlock the partitions using new DCMD set?  We actually are
>trying to unlock. Locking is not a requirement.
>
>
>
>
>_______________________________________________
>
>OSTech
>http://community.qnx.com/sf/go/post112029
>To cancel your subscription to this discussion, please e-mail
>ostech-core_os-unsubscribe@community.qnx.com

Attachment: Text lockssr.c 951 bytes Text readssr.c 1.27 KB Text writessr.c 1.08 KB
Re: flashio and resource manager questions...  
Hi,

I have another follow-up question.  Does the devf-generic driver take any actions prior to calling the unlock API?  If 
so, what actions are taken?

maurice
Re: flashio and resource manager questions...  
When the lock/unlock devctls get called the fs-flash3 lib does some
internal checks then calls the lock/unlock callback, e.g.
f3s_aCFI_v2dlock. The checks done by the fs-flash3 seem to be mostly error
checking but if you need to know the details you could request the
fs-flash3 source code.

Mark


On 2014-10-20, 10:29 PM, "maurice gibbs" <community-noreply@qnx.com> wrote:

>Hi,
>
>I have another follow-up question.  Does the devf-generic driver take any
>actions prior to calling the unlock API?  If so, what actions are taken?
>
>maurice
>
>
>
>_______________________________________________
>
>OSTech
>http://community.qnx.com/sf/go/post112076
>To cancel your subscription to this discussion, please e-mail
>ostech-core_os-unsubscribe@community.qnx.com