All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] ARM: configs: cm_fx6: add mtd support
Date: Sun, 19 Jun 2016 17:44:56 +0200	[thread overview]
Message-ID: <c80e03b327e3441198284b3e1b080b2f@rwthex-s1-b.rwth-ad.de> (raw)
In-Reply-To: <20160619154456.29027-1-christopher.spinrath@rwth-aachen.de>

The cm-fx6 module has an on-board spi flash chip. Enable mtd support
and the mtdparts command. Also define a default partitioning, add
it to the default environment, and enable support to overwrite the
partitioning defined in a device tree by it.

These changes move the effective default partitioning from the device
tree shipped with the vendor kernels to u-boot which becomes the single
point of definition for the partitioning for all device tree based
kernels (in particular, for the upstream linux kernel which does not
have a default partitioning defined in its device tree).

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
---
 include/configs/cm_fx6.h | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index f054ca8..c839b03 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -18,6 +18,7 @@
 #define CONFIG_MACH_TYPE		4273
 
 /* CMD */
+#define CONFIG_CMD_MTDPARTS
 
 /* MMC */
 #define CONFIG_SYS_FSL_USDHC_NUM	3
@@ -53,6 +54,20 @@
 #define CONFIG_SF_DEFAULT_SPEED		25000000
 #define CONFIG_SF_DEFAULT_MODE		(SPI_MODE_0)
 
+/* MTD support */
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_FDT_FIXUP_PARTITIONS
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_SPI_FLASH_MTD
+#endif
+
+#define MTDIDS_DEFAULT		"nor0=spi0.0"
+#define MTDPARTS_DEFAULT	"mtdparts=spi0.0:" \
+				"768k(uboot)," \
+				"256k(uboot-environment)," \
+				"-(reserved)"
+
 /* Environment */
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
@@ -83,6 +98,8 @@
 	"video_dvi=mxcfb0:dev=dvi,1280x800M-32 at 50,if=RGB32\0" \
 	"doboot=bootm ${loadaddr}\0" \
 	"doloadfdt=false\0" \
+	"mtdids=" MTDIDS_DEFAULT "\0" \
+	"mtdparts=" MTDPARTS_DEFAULT "\0" \
 	"setboottypez=setenv kernel ${zImage};" \
 		"setenv doboot bootz ${loadaddr} - ${fdtaddr};" \
 		"setenv doloadfdt true;\0" \
@@ -157,7 +174,7 @@
 	"run setupnandboot;" \
 	"run nandboot;"
 
-#define CONFIG_PREBOOT		"usb start"
+#define CONFIG_PREBOOT		"usb start;sf probe"
 
 /* SPI */
 #define CONFIG_SPI
-- 
2.8.3

  parent reply	other threads:[~2016-06-19 15:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-19 15:44 [U-Boot] [PATCH 0/3] ARM: imx: enhance support for the cm-fx6 module Christopher Spinrath
2016-06-19 15:44 ` [U-Boot] [PATCH 1/3] ARM: configs: cm_fx6: improve default environment Christopher Spinrath
2016-06-22 15:24   ` Igor Grinberg
2016-07-07  8:20   ` Nikita Kiryanov
2016-06-19 15:44 ` [U-Boot] [PATCH 2/3] ARM: board: cm_fx6: fixup mtd partitions in the fdt Christopher Spinrath
2016-06-22 16:02   ` Igor Grinberg
2016-06-22 16:17   ` Igor Grinberg
2016-07-07  8:53     ` Nikita Kiryanov
     [not found]     ` <2998896d159243199ecf53a75c1c6698@rwthex-s2-a.rwth-ad.de>
2016-07-07 13:30       ` Christopher Spinrath
2016-07-10  7:52         ` Nikita Kiryanov
     [not found]         ` <a2247b7ba1f141c3b8b5392e9164554e@rwthex-s2-a.rwth-ad.de>
2016-07-11 11:54           ` Christopher Spinrath
     [not found]   ` <fec86b5e27364c219569d1aa1297af83@rwthex-s2-a.rwth-ad.de>
2016-06-22 19:21     ` Christopher Spinrath
2016-06-23  8:56       ` Igor Grinberg
     [not found]       ` <c0cbb752390c4ad2b8e6f757c5251e86@rwthex-s1-a.rwth-ad.de>
2016-06-25 15:03         ` Christopher Spinrath
2016-06-19 15:44 ` Christopher Spinrath [this message]
2016-06-22 16:15   ` [U-Boot] [PATCH 3/3] ARM: configs: cm_fx6: add mtd support Igor Grinberg
     [not found]   ` <795d43d2bdc64a5d84abadcdbe528fdb@rwthex-w2-b.rwth-ad.de>
2016-06-22 19:27     ` Christopher Spinrath
2016-06-23  9:03       ` Igor Grinberg
     [not found]       ` <74b93a24448a4d4e93d5f1a2c28b1580@rwthex-w1-a.rwth-ad.de>
2016-06-25 15:05         ` Christopher Spinrath
2016-06-22 15:46 ` [U-Boot] [PATCH 0/3] ARM: imx: enhance support for the cm-fx6 module Igor Grinberg
     [not found] ` <1510d02bba0b4658aa2f20276e484c76@rwthex-s2-b.rwth-ad.de>
2016-06-22 19:10   ` Christopher Spinrath

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=c80e03b327e3441198284b3e1b080b2f@rwthex-s1-b.rwth-ad.de \
    --to=christopher.spinrath@rwth-aachen.de \
    --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.