From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] mpc7448_hpc2: Add storing env to flash as an option
Date: Thu, 3 Jan 2008 12:35:12 -0500 [thread overview]
Message-ID: <20080103173512.GA6684@windriver.com> (raw)
The default for the hpc2 has been to store env. in NVRAM, which is very
limited in size. This patch adds the option to store the env. in flash,
which allows for more (and more complex) env. settings. The default is
to continue to use NVRAM, but a user can now switch to flash with a one
line change in the config file.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/configs/mpc7448hpc2.h | 56 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/include/configs/mpc7448hpc2.h b/include/configs/mpc7448hpc2.h
index bd3107a..f60c14c 100644
--- a/include/configs/mpc7448hpc2.h
+++ b/include/configs/mpc7448hpc2.h
@@ -68,6 +68,10 @@
* High Level Configuration Options
* (easy to change)
*/
+
+/* NVRAM is a small amount of space. Use flash if you have a big env. list */
+#define CFG_ENV_IS_IN_NVRAM
+#undef CFG_ENV_IS_IN_FLASH
#define CONFIG_BAUDRATE 115200 /* console baudrate = 115000 */
@@ -120,8 +124,6 @@
#define CONFIG_BOOTARGS "console=ttyS0,115200"
#endif
-#undef CONFIG_EXTRA_ENV_SETTINGS
-
#define CONFIG_SERIAL "No. 1"
/* Networking Configuration */
@@ -383,11 +385,59 @@
#define PHYS_FLASH_SIZE 0x01000000
#define CFG_MAX_FLASH_SECT (128)
-#define CFG_ENV_IS_IN_NVRAM
+#ifdef CFG_ENV_IS_IN_NVRAM
+#undef CONFIG_EXTRA_ENV_SETTINGS
#define CFG_ENV_ADDR 0xFC000000
#define CFG_ENV_OFFSET 0x00000000 /* Offset of Environment Sector */
#define CFG_ENV_SIZE 0x00000400 /* Total Size of Environment Space */
+#endif
+
+#ifdef CFG_ENV_IS_IN_FLASH
+#define CFG_ENV_ADDR (CFG_MONITOR_BASE + 0x40000)
+
+#define CFG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#define CFG_ENV_SIZE 0x2000
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "netdev=eth0\0" \
+ "consoledev=ttyS0\0" \
+ "ramdiskaddr=2000000\0" \
+ "ramdiskfile=your.ramdisk.u-boot\0" \
+ "dtbaddr=c00000\0" \
+ "dtbfile=mpc7448hpc2.dtb\0"
+
+#define CONFIG_NFSBOOTCOMMAND \
+ "setenv bootargs root=/dev/nfs rw " \
+ "nfsroot=$serverip:$rootpath " \
+ "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
+ "console=$consoledev,$baudrate $othbootargs;" \
+ "tftp $loadaddr $bootfile;" \
+ "tftp $dtbaddr $dtbfile;" \
+ "bootm $loadaddr - $dtbaddr"
+
+#define CONFIG_RAMBOOTCOMMAND \
+ "setenv bootargs root=/dev/ram rw " \
+ "console=$consoledev,$baudrate $othbootargs;" \
+ "tftp $ramdiskaddr $ramdiskfile;" \
+ "tftp $loadaddr $bootfile;" \
+ "tftp $dtbaddr $dtbfile;" \
+ "bootm $loadaddr $ramdiskaddr $dtbaddr"
+
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND CONFIG_NFSBOOTCOMMAND
+#undef CONFIG_BOOTFILE
+#define CONFIG_BOOTFILE uImage
+
+#define CONFIG_ETHADDR 00:E0:0C:00:00:FD
+#define CONFIG_ETH1ADDR 00:E0:0C:00:01:FD
+
+#define CONFIG_SERVERIP 192.168.1.1
+#define CONFIG_GATEWAYIP 192.168.1.1
+#define CONFIG_NETMASK 255.255.255.0
+
+#endif /* ENV is in flash */
+
/*-----------------------------------------------------------------------
* Cache Configuration
--
1.5.0.rc1.gf4b6c
reply other threads:[~2008-01-03 17:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080103173512.GA6684@windriver.com \
--to=paul.gortmaker@windriver.com \
--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