* [U-Boot] [PATCH] ARM: da850-evm: Increase environment NOR partition offset
@ 2019-08-02 12:03 Adam Ford
2019-08-13 16:51 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Adam Ford @ 2019-08-02 12:03 UTC (permalink / raw)
To: u-boot
The current size allocated to U-Boot is 384k, but U-Boot has grown
to 436K which means that saving the environmental variables wipes
out part of the U-Boot source and the board ceases to function.
Due to the sector and erase size for the NOR part and a desire to
not have to change partition sizes often, this patch moves the
U-Boot environmental variables to an offset of 1M so saveenv
does not brick the board. This patch also sets up MTDIDS and
MTDPARTS to clearly show where U-Boot and U-Boot's environmental
variables are located.
Signed-off-by: Adam Ford <aford173@gmail.com>
diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig
index e3c2d13986..1c0e237571 100644
--- a/configs/da850evm_direct_nor_defconfig
+++ b/configs/da850evm_direct_nor_defconfig
@@ -21,10 +21,11 @@ CONFIG_SYS_PROMPT="U-Boot > "
CONFIG_CMD_IMLS=y
CONFIG_CRC32_VERIFY=y
CONFIG_CMD_DM=y
-# CONFIG_CMD_GPIO is not set
# CONFIG_CMD_GPT is not set
# CONFIG_CMD_MMC is not set
+CONFIG_CMD_MTD=y
# CONFIG_CMD_PART is not set
+# CONFIG_CMD_SF is not set
# CONFIG_CMD_SPI is not set
# CONFIG_CMD_SETEXPR is not set
# CONFIG_CMD_TIME is not set
@@ -32,6 +33,9 @@ CONFIG_CMD_DM=y
# CONFIG_CMD_EXT4 is not set
# CONFIG_CMD_FAT is not set
# CONFIG_CMD_FS_GENERIC is not set
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nor0=physmap-flash.2"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=physmap-flash.2:1m(u-boot),128k(u-boot-env),-(spare)"
CONFIG_CMD_DIAG=y
CONFIG_OF_CONTROL=y
CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
@@ -45,6 +49,8 @@ CONFIG_SYS_I2C_DAVINCI=y
CONFIG_MTD=y
CONFIG_MTD_NOR_FLASH=y
CONFIG_FLASH_CFI_DRIVER=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_FLASH_CFI_MTD=y
CONFIG_SYS_FLASH_PROTECTION=y
CONFIG_SYS_FLASH_CFI=y
CONFIG_DM_SPI_FLASH=y
@@ -64,7 +70,6 @@ CONFIG_DM_SPI=y
CONFIG_DAVINCI_SPI=y
CONFIG_USB=y
CONFIG_DM_USB=y
-# CONFIG_SPL_DM_USB is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_DA8XX=y
CONFIG_USB_STORAGE=y
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 0281dbd7b4..9bd6da015e 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -192,7 +192,7 @@
#ifdef CONFIG_USE_NOR
#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of flash banks */
#define CONFIG_SYS_FLASH_SECT_SZ (128 << 10) /* 128KB */
-#define CONFIG_ENV_OFFSET (CONFIG_SYS_FLASH_SECT_SZ * 3)
+#define CONFIG_ENV_OFFSET (SZ_1M)
#define CONFIG_ENV_SIZE (10 << 10) /* 10KB */
#define CONFIG_SYS_FLASH_BASE DAVINCI_ASYNC_EMIF_DATA_CE2_BASE
#define PHYS_FLASH_SIZE (8 << 20) /* Flash size 8MB */
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] ARM: da850-evm: Increase environment NOR partition offset
2019-08-02 12:03 [U-Boot] [PATCH] ARM: da850-evm: Increase environment NOR partition offset Adam Ford
@ 2019-08-13 16:51 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-08-13 16:51 UTC (permalink / raw)
To: u-boot
On Fri, Aug 02, 2019 at 07:03:39AM -0500, Adam Ford wrote:
> The current size allocated to U-Boot is 384k, but U-Boot has grown
> to 436K which means that saving the environmental variables wipes
> out part of the U-Boot source and the board ceases to function.
> Due to the sector and erase size for the NOR part and a desire to
> not have to change partition sizes often, this patch moves the
> U-Boot environmental variables to an offset of 1M so saveenv
> does not brick the board. This patch also sets up MTDIDS and
> MTDPARTS to clearly show where U-Boot and U-Boot's environmental
> variables are located.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig
> index e3c2d13986..1c0e237571 100644
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190813/a16cf465/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-13 16:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-02 12:03 [U-Boot] [PATCH] ARM: da850-evm: Increase environment NOR partition offset Adam Ford
2019-08-13 16:51 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox