linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. is25lp256d
@ 2018-03-15 14:13 Frank Smith
  2018-03-15 14:27 ` Frieder Schrempf
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Smith @ 2018-03-15 14:13 UTC (permalink / raw)
  To: linux-mtd

Dear list,

I am trying to get a new issi flash device (is25lp256d, 32MB) working. 
http://www.issi.com/WW/pdf/IS25LP(WP)256D.pdf

Therefore I added this line to spi-nor.c:

{ "is25lp256d", INFO(0x9d6019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK) },

I can confirm the flash device works as espected for the first 16MB.


But, when I change the partition in the device tree, from 16MB to 32MB I get the following errror: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. 

Changed "reg = <0x600000 0xa00000>;" to "reg = <0x600000 0x1a00000>;" in my device-tree file as follows:

spi_2: spi@0x31044000 {
	#address-cells = <1>;
	#size-cells = <0>;
	compatible = "adi,spi3";
	reg = <0x31044000 0xFF>;
	interrupts = <0 71 0>;
	num-cs = <128>;
	dma-channel = <26>, <27>;
	pinctrl-names = "default";
	pinctrl-0 = <&spi2_quad>;

	flash: s25fl128s@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "issi,is25lp256d", "jedec,spi-nor";
		spi-max-frequency = <50000000>;
		reg = <31>;
		spi-cpol;
		spi-cpha;
		spi-tx-bus-width = <4>;
		spi-rx-bus-width = <4>;
		dma-mode;
		partition@0 {
			label = "uboot (spi)";
			reg = <0x0 0x80000>;
		};
		partition@1 {
			label = "kernel (spi)";
			reg = <0x80000 0x580000>;
		};
		partition@2 {
			label = "root file system (spi)";
			reg = <0x600000 0x1a00000>;   /* <--- changed this from 0x0a00000 to 0x1a00000 */
		};
	};
};

Tried to use mtd-tools, but when writing at address 0xaXXXXX or higher, linux starts hanging, without a Ops.

Any Ideas? What is wrong with the higher addresses?

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

* Re: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. is25lp256d
  2018-03-15 14:13 jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. is25lp256d Frank Smith
@ 2018-03-15 14:27 ` Frieder Schrempf
  2018-03-15 14:43   ` Aw: " Frank Smith
  0 siblings, 1 reply; 6+ messages in thread
From: Frieder Schrempf @ 2018-03-15 14:27 UTC (permalink / raw)
  To: Frank Smith; +Cc: linux-mtd

Hi Frank,

On 15.03.2018 15:13, Frank Smith wrote:
> Dear list,
> 
> I am trying to get a new issi flash device (is25lp256d, 32MB) working.
> http://www.issi.com/WW/pdf/IS25LP(WP)256D.pdf
> 
> Therefore I added this line to spi-nor.c:
> 
> { "is25lp256d", INFO(0x9d6019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK) },
> 
> I can confirm the flash device works as espected for the first 16MB.
> 
> 
> But, when I change the partition in the device tree, from 16MB to 32MB I get the following errror: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found.

I guess you need to set SPI_NOR_4B_OPCODES flag to use 4 byte addressing 
and be able to access memory above 16MB.

Regards,

Frieder

> 
> Changed "reg = <0x600000 0xa00000>;" to "reg = <0x600000 0x1a00000>;" in my device-tree file as follows:
> 
> spi_2: spi@0x31044000 {
> 	#address-cells = <1>;
> 	#size-cells = <0>;
> 	compatible = "adi,spi3";
> 	reg = <0x31044000 0xFF>;
> 	interrupts = <0 71 0>;
> 	num-cs = <128>;
> 	dma-channel = <26>, <27>;
> 	pinctrl-names = "default";
> 	pinctrl-0 = <&spi2_quad>;
> 
> 	flash: s25fl128s@0 {
> 		#address-cells = <1>;
> 		#size-cells = <1>;
> 		compatible = "issi,is25lp256d", "jedec,spi-nor";
> 		spi-max-frequency = <50000000>;
> 		reg = <31>;
> 		spi-cpol;
> 		spi-cpha;
> 		spi-tx-bus-width = <4>;
> 		spi-rx-bus-width = <4>;
> 		dma-mode;
> 		partition@0 {
> 			label = "uboot (spi)";
> 			reg = <0x0 0x80000>;
> 		};
> 		partition@1 {
> 			label = "kernel (spi)";
> 			reg = <0x80000 0x580000>;
> 		};
> 		partition@2 {
> 			label = "root file system (spi)";
> 			reg = <0x600000 0x1a00000>;   /* <--- changed this from 0x0a00000 to 0x1a00000 */
> 		};
> 	};
> };
> 
> Tried to use mtd-tools, but when writing at address 0xaXXXXX or higher, linux starts hanging, without a Ops.
> 
> Any Ideas? What is wrong with the higher addresses?
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
> 

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

* Aw: Re: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. is25lp256d
  2018-03-15 14:27 ` Frieder Schrempf
