mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Franck Jullien <franck.jullien@gmail.com>
To: christian.buettner@rafi.de
Cc: barebox@lists.infradead.org
Subject: Re: nor flash board init code
Date: Fri, 27 Jul 2012 13:33:31 +0200	[thread overview]
Message-ID: <CAJfOKBzrkLQBtFWFJ7AbVgiud_EwMA+XEY8BWRgV73iAkOZH-Q@mail.gmail.com> (raw)
In-Reply-To: <OFEAC6280E.37553221-ONC1257A46.004F6310-C1257A46.004FD422@o0802.rafi.inhouse>

2012/7/25 <christian.buettner@rafi.de>
>
> hi all,
> is there any example board init code to load the mx25l8005 spi nor-flash through the imx53 (TX53 from KARO)?
> I want to use the m25p80 driver to read and write.
>
> christian
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>

Hi Christian,

This is what I use with the Altera SPI controller + an SPI flash device:

http://www.elec4fun.fr/index.php?option=com_content&view=article&id=10&Itemid=153

static struct spi_altera_master altera_spi_0_data = {
      .num_chipselect = 1,
      .spi_mode = 0,      /* SPI mode of the EPCS flash controller */
      .databits = 8,      /* Data length of the EPCS flash controller */
      .speed = 20000000,  /* EPCS flash controller speed */
};


static struct flash_platform_data epcs_flash = {
      .name = "epcs",    /* Cdev name, optional */
      .type = "m25p40",  /* Device type, required for non JEDEC chips */
};

static struct spi_board_info generic_spi_board_info[] = {
      {
            .name = "m25p",
            .max_speed_hz = 20000000,
            .bus_num = 0,
            .chip_select = 0,
            .bits_per_word = 8,
            .mode = SPI_MODE_0,
            .platform_data = &epcs_flash,
      }
};

static int myboard_devices_init(void) {

...

spi_register_board_info(myboard_spi_board_info,
ARRAY_SIZE(myboard_spi_board_info));

add_generic_device("altera_spi", -1, NULL, NIOS_SOPC_EPCS_BASE, 0x18,
                    IORESOURCE_MEM, &altera_spi_0_data);

...

Franck.

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

  reply	other threads:[~2012-07-27 11:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 14:31 christian.buettner
2012-07-27 11:33 ` Franck Jullien [this message]
2012-07-30  8:00   ` Antwort: " christian.buettner
2012-07-30  8:07     ` Franck Jullien
2012-07-30  8:15       ` Antwort: " christian.buettner
2012-07-30  8:33         ` Franck Jullien
2012-07-30  8:44           ` Antwort: " christian.buettner
2012-07-30 13:58           ` christian.buettner
2012-07-30 14:28             ` Franck Jullien
2012-07-30 14:49               ` Antwort: " christian.buettner
2012-07-30 17:05                 ` Sascha Hauer
2012-08-02  6:32               ` christian.buettner
2012-08-02  8:46                 ` Jean-Christophe PLAGNIOL-VILLARD

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=CAJfOKBzrkLQBtFWFJ7AbVgiud_EwMA+XEY8BWRgV73iAkOZH-Q@mail.gmail.com \
    --to=franck.jullien@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=christian.buettner@rafi.de \
    /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