public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCHv7 6/7] igep00x0: UBIize
Date: Sun, 17 Jan 2016 04:16:03 +0100	[thread overview]
Message-ID: <20160117031603.GG28493@localhost.localdomain> (raw)
In-Reply-To: <20160117030929.GA28493@localhost.localdomain>

Convert IGEP board to use UBI volumes for U-Boot, its environment and
kernel. With exception of first four sectors read by SoC boot
ROM whole NAND is UBI managed. As code is too big now, drop
CONFIG_SPL_EXT_SUPPORT to make it fit.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 include/configs/omap3_igep00x0.h | 80 ++++++++++++++++++++++------------------
 1 file changed, 45 insertions(+), 35 deletions(-)

diff --git a/include/configs/omap3_igep00x0.h b/include/configs/omap3_igep00x0.h
index 5da6cfd..9afbcbe 100644
--- a/include/configs/omap3_igep00x0.h
+++ b/include/configs/omap3_igep00x0.h
@@ -74,6 +74,8 @@
 #define CONFIG_CMD_CACHE
 #ifdef CONFIG_BOOT_ONENAND
 #define CONFIG_CMD_ONENAND	/* ONENAND support		*/
+#else
+#define CONFIG_CMD_UBI
 #endif
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_PING
@@ -86,6 +88,10 @@
 	"stdout=serial\0" \
 	"stderr=serial\0"
 
+#define ENV_MTD_SETTINGS \
+	"mtdids=nand0=gpmc-nand.0\0" \
+	"mtdparts=mtdparts=gpmc-nand.0:512k(SPL),-(UBI)\0"
+
 #define MEM_LAYOUT_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
 	"scriptaddr=0x87E00000\0" \
@@ -96,36 +102,15 @@
 
 #include <config_distro_bootcmd.h>
 
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	ENV_DEVICE_SETTINGS \
+	ENV_MTD_SETTINGS \
 	MEM_LAYOUT_SETTINGS \
 	BOOTENV
 
 #endif
 
 /*
- * FLASH and environment organization
- */
-
-#ifdef CONFIG_BOOT_ONENAND
-#define CONFIG_SYS_ONENAND_BASE		ONENAND_MAP
-
-#define ONENAND_ENV_OFFSET		0x260000 /* environment starts here */
-
-#define CONFIG_ENV_IS_IN_ONENAND	1
-#define CONFIG_ENV_SIZE			(512 << 10) /* Total Size Environment */
-#define CONFIG_ENV_ADDR			ONENAND_ENV_OFFSET
-#endif
-
-#ifdef CONFIG_NAND
-#define CONFIG_ENV_OFFSET		0x260000 /* environment starts here */
-#define CONFIG_ENV_IS_IN_NAND	        1
-#define CONFIG_ENV_SIZE			(512 << 10) /* Total Size Environment */
-#define CONFIG_ENV_ADDR			NAND_ENV_OFFSET
-#endif
-
-/*
  * SMSC911x Ethernet
  */
 #if defined(CONFIG_CMD_NET)
@@ -134,19 +119,50 @@
 #define CONFIG_SMC911X_BASE		0x2C000000
 #endif /* (CONFIG_CMD_NET) */
 
+/*
+ * FLASH and environment organization
+ */
+#ifdef CONFIG_NAND
+#define CONFIG_SPL_UBI			1
+#define CONFIG_SPL_UBI_MAX_VOL_LEBS	256
+#define CONFIG_SPL_UBI_MAX_PEB_SIZE	(256*1024)
+#define CONFIG_SPL_UBI_MAX_PEBS		4096
+#define CONFIG_SPL_UBI_VOL_IDS		8
+#define CONFIG_SPL_UBI_LOAD_MONITOR_ID	0
+#define CONFIG_SPL_UBI_LOAD_KERNEL_ID	3
+#define CONFIG_SPL_UBI_LOAD_ARGS_ID	4
+#define CONFIG_SPL_UBI_PEB_OFFSET	4
+#define CONFIG_SPL_UBI_VID_OFFSET	512
+#define CONFIG_SPL_UBI_LEB_START	2048
+#define CONFIG_SPL_UBI_INFO_ADDR	0x88080000
+
+#define CONFIG_ENV_IS_IN_UBI		1
+#define CONFIG_ENV_UBI_PART		"UBI"
+#define CONFIG_ENV_UBI_VOLUME		"config"
+#define CONFIG_ENV_UBI_VOLUME_REDUND	"config_r"
+#define CONFIG_UBI_SILENCE_MSG		1
+#define CONFIG_UBIFS_SILENCE_MSG	1
+#else
+#define CONFIG_ENV_IS_NOWHERE
+#endif
+#define CONFIG_ENV_SIZE			(32*1024)
+
+#define CONFIG_RBTREE
+#define CONFIG_MTD_PARTITIONS
+#define MTDIDS_DEFAULT			"nand0=gpmc-nand.0"
+#define MTDPARTS_DEFAULT		"mtdparts=gpmc-nand.0:512k(SPL),-(UBI)"
+
 /* OneNAND boot config */
 #ifdef CONFIG_BOOT_ONENAND
 #define CONFIG_SPL_ONENAND_SUPPORT
