[OpenWrt-Devel] [PATCH 7/9] uboot-sunxi: move pine64 lts env to spi flash
Oskari Lemmela
oskari at lemmela.net
Mon Jan 14 12:54:27 EST 2019
Patches to move pine64 LTS environment to SPI flash device.
Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
---
...-move-env-to-spi-flash-in-pine64-lts.patch | 27 +++++++++
...efines-if-config-env-is-in-spi-flash.patch | 57 +++++++++++++++++++
2 files changed, 84 insertions(+)
create mode 100644 package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch
create mode 100644 package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch
diff --git a/package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch b/package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch
new file mode 100644
index 0000000000..dc26c067eb
--- /dev/null
+++ b/package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch
@@ -0,0 +1,27 @@
+From 1a4cfdf1bfe4706a11ab7cd724949f7551a53b42 Mon Sep 17 00:00:00 2001
+From: Oskari Lemmela <oskari at lemmela.net>
+Date: Mon, 14 Jan 2019 12:34:55 +0200
+Subject: [PATCH] sunxi: a64: move env to spi flash in pine64 lts
+
+Move environment to SPI flash in pine64 LTS defconfig
+
+Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
+---
+ configs/pine64-lts_defconfig | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/configs/pine64-lts_defconfig b/configs/pine64-lts_defconfig
+index 82208f8a3e..cbf674e318 100644
+--- a/configs/pine64-lts_defconfig
++++ b/configs/pine64-lts_defconfig
+@@ -26,3 +26,7 @@ CONFIG_SPI=y
+ CONFIG_SPI_FLASH=y
+ CONFIG_SPI_FLASH_WINBOND=y
+ CONFIG_SUN4I_SPI=y
++CONFIG_ENV_IS_IN_FAT=n
++CONFIG_ENV_IS_IN_SPI_FLASH=y
++CONFIG_ENV_OFFSET=0xE0000
++CONFIG_ENV_SIZE=0x20000
+--
+2.17.1
+
diff --git a/package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch b/package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch
new file mode 100644
index 0000000000..60a6e39589
--- /dev/null
+++ b/package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch
@@ -0,0 +1,57 @@
+From f1579bf1f8278c650025469d19f31df41abd40c3 Mon Sep 17 00:00:00 2001
+From: Oskari Lemmela <oskari at lemmela.net>
+Date: Wed, 2 Jan 2019 17:35:04 +0200
+Subject: [PATCH] env: check defines if config env is in spi flash
+
+Check config environment defines if
+CONFIG_ENV_IS_IN_SPI_FLASH is defined
+
+Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
+---
+ include/environment.h | 23 +++++++++++++----------
+ 1 file changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/include/environment.h b/include/environment.h
+index 5e90f157e8..ff53b90c88 100644
+--- a/include/environment.h
++++ b/include/environment.h
+@@ -21,6 +21,19 @@
+ *
+ *************************************************************************/
+
++#if defined(CONFIG_ENV_IS_IN_FLASH) || defined(CONFIG_ENV_IS_IN_SPI_FLASH)
++# if defined(CONFIG_ENV_SECT_SIZE) || defined(CONFIG_ENV_SIZE)
++# ifndef CONFIG_ENV_SECT_SIZE
++# define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
++# endif
++# ifndef CONFIG_ENV_SIZE
++# define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
++# endif
++# else
++# error "Both CONFIG_ENV_SECT_SIZE and CONFIG_ENV_SIZE undefined"
++# endif
++#endif
++
+ #if defined(CONFIG_ENV_IS_IN_FLASH)
+ # ifndef CONFIG_ENV_ADDR
+ # define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
+@@ -32,16 +45,6 @@
+ # define CONFIG_ENV_ADDR_REDUND \
+ (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET_REDUND)
+ # endif
+-# if defined(CONFIG_ENV_SECT_SIZE) || defined(CONFIG_ENV_SIZE)
+-# ifndef CONFIG_ENV_SECT_SIZE
+-# define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
+-# endif
+-# ifndef CONFIG_ENV_SIZE
+-# define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
+-# endif
+-# else
+-# error "Both CONFIG_ENV_SECT_SIZE and CONFIG_ENV_SIZE undefined"
+-# endif
+ # if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND)
+ # define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+ # endif
+--
+2.17.1
+
--
2.17.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list