From 3900b45125dea0476c03f413ec80201865bfde70 Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Tue, 16 Jan 2018 17:43:48 +0100 Subject: [PATCH 01/14] sunxi: Fix display timing flags flags member of struct timing was not initialized, this took to unpredictable behaviour of display flags, such DISPLAY_FLAGS_HSYNC_HIGH instead of _LOW etc. Init timing->flags = 0 Signed-off-by: Giulio Benetti Acked-by: Maxime Ripard Reviewed-by: Jagan Teki --- drivers/video/sunxi/sunxi_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c index 0630289c0a..f191ef16c6 100644 --- a/drivers/video/sunxi/sunxi_display.c +++ b/drivers/video/sunxi/sunxi_display.c @@ -625,6 +625,8 @@ static void sunxi_ctfb_mode_to_display_timing(const struct ctfb_res_modes *mode, timing->vback_porch.typ = mode->upper_margin; timing->vsync_len.typ = mode->vsync_len; + timing->flags = 0; + if (mode->sync & FB_SYNC_HOR_HIGH_ACT) timing->flags |= DISPLAY_FLAGS_HSYNC_HIGH; else From 70c56c138f3776b68f24acb09a9bc3ba67855d0a Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:13 +0100 Subject: [PATCH 02/14] dfu: select HASH The DFU code relies on the HASH config option. Make sure it is always there by selecting it. Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- drivers/dfu/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig index 56a98f5273..fa27efbb40 100644 --- a/drivers/dfu/Kconfig +++ b/drivers/dfu/Kconfig @@ -2,6 +2,7 @@ menu "DFU support" config USB_FUNCTION_DFU bool + select HASH if CMD_DFU config DFU_TFTP From b02436089af064bc6d7c2fee256d23e5ba135454 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:14 +0100 Subject: [PATCH 03/14] cmd: crc32: Disable by default on sunXi The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index faa8bc62b5..dbeb41c86d 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -397,6 +397,7 @@ menu "Memory commands" config CMD_CRC32 bool "crc32" select HASH + default n if ARCH_SUNXI default y help Compute CRC32. From 3b50382ab5fa7f325e5eb976d0e3bbdb467b6854 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:15 +0100 Subject: [PATCH 04/14] cmd: unzip: Disable by default on sunXi The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index dbeb41c86d..fd34f445e0 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -539,6 +539,7 @@ config CMD_LZMADEC config CMD_UNZIP bool "unzip" + default n if ARCH_SUNXI default y if CMD_BOOTI help Uncompress a zip-compressed memory region. From 197e0be74494fc8e1a13e671e5156c9894cd70e7 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:16 +0100 Subject: [PATCH 05/14] cmd: loadb: Disable by default on sunXi The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index fd34f445e0..824a47e428 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -748,6 +748,7 @@ config CMD_I2C config CMD_LOADB bool "loadb" + default n if ARCH_SUNXI default y help Load a binary file over serial line. From e302ede73cb71c0d039c7720615cb991786afcd5 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:17 +0100 Subject: [PATCH 06/14] cmd: loads: Disable by default on sunXi The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 824a47e428..49dd3f95e1 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -755,6 +755,7 @@ config CMD_LOADB config CMD_LOADS bool "loads" + default n if ARCH_SUNXI default y help Load an S-Record file over serial line From 07dc22dd8568850644ecf2ebed8ef9213fe017a5 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:18 +0100 Subject: [PATCH 07/14] cmd: misc: Disable by default on sunXi The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Reviewed-by: Andre Przywara Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 49dd3f95e1..c399169910 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1138,6 +1138,7 @@ config CMD_GETTIME # TODO: rename to CMD_SLEEP config CMD_MISC bool "sleep" + default n if ARCH_SUNXI default y help Delay execution for some time From 2e8f1dd60815710ad38965ac01c42ff29b0d9bee Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:19 +0100 Subject: [PATCH 08/14] video: bpp8: Disable by default on sunXi The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Reviewed-by: Anatolij Gustschin Reviewed-by: Andre Przywara Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- drivers/video/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 45a105db06..a267c9acfe 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -38,6 +38,7 @@ config BACKLIGHT_GPIO config VIDEO_BPP8 bool "Support 8-bit-per-pixel displays" depends on DM_VIDEO + default n if ARCH_SUNXI default y if DM_VIDEO help Support drawing text and bitmaps onto a 8-bit-per-pixel display. From 0a319b610b239b84cb06cfdf95ae7644169ae9c2 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:20 +0100 Subject: [PATCH 09/14] video: bpp16: Disable by default on sunXi The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Reviewed-by: Anatolij Gustschin Reviewed-by: Andre Przywara Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- drivers/video/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index a267c9acfe..2fc0defcd0 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -49,6 +49,7 @@ config VIDEO_BPP8 config VIDEO_BPP16 bool "Support 16-bit-per-pixel displays" depends on DM_VIDEO + default n if ARCH_SUNXI default y if DM_VIDEO help Support drawing text and bitmaps onto a 16-bit-per-pixel display. From acd4d3343f6dc0f8a0c62bd4fb4ed5dbbc2ced1b Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:21 +0100 Subject: [PATCH 10/14] net: regex: Disable by default on sunXi The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this option that is not critical until we can adress the issue properly. Reviewed-by: Andre Przywara Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- lib/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Kconfig b/lib/Kconfig index 00ac650e74..710deb7a63 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -57,6 +57,7 @@ config PANIC_HANG config REGEX bool "Enable regular expression support" + default n if ARCH_SUNXI default y if NET help If this variable is defined, U-Boot is linked against the From eff264d731d00a82a04e357fa04024d1a445d269 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Tue, 16 Jan 2018 09:44:22 +0100 Subject: [PATCH 11/14] sunxi: imply CONFIG_OF_LIBFDT_OVERLAY fdt overlay support is useful for all sunxi boards, enable per default and remove it from sunxi defconfigs. Signed-off-by: Andre Heider Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- arch/arm/Kconfig | 1 + configs/CHIP_defconfig | 1 - configs/CHIP_pro_defconfig | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f6d57f5505..73fbd54edb 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -746,6 +746,7 @@ config ARCH_SUNXI select USE_TINY_PRINTF imply CMD_GPT imply FAT_WRITE + imply OF_LIBFDT_OVERLAY imply PRE_CONSOLE_BUFFER imply SPL_GPIO_SUPPORT imply SPL_LIBCOMMON_SUPPORT diff --git a/configs/CHIP_defconfig b/configs/CHIP_defconfig index 062ac76e6d..2452d42a87 100644 --- a/configs/CHIP_defconfig +++ b/configs/CHIP_defconfig @@ -20,4 +20,3 @@ CONFIG_AXP_ALDO4_VOLT=3300 CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y -CONFIG_OF_LIBFDT_OVERLAY=y diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig index f47aead6f9..02e79b5bb5 100644 --- a/configs/CHIP_pro_defconfig +++ b/configs/CHIP_pro_defconfig @@ -25,4 +25,3 @@ CONFIG_AXP_ALDO4_VOLT=3300 CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y -CONFIG_OF_LIBFDT_OVERLAY=y From e89f5591f40a1c46f4a1016eddd1e215175b992f Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:23 +0100 Subject: [PATCH 12/14] Makefile: Add size check to the u-boot.itb make target The make macro to check if the binary exceeds the board size limit is not called. Make sure that is the case. Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 4981a2ed6f..7195219503 100644 --- a/Makefile +++ b/Makefile @@ -1053,6 +1053,7 @@ u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \ u-boot.itb: u-boot-nodtb.bin dts/dt.dtb $(U_BOOT_ITS) FORCE $(call if_changed,mkfitimage) + $(BOARD_SIZE_CHECK) u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) From 99219664085a35a32688564199e0d2c3dded5077 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 16 Jan 2018 09:44:24 +0100 Subject: [PATCH 13/14] sunxi: Add limit with the MMC environment The MMC environment offset is getting very close to the end of the U-Boot binary now. Since we want to make sure this will not overflow, add a size limit in the board for arm64. arm32 has already that limit enforced in our custom image generation. Signed-off-by: Maxime Ripard Reviewed-by: Jagan Teki --- include/configs/sunxi-common.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 3855c564f9..6236e129a8 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -147,6 +147,16 @@ #endif #if defined(CONFIG_ENV_IS_IN_MMC) + +#ifdef CONFIG_ARM64 +/* + * This is actually (CONFIG_ENV_OFFSET - + * (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)), but the value will be used + * directly in a makefile, without the preprocessor expansion. + */ +#define CONFIG_BOARD_SIZE_LIMIT 0x7e000 +#endif + #if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1 /* If we have two devices (most likely eMMC + MMC), favour the eMMC */ #define CONFIG_SYS_MMC_ENV_DEV 1 From a6968ecb0ad6b06552c97005eba265a4c5761626 Mon Sep 17 00:00:00 2001 From: Chris Blake Date: Mon, 15 Jan 2018 16:28:18 -0600 Subject: [PATCH 14/14] gpio: sunxi: Add compatible string for H5 PIO Add allwinner,sun50i-h5-pinctrl compatible for H5 boards. Signed-off-by: Chris Blake Reviewed-by: Jagan Teki [jagan: remove external link and format commit message] Signed-off-by: Jagan Teki --- drivers/gpio/sunxi_gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c index b47cc66c58..3cf01b6e36 100644 --- a/drivers/gpio/sunxi_gpio.c +++ b/drivers/gpio/sunxi_gpio.c @@ -345,6 +345,7 @@ static const struct udevice_id sunxi_gpio_ids[] = { ID("allwinner,sun4i-a10-pinctrl", a_all), ID("allwinner,sun5i-a10s-pinctrl", a_all), ID("allwinner,sun5i-a13-pinctrl", a_all), + ID("allwinner,sun50i-h5-pinctrl", a_all), ID("allwinner,sun6i-a31-pinctrl", a_all), ID("allwinner,sun6i-a31s-pinctrl", a_all), ID("allwinner,sun7i-a20-pinctrl", a_all),