-#define CONFIG_SYS_ONENAND_U_BOOT_OFFS  0x80000
 #define CONFIG_SYS_ONENAND_PAGE_SIZE	2048
-#define CONFIG_SPL_ONENAND_LOAD_ADDR    0x80000
-#define CONFIG_SPL_ONENAND_LOAD_SIZE    \
-	(512 * 1024 - CONFIG_SPL_ONENAND_LOAD_ADDR)
-
+#define CONFIG_SYS_ONENAND_BASE		ONENAND_MAP
+#define CONFIG_SYS_ONENAND_U_BOOT_OFFS	0x80000
 #endif
 
 /* NAND boot config */
 #ifdef CONFIG_NAND
+#define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
@@ -166,14 +182,8 @@
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 #define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_BCH
-
-#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
-/* NAND: SPL falcon mode configs */
-#ifdef CONFIG_SPL_OS_BOOT
-#define CONFIG_CMD_SPL_NAND_OFS		0x240000
-#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x280000
-#define CONFIG_CMD_SPL_WRITE_SIZE	0x2000
-#endif
 #endif
 
+#undef CONFIG_SPL_EXT_SUPPORT
+
 #endif /* __IGEP00X0_H */
-- 
2.1.4

  parent reply	other threads:[~2016-01-17  3:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-17  3:09 [U-Boot] [PATCHv4 0/7] spl: Lightweight UBI and UBI fastmap support Ladislav Michl
2016-01-17  3:11 ` [U-Boot] [PATCHv4 1/7] mtd: Sort subsystem directories aplhabeticaly in Makefile Ladislav Michl
2016-01-21  6:04   ` Heiko Schocher
2016-01-17  3:12 ` [U-Boot] [PATCHv4 2/7] nand_spl_simple: Add a simple NAND read function Ladislav Michl
2016-01-21  6:05   ` Heiko Schocher
2016-01-17  3:13 ` [U-Boot] [PATCHv4 3/7] spl: Lightweight UBI and UBI fastmap support Ladislav Michl
2016-01-17  3:13 ` [U-Boot] [PATCHv4 4/7] spl: support loading from UBI volumes Ladislav Michl
2016-01-21  6:06   ` Heiko Schocher
2016-01-17  3:15 ` [U-Boot] [PATCHv5 5/7] spl: zImage support in Falcon mode Ladislav Michl
2016-01-21  6:07   ` Heiko Schocher
2016-01-17  3:16 ` Ladislav Michl [this message]
2016-01-21  6:07   ` [U-Boot] [PATCHv7 6/7] igep00x0: UBIize Heiko Schocher
2016-01-22 22:35     ` Enric Balletbo Serra
2016-01-24 13:44       ` Ladislav Michl
2016-01-25  6:39       ` Heiko Schocher
2016-01-25  7:26         ` Enric Balletbo Serra
2016-01-25  8:13           ` Heiko Schocher
2016-01-25 15:56           ` Ladislav Michl
2016-01-25 16:56             ` Enric Balletbo Serra
2016-04-13  5:19               ` Heiko Schocher
2016-04-13 11:39                 ` Enric Balletbo Serra
2016-04-19 10:15                   ` Enric Balletbo Serra
2016-06-04 20:48             ` [U-Boot] [RFC] runtime mtdparts_default; was: " Ladislav Michl
2016-01-25 15:13         ` [U-Boot] [PATCHv7 6/7] " Tom Rini
2016-01-25 15:35           ` Heiko Schocher
2016-01-17  3:16 ` [U-Boot] [PATCHv4 7/7] igep00x0: Falcon mode Ladislav Michl
2016-01-21  6:08   ` Heiko Schocher
2016-01-22 22:38     ` Enric Balletbo Serra

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=20160117031603.GG28493@localhost.localdomain \
    --to=ladis@linux-mips.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox