Skip to contentSkip to conversation

mx6qsabreauto: Configure the WEIM controller like the kernel

PATCH New Fabio Estevam 4 participants 14 messages Dec 15, 2016 – Feb 3, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 mx6qsabreauto: Configure the WEIM controller like the kernel

Do the same WEIM initialization as done in the Linux kernel according to arch/arm/boot/dts/imx6qdl-sabreauto.dtsi from kernel 4.9.

---
Changes since v1:
- None

 board/freescale/mx6qsabreauto/mx6qsabreauto.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
board/freescale/mx6qsabreauto/mx6qsabreauto.c +12 -4
index 5fca4d1..13a9b5a 100644
@@ -221,12 +221,20 @@ static void eimnor_cs_setup(void)
 {
 	struct weim *weim_regs = (struct weim *)WEIM_BASE_ADDR;
 
-	writel(0x00020181, &weim_regs->cs0gcr1);
+	/*
+	 * Configure weim like the linux kernel.
+	 * From arch/arm/boot/dts/imx6qdl-sabreauto.dtsi:
+	 *
+	 * fsl,weim-cs-timing = <0x00620081 0x00000001 0x1c022000
+	 *		      	 0x0000c000 0x1404a38e 0x00000000>;
+	 */
+
+	writel(0x00620081, &weim_regs->cs0gcr1);
 	writel(0x00000001, &weim_regs->cs0gcr2);
-	writel(0x0a020000, &weim_regs->cs0rcr1);
+	writel(0x1c022000, &weim_regs->cs0rcr1);
 	writel(0x0000c000, &weim_regs->cs0rcr2);
-	writel(0x0804a240, &weim_regs->cs0wcr1);
-	writel(0x00000120, &weim_regs->wcr);
+	writel(0x1404a38e, &weim_regs->cs0wcr1);
+	writel(0x00000000, &weim_regs->wcr);
 
 	set_chipselect_size(CS0_128);
 }
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 2/4 mx6qsabreauto: Pass the correct parallel NOR width

On mx6qsabreauto the parallel NOR width is 16 bits, so pass configure CONFIG_SYS_FLASH_CFI_WIDTH correctly so that the CFI driver does not use 8 bits by default.

---
Changes since v1:
- None

 include/configs/mx6qsabreauto.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/mx6qsabreauto.h +1 -0
index f849f34..7d68633 100644
@@ -38,6 +38,7 @@
 #define CONFIG_FLASH_CFI_DRIVER         /* Use drivers/cfi_flash.c */
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE /* Use buffered writes*/
 #define CONFIG_SYS_FLASH_EMPTY_INFO
+#define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 
 #define CONFIG_SYS_FSL_USDHC_NUM	2
 #if defined(CONFIG_ENV_IS_IN_MMC)
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/4 mx6qsabreauto: Pass the correct parallel NOR width

Quoted 18 lines · Fabio Estevam

On mx6qsabreauto the parallel NOR width is 16 bits, so pass configure CONFIG_SYS_FLASH_CFI_WIDTH correctly so that the CFI driver does not use 8 bits by default.

---
Changes since v1:
- None

 include/configs/mx6qsabreauto.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/mx6qsabreauto.h +0 -0
index f849f34..7d68633 100644

include/configs/mx6qsabreauto.h line 44

Quoted 7 lines
include/configs/mx6qsabreauto.h +1 -0
@@ -38,6 +38,7 @@
 #define CONFIG_FLASH_CFI_DRIVER         /* Use drivers/cfi_flash.c */
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE /* Use buffered writes*/
 #define CONFIG_SYS_FLASH_EMPTY_INFO
+#define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 
 #define CONFIG_SYS_FSL_USDHC_NUM	2
 #if defined(CONFIG_ENV_IS_IN_MMC)

This is orthogonal to the other patches in the series, and it was not yet applied.

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
reviewer
#3 lore raw

PATCH v2 2/4 mx6qsabreauto: Pass the correct parallel NOR width

Hi Stefano,

Quoted 2 lines · Stefano Babic

This is orthogonal to the other patches in the series, and it was not yet applied.

Patch 1/3 :
[U-Boot] [PATCH 1/3] mx6qsabreauto: Configure the WEIM controller like the kernel

