From d5be6bf3fbe73588697866676514369fd8f4e784 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Wed, 13 Jan 2016 17:00:35 +0100 Subject: [PATCH 01/13] Import GMAC_PHY_POWER support from the loboris source tree. Signed-off-by: Yann Dirson --- drivers/net/ethernet/sunxi/eth/Kconfig | 8 +++++ drivers/net/ethernet/sunxi/eth/sunxi_geth.c | 35 +++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/drivers/net/ethernet/sunxi/eth/Kconfig b/drivers/net/ethernet/sunxi/eth/Kconfig index 13787db7a8db47..af930df0246892 100755 --- a/drivers/net/ethernet/sunxi/eth/Kconfig +++ b/drivers/net/ethernet/sunxi/eth/Kconfig @@ -35,5 +35,13 @@ config GETH_PHY_POWER If external PHY power is exist, and it want to be controled, select it. If not, it mean the power of PHY already on. +config GMAC_PHY_POWER + bool "External PHY power control" + depends on SUNXI_GETH + default y + ---help--- + If external PHY power is exist, and it want to be controled, + select it. If not, it mean the power of PHY already on. + endif diff --git a/drivers/net/ethernet/sunxi/eth/sunxi_geth.c b/drivers/net/ethernet/sunxi/eth/sunxi_geth.c index 7c48f7b0dd56a1..03931f287f9d14 100755 --- a/drivers/net/ethernet/sunxi/eth/sunxi_geth.c +++ b/drivers/net/ethernet/sunxi/eth/sunxi_geth.c @@ -154,6 +154,9 @@ struct geth_priv { spinlock_t lock; spinlock_t tx_lock; +#ifdef CONFIG_GMAC_PHY_POWER + u32 gpio_power_hd; +#endif }; #ifdef CONFIG_GETH_PHY_POWER @@ -195,6 +198,11 @@ static void desc_print(struct dma_desc *desc, int size) static int geth_power_on(struct geth_priv *priv) { int value; + +#ifdef CONFIG_GMAC_PHY_POWER + gpio_set_value(priv->gpio_power_hd, 1); +#endif + #ifdef CONFIG_GETH_PHY_POWER struct regulator **regu; int ret = 0, i = 0; @@ -258,6 +266,11 @@ static int geth_power_on(struct geth_priv *priv) static void geth_power_off(struct geth_priv *priv) { int value; + +#ifdef CONFIG_GMAC_PHY_POWER + gpio_set_value(priv->gpio_power_hd, 0); +#endif + #ifdef CONFIG_GETH_PHY_POWER struct regulator **regu = priv->power; int i = 0; @@ -1608,6 +1621,12 @@ static int geth_sys_request(struct platform_device *pdev) int ret = 0; struct resource *res; +#ifdef CONFIG_GMAC_PHY_POWER + script_item_value_type_e type; + script_item_u item; + int req_status; +#endif + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "geth_extclk"); if (unlikely(!res)){ ret = -ENODEV; @@ -1681,6 +1700,22 @@ static int geth_sys_request(struct platform_device *pdev) } } #endif + +#ifdef CONFIG_GMAC_PHY_POWER && CONFIG_GETH_SCRIPT_SYS + type = script_get_item("gmac_phy_power", "gmac_phy_power_en", &item); + if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) { + pr_err("script_get_item return type err\n"); + return -EFAULT; + } + /*request gpio*/ + req_status = gpio_request(item.gpio.gpio, NULL); + if (0 != req_status) { + pr_err("request gpio failed!\n"); + } + gpio_direction_output(item.gpio.gpio, 1); + priv->gpio_power_hd = item.gpio.gpio; + #endif + return 0; pin_err: From d55ffff2c945766659a9d7337caf89dd89228175 Mon Sep 17 00:00:00 2001 From: Edward Nielsen Date: Sat, 19 May 2012 10:57:54 +0200 Subject: [PATCH 02/13] gpu: drm: Add Mali DX910-SW-99002-r2p4-02rel1 the mali directory came from the DX910-SW-99002-r2p4-02rel1 http://www.malideveloper.com/developer-resources/drivers/open-source-mali-gpus-linux-exadri2-and-x11-display-drivers.php menuconfig to enable CONFIG_DRM_MALI under device drivers->graphics support->Direct Rendering Manager the only issue is at the bottom of the mali_drv.c file I had to use /* MODULE_LICENSE(DRIVER_LICENSE); */ MODULE_LICENSE("GPL"); to avoid a GPL / NONGPL license error while compiling. The header of this file says it has a GPL license so the change should be ok. I am not a license expert but I believe it will be ok. (cherry picked from commit 250cc15284336be76b84fdbdb123d5aad6409d37) --- drivers/gpu/drm/Kconfig | 7 ++ drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/mali/Makefile | 20 +++++ drivers/gpu/drm/mali/mali_drv.c | 153 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/mali/mali_drv.h | 25 ++++++ 5 files changed, 206 insertions(+) create mode 100644 drivers/gpu/drm/mali/Makefile create mode 100644 drivers/gpu/drm/mali/mali_drv.c create mode 100644 drivers/gpu/drm/mali/mali_drv.h diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index e354bc0b052a22..10e1797bf2fd68 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -172,6 +172,13 @@ config DRM_VIA Choose this option if you have a Via unichrome or compatible video chipset. If M is selected the module will be called via. +config DRM_MALI + tristate "Mali DRM supprt" + depends on DRM + help + Choose this option if you have a Mali 200 or Mali 400 gpu + If M is selected the module will be called mali_drm. + config DRM_SAVAGE tristate "Savage video cards" depends on DRM && PCI diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index c20da5bda3551c..e94a1a804bf563 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_DRM_SIS) += sis/ obj-$(CONFIG_DRM_SAVAGE)+= savage/ obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/ obj-$(CONFIG_DRM_VIA) +=via/ +obj-$(CONFIG_DRM_MALI) += mali/ obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/ obj-$(CONFIG_DRM_EXYNOS) +=exynos/ obj-$(CONFIG_DRM_GMA500) += gma500/ diff --git a/drivers/gpu/drm/mali/Makefile b/drivers/gpu/drm/mali/Makefile new file mode 100644 index 00000000000000..c9a9a8305cf2db --- /dev/null +++ b/drivers/gpu/drm/mali/Makefile @@ -0,0 +1,20 @@ +# +# * Copyright (C) 2010 ARM Limited. All rights reserved. +# * +# * This program is free software and is provided to you under the terms of the GNU General Public License version 2 +# * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. +# * +# * A copy of the licence is included with the program, and can also be obtained from Free Software +# * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# Makefile for the Mali drm device driver. This driver provides support for the +# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. + +ccflags-y = -Iinclude/drm -Larch/arm/mach-sun4i/devices.o +mali_drm-y := mali_drv.o + +obj-$(CONFIG_DRM_MALI) += mali_drm.o + + diff --git a/drivers/gpu/drm/mali/mali_drv.c b/drivers/gpu/drm/mali/mali_drv.c new file mode 100644 index 00000000000000..e88873e624f210 --- /dev/null +++ b/drivers/gpu/drm/mali/mali_drv.c @@ -0,0 +1,153 @@ +/** + * Copyright (C) 2010 ARM Limited. All rights reserved. + * + * This program is free software and is provided to you under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. + * + * A copy of the licence is included with the program, and can also be obtained from Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * @file mali_drv.c + * Implementation of the Linux device driver entrypoints for Mali DRM + */ + +#include +#include "drmP.h" +#include "mali_drv.h" + + +void mali_drm_preclose(struct drm_device *dev) +{ +} + +void mali_drm_lastclose(struct drm_device *dev) +{ +} + +static int mali_drm_suspend(struct drm_device *dev) +{ + return 0; +} + +static int mali_drm_resume(struct drm_device *dev) +{ + return 0; +} + +static int mali_drm_load(struct drm_device *dev, unsigned long chipset) +{ + return 0; +} + +static int mali_drm_unload(struct drm_device *dev) +{ + return 0; +} + +static struct drm_driver driver = +{ + .driver_features = DRIVER_BUS_PLATFORM, + .load = mali_drm_load, + .unload = mali_drm_unload, + .context_dtor = NULL, + .reclaim_buffers = NULL, + .reclaim_buffers_idlelocked = NULL, + .preclose = mali_drm_preclose, + .lastclose = mali_drm_lastclose, + .suspend = mali_drm_suspend, + .resume = mali_drm_resume, + + .ioctls = NULL, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .unlocked_ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .name = DRIVER_NAME, + .desc = DRIVER_DESC, + .date = DRIVER_DATE, + .major = DRIVER_MAJOR, + .minor = DRIVER_MINOR, + .patchlevel = DRIVER_PATCHLEVEL, +}; + +int mali_drm_init(struct platform_device *dev) +{ + printk(KERN_INFO "Mali DRM initialize, driver name: %s, version %d.%d\n", DRIVER_NAME, DRIVER_MAJOR, DRIVER_MINOR); + driver.num_ioctls = 0; + + return drm_platform_init(&driver, dev); +} + +void mali_drm_exit(struct platform_device *dev) +{ + + return drm_platform_exit(&driver, dev); +} + +static int __devinit mali_platform_drm_probe(struct platform_device *dev) +{ + return mali_drm_init(dev); +} + +static int mali_platform_drm_remove(struct platform_device *dev) +{ + mali_drm_exit(dev); + + return 0; +} + +static int mali_platform_drm_suspend(struct platform_device *dev, pm_message_t state) +{ + return 0; +} + +static int mali_platform_drm_resume(struct platform_device *dev) +{ + return 0; +} + + +static struct platform_driver platform_drm_driver = { + .probe = mali_platform_drm_probe, + .remove = __devexit_p(mali_platform_drm_remove), + .suspend = mali_platform_drm_suspend, + .resume = mali_platform_drm_resume, + .driver = { + .owner = THIS_MODULE, + .name = DRIVER_NAME, + }, +}; + +static int __init mali_platform_drm_init(void) +{ + return platform_driver_register( &platform_drm_driver ); +} + +static void __exit mali_platform_drm_exit(void) +{ + platform_driver_unregister( &platform_drm_driver ); +} + +#ifdef MODULE +module_init(mali_platform_drm_init); +#else +late_initcall(mali_platform_drm_init); +#endif +module_exit(mali_platform_drm_exit); + +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_VERSION(DRIVER_VERSION); +MODULE_AUTHOR(DRIVER_AUTHOR); +/* MODULE_LICENSE(DRIVER_LICENSE); */ +MODULE_LICENSE("GPL"); +MODULE_ALIAS(DRIVER_ALIAS); +MODULE_INFO(vermagic, VERMAGIC_STRING); + + diff --git a/drivers/gpu/drm/mali/mali_drv.h b/drivers/gpu/drm/mali/mali_drv.h new file mode 100644 index 00000000000000..aed5fd356b732d --- /dev/null +++ b/drivers/gpu/drm/mali/mali_drv.h @@ -0,0 +1,25 @@ +/** + * Copyright (C) 2010 ARM Limited. All rights reserved. + * + * This program is free software and is provided to you under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. + * + * A copy of the licence is included with the program, and can also be obtained from Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _MALI_DRV_H_ +#define _MALI_DRV_H_ + +#define DRIVER_AUTHOR "ARM Ltd." +#define DRIVER_NAME "mali_drm" +#define DRIVER_DESC "DRM module for Mali-200, Mali-400" +#define DRIVER_LICENSE "GPLv2" +#define DRIVER_ALIAS "platform:mali_drm" +#define DRIVER_DATE "20101111" +#define DRIVER_VERSION "0.2" +#define DRIVER_MAJOR 2 +#define DRIVER_MINOR 1 +#define DRIVER_PATCHLEVEL 1 + +#endif /* _MALI_DRV_H_ */ From f35068c7c8d376c45e7946d210afe1ca1d8cb12d Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Fri, 13 Jul 2012 14:02:18 +0200 Subject: [PATCH 03/13] drm: mali: fix for 3.4 (cherry picked from commit 5bba4fb83f9f68d2e84ec7b83ce334f7fd5dd704) --- drivers/gpu/drm/mali/mali_drv.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/mali/mali_drv.c b/drivers/gpu/drm/mali/mali_drv.c index e88873e624f210..af8c014dcd0e7d 100644 --- a/drivers/gpu/drm/mali/mali_drv.c +++ b/drivers/gpu/drm/mali/mali_drv.c @@ -13,12 +13,13 @@ * Implementation of the Linux device driver entrypoints for Mali DRM */ +#include #include #include "drmP.h" #include "mali_drv.h" -void mali_drm_preclose(struct drm_device *dev) +void mali_drm_preclose(struct drm_device *dev, struct drm_file *file_priv) { } @@ -26,7 +27,7 @@ void mali_drm_lastclose(struct drm_device *dev) { } -static int mali_drm_suspend(struct drm_device *dev) +static int mali_drm_suspend(struct drm_device *dev, pm_message_t state) { return 0; } @@ -46,6 +47,16 @@ static int mali_drm_unload(struct drm_device *dev) return 0; } +static struct file_operations mali_fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .unlocked_ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, +}; + static struct drm_driver driver = { .driver_features = DRIVER_BUS_PLATFORM, @@ -58,17 +69,8 @@ static struct drm_driver driver = .lastclose = mali_drm_lastclose, .suspend = mali_drm_suspend, .resume = mali_drm_resume, - .ioctls = NULL, - .fops = { - .owner = THIS_MODULE, - .open = drm_open, - .release = drm_release, - .unlocked_ioctl = drm_ioctl, - .mmap = drm_mmap, - .poll = drm_poll, - .fasync = drm_fasync, - }, + .fops = &mali_fops, .name = DRIVER_NAME, .desc = DRIVER_DESC, .date = DRIVER_DATE, From d2dd49d029c30f6c00050bb917fdc80b65e2bd14 Mon Sep 17 00:00:00 2001 From: Dmitriy Beykun Date: Sun, 16 Sep 2012 00:09:07 +0400 Subject: [PATCH 04/13] gpu: drm: mali_drv: fixed integration with 3.x kernels DRM mali_drv is taken from http://www.igloocommunity.org git. Now you can use X11 DRI2 Mali-400 drivers from ARM with default xorg.conf. This commit also adds support for two framebuffers for Mali DRM, they are different platform devices called mali_drm.0 and mali_drm.1 accordingly. (cherry picked from commit 8b9710bfd0c65611e0fc3a85188299e8411d337c) --- drivers/gpu/drm/mali/mali_drv.c | 57 ++++++++++++++++++++++++++------- drivers/gpu/drm/mali/mali_drv.h | 2 +- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/mali/mali_drv.c b/drivers/gpu/drm/mali/mali_drv.c index af8c014dcd0e7d..ac0138c1972c4a 100644 --- a/drivers/gpu/drm/mali/mali_drv.c +++ b/drivers/gpu/drm/mali/mali_drv.c @@ -15,9 +15,11 @@ #include #include -#include "drmP.h" +#include #include "mali_drv.h" +static struct platform_device *dev0; +static struct platform_device *dev1; void mali_drm_preclose(struct drm_device *dev, struct drm_file *file_priv) { @@ -57,7 +59,29 @@ static struct file_operations mali_fops = { .fasync = drm_fasync, }; -static struct drm_driver driver = +static struct drm_driver driver = +{ + .driver_features = DRIVER_BUS_PLATFORM, + .load = mali_drm_load, + .unload = mali_drm_unload, + .context_dtor = NULL, + .reclaim_buffers = NULL, + .reclaim_buffers_idlelocked = NULL, + .preclose = mali_drm_preclose, + .lastclose = mali_drm_lastclose, + .suspend = mali_drm_suspend, + .resume = mali_drm_resume, + .ioctls = NULL, + .fops = &mali_fops, + .name = DRIVER_NAME, + .desc = DRIVER_DESC, + .date = DRIVER_DATE, + .major = DRIVER_MAJOR, + .minor = DRIVER_MINOR, + .patchlevel = DRIVER_PATCHLEVEL, +}; + +static struct drm_driver driver1 = { .driver_features = DRIVER_BUS_PLATFORM, .load = mali_drm_load, @@ -82,15 +106,25 @@ static struct drm_driver driver = int mali_drm_init(struct platform_device *dev) { printk(KERN_INFO "Mali DRM initialize, driver name: %s, version %d.%d\n", DRIVER_NAME, DRIVER_MAJOR, DRIVER_MINOR); - driver.num_ioctls = 0; - - return drm_platform_init(&driver, dev); + if (dev == dev0) { + driver.num_ioctls = 0; + driver.kdriver.platform_device = dev; + return drm_platform_init(&driver, dev); + } else if (dev == dev1) { + driver1.num_ioctls = 0; + driver1.kdriver.platform_device = dev; + return drm_platform_init(&driver1, dev); + } + return 0; } void mali_drm_exit(struct platform_device *dev) { - - return drm_platform_exit(&driver, dev); + if (driver.kdriver.platform_device == dev) { + drm_platform_exit(&driver, dev); + } else if (driver1.kdriver.platform_device == dev) { + drm_platform_exit(&driver1, dev); + } } static int __devinit mali_platform_drm_probe(struct platform_device *dev) @@ -129,12 +163,16 @@ static struct platform_driver platform_drm_driver = { static int __init mali_platform_drm_init(void) { + dev0 = platform_device_register_simple("mali_drm", 0, NULL, 0); + dev1 = platform_device_register_simple("mali_drm", 1, NULL, 0); return platform_driver_register( &platform_drm_driver ); } static void __exit mali_platform_drm_exit(void) { platform_driver_unregister( &platform_drm_driver ); + platform_device_unregister(dev0); + platform_device_unregister(dev1); } #ifdef MODULE @@ -147,9 +185,6 @@ module_exit(mali_platform_drm_exit); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_VERSION(DRIVER_VERSION); MODULE_AUTHOR(DRIVER_AUTHOR); -/* MODULE_LICENSE(DRIVER_LICENSE); */ -MODULE_LICENSE("GPL"); +MODULE_LICENSE(DRIVER_LICENSE); MODULE_ALIAS(DRIVER_ALIAS); MODULE_INFO(vermagic, VERMAGIC_STRING); - - diff --git a/drivers/gpu/drm/mali/mali_drv.h b/drivers/gpu/drm/mali/mali_drv.h index aed5fd356b732d..188f427ee6d873 100644 --- a/drivers/gpu/drm/mali/mali_drv.h +++ b/drivers/gpu/drm/mali/mali_drv.h @@ -14,7 +14,7 @@ #define DRIVER_AUTHOR "ARM Ltd." #define DRIVER_NAME "mali_drm" #define DRIVER_DESC "DRM module for Mali-200, Mali-400" -#define DRIVER_LICENSE "GPLv2" +#define DRIVER_LICENSE "GPL v2" #define DRIVER_ALIAS "platform:mali_drm" #define DRIVER_DATE "20101111" #define DRIVER_VERSION "0.2" From e1fe23471962c3455094d04b7a8f5bbe0b6685b6 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 14 Jan 2016 01:12:10 +0100 Subject: [PATCH 05/13] Build drm and drm_mali modules by default. --- arch/arm/configs/sun8iw7p1smp_defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/sun8iw7p1smp_defconfig b/arch/arm/configs/sun8iw7p1smp_defconfig index a7fefe88ff3655..252f54497a7433 100755 --- a/arch/arm/configs/sun8iw7p1smp_defconfig +++ b/arch/arm/configs/sun8iw7p1smp_defconfig @@ -2062,7 +2062,8 @@ CONFIG_VIDEO_ENCODER_DECODER_SUNXI=y # # Graphics support # -# CONFIG_DRM is not set +CONFIG_DRM=m +CONFIG_DRM_MALI=m CONFIG_ION=y CONFIG_ION_SUNXI=y CONFIG_ION_SUNXI_RESERVE_LIST="160M@0,256M@0,130M@1,200M@1" From 11a03eba724c555fff11fdb7a8846a98f5838358 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 14 Jan 2016 02:32:31 +0100 Subject: [PATCH 06/13] Fix paths to files in $(src) erroneously searched for in $(obj). This fixes some part of building the kernel in a separate directory. The remaining part (real libs really in source tree) is more tricky. --- arch/arm/mach-sunxi/power/brom/Makefile | 12 ++++++------ drivers/arisc/binary/Makefile | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-sunxi/power/brom/Makefile b/arch/arm/mach-sunxi/power/brom/Makefile index b7b36d81ff0ef8..488cd6b66a5aef 100755 --- a/arch/arm/mach-sunxi/power/brom/Makefile +++ b/arch/arm/mach-sunxi/power/brom/Makefile @@ -22,21 +22,21 @@ resumes-y := resumes.o \ resumes-y := $(addprefix $(obj)/,$(resumes-y)) -$(obj)/resumes.code: $(obj)/resumes.bin - $(Q)$(obj)/gen_check_code $(obj)/resumes.bin $(obj)/resumes.code +$(obj)/resumes.code: $(src)/gen_check_code $(obj)/resumes.bin + $(Q)$< $(obj)/resumes.bin $(obj)/resumes.code $(obj)/resumes.bin: $(obj)/resumes.elf FORCE $(Q)$(CROSS_COMPILE)objcopy -O binary $(obj)/resumes.elf $(obj)/resumes.bin ifneq ($(strip $(CONFIG_ARCH_SUN9I)),) -$(obj)/resumes.elf: $(obj)/sun9i_brom_scatter.scat $(resumes-y) - $(Q)$(CROSS_COMPILE)ld -T $(obj)/sun9i_brom_scatter.scat -EL $(resumes-y) -o $(obj)/resumes.elf -Map $(obj)/resumes.map +$(obj)/resumes.elf: $(src)/sun9i_brom_scatter.scat $(resumes-y) + $(Q)$(CROSS_COMPILE)ld -T $< -EL $(resumes-y) -o $(obj)/resumes.elf -Map $(obj)/resumes.map $(Q)$(CROSS_COMPILE)objdump -D $(obj)/resumes.elf > $(obj)/resumes.lst endif ifneq ($(strip $(CONFIG_ARCH_SUN8I)),) -$(obj)/resumes.elf: $(obj)/sun8i_brom_scatter.scat $(resumes-y) - $(Q)$(CROSS_COMPILE)ld -T $(obj)/sun8i_brom_scatter.scat -EL $(resumes-y) -o $(obj)/resumes.elf -Map $(obj)/resumes.map +$(obj)/resumes.elf: $(src)/sun8i_brom_scatter.scat $(resumes-y) + $(Q)$(CROSS_COMPILE)ld -T $< -EL $(resumes-y) -o $(obj)/resumes.elf -Map $(obj)/resumes.map $(Q)$(CROSS_COMPILE)objdump -D $(obj)/resumes.elf > $(obj)/resumes.lst endif diff --git a/drivers/arisc/binary/Makefile b/drivers/arisc/binary/Makefile index ab3d5d2376fda1..08b81fd5a3a397 100755 --- a/drivers/arisc/binary/Makefile +++ b/drivers/arisc/binary/Makefile @@ -29,8 +29,8 @@ ifdef CONFIG_ARCH_SUN9IW1P1 PLATFORM=arisc_sun9iw1p1 endif -$(obj)/$(PLATFORM).bin : $(obj)/$(PLATFORM).code - cp $(obj)/$(PLATFORM).code $(obj)/$(PLATFORM).tar.bz2; \ +$(obj)/$(PLATFORM).bin : $(src)/$(PLATFORM).code + cp $< $(obj)/$(PLATFORM).tar.bz2; \ tar -xjvf $(obj)/$(PLATFORM).tar.bz2 -C $(obj)/; \ cp $(obj)/arisc_package/$(PLATFORM).bin $(obj)/$(PLATFORM).bin; \ cp $(obj)/arisc_package/$(PLATFORM).tar.bz2.aes $(obj)/arisc; \ From acdcb2a675ed117c97e321ddf3a4e077994b1e43 Mon Sep 17 00:00:00 2001 From: Trevor Woerner Date: Thu, 24 Sep 2015 17:07:26 -0400 Subject: [PATCH 07/13] gcc5 fixes gcc5 is pickier about inline functions defined in headers. Signed-off-by: Trevor Woerner Adjusted to this source tree. Signed-off-by: Yann Dirson --- drivers/net/wireless/rtl8188eu/include/ieee80211.h | 6 +++--- drivers/net/wireless/rtl8189es/include/ieee80211.h | 6 +++--- drivers/net/wireless/rtl8723bs/include/ieee80211.h | 6 +++--- drivers/staging/rtl8712/ieee80211.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/rtl8188eu/include/ieee80211.h b/drivers/net/wireless/rtl8188eu/include/ieee80211.h index fc293c45759882..0898cd47e40c3d 100755 --- a/drivers/net/wireless/rtl8188eu/include/ieee80211.h +++ b/drivers/net/wireless/rtl8188eu/include/ieee80211.h @@ -1314,18 +1314,18 @@ enum ieee80211_state { (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else -extern __inline int is_multicast_mac_addr(const u8 *addr) +static __inline int is_multicast_mac_addr(const u8 *addr) { return ((addr[0] != 0xff) && (0x01 & addr[0])); } -extern __inline int is_broadcast_mac_addr(const u8 *addr) +static __inline int is_broadcast_mac_addr(const u8 *addr) { return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } -extern __inline int is_zero_mac_addr(const u8 *addr) +static __inline int is_zero_mac_addr(const u8 *addr) { return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); diff --git a/drivers/net/wireless/rtl8189es/include/ieee80211.h b/drivers/net/wireless/rtl8189es/include/ieee80211.h index fc293c45759882..0898cd47e40c3d 100755 --- a/drivers/net/wireless/rtl8189es/include/ieee80211.h +++ b/drivers/net/wireless/rtl8189es/include/ieee80211.h @@ -1314,18 +1314,18 @@ enum ieee80211_state { (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else -extern __inline int is_multicast_mac_addr(const u8 *addr) +static __inline int is_multicast_mac_addr(const u8 *addr) { return ((addr[0] != 0xff) && (0x01 & addr[0])); } -extern __inline int is_broadcast_mac_addr(const u8 *addr) +static __inline int is_broadcast_mac_addr(const u8 *addr) { return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } -extern __inline int is_zero_mac_addr(const u8 *addr) +static __inline int is_zero_mac_addr(const u8 *addr) { return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); diff --git a/drivers/net/wireless/rtl8723bs/include/ieee80211.h b/drivers/net/wireless/rtl8723bs/include/ieee80211.h index fc293c45759882..0898cd47e40c3d 100755 --- a/drivers/net/wireless/rtl8723bs/include/ieee80211.h +++ b/drivers/net/wireless/rtl8723bs/include/ieee80211.h @@ -1314,18 +1314,18 @@ enum ieee80211_state { (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else -extern __inline int is_multicast_mac_addr(const u8 *addr) +static __inline int is_multicast_mac_addr(const u8 *addr) { return ((addr[0] != 0xff) && (0x01 & addr[0])); } -extern __inline int is_broadcast_mac_addr(const u8 *addr) +static __inline int is_broadcast_mac_addr(const u8 *addr) { return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } -extern __inline int is_zero_mac_addr(const u8 *addr) +static __inline int is_zero_mac_addr(const u8 *addr) { return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); diff --git a/drivers/staging/rtl8712/ieee80211.h b/drivers/staging/rtl8712/ieee80211.h index 3c0092b7de0941..1e7b55bc956852 100644 --- a/drivers/staging/rtl8712/ieee80211.h +++ b/drivers/staging/rtl8712/ieee80211.h @@ -734,7 +734,7 @@ enum ieee80211_state { #define IEEE_G (1<<2) #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) -extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) +static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) { /* Single white space is for Linksys APs */ if (essid_len == 1 && essid[0] == ' ') @@ -748,7 +748,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) return 1; } -extern inline int ieee80211_get_hdrlen(u16 fc) +static inline int ieee80211_get_hdrlen(u16 fc) { int hdrlen = 24; From 4da57f43d3740a50fbe338773d7a914236fb18a8 Mon Sep 17 00:00:00 2001 From: Jens Lucius Date: Wed, 23 Sep 2015 12:06:20 +0200 Subject: [PATCH 08/13] linux-sunxi: add missing compiler-gcc5.h from master This patch had been added by Jens Lucius to the yocto linux-sunxi-3.4 recipe in meta-sunxi rev 062c1477cf0252f2afe07c545b4af075f21421f7. Signed-off-by: Yann Dirson --- include/linux/compiler-gcc5.h | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 include/linux/compiler-gcc5.h diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h new file mode 100644 index 00000000000000..cdd1cc202d51ef --- /dev/null +++ b/include/linux/compiler-gcc5.h @@ -0,0 +1,66 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif + +#define __used __attribute__((__used__)) +#define __must_check __attribute__((warn_unused_result)) +#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) + +/* Mark functions as cold. gcc will assume any path leading to a call + to them will be unlikely. This means a lot of manual unlikely()s + are unnecessary now for any paths leading to the usual suspects + like BUG(), printk(), panic() etc. [but let's keep them for now for + older compilers] + + Early snapshots of gcc 4.3 don't support this and we can't detect this + in the preprocessor, but we can live with this because they're unreleased. + Maketime probing would be overkill here. + + gcc also has a __attribute__((__hot__)) to move hot functions into + a special section, but I don't see any sense in this right now in + the kernel context */ +#define __cold __attribute__((__cold__)) + +#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) + +#ifndef __CHECKER__ +# define __compiletime_warning(message) __attribute__((warning(message))) +# define __compiletime_error(message) __attribute__((error(message))) +#endif /* __CHECKER__ */ + +/* + * Mark a position in code as unreachable. This can be used to + * suppress control flow warnings after asm blocks that transfer + * control elsewhere. + * + * Early snapshots of gcc 4.5 don't support this and we can't detect + * this in the preprocessor, but we can live with this because they're + * unreleased. Really, we need to have autoconf for the kernel. + */ +#define unreachable() __builtin_unreachable() + +/* Mark a function definition as prohibited from being cloned. */ +#define __noclone __attribute__((__noclone__)) + +/* + * Tell the optimizer that something else uses this function or variable. + */ +#define __visible __attribute__((externally_visible)) + +/* + * GCC 'asm goto' miscompiles certain code sequences: + * + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 + * + * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. + * Fixed in GCC 4.8.2 and later versions. + * + * (asm goto is automatically volatile - the naming reflects this.) + */ +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) + +#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP +#define __HAVE_BUILTIN_BSWAP32__ +#define __HAVE_BUILTIN_BSWAP64__ +#define __HAVE_BUILTIN_BSWAP16__ +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ From fdebcfd57a2921245f0af8670d93e6fd978c2c5c Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 14 Jan 2016 01:11:16 +0100 Subject: [PATCH 09/13] Copy essential defconfig items form loboris tree. * CONFIG_DEFAULT_MMAP_MIN_ADDR too high disallowed execution of some debian binaries (eg. m4, setxkbmap) * CONFIG_ANDROID_PARANOID_NETWORK required special work to get network access * CONFIG_GMAC_PHY_POWER must be enabled on Orange Pi Plus for ethernet to work at all Signed-off-by: Yann Dirson --- arch/arm/configs/sun8iw7p1smp_defconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/configs/sun8iw7p1smp_defconfig b/arch/arm/configs/sun8iw7p1smp_defconfig index 252f54497a7433..7bb7f2c1328059 100755 --- a/arch/arm/configs/sun8iw7p1smp_defconfig +++ b/arch/arm/configs/sun8iw7p1smp_defconfig @@ -471,7 +471,7 @@ CONFIG_ZONE_DMA_FLAG=0 CONFIG_BOUNCE=y CONFIG_VIRT_TO_BUS=y # CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 # CONFIG_CLEANCACHE is not set CONFIG_FORCE_MAX_ZONEORDER=11 CONFIG_ALIGNMENT_TRAP=y @@ -658,7 +658,7 @@ CONFIG_IPV6_TUNNEL=y CONFIG_IPV6_MULTIPLE_TABLES=y # CONFIG_IPV6_SUBTREES is not set # CONFIG_IPV6_MROUTE is not set -CONFIG_ANDROID_PARANOID_NETWORK=y +# CONFIG_ANDROID_PARANOID_NETWORK is not set CONFIG_NET_ACTIVITY_STATS=y CONFIG_NETWORK_SECMARK=y # CONFIG_NETWORK_PHY_TIMESTAMPING is not set @@ -1209,6 +1209,7 @@ CONFIG_NET_VENDOR_SUNXI=y CONFIG_SUNXI_GETH=y CONFIG_GETH_SCRIPT_SYS=y CONFIG_GETH_CLK_SYS=y +CONFIG_GMAC_PHY_POWER=y CONFIG_PHYLIB=y # From c82cbadecca7a69066d89d0fefaf867699b9d77e Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sat, 23 Jan 2016 19:03:58 +0100 Subject: [PATCH 10/13] sun8iw7p1smp: activate MALI driver in defaultconfig Signed-off-by: Yann Dirson --- arch/arm/configs/sun8iw7p1smp_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/sun8iw7p1smp_defconfig b/arch/arm/configs/sun8iw7p1smp_defconfig index 7bb7f2c1328059..7fa4e4cb257800 100755 --- a/arch/arm/configs/sun8iw7p1smp_defconfig +++ b/arch/arm/configs/sun8iw7p1smp_defconfig @@ -2068,6 +2068,7 @@ CONFIG_DRM_MALI=m CONFIG_ION=y CONFIG_ION_SUNXI=y CONFIG_ION_SUNXI_RESERVE_LIST="160M@0,256M@0,130M@1,200M@1" +CONFIG_MALI=m # CONFIG_VGASTATE is not set # CONFIG_VIDEO_OUTPUT_CONTROL is not set CONFIG_FB=y From 14a879e061b70c091dec20ec47dbd64a3fcd0723 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sat, 23 Jan 2016 19:25:09 +0100 Subject: [PATCH 11/13] sun8iw7p1smp: remove default initrd preventing compilation --- arch/arm/configs/sun8iw7p1smp_defconfig | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/arm/configs/sun8iw7p1smp_defconfig b/arch/arm/configs/sun8iw7p1smp_defconfig index 7fa4e4cb257800..0fb79192c14a3e 100755 --- a/arch/arm/configs/sun8iw7p1smp_defconfig +++ b/arch/arm/configs/sun8iw7p1smp_defconfig @@ -108,16 +108,8 @@ CONFIG_NET_NS=y # CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="output/rootfs.cpio.gz" -CONFIG_INITRAMFS_ROOT_UID=0 -CONFIG_INITRAMFS_ROOT_GID=0 -CONFIG_RD_GZIP=y -# CONFIG_RD_BZIP2 is not set -# CONFIG_RD_LZMA is not set -# CONFIG_RD_XZ is not set -# CONFIG_RD_LZO is not set -CONFIG_INITRAMFS_COMPRESSION_NONE=y +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_INITRAMFS_COMPRESSION_NONE is not set # CONFIG_INITRAMFS_COMPRESSION_GZIP is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y @@ -3105,7 +3097,6 @@ CONFIG_XZ_DEC_ARMTHUMB=y CONFIG_XZ_DEC_SPARC=y CONFIG_XZ_DEC_BCJ=y # CONFIG_XZ_DEC_TEST is not set -CONFIG_DECOMPRESS_GZIP=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_TEXTSEARCH=y CONFIG_TEXTSEARCH_KMP=y From f136416188ecac483885feb3b434d68ef2aa0088 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 24 Jan 2016 18:11:48 +0100 Subject: [PATCH 12/13] sun8iw7p1smp: don't force cmdline Signed-off-by: Yann Dirson --- arch/arm/configs/sun8iw7p1smp_defconfig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/configs/sun8iw7p1smp_defconfig b/arch/arm/configs/sun8iw7p1smp_defconfig index 0fb79192c14a3e..f8e5eb6b606827 100755 --- a/arch/arm/configs/sun8iw7p1smp_defconfig +++ b/arch/arm/configs/sun8iw7p1smp_defconfig @@ -109,8 +109,6 @@ CONFIG_NET_NS=y # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y # CONFIG_BLK_DEV_INITRD is not set -# CONFIG_INITRAMFS_COMPRESSION_NONE is not set -# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y CONFIG_ANON_INODES=y @@ -479,10 +477,10 @@ CONFIG_ARM_FLUSH_CONSOLE_ON_RESTART=y # CONFIG_USE_OF is not set CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_CMDLINE="earlyprintk=ttyS0,115200 loglevel=8 initcall_debug=0 console=ttyS0,115200 init=/init " +CONFIG_CMDLINE="" # CONFIG_CMDLINE_FROM_BOOTLOADER is not set # CONFIG_CMDLINE_EXTEND is not set -CONFIG_CMDLINE_FORCE=y +# CONFIG_CMDLINE_FORCE is not set # CONFIG_XIP_KERNEL is not set # CONFIG_KEXEC is not set # CONFIG_CRASH_DUMP is not set From e76ae1027fe8cccecbc778ba365f65b4f19d387e Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Mon, 25 Jan 2016 22:51:19 +0100 Subject: [PATCH 13/13] sun8iw7p1smp: compile in disp2 hdmi module. This driver is not autoloaded when compiled as a module, and it has to be loaded before Xorg can properly start on HDMI. No idea of possible interactions with the disp2 tv driver, but at least compiling it in is the choice that was made in sun8i_h3_defconfig. Signed-off-by: Yann Dirson --- arch/arm/configs/sun8iw7p1smp_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/sun8iw7p1smp_defconfig b/arch/arm/configs/sun8iw7p1smp_defconfig index f8e5eb6b606827..7da55329583e66 100755 --- a/arch/arm/configs/sun8iw7p1smp_defconfig +++ b/arch/arm/configs/sun8iw7p1smp_defconfig @@ -2090,7 +2090,7 @@ CONFIG_FB=y # # CONFIG_FB_CONSOLE_SUNXI is not set CONFIG_DISP2_SUNXI=y -CONFIG_HDMI_DISP2_SUNXI=m +CONFIG_HDMI_DISP2_SUNXI=y CONFIG_TV_DISP2_SUNXI=m # CONFIG_DISP2_SUNXI_BOOT_COLORBAR is not set CONFIG_DISP2_SUNXI_DEBUG=y