From: Roy Spliet <r.spliet@ultimaker.com>
To: Linux MTD Mailinglist <linux-mtd@lists.infradead.org>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>,
Baruch Siach <baruch@tkos.co.il>,
Rafal Milecki <zajec5@gmail.com>
Cc: Roy Spliet <r.spliet@ultimaker.com>
Subject: [RFC Patch 2/3] mtd: nand: Support non-ONFI timing modes
Date: Tue, 16 Jun 2015 11:45:03 +0200 [thread overview]
Message-ID: <1434447904-31748-3-git-send-email-r.spliet@ultimaker.com> (raw)
In-Reply-To: <1434447904-31748-1-git-send-email-r.spliet@ultimaker.com>
For chips whose timings are exceptionally aberrant to the point that it
impacts performance, we are going to need some mechanism to steer away
from ONFI modes. This lays the foundation for defining custom modes
---
drivers/mtd/nand/nand_base.c | 9 +++++++--
include/linux/mtd/nand.h | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index f561c68..8e636df 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3624,8 +3624,13 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
chip->ecc_strength_ds = NAND_ECC_STRENGTH(type);
chip->ecc_step_ds = NAND_ECC_STEP(type);
- mode = type->onfi_timing_mode_default;
- chip->sdr_timings = onfi_async_timing_mode_to_sdr_timings(mode);
+ if (type->custom_sdr_timing) {
+ chip->sdr_timings = type->custom_sdr_timing;
+ } else {
+ mode = type->onfi_timing_mode_default;
+ chip->sdr_timings =
+ onfi_async_timing_mode_to_sdr_timings(mode);
+ }
*busw = type->options & NAND_BUSWIDTH_16;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 2eb92a3..7d9e599 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -863,6 +863,7 @@ struct nand_flash_dev {
uint16_t step_ds;
} ecc;
int onfi_timing_mode_default;
+ const struct nand_sdr_timings *custom_sdr_timing;
};
/**
--
2.4.3
--
IMAGINE IT >> MAKE IT
Meet us online at Twitter <http://twitter.com/ultimaker>, Facebook
<http://facebook.com/ultimaker>, Google+ <http://google.com/+Ultimaker>
www.ultimaker.com
next prev parent reply other threads:[~2015-06-16 9:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 9:45 [RFC] Support custom timings for NAND chips Roy Spliet
2015-06-16 9:45 ` [RFC Patch 1/3] mtd: nand: Store actual timing in nand_chip Roy Spliet
2015-06-16 9:45 ` Roy Spliet [this message]
2015-06-16 9:45 ` [RFC Patch 3/3] mtd: nand: Add custom timings for Hynix H27UBG8T2BTR-BC Roy Spliet
2015-10-20 10:32 ` [RFC] Support custom timings for NAND chips Boris Brezillon
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=1434447904-31748-3-git-send-email-r.spliet@ultimaker.com \
--to=r.spliet@ultimaker.com \
--cc=baruch@tkos.co.il \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=maxime.ripard@free-electrons.com \
--cc=zajec5@gmail.com \
/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