@ 2018-03-15 14:43   ` Frank Smith
  2018-03-15 15:04     ` Frieder Schrempf
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Smith @ 2018-03-15 14:43 UTC (permalink / raw)
  To: Frieder Schrempf; +Cc: linux-mtd

> I guess you need to set SPI_NOR_4B_OPCODES flag to use 4 byte addressing
> and be able to access memory above 16MB.

SPI_NOR_4B_OPCODES does not have an effect. Still these error above from 0xA00000 to 0xeXXXXX

jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d60024: 0x0069 instead

and 

jffs2: Empty flash at 0x00d6fe34 ends at 0x00d6fe3c

What do you mean by, be able to access memory above 16MB? How to verify this?

Best, Frank

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

* Re: Aw: Re: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. is25lp256d
  2018-03-15 14:43   ` Aw: " Frank Smith
@ 2018-03-15 15:04     ` Frieder Schrempf
  2018-03-16  8:28       ` Aw: " Frank Smith
  0 siblings, 1 reply; 6+ messages in thread
From: Frieder Schrempf @ 2018-03-15 15:04 UTC (permalink / raw)
  To: Frank Smith; +Cc: linux-mtd

On 15.03.2018 15:43, Frank Smith wrote:
>> I guess you need to set SPI_NOR_4B_OPCODES flag to use 4 byte addressing
>> and be able to access memory above 16MB.
> 
> SPI_NOR_4B_OPCODES does not have an effect. Still these error above from 0xA00000 to 0xeXXXXX
> 
> jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00d60024: 0x0069 instead
> 
> and
> 
> jffs2: Empty flash at 0x00d6fe34 ends at 0x00d6fe3c
> 
> What do you mean by, be able to access memory above 16MB? How to verify this?
> 

Unfortunately I'm not an expert, but what I do know is, that you need 4 
byte addresses to be able to access memory above 16MiB (simply because 
with 3 bytes you can only address 2^24 bytes = 16MiB).

And in the spi-nor driver you can set SPI_NOR_4B_OPCODES to tell the 
driver to use the special opcodes for 4 byte mode.

But I haven't looked into this and I don't know if ISSI chips need any 
special handling.

Also as I already said, I'm not an expert and other people on the list 
can probably tell you more about this.

Regards,

Frieder

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

* Aw: Re:  Re: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. is25lp256d
  2018-03-15 15:04     ` Frieder Schrempf
@ 2018-03-16  8:28       ` Frank Smith
  2018-03-19 17:48         ` Frank Smith
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Smith @ 2018-03-16  8:28 UTC (permalink / raw)
  To: Frieder Schrempf; +Cc: linux-mtd

I figured out, when writing zero's with "flashcp" onto 0xA00000 or higher the first sectors at 0x000000 are equal.
So, partial both areas, are identical.. somehow.

Do you know where to start at debugging?

Best, Frank

 

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

* Aw: Re:  Re: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. is25lp256d
  2018-03-16  8:28       ` Aw: " Frank Smith
@ 2018-03-19 17:48         ` Frank Smith
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Smith @ 2018-03-19 17:48 UTC (permalink / raw)
  To: Frank Smith; +Cc: Frieder Schrempf, linux-mtd

After some debugging, I figured out is25lp256d is not jedec jesd16b conform.

nor->addr_width = 3 is the result from the spi_nor_parse_bfpt and this is wrong. It should be 4.

	err = spi_nor_read_sfdp_dma_unsafe(nor,  addr, len, &bfpt);
	if (err < 0)
		return err;

	/* Fix endianness of the BFPT DWORDs. */
	for (i = 0; i < BFPT_DWORD_MAX; i++)
		bfpt.dwords[i] = le32_to_cpu(bfpt.dwords[i]);

        /* Number of address bytes. */
	switch (bfpt.dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) {
	case BFPT_DWORD1_ADDRESS_BYTES_3_ONLY:  <-- this is not right should be 3 or 4
		nor->addr_width = 3;
		break;

	case BFPT_DWORD1_ADDRESS_BYTES_4_ONLY:
		nor->addr_width = 4;
		break;

	default:
		break;
	}


I got it working with the following hack:

sei-nor.h
#define SNOR_MFR_ISSI	0x9d 

spi-nor.c:
{ "is25lp256d", INFO(0x9d6019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES) },

spi_nor_init_params(){
..
if(JEDEC_MFR(info)== SNOR_MFR_ISSI)
   nor->addr_width = 0;
}

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

end of thread, other threads:[~2018-03-19 17:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15 14:13 jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found. is25lp256d Frank Smith
2018-03-15 14:27 ` Frieder Schrempf
2018-03-15 14:43   ` Aw: " Frank Smith
2018-03-15 15:04     ` Frieder Schrempf
2018-03-16  8:28       ` Aw: " Frank Smith
2018-03-19 17:48         ` Frank Smith

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