has not been applied as well.

#4 lore raw

PATCH v2 2/4 mx6qsabreauto: Pass the correct parallel NOR width

Quoted 4 lines · Fabio Estevam

Hi Stefano,

On Fri, Jan 27, 2017 at 7:33 AM, Stefano Babic <[email protected]> wrote:

Quoted 8 lines
Quoted 2 lines

This is orthogonal to the other patches in the series, and it was not yet applied.

Patch 1/3 :
[U-Boot] [PATCH 1/3] mx6qsabreauto: Configure the WEIM controller like the kernel

has not been applied as well.

Thanks to report this: I check it.

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#5 lore raw

PATCH v2 3/4 Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig

In reply to Fabio Estevam

Move USE_ARCH_MEMCPY/MEMSET options to Kconfig.

Make it "default y" for the ARM architecture.

Unset these options for uniphier and tegra to preserve the original behavior.

---
Changes since v1:
- Newly introduced

 Kconfig                              | 16 ++++++++++++++++
 configs/apalis_t30_defconfig         |  2 ++
 configs/beaver_defconfig             |  2 ++
 configs/cardhu_defconfig             |  2 ++
 configs/cei-tk1-som_defconfig        |  2 ++
 configs/colibri_t20_defconfig        |  2 ++
 configs/colibri_t30_defconfig        |  2 ++
 configs/dalmore_defconfig            |  2 ++
 configs/e2220-1170_defconfig         |  2 ++
 configs/harmony_defconfig            |  2 ++
 configs/jetson-tk1_defconfig         |  2 ++
 configs/medcom-wide_defconfig        |  2 ++
 configs/nyan-big_defconfig           |  2 ++
 configs/p2371-0000_defconfig         |  2 ++
 configs/p2371-2180_defconfig         |  2 ++
 configs/p2571_defconfig              |  2 ++
 configs/p2771-0000-000_defconfig     |  2 ++
 configs/p2771-0000-500_defconfig     |  2 ++
 configs/paz00_defconfig              |  2 ++
 configs/plutux_defconfig             |  2 ++
 configs/seaboard_defconfig           |  2 ++
 configs/tec-ng_defconfig             |  2 ++
 configs/tec_defconfig                |  2 ++
 configs/trimslice_defconfig          |  2 ++
 configs/uniphier_ld11_defconfig      |  2 ++
 configs/uniphier_ld20_defconfig      |  2 ++
 configs/uniphier_ld4_sld8_defconfig  |  2 ++
 configs/uniphier_pro4_defconfig      |  2 ++
 configs/uniphier_pxs2_ld6b_defconfig |  2 ++
 configs/uniphier_sld3_defconfig      |  2 ++
 configs/venice2_defconfig            |  2 ++
 configs/ventana_defconfig            |  2 ++
 configs/whistler_defconfig           |  2 ++
 include/configs/armadillo-800eva.h   |  2 --
 include/configs/blanche.h            |  3 ---
 include/configs/colibri_imx7.h       |  2 --
 include/configs/colibri_vf.h         |  2 --
 include/configs/exynos-common.h      |  3 ---
 include/configs/pcm052.h             |  1 -
 include/configs/tegra-common.h       |  6 ------
 include/configs/uniphier.h           |  5 -----
 include/configs/vf610twr.h           |  1 -
 42 files changed, 80 insertions(+), 25 deletions(-)
Kconfig +16 -0
index a44ac91..f3ede0d 100644
@@ -92,6 +92,22 @@ config SYS_MALLOC_F_LEN
 	  particular needs this to operate, so that it can allocate the
 	  initial serial device and any others that are needed.
 
+config USE_ARCH_MEMCPY
+	bool "Use an assembly optimized implementation of memcpy"
+	default y if ARM
+	help
+	  Enable the generation of an optimized version of memcpy
+	  if available. Such implementation may be faster under some
+	  conditions but may increase the binary size.
+
+config USE_ARCH_MEMSET
+	bool "Use an assembly optimized implementation of memset"
+	default y if ARM
+	help
+	  Enable the generation of an optimized version of memset
+	  if available. Such implementation may be faster under some
+	  conditions but may increase the binary size.
+
 menuconfig EXPERT
 	bool "Configure standard U-Boot features (expert users)"
 	default y
