[Armadeus-commitlog] armadeus branch, master, updated. release-3.4-66-ge218645
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2011-04-19 08:38:28
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via e2186453cb5549a4579494a15bb530081aeeaae9 (commit)
via 5d4ef8c1af2334d3f1622b3e6176f44daf35cf9c (commit)
from 70121b2381083d23194405e967fdf39e2018376f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e2186453cb5549a4579494a15bb530081aeeaae9
Author: Julien Boibessot <jul...@ar...>
Date: Tue Apr 19 10:37:23 2011 +0200
Updates target/linux/.gitignore
commit 5d4ef8c1af2334d3f1622b3e6176f44daf35cf9c
Author: Julien Boibessot <jul...@ar...>
Date: Tue Apr 19 10:36:18 2011 +0200
[LINUX] 2.6.38: makes FPGA wishbone example drivers work again for APF27
-----------------------------------------------------------------------
Summary of changes:
...nel_to_export_some_irq_handling_functions.patch | 48 +++++++++++++++++++
target/linux/.gitignore | 1 +
.../fpga/wishbone_example/wb_button/gbutton.c | 50 ++++++-------------
.../fpga/wishbone_example/wb_irq_mngr/main.c | 18 ++++----
.../fpga/wishbone_example/wb_led/board_leds.c | 18 +++----
.../modules/fpga/wishbone_example/wb_led/g_led.c | 47 ++++--------------
6 files changed, 92 insertions(+), 90 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
new file mode 100644
index 0000000..46b889d
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
@@ -0,0 +1,48 @@
+Allows to use some usefull irq_chip registering/handling functions in modules.
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-2.6.38.1/kernel/irq/chip.c
+===================================================================
+--- linux-2.6.38.1.orig/kernel/irq/chip.c 2011-04-18 20:43:15.000000000 +0200
++++ linux-2.6.38.1/kernel/irq/chip.c 2011-04-18 20:46:11.000000000 +0200
+@@ -663,6 +663,7 @@
+ out_unlock:
+ raw_spin_unlock(&desc->lock);
+ }
++EXPORT_SYMBOL_GPL(handle_edge_irq);
+
+ /**
+ * handle_percpu_irq - Per CPU local irq handler
+@@ -748,6 +749,7 @@
+ set_irq_chip(irq, chip);
+ __set_irq_handler(irq, handle, 0, NULL);
+ }
++EXPORT_SYMBOL_GPL(set_irq_chip_and_handler);
+
+ void
+ set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
+Index: linux-2.6.38.1/arch/arm/kernel/irq.c
+===================================================================
+--- linux-2.6.38.1.orig/arch/arm/kernel/irq.c 2011-04-18 20:48:25.000000000 +0200
++++ linux-2.6.38.1/arch/arm/kernel/irq.c 2011-04-18 20:48:56.000000000 +0200
+@@ -163,6 +163,7 @@
+ desc->status &= ~IRQ_NOAUTOEN;
+ raw_spin_unlock_irqrestore(&desc->lock, flags);
+ }
++EXPORT_SYMBOL_GPL(set_irq_flags);
+
+ void __init init_IRQ(void)
+ {
+Index: linux-2.6.38.1/kernel/irq/irqdesc.c
+===================================================================
+--- linux-2.6.38.1.orig/kernel/irq/irqdesc.c 2011-04-18 21:02:58.000000000 +0200
++++ linux-2.6.38.1/kernel/irq/irqdesc.c 2011-04-18 21:19:39.000000000 +0200
+@@ -273,6 +273,7 @@
+ {
+ return (irq < NR_IRQS) ? irq_desc + irq : NULL;
+ }
++EXPORT_SYMBOL_GPL(irq_to_desc);
+
+ struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node)
+ {
diff --git a/target/linux/.gitignore b/target/linux/.gitignore
index 5b9e868..47c9538 100644
--- a/target/linux/.gitignore
+++ b/target/linux/.gitignore
@@ -9,3 +9,4 @@
.tmp_versions
Module.symvers
Module.markers
+*.builtin
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c b/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
index 5ec1e8b..68fdf99 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
@@ -22,25 +22,19 @@
*/
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-#include <linux/config.h>
-#endif
-
#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h> /* for file operations */
#include <linux/cdev.h>
-#include <asm/uaccess.h> /* copy_to_user function */
#include <linux/ioport.h> /* request_mem_region */
-#include <asm/io.h> /* readw() writew() */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-/* hardware addresses */
-# include <asm/hardware.h>
-#else
-# include <mach/hardware.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)
+#include <linux/slab.h> /* kmalloc */
#endif
+#include <asm/uaccess.h> /* copy_to_user function */
+#include <asm/io.h> /* readw() writew() */
+#include <mach/hardware.h>
+
/* for platform device */
#include <linux/platform_device.h>
@@ -54,7 +48,7 @@
#undef PDEBUG
#ifdef BUTTON_DEBUG
# ifdef __KERNEL__
-/* for kernel spage */
+/* for kernel space */
# define PDEBUG(fmt,args...) printk(KERN_DEBUG "BUTTON : " fmt, ##args)
# else
/* for user space */
@@ -171,9 +165,7 @@ static int button_probe(struct platform_device *pdev)
PDEBUG("Button probing\n");
PDEBUG("Register %s num %d\n",dev->name,dev->num);
- /**************************/
/* check if ID is correct */
- /**************************/
data = ioread16(dev->membase+BUTTON_ID_OFFSET);
if (data != dev->idnum) {
result = -1;
@@ -183,9 +175,7 @@ static int button_probe(struct platform_device *pdev)
goto error_id;
}
- /********************************************/
- /* allocate memory for sdev structure */
- /********************************************/
+ /* allocate memory for sdev structure */
sdev = kmalloc(sizeof(struct button_dev),GFP_KERNEL);
if (!sdev) {
result = -ENOMEM;
@@ -199,15 +189,12 @@ static int button_probe(struct platform_device *pdev)
printk("Kmalloc name space error\n");
goto error_name_alloc;
}
- if (strncpy(sdev->name,dev->name,1+strlen(dev->name)) < 0) {
+ if (strncpy(sdev->name, dev->name, 1+strlen(dev->name)) < 0) {
printk("copy error");
goto error_name_copy;
}
- /******************************************/
/* Get the major and minor device numbers */
- /******************************************/
-
button_major = 251;
button_minor = dev->num;
@@ -225,11 +212,9 @@ static int button_probe(struct platform_device *pdev)
/* initiate mutex locked */
sdev->read_in_wait = 0;
- init_MUTEX_LOCKED(&sdev->sem);
+ sema_init(&sdev->sem, 0);
- /****************************/
/* Init the cdev structure */
- /****************************/
PDEBUG("Init the cdev structure\n");
cdev_init(&sdev->cdev,&button_fops);
sdev->cdev.owner = THIS_MODULE;
@@ -273,7 +258,7 @@ request_irq_error:
error_cdev_add:
/* free major and minor number */
unregister_chrdev_region(sdev->devno, 1);
- printk(KERN_INFO "%s: Led deleted\n", dev->name);
+ printk(KERN_INFO "%s: button deleted\n", dev->name);
error_devno:
error_name_copy:
kfree(sdev->name);
@@ -292,22 +277,19 @@ static int __devexit button_remove(struct platform_device *pdev)
/* freeing irq */
free_irq(dev->interrupt_number, sdev);
-//request_irq_error:
+
/* delete the cdev structure */
cdev_del(&sdev->cdev);
PDEBUG("%s:cdev deleted\n",dev->name);
-//error_cdev_add:
+
/* free major and minor number */
unregister_chrdev_region(sdev->devno, 1);
- printk(KERN_INFO "%s: Led deleted\n", dev->name);
-//error_devno:
-//error_name_copy:
+ printk(KERN_INFO "%s: button deleted\n", dev->name);
+
kfree(sdev->name);
-//error_name_alloc:
kfree(sdev);
-//error_sdev_alloc:
printk(KERN_INFO "%s: deleted with success\n", dev->name);
-//error_id:
+
return 0;
}
diff --git a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
index 759ebbb..94c8f56 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
@@ -32,29 +32,25 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-# include <asm/hardware.h>
-# include <asm/arch/irqs.h>
-#else
-# include <mach/hardware.h>
-# include <mach/irqs.h>
-#endif
+
+#include <mach/hardware.h>
+#include <mach/irqs.h>
#include <asm/irq.h>
#include <asm/io.h> /* readb() & Co */
#include <asm/mach/irq.h>
#ifdef CONFIG_MACH_APF27
#include <mach/fpga.h> /* To remove when MX1 platform merged */
+#define VA_GPIO_BASE MX27_GPIO_BASE_ADDR
#else
#define VA_GPIO_BASE IO_ADDRESS(IMX_GPIO_BASE)
-#define MXC_ISR(x) (0x34 + ((x) << 8))
+#define MXC_ISR(x) (0x34 + ((x) << 8))
struct fpga_irq_mng_platform_data { /* To remove when MX1 platform merged */
int (*init)(struct platform_device*);
void (*exit)(struct platform_device*);
};
#endif
-
#define IRQ_MNGR_BASE (0x0)
#define ID (1)
#define ID_OFFSET (0x02 *(16/8))
@@ -116,7 +112,11 @@ imx_fpga_handler(unsigned int mask, unsigned int irq,
struct irq_desc *desc)
{
pr_debug("%s: mask:0x%04x\n", __FUNCTION__, mask);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)
+ desc = irq_to_desc(irq);
+#else
desc = irq_desc + irq;
+#endif
while (mask) {
if (mask & 1) {
pr_debug("handling irq %d\n", irq);
diff --git a/target/linux/modules/fpga/wishbone_example/wb_led/board_leds.c b/target/linux/modules/fpga/wishbone_example/wb_led/board_leds.c
index 8fa40a8..b37b47e 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_led/board_leds.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_led/board_leds.c
@@ -20,17 +20,14 @@
*/
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-#include <linux/config.h>
-#endif
-
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+
#ifdef CONFIG_MACH_APF27 /* to be removed when MX1 platform merged */
#include <mach/fpga.h>
#endif
-#include"led.h"
+#include "led.h"
static struct plat_led_port plat_led0_data = {
@@ -42,8 +39,9 @@ static struct plat_led_port plat_led0_data = {
};
-void plat_led_release(struct device *dev){
- PDEBUG("device %s .released\n",dev->bus_id);
+void plat_led_release(struct device *dev)
+{
+ dev_dbg(dev, "released\n");
}
static struct platform_device plat_led0_device = {
@@ -51,8 +49,8 @@ static struct platform_device plat_led0_device = {
.id = 0,
.dev = {
.release = plat_led_release,
- .platform_data=&plat_led0_data
- },
+ .platform_data = &plat_led0_data
+ },
};
@@ -71,6 +69,6 @@ module_init(sled_init);
module_exit(sled_exit);
MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
-MODULE_DESCRIPTION("Driver to blink blink some leds");
+MODULE_DESCRIPTION("Driver to blink some LEDs on FPGA");
MODULE_LICENSE("GPL");
diff --git a/target/linux/modules/fpga/wishbone_example/wb_led/g_led.c b/target/linux/modules/fpga/wishbone_example/wb_led/g_led.c
index 0bbdfd4..fcd83ca 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_led/g_led.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_led/g_led.c
@@ -22,37 +22,21 @@
*/
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-#include <linux/config.h>
-#endif
-
/* form module/drivers */
#include <linux/init.h>
#include <linux/module.h>
-
-/* for file operations */
+/* for file operations */
#include <linux/fs.h>
#include <linux/cdev.h>
-
-/* copy_to_user function */
-#include <asm/uaccess.h>
-
-/* request_mem_region */
-#include <linux/ioport.h>
-
-/* readw() writew() */
-#include <asm/io.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-/* hardware addresses */
-# include <asm/hardware.h>
-#else
-# include <mach/hardware.h>
+#include <linux/ioport.h> /* request_mem_region */
+#include <linux/platform_device.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)
+#include <linux/slab.h> /* kmalloc */
#endif
-
-/* for platform device */
-#include <linux/platform_device.h>
+#include <asm/uaccess.h> /* copy_to_user function */
+#include <asm/io.h> /* readw() writew() */
+#include <mach/hardware.h>
/* led */
#include "led.h"
@@ -77,7 +61,7 @@
/*************************/
/* main device structure */
/*************************/
-struct led_dev{
+struct led_dev {
char *name; /* the name of the instance */
int loaded_led_num;/* number of the led, depends on load order*/
struct cdev cdev;/* Char device structure */
@@ -201,9 +185,7 @@ static int led_probe(struct platform_device *pdev)
PDEBUG("Led probing\n");
PDEBUG("Register %s num %d\n", dev->name, dev->num);
- /**************************/
/* check if ID is correct */
- /**************************/
data = ioread16(dev->membase+dev->idoffset);
if (data != dev->idnum) {
result = -1;
@@ -213,9 +195,7 @@ static int led_probe(struct platform_device *pdev)
goto error_id;
}
- /********************************************/
- /* allocate memory for sdev structure */
- /********************************************/
+ /* allocate memory for sdev structure */
sdev = kmalloc(sizeof(struct led_dev), GFP_KERNEL);
if (!sdev) {
result = -ENOMEM;
@@ -234,10 +214,7 @@ static int led_probe(struct platform_device *pdev)
goto error_name_copy;
}
- /******************************************/
/* Get the major and minor device numbers */
- /******************************************/
-
led_major = 252;
led_minor = dev->num ;/* num come from plat_led_port data structure */
@@ -252,9 +229,7 @@ static int led_probe(struct platform_device *pdev)
MAJOR(sdev->devno),
MINOR(sdev->devno));
- /****************************/
/* Init the cdev structure */
- /****************************/
PDEBUG("Init the cdev structure\n");
cdev_init(&sdev->cdev, &led_fops);
sdev->cdev.owner = THIS_MODULE;
@@ -278,9 +253,7 @@ static int led_probe(struct platform_device *pdev)
printk(KERN_INFO "Led module %s insered\n", dev->name);
return 0;
- /*********************/
/* Errors management */
- /*********************/
/* delete the cdev structure */
cdev_del(&sdev->cdev);
PDEBUG("%s:cdev deleted\n", dev->name);
hooks/post-receive
--
armadeus
|