[U-Boot] [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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- Changes since v1: - None
board/freescale/mx6qsabreauto/mx6qsabreauto.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index 5fca4d1..13a9b5a 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -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); }

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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- Changes since v1: - None
include/configs/mx6qsabreauto.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h index f849f34..7d68633 100644 --- a/include/configs/mx6qsabreauto.h +++ b/include/configs/mx6qsabreauto.h @@ -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)

On 15/12/2016 19:00, Fabio Estevam wrote:
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Changes since v1:
- None
include/configs/mx6qsabreauto.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h index f849f34..7d68633 100644 --- a/include/configs/mx6qsabreauto.h +++ b/include/configs/mx6qsabreauto.h @@ -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

Hi Stefano,
On Fri, Jan 27, 2017 at 7:33 AM, Stefano Babic sbabic@denx.de wrote:
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.

On 03/02/2017 14:10, Fabio Estevam wrote:
Hi Stefano,
On Fri, Jan 27, 2017 at 7:33 AM, Stefano Babic sbabic@denx.de wrote:
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

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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- 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(-)
diff --git a/Kconfig b/Kconfig index a44ac91..f3ede0d 100644 --- a/Kconfig +++ b/Kconfig @@ -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 diff --git a/configs/apalis_t30_defconfig b/configs/apalis_t30_defconfig index 691148c..9acfb68 100644 --- a/configs/apalis_t30_defconfig +++ b/configs/apalis_t30_defconfig @@ -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 diff --git a/configs/beaver_defconfig b/configs/beaver_defconfig index 5cb73c0..5bc988e 100644 --- a/configs/beaver_defconfig +++ b/configs/beaver_defconfig @@ -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 diff --git a/configs/cardhu_defconfig b/configs/cardhu_defconfig index 0214758..05f14ab 100644 --- a/configs/cardhu_defconfig +++ b/configs/cardhu_defconfig @@ -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 diff --git a/configs/cei-tk1-som_defconfig b/configs/cei-tk1-som_defconfig index 909b367..ddb640b 100644 --- a/configs/cei-tk1-som_defconfig +++ b/configs/cei-tk1-som_defconfig @@ -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 diff --git a/configs/colibri_t20_defconfig b/configs/colibri_t20_defconfig index a543246..681f60c 100644 --- a/configs/colibri_t20_defconfig +++ b/configs/colibri_t20_defconfig @@ -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 diff --git a/configs/colibri_t30_defconfig b/configs/colibri_t30_defconfig index 2ab6764..95d7f42 100644 --- a/configs/colibri_t30_defconfig +++ b/configs/colibri_t30_defconfig @@ -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 diff --git a/configs/dalmore_defconfig b/configs/dalmore_defconfig index 0db2d1d..d37020e 100644 --- a/configs/dalmore_defconfig +++ b/configs/dalmore_defconfig @@ -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 diff --git a/configs/e2220-1170_defconfig b/configs/e2220-1170_defconfig index c88cd36..2a7c56f 100644 --- a/configs/e2220-1170_defconfig +++ b/configs/e2220-1170_defconfig @@ -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 diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig index d8712d5..1ed138b 100644 --- a/configs/harmony_defconfig +++ b/configs/harmony_defconfig @@ -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) # " diff --git a/configs/jetson-tk1_defconfig b/configs/jetson-tk1_defconfig index b0aa3c7..98477f9 100644 --- a/configs/jetson-tk1_defconfig +++ b/configs/jetson-tk1_defconfig @@ -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 diff --git a/configs/medcom-wide_defconfig b/configs/medcom-wide_defconfig index a65c3ad..814b374 100644 --- a/configs/medcom-wide_defconfig +++ b/configs/medcom-wide_defconfig @@ -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 diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig index e6f862d..0d9e0a4 100644 --- a/configs/nyan-big_defconfig +++ b/configs/nyan-big_defconfig @@ -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 diff --git a/configs/p2371-0000_defconfig b/configs/p2371-0000_defconfig index 0b074ec..070b758 100644 --- a/configs/p2371-0000_defconfig +++ b/configs/p2371-0000_defconfig @@ -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 diff --git a/configs/p2371-2180_defconfig b/configs/p2371-2180_defconfig index 70e43a1..a0f6645 100644 --- a/configs/p2371-2180_defconfig +++ b/configs/p2371-2180_defconfig @@ -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 diff --git a/configs/p2571_defconfig b/configs/p2571_defconfig index a114ce3..bdb1dcd 100644 --- a/configs/p2571_defconfig +++ b/configs/p2571_defconfig @@ -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 diff --git a/configs/p2771-0000-000_defconfig b/configs/p2771-0000-000_defconfig index 61bb3a1..99cb220 100644 --- a/configs/p2771-0000-000_defconfig +++ b/configs/p2771-0000-000_defconfig @@ -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 diff --git a/configs/p2771-0000-500_defconfig b/configs/p2771-0000-500_defconfig index 79f4808..4d6f7c6 100644 --- a/configs/p2771-0000-500_defconfig +++ b/configs/p2771-0000-500_defconfig @@ -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 diff --git a/configs/paz00_defconfig b/configs/paz00_defconfig index b3d6f90..f21347e 100644 --- a/configs/paz00_defconfig +++ b/configs/paz00_defconfig @@ -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 # " diff --git a/configs/plutux_defconfig b/configs/plutux_defconfig index 3c45b9d..023e1b1 100644 --- a/configs/plutux_defconfig +++ b/configs/plutux_defconfig @@ -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 diff --git a/configs/seaboard_defconfig b/configs/seaboard_defconfig index c3119dc..9e59476 100644 --- a/configs/seaboard_defconfig +++ b/configs/seaboard_defconfig @@ -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 diff --git a/configs/tec-ng_defconfig b/configs/tec-ng_defconfig index f52f19b..64debb9 100644 --- a/configs/tec-ng_defconfig +++ b/configs/tec-ng_defconfig @@ -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 diff --git a/configs/tec_defconfig b/configs/tec_defconfig index 1ccec73..6805b80 100644 --- a/configs/tec_defconfig +++ b/configs/tec_defconfig @@ -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 diff --git a/configs/trimslice_defconfig b/configs/trimslice_defconfig index a145ff8..3b260a4 100644 --- a/configs/trimslice_defconfig +++ b/configs/trimslice_defconfig @@ -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 diff --git a/configs/uniphier_ld11_defconfig b/configs/uniphier_ld11_defconfig index c0ac5ac..143a61e 100644 --- a/configs/uniphier_ld11_defconfig +++ b/configs/uniphier_ld11_defconfig @@ -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 diff --git a/configs/uniphier_ld20_defconfig b/configs/uniphier_ld20_defconfig index 3e802d3..7f24840 100644 --- a/configs/uniphier_ld20_defconfig +++ b/configs/uniphier_ld20_defconfig @@ -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 diff --git a/configs/uniphier_ld4_sld8_defconfig b/configs/uniphier_ld4_sld8_defconfig index b141561..4d48b9e 100644 --- a/configs/uniphier_ld4_sld8_defconfig +++ b/configs/uniphier_ld4_sld8_defconfig @@ -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 diff --git a/configs/uniphier_pro4_defconfig b/configs/uniphier_pro4_defconfig index f71ef56..e7e7254 100644 --- a/configs/uniphier_pro4_defconfig +++ b/configs/uniphier_pro4_defconfig @@ -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 diff --git a/configs/uniphier_pxs2_ld6b_defconfig b/configs/uniphier_pxs2_ld6b_defconfig index ba3867f..b1e720c 100644 --- a/configs/uniphier_pxs2_ld6b_defconfig +++ b/configs/uniphier_pxs2_ld6b_defconfig @@ -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 diff --git a/configs/uniphier_sld3_defconfig b/configs/uniphier_sld3_defconfig index 3568f7a..615b770 100644 --- a/configs/uniphier_sld3_defconfig +++ b/configs/uniphier_sld3_defconfig @@ -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 diff --git a/configs/venice2_defconfig b/configs/venice2_defconfig index 8ff879f..0b60b83 100644 --- a/configs/venice2_defconfig +++ b/configs/venice2_defconfig @@ -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 diff --git a/configs/ventana_defconfig b/configs/ventana_defconfig index 1f2809a..fc27066 100644 --- a/configs/ventana_defconfig +++ b/configs/ventana_defconfig @@ -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 diff --git a/configs/whistler_defconfig b/configs/whistler_defconfig index b7c3ed9..a415eec 100644 --- a/configs/whistler_defconfig +++ b/configs/whistler_defconfig @@ -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 diff --git a/include/configs/armadillo-800eva.h b/include/configs/armadillo-800eva.h index 2d24253..3775a49 100644 --- a/include/configs/armadillo-800eva.h +++ b/include/configs/armadillo-800eva.h @@ -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
diff --git a/include/configs/blanche.h b/include/configs/blanche.h index f094bbe..0deb350 100755 --- a/include/configs/blanche.h +++ b/include/configs/blanche.h @@ -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 diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h index 5ce0a34..bc3b53b 100644 --- a/include/configs/colibri_imx7.h +++ b/include/configs/colibri_imx7.h @@ -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 diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h index d58145e..47dea62 100644 --- a/include/configs/colibri_vf.h +++ b/include/configs/colibri_vf.h @@ -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 diff --git a/include/configs/exynos-common.h b/include/configs/exynos-common.h index 3b61a41..566f246 100644 --- a/include/configs/exynos-common.h +++ b/include/configs/exynos-common.h @@ -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 */ diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h index eb1944a..e70c3f0 100644 --- a/include/configs/pcm052.h +++ b/include/configs/pcm052.h @@ -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
diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h index 63b711b..23a0e78 100644 --- a/include/configs/tegra-common.h +++ b/include/configs/tegra-common.h @@ -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 */ diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h index f9c9f82..74f1373 100644 --- a/include/configs/uniphier.h +++ b/include/configs/uniphier.h @@ -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 */ diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h index af5ba61..6aeb078 100644 --- a/include/configs/vf610twr.h +++ b/include/configs/vf610twr.h @@ -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

