From: Mikhail Kshevetskiy <mkshevetskiy@oktetlabs.ru>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] mtd: make spinand driver usable without CONFIG_DM
Date: Sat, 11 Jul 2020 12:36:26 +0300 [thread overview]
Message-ID: <20200711123626.1c068778@laska.lan> (raw)
In-Reply-To: <CAMty3ZBn2W7267av=teTn=0dqMOPcim6d9KuZ1hiTJPrOHqLyQ@mail.gmail.com>
On Sat, 11 Jul 2020 14:16:23 +0530
Jagan Teki <jagan@amarulasolutions.com> wrote:
> On Mon, Jun 22, 2020 at 9:25 PM Mikhail Kshevetskiy
> <mikhail.kshevetskiy@oktetlabs.ru> wrote:
> >
> > From: Mikhail Kshevetskiy <Mikhail.Kshevetskiy@oktetlabs.ru>
> >
> > Here is an example of spinand driver initialization without CONFIG_DM
> > enabled:
> >
> > void board_nand_init(void)
> > {
> > static struct spinand_device spinand;
> > static struct mtd_info mtd;
> > static struct spi_slave *slave;
> > int ret;
> >
> > memset(&spinand, 0, sizeof(spinand));
> > memset(&mtd, 0, sizeof(mtd));
> >
> > slave = spi_setup_slave(BUS, CS, MAX_HZ, MODE);
> > if (!slave) {
> > printf("SPI-NAND: Failed to set up SPI slave\n");
> > return;
> > }
> >
> > slave->mode |= (SPI_TX_BYTE | SPI_RX_SLOW);
> > slave->max_read_size = SPI_MAX_READ_SIZE;
> > slave->max_write_size = SPI_MAX_WRITE_SIZE;
> >
> > ret = spinand_probe_no_dm(&spinand, slave, &mtd);
> > if (!ret)
> > nand_register(0, &mtd);
> > }
> >
> > Using of dual and quad wire transfer modes requires:
> > * dual/quad speed capable hardware (both controller and flash)
> > * physical presence of 4 data wires (quad mode only)
> > * spi controller driver MUST supports slave->mem_ops.exec_op() operations
> > (spi_xfer() interface will suits for single speed data transfer mode
> > only)
> >
> > Signed-off-by: Mikhail Kshevetskiy <Mikhail.Kshevetskiy@oktetlabs.ru>
> > ---
>
> Now it's time for dm only code, better not come up with nondm anymore
> as possible, please.
>
> Jagan.
I know about it. These patches were in the queue for upstreaming from the new
year :-(
We are using 2010 and 2016 year based u-boot in our projects and due to some
reasons it's not easy to switch it to DM build. This two patches helps us with
backporting of spinand driver from upsteam u-boot. I think we are not an only
users of old u-boot in the world, so it maybe helpful for other people as well.
Just ignore these two patches if you think that NODM era is completely over.
Mikhail.
next prev parent reply other threads:[~2020-07-11 9:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-22 15:54 [PATCH 1/2] spi: make spi-mem driver usable without CONFIG_DM_SPI, drop NODM variant Mikhail Kshevetskiy
2020-06-22 15:54 ` [PATCH 2/2] mtd: make spinand driver usable without CONFIG_DM Mikhail Kshevetskiy
2020-07-11 8:46 ` Jagan Teki
2020-07-11 9:36 ` Mikhail Kshevetskiy [this message]
2020-07-11 9:45 ` Jagan Teki
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=20200711123626.1c068778@laska.lan \
--to=mkshevetskiy@oktetlabs.ru \
--cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.