From ed3f802a5f7984caf088c553a0c4bf6bd2d021c4 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Wed, 21 May 2014 23:26:20 +0200 Subject: linux-yocto_3.14: add patches and defconfig for ipaq h1940 Signed-off-by: Vasily Khoruzhick Signed-off-by: Andrea Adami --- .../h1940/0001-rfkill-add-IR-type.patch | 59 +++ ...-Remove-S3C24XX_DMA-dependency-from-S3C24.patch | 30 ++ ...4xx-add-dma_coherent_mask-for-DMA-devices.patch | 35 ++ ...s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch | 34 ++ ...xx-drop-RFKILL-driver-for-H1940-bluetooth.patch | 202 ++++++++ .../0006-ARM-s3c24xx-h1940-Add-nand-device.patch | 126 +++++ ...007-ARM-s3c24xx-h1940-don-t-touch-UPLLCON.patch | 41 ++ ...008-ARM-s3c24xx-h1940-unlock-reset-button.patch | 52 +++ ...3c24xx-h1940-add-bluetooth-RF-kill-switch.patch | 100 ++++ .../0010-ARM-s3c24xx-h1940-add-IR-switch.patch | 73 +++ ...s3c24xx-h1940-increase-oversampling-shift.patch | 29 ++ .../0012-ARM-s3c24xx-h1940-Add-DMA-device.patch | 27 ++ ...engine-s3c24xx-dma-Process-whole-SG-chain.patch | 27 ++ ...e-s3c24xx-dma-Add-cyclic-transfer-support.patch | 183 ++++++++ ...015-s3cmci-port-DMA-code-to-dmaengine-API.patch | 370 +++++++++++++++ ...g-s3c24-xx-12-i2s-port-to-use-generic-dma.patch | 385 +++++++++++++++ ...g-drop-support-for-legacy-S3C24XX-DMA-API.patch | 515 +++++++++++++++++++++ .../linux/linux-yocto-3.14/h1940/defconfig | 200 ++++++++ recipes-kernel/linux/linux-yocto_3.14.bbappend | 27 +- 19 files changed, 2514 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0001-rfkill-add-IR-type.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0002-ARM-s3c24xx-Remove-S3C24XX_DMA-dependency-from-S3C24.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0003-ARM-s3c24xx-add-dma_coherent_mask-for-DMA-devices.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0004-ARM-s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0005-ARM-s3c24xx-drop-RFKILL-driver-for-H1940-bluetooth.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0006-ARM-s3c24xx-h1940-Add-nand-device.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0007-ARM-s3c24xx-h1940-don-t-touch-UPLLCON.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0008-ARM-s3c24xx-h1940-unlock-reset-button.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0009-ARM-s3c24xx-h1940-add-bluetooth-RF-kill-switch.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0010-ARM-s3c24xx-h1940-add-IR-switch.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0011-ARM-s3c24xx-h1940-increase-oversampling-shift.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0012-ARM-s3c24xx-h1940-Add-DMA-device.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0013-dmaengine-s3c24xx-dma-Process-whole-SG-chain.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0014-dmaengine-s3c24xx-dma-Add-cyclic-transfer-support.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0015-s3cmci-port-DMA-code-to-dmaengine-API.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0016-ASoC-samsung-s3c24-xx-12-i2s-port-to-use-generic-dma.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/0017-ASoC-samsung-drop-support-for-legacy-S3C24XX-DMA-API.patch create mode 100644 recipes-kernel/linux/linux-yocto-3.14/h1940/defconfig diff --git a/recipes-kernel/linux/linux-yocto-3.14/h1940/0001-rfkill-add-IR-type.patch b/recipes-kernel/linux/linux-yocto-3.14/h1940/0001-rfkill-add-IR-type.patch new file mode 100644 index 0000000..0045cf2 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto-3.14/h1940/0001-rfkill-add-IR-type.patch @@ -0,0 +1,59 @@ +From 674eef7154d529886d5e9fe77914e9bc77e549b0 Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Thu, 17 Oct 2013 12:19:47 +0300 +Subject: [PATCH 01/17] rfkill: add IR type + +Infrared receivers/transmitters can also be disabled, +so add IR type to rfkill subsystem + +Signed-off-by: Vasily Khoruzhick +--- + include/uapi/linux/rfkill.h | 2 ++ + net/rfkill/core.c | 4 +++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/include/uapi/linux/rfkill.h b/include/uapi/linux/rfkill.h +index 058757f..d4ae526 100644 +--- a/include/uapi/linux/rfkill.h ++++ b/include/uapi/linux/rfkill.h +@@ -38,6 +38,7 @@ + * @RFKILL_TYPE_GPS: switch is on a GPS device. + * @RFKILL_TYPE_FM: switch is on a FM radio device. + * @RFKILL_TYPE_NFC: switch is on an NFC device. ++ * @RFKILL_TYPE_IR: switch is on an IR device. + * @NUM_RFKILL_TYPES: number of defined rfkill types + */ + enum rfkill_type { +@@ -50,6 +51,7 @@ enum rfkill_type { + RFKILL_TYPE_GPS, + RFKILL_TYPE_FM, + RFKILL_TYPE_NFC, ++ RFKILL_TYPE_IR, + NUM_RFKILL_TYPES, + }; + +diff --git a/net/rfkill/core.c b/net/rfkill/core.c +index ed7e0b4..4c4abb6 100644 +--- a/net/rfkill/core.c ++++ b/net/rfkill/core.c +@@ -585,7 +585,7 @@ static DEVICE_ATTR_RO(name); + + static const char *rfkill_get_type_str(enum rfkill_type type) + { +- BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_NFC + 1); ++ BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_IR + 1); + + switch (type) { + case RFKILL_TYPE_WLAN: +@@ -604,6 +604,8 @@ static const char *rfkill_get_type_str(enum rfkill_type type) + return "fm"; + case RFKILL_TYPE_NFC: + return "nfc"; ++ case RFKILL_TYPE_IR: ++ return "ir"; + default: + BUG(); + } +-- +1.9.3 + diff --git a/recipes-kernel/linux/linux-yocto-3.14/h1940/0002-ARM-s3c24xx-Remove-S3C24XX_DMA-dependency-from-S3C24.patch b/recipes-kernel/linux/linux-yocto-3.14/h1940/0002-ARM-s3c24xx-Remove-S3C24XX_DMA-dependency-from-S3C24.patch new file mode 100644 index 0000000..0a2f0df --- /dev/null +++ b/recipes-kernel/linux/linux-yocto-3.14/h1940/0002-ARM-s3c24xx-Remove-S3C24XX_DMA-dependency-from-S3C24.patch @@ -0,0 +1,30 @@ +From 43403f1d4744e0d71ef360655f44b489b57f443e Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Sun, 18 May 2014 12:43:35 +0300 +Subject: [PATCH 02/17] ARM: s3c24xx: Remove S3C24XX_DMA dependency from + S3C2410_DMA + +S3C24XX_DMA enables legacy DMA driver, and since we want to +move to introduced generic dmaengine s3c24xx-dma driver, +it's necessary to remove this redundant dependency. + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/mach-s3c24xx/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig +index d876431..3be853c 100644 +--- a/arch/arm/mach-s3c24xx/Kconfig ++++ b/arch/arm/mach-s3c24xx/Kconfig +@@ -149,7 +149,6 @@ config S3C2410_DMA_DEBUG + + config S3C2410_DMA + bool +- depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442) + help + DMA device selection for S3C2410 and compatible CPUs + +-- +1.9.3 + diff --git a/recipes-kernel/linux/linux-yocto-3.14/h1940/0003-ARM-s3c24xx-add-dma_coherent_mask-for-DMA-devices.patch b/recipes-kernel/linux/linux-yocto-3.14/h1940/0003-ARM-s3c24xx-add-dma_coherent_mask-for-DMA-devices.patch new file mode 100644 index 0000000..5372b93 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto-3.14/h1940/0003-ARM-s3c24xx-add-dma_coherent_mask-for-DMA-devices.patch @@ -0,0 +1,35 @@ +From acdc541821464171954cbd1a4e1a34f3e743e043 Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Sun, 18 May 2014 12:44:52 +0300 +Subject: [PATCH 03/17] ARM: s3c24xx: add dma_coherent_mask for DMA devices + +Otherwise dma_alloc_coherent() fails. + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/mach-s3c24xx/common.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c +index 4adaa4b..d61f611 100644 +--- a/arch/arm/mach-s3c24xx/common.c ++++ b/arch/arm/mach-s3c24xx/common.c +@@ -383,6 +383,7 @@ struct platform_device s3c2410_device_dma = { + .resource = s3c2410_dma_resource, + .dev = { + .platform_data = &s3c2410_dma_platdata, ++ .coherent_dma_mask = ~0, + }, + }; + #endif +@@ -480,6 +481,7 @@ struct platform_device s3c2440_device_dma = { + .resource = s3c2410_dma_resource, + .dev = { + .platform_data = &s3c2440_dma_platdata, ++ .coherent_dma_mask = ~0, + }, + }; + #endif +-- +1.9.3 + diff --git a/recipes-kernel/linux/linux-yocto-3.14/h1940/0004-ARM-s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch b/recipes-kernel/linux/linux-yocto-3.14/h1940/0004-ARM-s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch new file mode 100644 index 0000000..9a25241 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto-3.14/h1940/0004-ARM-s3c24xx-Add-DMA-resources-for-SDI-and-I2S.patch @@ -0,0 +1,34 @@ +From e62096b744e4fa4376f0fe10bbe72dc0cae32b0d Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Sun, 18 May 2014 12:45:39 +0300 +Subject: [PATCH 04/17] ARM: s3c24xx: Add DMA resources for SDI and I2S + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/plat-samsung/devs.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c +index ac07e87..a0575d5 100644 +--- a/arch/arm/plat-samsung/devs.c ++++ b/arch/arm/plat-samsung/devs.c +@@ -787,6 +787,8 @@ void __init s5p_hdmi_set_platdata(struct i2c_board_info *hdmiphy_info, + #ifdef CONFIG_PLAT_S3C24XX + static struct resource s3c_iis_resource[] = { + [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS), ++ [1] = DEFINE_RES_DMA(DMACH_I2S_OUT), ++ [2] = DEFINE_RES_DMA(DMACH_I2S_IN), + }; + + struct platform_device s3c_device_iis = { +@@ -1153,6 +1155,7 @@ struct platform_device s3c_device_rtc = { + static struct resource s3c_sdi_resource[] = { + [0] = DEFINE_RES_MEM(S3C24XX_PA_SDI, S3C24XX_SZ_SDI), + [1] = DEFINE_RES_IRQ(IRQ_SDI), ++ [2] = DEFINE_RES_DMA(DMACH_SDI), + }; + + struct platform_device s3c_device_sdi = { +-- +1.9.3 + diff --git a/recipes-kernel/linux/linux-yocto-3.14/h1940/0005-ARM-s3c24xx-drop-RFKILL-driver-for-H1940-bluetooth.patch b/recipes-kernel/linux/linux-yocto-3.14/h1940/0005-ARM-s3c24xx-drop-RFKILL-driver-for-H1940-bluetooth.patch new file mode 100644 index 0000000..6347474 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto-3.14/h1940/0005-ARM-s3c24xx-drop-RFKILL-driver-for-H1940-bluetooth.patch @@ -0,0 +1,202 @@ +From ead5b0c7815504351ae492c6445251769c75db7b Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Thu, 17 Oct 2013 12:09:19 +0300 +Subject: [PATCH 05/17] ARM: s3c24xx: drop RFKILL driver for H1940 bluetooth + +rfkill-gpio can do it's job easily. + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/mach-s3c24xx/Kconfig | 8 -- + arch/arm/mach-s3c24xx/Makefile | 1 - + arch/arm/mach-s3c24xx/h1940-bluetooth.c | 147 -------------------------------- + 3 files changed, 156 deletions(-) + delete mode 100644 arch/arm/mach-s3c24xx/h1940-bluetooth.c + +diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig +index 3be853c..e115127 100644 +--- a/arch/arm/mach-s3c24xx/Kconfig ++++ b/arch/arm/mach-s3c24xx/Kconfig +@@ -286,14 +286,6 @@ config ARCH_H1940 + help + Say Y here if you are using the HP IPAQ H1940 + +-config H1940BT +- tristate "Control the state of H1940 bluetooth chip" +- depends on ARCH_H1940 +- select RFKILL +- help +- This is a simple driver that is able to control +- the state of built in bluetooth chip on h1940. +- + config PM_H1940 + bool + help +diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile +index 7f54e5b..d326722 100644 +--- a/arch/arm/mach-s3c24xx/Makefile ++++ b/arch/arm/mach-s3c24xx/Makefile +@@ -65,7 +65,6 @@ obj-$(CONFIG_MACH_AML_M5900) += mach-amlm5900.o + obj-$(CONFIG_ARCH_BAST) += mach-bast.o + obj-$(CONFIG_BAST_PC104_IRQ) += bast-irq.o + obj-$(CONFIG_ARCH_H1940) += mach-h1940.o +-obj-$(CONFIG_H1940BT) += h1940-bluetooth.o + obj-$(CONFIG_PM_H1940) += pm-h1940.o + obj-$(CONFIG_MACH_N30) += mach-n30.o + obj-$(CONFIG_MACH_OTOM) += mach-otom.o +diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c +deleted file mode 100644 +index b4d14b8..0000000 +--- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c ++++ /dev/null +@@ -1,147 +0,0 @@ +-/* +- * arch/arm/mach-s3c2410/h1940-bluetooth.c +- * Copyright (c) Arnaud Patard +- * +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file COPYING in the main directory of this archive for +- * more details. +- * +- * S3C2410 bluetooth "driver" +- * +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-#include "h1940.h" +- +-#define DRV_NAME "h1940-bt" +- +-/* Bluetooth control */ +-static void h1940bt_enable(int on) +-{ +- if (on) { +- /* Power on the chip */ +- gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 1); +- /* Reset the chip */ +- mdelay(10); +- +- gpio_set_value(S3C2410_GPH(1), 1); +- mdelay(10); +- gpio_set_value(S3C2410_GPH(1), 0); +- +- h1940_led_blink_set(-EINVAL, GPIO_LED_BLINK, NULL, NULL); +- } +- else { +- gpio_set_value(S3C2410_GPH(1), 1); +- mdelay(10); +- gpio_set_value(S3C2410_GPH(1), 0); +- mdelay(10); +- gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 0); +- +- h1940_led_blink_set(-EINVAL, GPIO_LED_NO_BLINK_LOW, NULL, NULL); +- } +-} +- +-static int h1940bt_set_block(void *data, bool blocked) +-{ +- h1940bt_enable(!blocked); +- return 0; +-} +- +-static const struct rfkill_ops h1940bt_rfkill_ops = { +- .set_block = h1940bt_set_block, +-}; +- +-static int h1940bt_probe(struct platform_device *pdev) +-{ +- struct rfkill *rfk; +- int ret = 0; +- +- ret = gpio_request(S3C2410_GPH(1), dev_name(&pdev->dev)); +- if (ret) { +- dev_err(&pdev->dev, "could not get GPH1\n"); +- return ret; +- } +- +- ret = gpio_request(H1940_LATCH_BLUETOOTH_POWER, dev_name(&pdev->dev)); +- if (ret) { +- gpio_free(S3C2410_GPH(1)); +- dev_err(&pdev->dev, "could not get BT_POWER\n"); +- return ret; +- } +- +- /* Configures BT serial port GPIOs */ +- s3c_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); +- s3c_gpio_setpull(S3C2410_GPH(0), S3C_GPIO_PULL_NONE); +- s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); +- s3c_gpio_setpull(S3C2410_GPH(1), S3C_GPIO_PULL_NONE); +- s3c_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); +- s3c_gpio_setpull(S3C2410_GPH(2), S3C_GPIO_PULL_NONE); +- s3c_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); +- s3c_gpio_setpull(S3C2410_GPH(3), S3C_GPIO_PULL_NONE); +- +- rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, +- &h1940bt_rfkill_ops, NULL); +- if (!rfk) { +- ret = -ENOMEM; +- goto err_rfk_alloc; +- } +- +- ret = rfkill_register(rfk); +- if (ret) +- goto err_rfkill; +- +- platform_set_drvdata(pdev, rfk); +- +- return 0; +- +-err_rfkill: +- rfkill_destroy(rfk); +-err_rfk_alloc: +- return ret; +-} +- +-static int h1940bt_remove(struct platform_device *pdev) +-{ +- struct rfkill *rfk = platform_get_drvdata(pdev); +- +- platform_set_drvdata(pdev, NULL); +- gpio_free(S3C2410_GPH(1)); +- +- if (rfk) { +- rfkill_unregister(rfk); +- rfkill_destroy(rfk); +- } +- rfk = NULL; +- +- h1940bt_enable(0); +- +- return 0; +-} +- +- +-static struct platform_driver h1940bt_driver = { +- .driver = { +- .name = DRV_NAME, +- }, +- .probe = h1940bt_probe, +- .remove = h1940bt_remove, +-}; +- +-module_platform_driver(h1940bt_driver); +- +-MODULE_AUTHOR("Arnaud Patard "); +-MODULE_DESCRIPTION("Driver for the iPAQ H1940 bluetooth chip"); +-MODULE_LICENSE("GPL"); +-- +1.9.3 + diff --git a/recipes-kernel/linux/linux-yocto-3.14/h1940/0006-ARM-s3c24xx-h1940-Add-nand-device.patch b/recipes-kernel/linux/linux-yocto-3.14/h1940/0006-ARM-s3c24xx-h1940-Add-nand-device.patch new file mode 100644 index 0000000..c23984a --- /dev/null +++ b/recipes-kernel/linux/linux-yocto-3.14/h1940/0006-ARM-s3c24xx-h1940-Add-nand-device.patch @@ -0,0 +1,126 @@ +From a63933b7f6b410c478a4fad08ec61f13ef1549a8 Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Thu, 17 Oct 2013 12:13:29 +0300 +Subject: [PATCH 06/17] ARM: s3c24xx: h1940: Add nand device + +Signed-off-by: Vasily Khoruzhick +--- + arch/arm/mach-s3c24xx/mach-h1940.c | 74 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c +index de08321..1b3807e 100644 +--- a/arch/arm/mach-s3c24xx/mach-h1940.c ++++ b/arch/arm/mach-s3c24xx/mach-h1940.c +@@ -31,6 +31,9 @@ + #include + #include + ++#include ++#include ++ + #include