On Thu, Dec 15, 2016 at 04:00:12PM -0200, Fabio Estevam wrote:
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
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!

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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- Changes since v1: - Always use memcpy()
cmd/mem.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-)
diff --git a/cmd/mem.c b/cmd/mem.c index a690957..ff6a770 100644 --- a/cmd/mem.c +++ b/cmd/mem.c @@ -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; }

On Thu, Dec 15, 2016 at 04:00:13PM -0200, Fabio Estevam wrote:
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Can you load up a few other platforms via QEMU and test it out there? Thanks!

On Thu, Dec 15, 2016 at 04:00:13PM -0200, Fabio Estevam wrote:
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
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).

Hi Tom,
On Mon, Dec 19, 2016 at 8:09 PM, Tom Rini trini@konsulko.com wrote:
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.
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!

Hi Tom,
On Mon, Dec 19, 2016 at 8:09 PM, Tom Rini trini@konsulko.com wrote:
On Thu, Dec 15, 2016 at 04:00:13PM -0200, Fabio Estevam wrote:
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
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

On Wed, Jan 11, 2017 at 01:49:55PM -0200, Fabio Estevam wrote:
Hi Tom,
On Mon, Dec 19, 2016 at 8:09 PM, Tom Rini trini@konsulko.com wrote:
On Thu, Dec 15, 2016 at 04:00:13PM -0200, Fabio Estevam wrote:
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
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?
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.

On Thu, Dec 15, 2016 at 04:00:13PM -0200, Fabio Estevam wrote:
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Applied to u-boot/master, thanks!
participants (4)
-
Fabio Estevam
-
Fabio Estevam
-
Stefano Babic
-
Tom Rini