configs/apalis_t30_defconfig +2 -0
index 691148c..9acfb68 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA30=y
 CONFIG_TARGET_APALIS_T30=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-apalis"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/beaver_defconfig +2 -0
index 5cb73c0..5bc988e 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA30=y
 CONFIG_TARGET_BEAVER=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-beaver"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/cardhu_defconfig +2 -0
index 0214758..05f14ab 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA30=y
 CONFIG_TARGET_CARDHU=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-cardhu"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/cei-tk1-som_defconfig +2 -0
index 909b367..ddb640b 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA124=y
 CONFIG_TARGET_CEI_TK1_SOM=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra124-cei-tk1-som"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/colibri_t20_defconfig +2 -0
index a543246..681f60c 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_COLIBRI_T20=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-colibri"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 # CONFIG_DISPLAY_BOARDINFO is not set
configs/colibri_t30_defconfig +2 -0
index 2ab6764..95d7f42 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA30=y
 CONFIG_TARGET_COLIBRI_T30=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-colibri"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/dalmore_defconfig +2 -0
index 0db2d1d..d37020e 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA114=y
 CONFIG_TARGET_DALMORE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra114-dalmore"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/e2220-1170_defconfig +2 -0
index c88cd36..2a7c56f 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_TEGRA=y
 CONFIG_TEGRA210=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra210-e2220-1170"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/harmony_defconfig +2 -0
index d8712d5..1ed138b 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_HARMONY=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-harmony"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra20 (Harmony) # "
configs/jetson-tk1_defconfig +2 -0
index b0aa3c7..98477f9 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA124=y
 CONFIG_TARGET_JETSON_TK1=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra124-jetson-tk1"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/medcom-wide_defconfig +2 -0
index a65c3ad..814b374 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_MEDCOM_WIDE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-medcom-wide"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/nyan-big_defconfig +2 -0
index e6f862d..0d9e0a4 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA124=y
 CONFIG_TARGET_NYAN_BIG=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra124-nyan-big"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_FIT=y
 CONFIG_FIT_BEST_MATCH=y
 CONFIG_OF_SYSTEM_SETUP=y
configs/p2371-0000_defconfig +2 -0
index 0b074ec..070b758 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA210=y
 CONFIG_TARGET_P2371_0000=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2371-0000"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/p2371-2180_defconfig +2 -0
index 70e43a1..a0f6645 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA210=y
 CONFIG_TARGET_P2371_2180=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2371-2180"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/p2571_defconfig +2 -0
index a114ce3..bdb1dcd 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA210=y
 CONFIG_TARGET_P2571=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2571"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/p2771-0000-000_defconfig +2 -0
index 61bb3a1..99cb220 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_TEGRA=y
 CONFIG_TEGRA186=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra186-p2771-0000-000"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/p2771-0000-500_defconfig +2 -0
index 79f4808..4d6f7c6 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_TEGRA=y
 CONFIG_TEGRA186=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra186-p2771-0000-500"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/paz00_defconfig +2 -0
index b3d6f90..f21347e 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_PAZ00=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-paz00"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra20 (Paz00) MOD # "
configs/plutux_defconfig +2 -0
index 3c45b9d..023e1b1 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_PLUTUX=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-plutux"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
configs/seaboard_defconfig +2 -0
index c3119dc..9e59476 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_SEABOARD=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-seaboard"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_PROMPT="Tegra20 (SeaBoard) # "
 # CONFIG_CMD_IMI is not set
configs/tec-ng_defconfig +2 -0
index f52f19b..64debb9 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA30=y
 CONFIG_TARGET_TEC_NG=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-tec-ng"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
