[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-779-gf6923c2
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2015-06-25 07:03:09
|
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 f6923c2d2c066ccf85812e99e1da914251a364e3 (commit)
via f976f3f884de894763222806f73a9ff5b1e064f0 (commit)
from c0febd24b54a688f8993333d46a7229c34f8700b (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 f6923c2d2c066ccf85812e99e1da914251a364e3
Author: Fabien Marteau <fab...@ar...>
Date: Thu Jun 25 08:58:31 2015 +0200
[TOOLS][APF6]apf6_recovery.py: python nitpicks
commit f976f3f884de894763222806f73a9ff5b1e064f0
Author: Fabien Marteau <fab...@ar...>
Date: Thu Jun 25 08:57:21 2015 +0200
[DEMOS][APF6SP][DRIVER] Adding a simple demo driver for MSI interrupt with PCIe
-----------------------------------------------------------------------
Summary of changes:
software/uboot_recover/apf6_recovery.py | 5 +-
target/demos/pcie_msi/Makefile | 26 +++++++++++
target/demos/pcie_msi/pcie_msi.c | 73 +++++++++++++++++++++++++++++++
target/demos/pcie_msi/readme.txt | 8 +++
4 files changed, 110 insertions(+), 2 deletions(-)
create mode 100644 target/demos/pcie_msi/Makefile
create mode 100644 target/demos/pcie_msi/pcie_msi.c
create mode 100644 target/demos/pcie_msi/readme.txt
diff --git a/software/uboot_recover/apf6_recovery.py b/software/uboot_recover/apf6_recovery.py
index bcdc6ee..395ec34 100644
--- a/software/uboot_recover/apf6_recovery.py
+++ b/software/uboot_recover/apf6_recovery.py
@@ -30,7 +30,8 @@ import time
from helpers import color
-class UBoot:
+
+class UBoot(object):
def __init__(self, serial):
self.serial = serial
@@ -50,7 +51,7 @@ class UBoot:
return self.__getOutput(r'C')
def resetEnv(self, save=True):
- if save == False:
+ if save is False:
self.serial.write("env default -f -a\n")
else:
self.serial.write("run flash_reset_env\n")
diff --git a/target/demos/pcie_msi/Makefile b/target/demos/pcie_msi/Makefile
new file mode 100644
index 0000000..c4f3984
--- /dev/null
+++ b/target/demos/pcie_msi/Makefile
@@ -0,0 +1,26 @@
+# Part executed when called from kernel build system:
+ifneq ($(KERNELRELEASE),)
+
+obj-m += pcie_msi.o
+
+else
+
+PWD := $(shell pwd)
+
+BSP_APF6_BROUTPUT := $(PWD)/../../../buildroot/output/
+
+CC = $(BSP_APF6_BROUTPUT)host/usr/bin/arm-linux-gnueabihf-gcc
+LD = $(BSP_APF6_BROUTPUT)host/usr/bin/arm-linux-gnueabihf-ld
+OBJDUMP = $(BSP_APF6_BROUTPUT)host/usr/bin/arm-linux-gnueabihf-objdump
+KDIR := $(BSP_APF6_BROUTPUT)build/linux-3.19.3/
+
+default:
+ $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) ARCH=arm CROSS_COMPILE=arm-linux- modules CC=$(CC) LD=$(LD) OBJDUMP=$(OBJDUMP)
+
+clean:
+ $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
+ rm -f modules.order
+ rm -rf .tmp_versions/
+ rm -f Module.markers
+
+endif
diff --git a/target/demos/pcie_msi/pcie_msi.c b/target/demos/pcie_msi/pcie_msi.c
new file mode 100644
index 0000000..dbf1bb0
--- /dev/null
+++ b/target/demos/pcie_msi/pcie_msi.c
@@ -0,0 +1,73 @@
+/*
+ * pcie_msi.c - Driver to register an MSI interrupt in kernel
+ *
+ * Copyright 2015 Fabien Marteau fab...@ar...
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+
+#define DRV_NAME "pcie_msi"
+#define DRV_VERSION "0.1"
+
+static irqreturn_t interrupt_msi(int irq, void *data)
+{
+ printk("msi %d\n", irq);
+ return IRQ_HANDLED;
+}
+
+static int msi_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+{
+ int ret = -EAGAIN;
+ int msi_num = 0;
+
+ /* acquire resources */
+ ret = pcim_enable_device(pdev);
+ if (ret)
+ return ret;
+ /* Set up a single MSI interrupt */
+ msi_num = pci_enable_msi_range(pdev, 1, 4);
+ if (msi_num) {
+ ret = request_irq(pdev->irq, interrupt_msi, 0, "test_msi_pcie", NULL);
+ if(ret) {
+ printk("can't request msi interrupt\n");
+ pci_disable_msi(pdev);
+ }
+
+ }
+ printk("%d: %d msi registered\n", pdev->irq, msi_num);
+
+ pci_set_master(pdev);
+
+ return 0;
+}
+
+static void msi_remove(struct pci_dev *pdev)
+{
+ pci_clear_master(pdev);
+ free_irq(pdev->irq, NULL);
+ pci_disable_msi(pdev);
+ pci_disable_device(pdev);
+}
+
+static const struct pci_device_id msi_pci_tbl[] = {
+ { PCI_DEVICE(0x1172, 0xE001), 0},
+ {}
+};
+
+static struct pci_driver msi_pci_driver = {
+ .name = DRV_NAME,
+ .id_table = msi_pci_tbl,
+ .probe = msi_probe,
+ .remove = msi_remove,
+};
+
+module_pci_driver(msi_pci_driver);
+MODULE_AUTHOR("Fabien Marteau");
+MODULE_DESCRIPTION("Register an MSI interrupt");
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(pci, msi_pci_tbl);
diff --git a/target/demos/pcie_msi/readme.txt b/target/demos/pcie_msi/readme.txt
new file mode 100644
index 0000000..abe0245
--- /dev/null
+++ b/target/demos/pcie_msi/readme.txt
@@ -0,0 +1,8 @@
+Simple module example to register a MSI interrupt
+=================================================
+
+To compile it, compile your BSP before, and do :
+
+ $ make
+
+in this directory
hooks/post-receive
--
armadeus
|