mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Holger Schurig <holgerschurig@gmail.com>
To: barebox@lists.infradead.org
Subject: SPI question
Date: Tue, 13 May 2014 11:28:07 +0200	[thread overview]
Message-ID: <CAOpc7mEpPQRiCd60RK9Mc=DtVLqNVqg2Y+WxXOuJNk+=AMZFPA@mail.gmail.com> (raw)

Hi,

I have an SPI NOR flash in my device and with the patch below it get's
detected. However, I cannot erase it. The flash is a Micron N25Q512A,
thought the JEDEC ID matches that of a N25Q512 from u-boot's source
code. Any idea on what's going on?

detected i.MX6 Quad revision 1.2
mdio_bus: miibus0: probed
m25p80 spiflash@00: n25q512 (65536 Kbytes)
m25p80 spiflash@00: mtd .name = <NULL>, .size = 0x4000000 (64MiB)
.erasesize = 0x00001000 (4KiB) .numeraseregions = 0
m25p80 spiflash@10: n25q512 (65536 Kbytes)
m25p80 spiflash@10: mtd .name = <NULL>, .size = 0x4000000 (64MiB)
.erasesize = 0x00001000 (4KiB) .numeraseregions = 0
imx-esdhc 2194000.usdhc: registered as 2194000.usdhc
imx-esdhc 219c000.usdhc: registered as 219c000.usdhc
barebox-environment environment.11: setting default environment path
to /dev/m25p0.barebox-environment
wrong crc on env
no valid environment found on /dev/m25p0.barebox-environment. Using
default environment
running /env/bin/init...
barebox:/ unprotect /dev/m25p0
barebox:/ erase /dev/m25p0
m25p80 spiflash@00: m25p80_erase at 0x0, len 67108864
m25p80 spiflash@00: erase_chip 65536KiB
barebox:/ md -s /dev/m25p0
00000000: 798fba79 00000000 6c456c4c 000001e0                y..y....LlEl....
00000010: 00000001 00000000 29438628 67a8c78d                ........(.C)...g
00000020: 000000b1 00000018 74656e2f 6b726f77                ......../network
00000030: 6874652f 00000030 68a8c78d 000001ff                /eth0......h....
00000040: 622f2123 732f6e69 230a0a68 20706920                #!/bin/sh..# ip
00000050: 74746573 20676e69 61747328 2f636974                setting (static/
00000060: 70636864 70690a29 6174733d 0a636974                dhcp).ip=static.
00000070: 7320230a 69746174 65732063 20707574                .# static setup
00000080: 64657375 20666920 733d7069 69746174                used if ip=stati
00000090: 70690a63 72646461 3239313d 3836312e                c.ipaddr=192.168
000000a0: 3333322e 3839312e 74656e0a 6b73616d                .233.198.netmask
000000b0: 3535323d 3535322e 3535322e 730a302e                =255.255.255.0.s
000000c0: 65767265 3d706972 2e323931 2e383631                erverip=192.168.
000000d0: 2e333332 650a3836 64616874 413d7264                233.68.ethaddr=A
000000e0: 42453a32 3a32373a 353a3638 46313a31                2:EB:72:86:51:1F
000000f0: 0000000a 67a8c78d 00000032 ff000014                .......g2.......

However, the fact that actually something is stored there seems that
things are at least partially working, i.e. on of the "saveenv"
commands must have worked).


Index: barebox/drivers/mtd/devices/m25p80.c
===================================================================
--- barebox.orig/drivers/mtd/devices/m25p80.c   2014-05-06
19:28:24.735953323 +0200
+++ barebox/drivers/mtd/devices/m25p80.c        2014-05-06
19:29:01.907954021 +0200
@@ -661,6 +661,7 @@ static const struct platform_device_id m
        /* Micron */
        { "n25q128",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
        { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
+       { "n25q512",  INFO(0x20ba20, 0, 64 * 1024,1024, SECT_4K) },

        /* Spansion -- single (large) sector size only, at least
         * for the chips listed here (without boot sectors).

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2014-05-13  9:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAOpc7mEpPQRiCd60RK9Mc=DtVLqNVqg2Y+WxXOuJNk+=AMZFPA@mail.gmail.com' \
    --to=holgerschurig@gmail.com \
    --cc=barebox@lists.infradead.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