configs/tec_defconfig +2 -0
index 1ccec73..6805b80 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_TEC=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-tec"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/trimslice_defconfig +2 -0
index a145ff8..3b260a4 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_TRIMSLICE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-trimslice"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/uniphier_ld11_defconfig +2 -0
index c0ac5ac..143a61e 100644
@@ -6,6 +6,8 @@ CONFIG_ARCH_UNIPHIER_LD11=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ld11-ref"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_XIMG is not set
configs/uniphier_ld20_defconfig +2 -0
index 3e802d3..7f24840 100644
@@ -6,6 +6,8 @@ CONFIG_ARCH_UNIPHIER_LD20=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ld20-ref"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_XIMG is not set
configs/uniphier_ld4_sld8_defconfig +2 -0
index b141561..4d48b9e 100644
@@ -8,6 +8,8 @@ CONFIG_ARCH_UNIPHIER_LD4_SLD8=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ld4-ref"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
configs/uniphier_pro4_defconfig +2 -0
index f71ef56..e7e7254 100644
@@ -7,6 +7,8 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
 CONFIG_DEFAULT_DEVICE_TREE="uniphier-pro4-ref"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
configs/uniphier_pxs2_ld6b_defconfig +2 -0
index ba3867f..b1e720c 100644
@@ -8,6 +8,8 @@ CONFIG_ARCH_UNIPHIER_PRO5_PXS2_LD6B=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
 CONFIG_DEFAULT_DEVICE_TREE="uniphier-pxs2-vodka"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
configs/uniphier_sld3_defconfig +2 -0
index 3568f7a..615b770 100644
@@ -8,6 +8,8 @@ CONFIG_ARCH_UNIPHIER_SLD3=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
 CONFIG_DEFAULT_DEVICE_TREE="uniphier-sld3-ref"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
configs/venice2_defconfig +2 -0
index 8ff879f..0b60b83 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA124=y
 CONFIG_TARGET_VENICE2=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra124-venice2"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
configs/ventana_defconfig +2 -0
index 1f2809a..fc27066 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_VENTANA=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-ventana"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_PROMPT="Tegra20 (Ventana) # "
 # CONFIG_CMD_IMI is not set
configs/whistler_defconfig +2 -0
index b7c3ed9..a415eec 100644
@@ -3,6 +3,8 @@ CONFIG_TEGRA=y
 CONFIG_TEGRA20=y
 CONFIG_TARGET_WHISTLER=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-whistler"
+# CONFIG_USE_ARCH_MEMCPY is not set
+# CONFIG_USE_ARCH_MEMSET is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
include/configs/armadillo-800eva.h +0 -2
index 2d24253..3775a49 100644
@@ -28,8 +28,6 @@
 
 #define CONFIG_ARCH_CPU_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_USE_ARCH_MEMSET
-#define CONFIG_USE_ARCH_MEMCPY
 #define CONFIG_TMU_TIMER
 #define CONFIG_SYS_DCACHE_OFF
 
include/configs/blanche.h +0 -3
index f094bbe..0deb350 100755
@@ -16,9 +16,6 @@
 
 #include "rcar-gen2-common.h"
 
-#define CONFIG_USE_ARCH_MEMSET
-#define CONFIG_USE_ARCH_MEMCPY
-
 /* STACK */
 #define CONFIG_SYS_INIT_SP_ADDR		0xE817FFFC
 #define STACK_AREA_SIZE			0xC000
include/configs/colibri_imx7.h +0 -2
index 5ce0a34..bc3b53b 100644
@@ -15,8 +15,6 @@
 #include "mx7_common.h"
 
 #define CONFIG_SYS_THUMB_BUILD
-#define CONFIG_USE_ARCH_MEMCPY
-#define CONFIG_USE_ARCH_MEMSET
 
 /*#define CONFIG_DBG_MONITOR*/
 #define PHYS_SDRAM_SIZE			SZ_512M
include/configs/colibri_vf.h +0 -2
index d58145e..47dea62 100644
@@ -16,8 +16,6 @@
 
 #define CONFIG_VF610
 #define CONFIG_SYS_THUMB_BUILD
-#define CONFIG_USE_ARCH_MEMCPY
-#define CONFIG_USE_ARCH_MEMSET
 #define CONFIG_SYS_FSL_CLK
 
 #define CONFIG_ARCH_MISC_INIT
include/configs/exynos-common.h +0 -3
index 3b61a41..566f246 100644
@@ -20,9 +20,6 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#define CONFIG_USE_ARCH_MEMCPY
-#define CONFIG_USE_ARCH_MEMSET
-
 /* Keep L2 Cache Disabled */
 
 /* input clock of PLL: 24MHz input clock */
