From 82548aaad57b4060e57dfecc7752253eb3534474 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 3 Apr 2019 13:46:36 +0200 Subject: [PATCH 1/4] phy: Also allow MESON_GXM for MESON_GXL_USB_PHY The MESON_GXL_USB_PHY is also used on the Amlogic Meson GXM SoCs. Fixes: 2960e27e38 ("phy: Add Amlogic Meson USB2 & USB3 Generic PHY drivers") Signed-off-by: Neil Armstrong --- drivers/phy/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 825ee7c3beb3..32bbf41dd1f5 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -141,7 +141,7 @@ config PHY_STM32_USBPHYC config MESON_GXL_USB_PHY bool "Amlogic Meson GXL USB PHYs" - depends on PHY && ARCH_MESON && MESON_GXL + depends on PHY && ARCH_MESON && (MESON_GXL || MESON_GXM) imply REGMAP help This is the generic phy driver for the Amlogic Meson GXL From 2118a272e3c2ae9e677ab0527939a979dc1a0f60 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 3 Apr 2019 13:46:37 +0200 Subject: [PATCH 2/4] configs: khadas_vim2: Fix defconfig The Khadas VIM2 defconfig was missing the USB PHY config and two other misc configs to setup dram banks and call misc_init_r. Align it on the other Amlogic SoC based boards defconfig. Signed-off-by: Neil Armstrong --- configs/khadas-vim2_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/khadas-vim2_defconfig b/configs/khadas-vim2_defconfig index 0f738cbb908e..080dd19590e3 100644 --- a/configs/khadas-vim2_defconfig +++ b/configs/khadas-vim2_defconfig @@ -6,8 +6,10 @@ CONFIG_DEBUG_UART_BASE=0xc81004c0 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_IDENT_STRING=" khadas-vim2" CONFIG_DEBUG_UART=y +CONFIG_NR_DRAM_BANKS=1 CONFIG_OF_BOARD_SETUP=y CONFIG_CONSOLE_MUX=y +CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set # CONFIG_CMD_BDI is not set @@ -30,6 +32,7 @@ CONFIG_MTD=y CONFIG_DM_ETH=y CONFIG_ETH_DESIGNWARE=y CONFIG_PHY=y +CONFIG_MESON_GXL_USB_PHY=y CONFIG_PINCTRL=y CONFIG_PINCTRL_MESON_GXL=y CONFIG_DM_REGULATOR_FIXED=y From ab8fc413028b4fd22492a93ef31223d606cac5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=98=E9=BB=98?= Date: Sun, 31 Mar 2019 16:07:03 +0800 Subject: [PATCH 3/4] fix compile error on macOS Mojave --- Makefile | 7 +++++++ lib/bch.c | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c1af9307b38e..92e04dd68987 100644 --- a/Makefile +++ b/Makefile @@ -291,6 +291,9 @@ DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.') os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \ $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;) +os_x_after = $(shell if [ $(DARWIN_MAJOR_VERSION) -ge $(1) -a \ + $(DARWIN_MINOR_VERSION) -ge $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;) + # Snow Leopards build environment has no longer restrictions as described above HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc") HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp") @@ -300,6 +303,10 @@ HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress") # in some host tools which is a problem then ... so disable ASLR for these # tools HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie") + +# macOS Mojave (10.14.X) +# Undefined symbols for architecture x86_64: "_PyArg_ParseTuple" +HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "") endif # Decide whether to build built-in, modular, or both. diff --git a/lib/bch.c b/lib/bch.c index 20079eb9ebd1..c4fac77d6114 100644 --- a/lib/bch.c +++ b/lib/bch.c @@ -62,6 +62,9 @@ #include #if defined(__FreeBSD__) #include +#elif defined(__APPLE__) +#include +#include #else #include #endif @@ -70,7 +73,11 @@ #include #undef cpu_to_be32 +#if defined(__APPLE__) +#define cpu_to_be32 OSSwapHostToBigInt32 +#else #define cpu_to_be32 htobe32 +#endif #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) #define kmalloc(size, flags) malloc(size) #define kzalloc(size, flags) calloc(1, size) @@ -116,7 +123,7 @@ struct gf_poly_deg1 { }; #ifdef USE_HOSTCC -#if !defined(__DragonFly__) && !defined(__FreeBSD__) +#if !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__APPLE__) static int fls(int x) { int r = 32; From d7edeba79b2776a2097adf952b3b392c2dfb036b Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 30 Mar 2019 15:29:23 +0100 Subject: [PATCH 4/4] tools/Makefile: build host tools with -std=gnu99 Parts of the code are using C99 constructs (such as variables declared inside loops), but also GNU extensions (such as typeof), so using -std=gnu99 is necessary to build with older versions of gcc that don't default to building with gnu99. It fixes the following build failure: ./tools/../lib/crc16.c: In function "crc16_ccitt": ./tools/../lib/crc16.c:70:2: error: "for" loop initial declarations are only allowed in C99 mode for (int i = 0; i < len; i++) ^ ./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code when building the host tools with gcc 4.7. Signed-off-by: Thomas Petazzoni Reviewed-by: Philipp Tomsich --- tools/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index 081383d7a790..d377d85f74e7 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -254,7 +254,8 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \ -I$(srctree)/tools \ -DUSE_HOSTCC \ -D__KERNEL_STRICT_NAMES \ - -D_GNU_SOURCE + -D_GNU_SOURCE \ + -std=gnu99 __build: $(LOGO-y)