include/configs/pcm052.h +0 -1
index eb1944a..e70c3f0 100644
@@ -35,7 +35,6 @@
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 
 #ifdef CONFIG_CMD_NAND
-#define CONFIG_USE_ARCH_MEMCPY
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define CONFIG_SYS_NAND_BASE		NFC_BASE_ADDR
 
include/configs/tegra-common.h +0 -6
index 63b711b..23a0e78 100644
@@ -76,12 +76,6 @@
 #define CONFIG_SYS_MEMTEST_START	(NV_PA_SDRC_CS0 + 0x600000)
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + 0x100000)
 
-#ifndef CONFIG_ARM64
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_USE_ARCH_MEMCPY
-#endif
-#endif
-
 /*-----------------------------------------------------------------------
  * Physical Memory Map
  */
include/configs/uniphier.h +0 -5
index f9c9f82..74f1373 100644
@@ -63,11 +63,6 @@
 /* serial console configuration */
 #define CONFIG_BAUDRATE			115200
 
-#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_ARM64)
-#define CONFIG_USE_ARCH_MEMSET
-#define CONFIG_USE_ARCH_MEMCPY
-#endif
-
 #define CONFIG_SYS_LONGHELP		/* undef to save memory */
 
 #define CONFIG_CMDLINE_EDITING		/* add command line history	*/
include/configs/vf610twr.h +0 -1
index af5ba61..6aeb078 100644
@@ -42,7 +42,6 @@
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 
 #ifdef CONFIG_CMD_NAND
-#define CONFIG_USE_ARCH_MEMCPY
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define CONFIG_SYS_NAND_BASE		NFC_BASE_ADDR
 
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 3/4 Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig

Quoted 8 lines · Fabio Estevam

Move USE_ARCH_MEMCPY/MEMSET options to Kconfig.

Make it "default y" for the ARM architecture.

Unset these options for uniphier and tegra to preserve the original behavior.

So, thanks for starting on this. But it needs to go into arch/arm/Kconfig. And I meant, it should be default y if CPU_V7, and depend on !ARM64 (because we don't have asm versions of these functions, we could borrow them from the kernel, and someone should I suspect). The key here is that on some older ARM cores we will exceed the SPL size limit with these functions enabled. Make sense? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161215/2fd3e4b0/attachment.sig>
#7 lore raw

PATCH v2 4/4 cmd: mem: Use memcpy for 'cp' command

In reply to Fabio Estevam

Simplify the 'cp' command implementation by using the memcpy() function, which brings the additional benefit of performance gain for those who have CONFIG_USE_ARCH_MEMCPY selected.

Tested on a mx6qsabreauto board where a 5x gain in performance is seen when reading 10MB from the parallel NOR memory.

---
Changes since v1:
- Always use memcpy()

 cmd/mem.c | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)
cmd/mem.c +2 -26
index a690957..ff6a770 100644
@@ -372,10 +372,8 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	ulong	addr, dest, count, bytes;
+	ulong	addr, dest, count;
 	int	size;
-	const void *src;
-	void *buf;
 
 	if (argc != 4)
 		return CMD_RET_USAGE;
@@ -465,29 +463,7 @@ static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	}
 #endif
 
-	bytes = size * count;
-	buf = map_sysmem(dest, bytes);
-	src = map_sysmem(addr, bytes);
-	while (count-- > 0) {
-		if (size == 4)
-			*((u32 *)buf) = *((u32  *)src);
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
-		else if (size == 8)
-			*((u64 *)buf) = *((u64 *)src);
-#endif
-		else if (size == 2)
-			*((u16 *)buf) = *((u16 *)src);
-		else
-			*((u8 *)buf) = *((u8 *)src);
-		src += size;
-		buf += size;
-
-		/* reset watchdog from time to time */
-		if ((count % (64 << 10)) == 0)
-			WATCHDOG_RESET();
-	}
-	unmap_sysmem(buf);
-	unmap_sysmem(src);
+	memcpy((void *)dest, (void *)addr, count * size);
 
 	return 0;
 }
Signature · 1 line
2.7.4
#8 lore raw

PATCH v2 4/4 cmd: mem: Use memcpy for 'cp' command

Quoted 8 lines · Fabio Estevam

Simplify the 'cp' command implementation by using the memcpy() function, which brings the additional benefit of performance gain for those who have CONFIG_USE_ARCH_MEMCPY selected.

Tested on a mx6qsabreauto board where a 5x gain in performance is seen when reading 10MB from the parallel NOR memory.

Can you load up a few other platforms via QEMU and test it out there? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161217/18ebd6f7/attachment.sig>
#9 lore raw

PATCH v2 4/4 cmd: mem: Use memcpy for 'cp' command

In reply to Fabio Estevam
Quoted 11 lines · Fabio Estevam

Simplify the 'cp' command implementation by using the memcpy() function, which brings the additional benefit of performance gain for those who have CONFIG_USE_ARCH_MEMCPY selected.

Tested on a mx6qsabreauto board where a 5x gain in performance is seen when reading 10MB from the parallel NOR memory.

---
Changes since v1:
- Always use memcpy()

I feel like this is correct. I also feel like it's too close to release to do this, so I'll be applying this shortly after release, thanks!

I also found it odd, and might try and rectify, that we don't have a 'cp' test in test.py which would make being relatively sure it's OK on x86/MIPS/PowerPC easy, slightly less easy (I'll be firing up qemu by hand and maybe writing a test too).

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161219/ab820da0/attachment.sig>
reviewer
#10 lore raw

PATCH v2 4/4 cmd: mem: Use memcpy for 'cp' command

Hi Tom,

Quoted 2 lines · Tom Rini

I feel like this is correct. I also feel like it's too close to release to do this, so I'll be applying this shortly after release, thanks!

Yes, agreed this is material for the next release.

Quoted 4 lines

I also found it odd, and might try and rectify, that we don't have a 'cp' test in test.py which would make being relatively sure it's OK on x86/MIPS/PowerPC easy, slightly less easy (I'll be firing up qemu by hand and maybe writing a test too).

Thanks for doing this!

reviewer
#11 lore raw

PATCH v2 4/4 cmd: mem: Use memcpy for 'cp' command

In reply to Tom Rini

Hi Tom,

Quoted 9 lines · Tom Rini
Quoted 7 lines · Fabio Estevam

Simplify the 'cp' command implementation by using the memcpy() function, which brings the additional benefit of performance gain for those who have CONFIG_USE_ARCH_MEMCPY selected.

Tested on a mx6qsabreauto board where a 5x gain in performance is seen when reading 10MB from the parallel NOR memory.

Quoted 7 lines
Quoted 4 lines

---
Changes since v1:
- Always use memcpy()

I feel like this is correct. I also feel like it's too close to release to do this, so I'll be applying this shortly after release, thanks!

Is it a good time to apply this one now?

Thanks

#12 lore raw

PATCH v2 4/4 cmd: mem: Use memcpy for 'cp' command

Quoted 17 lines · Fabio Estevam

Hi Tom,

Quoted 14 lines · Tom Rini
Quoted 11 lines · Fabio Estevam

Simplify the 'cp' command implementation by using the memcpy() function, which brings the additional benefit of performance gain for those who have CONFIG_USE_ARCH_MEMCPY selected.

Tested on a mx6qsabreauto board where a 5x gain in performance is seen when reading 10MB from the parallel NOR memory.

---
Changes since v1:
- Always use memcpy()

Quoted 4 lines
Quoted 2 lines

I feel like this is correct. I also feel like it's too close to release to do this, so I'll be applying this shortly after release, thanks!

Is it a good time to apply this one now?

Yes, yes it would, thanks for the reminder. I'm kicking off a round of testing in travis-ci now along with another pre-req of finally, really, making arch/arm/lib/mem{set,cpy}.S be used by default in most cases.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170111/4ff919aa/attachment.sig>
#13 lore raw

PATCH v2 4/4 cmd: mem: Use memcpy for 'cp' command

In reply to Fabio Estevam
Quoted 8 lines · Fabio Estevam

Simplify the 'cp' command implementation by using the memcpy() function, which brings the additional benefit of performance gain for those who have CONFIG_USE_ARCH_MEMCPY selected.

Tested on a mx6qsabreauto board where a 5x gain in performance is seen when reading 10MB from the parallel NOR memory.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170112/c4f0d0c0/attachment.sig>