Xenomai, Raspberry Pi, 3.5.7 kernel
Attached, a patch set aimed at providing support for the Broadcom BCM2835 SoC as used in the Raspberry Pi[1].
The first patch assumes that the core-ipipe-3.5.7-arm patch has already been applied or the sources have been pulled from the ipipe git repository[2]. Most of the changes have been pulled from the 3.6.11 kernel sources maintained by the Rasbperry team and adds a number of drivers needed by the BCM2835 chip. Low level changes to the timer support have been made courtesy of ian-cim and his preliminary 3.2.21 patch[3]
Patch number 2 silences a trivial compile time warning and can be skipped..
Patch number three adds a minimal default config (bcmrpi_defconfig) that can be used as a basis for compiling a Xenomai enabled kernel. This patch can also be skipped if a defconfig is not required.
Patch number four makes some changes to the way GPIO interrupts are handled - Interrupt latencies are considerably improved (typically in the 15-30uS range).
Work is being undertaken by the Raspberry team to get support built in to the mainline kernel - I believe the window has been missed for 3.8.x, so fingers are crossed for 3.10.x.
Regards, Paul.
[1] www.raspberrypi.org
[2] git://git.denx.de/ipipe.git
[3] www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=12368
-------------- next part --------------
A non-text attachment was scrubbed...
Name: raspberry-pi.bz2
Type: application/x-bzip2
Size: 458222 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130214/bb9244d7/attachment.bin>
Quoted 18 lines · Paul
Attached, a patch set aimed at providing support for the Broadcom BCM2835 SoC as used in the Raspberry Pi[1].
The first patch assumes that the core-ipipe-3.5.7-arm patch has already been applied or the sources have been pulled from the ipipe git repository[2]. Most of the changes have been pulled from the 3.6.11 kernel sources maintained by the Rasbperry team and adds a number of drivers needed by the BCM2835 chip. Low level changes to the timer support have been made courtesy of ian-cim and his preliminary 3.2.21 patch[3]
Patch number 2 silences a trivial compile time warning and can be skipped..
Patch number three adds a minimal default config (bcmrpi_defconfig) that can be used as a basis for compiling a Xenomai enabled kernel. This patch can also be skipped if a defconfig is not required.
Quoted 7 lines
Patch number four makes some changes to the way GPIO interrupts are handled - Interrupt latencies are considerably improved (typically in the 15-30uS range).
Work is being undertaken by the Raspberry team to get support built in to the mainline kernel - I believe the window has been missed for 3.8.x, so fingers are crossed for 3.10.x.
In the meantime, we can put it in a raspberry subdirectory in Xenomai sources. Would you mind making a single patch? Or do you prefer the patches to be kept separated?
Signature · 1 line
Gilles.
Quoted 7 lines · Gilles Chanteperdrix
Quoted 2 lines · Paul
Attached, a patch set aimed at providing support for the Broadcom BCM2835 SoC as used in the Raspberry Pi[1].
In the meantime, we can put it in a raspberry subdirectory in Xenomai sources. Would you mind making a single patch? Or do you prefer the patches to be kept separated?
A single patch would be preferable for most people - The multi-patch set was mainly for the benefit of the guys who had a working kernel but were sturggling with the GPIO problem (patch No.4 should apply on a 3.2.2x kernel).
I'll rename the defconfig and add some recent changes made to the "official" Raspberry kernel. Expect a single patch in a day or two.
Regards, Paul.
Quoted 9 lines · Paul
Quoted 7 lines · Gilles Chanteperdrix
Quoted 2 lines · Paul
Attached, a patch set aimed at providing support for the Broadcom BCM2835 SoC as used in the Raspberry Pi[1].
In the meantime, we can put it in a raspberry subdirectory in Xenomai sources. Would you mind making a single patch? Or do you prefer the patches to be kept separated?
Quoted 8 lines
A single patch would be preferable for most people - The multi-patch set was mainly for the benefit of the guys who had a working kernel but were sturggling with the GPIO problem (patch No.4 should apply on a 3.2.2x kernel).
I'll rename the defconfig and add some recent changes made to the "official" Raspberry kernel. Expect a single patch in a day or two.
Attached, a single patch against ipipe-core-3.5.7. This assumes the appropriate arm patch has already been applied to a virgin stable 3.5.7 tree as per standard instructions.
The raspberry-post.patch provides support for the BCM2835 SoC backported from the rpi-3.6.y branch[1] up to, and including commit 871eef1b84. A minimal config is provided (bcmrpi_xenomai_defconfig) in place of the usual bcmrpi_*_defconfigs.
Credit for the original 3.2.21 Xenomai support should go to ian-cim as noted in earlier emails - My efforts are limited to backporting and hacks to the gpio interrupts.
Regards, Paul.
[1] git://github.com/raspberrypi/linux.git
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipipe-core-3.5.7-raspberry-post.patch
Type: text/x-diff
Size: 2724091 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130216/4f487e30/attachment.patch>
Quoted 28 lines · Paul
Quoted 9 lines · Paul
Quoted 7 lines · Gilles Chanteperdrix
Quoted 2 lines · Paul
Attached, a patch set aimed at providing support for the Broadcom BCM2835 SoC as used in the Raspberry Pi[1].
In the meantime, we can put it in a raspberry subdirectory in Xenomai sources. Would you mind making a single patch? Or do you prefer the patches to be kept separated?
Quoted 8 lines
A single patch would be preferable for most people - The multi-patch set was mainly for the benefit of the guys who had a working kernel but were sturggling with the GPIO problem (patch No.4 should apply on a 3.2.2x kernel).
I'll rename the defconfig and add some recent changes made to the "official" Raspberry kernel. Expect a single patch in a day or two.
Attached, a single patch against ipipe-core-3.5.7. This assumes the appropriate arm patch has already been applied to a virgin stable 3.5.7 tree as per standard instructions.
The raspberry-post.patch provides support for the BCM2835 SoC backported from the rpi-3.6.y branch[1] up to, and including commit
871eef1b84. A minimal config is provided (bcmrpi_xenomai_defconfig) in place of the usual bcmrpi_*_defconfigs.
Quoted 7 lines
Credit for the original 3.2.21 Xenomai support should go to ian-cim as noted in earlier emails - My efforts are limited to backporting and hacks to the gpio interrupts.
Regards, Paul.
Included in the repository, thanks.
Signature · 1 line
Gilles.
Quoted 37 lines · Gilles Chanteperdrix <gilles.chanteperdrix <at> xenomai.org> writes:
Quoted 34 lines · Paul
Quoted 9 lines · Paul
Quoted 7 lines · Gilles Chanteperdrix
Quoted 2 lines · Paul
Attached, a patch set aimed at providing support for the Broadcom BCM2835 SoC as used in the Raspberry Pi[1].
In the meantime, we can put it in a raspberry subdirectory in Xenomai sources. Would you mind making a single patch? Or do you prefer the patches to be kept separated?
Quoted 8 lines
A single patch would be preferable for most people - The multi-patch set was mainly for the benefit of the guys who had a working kernel but were sturggling with the GPIO problem (patch No.4 should apply on a 3.2.2x kernel).
I'll rename the defconfig and add some recent changes made to the "official" Raspberry kernel. Expect a single patch in a day or two.
Attached, a single patch against ipipe-core-3.5.7. This assumes the appropriate arm patch has already been applied to a virgin stable 3.5.7 tree as per standard instructions.
The raspberry-post.patch provides support for the BCM2835 SoC backported from the rpi-3.6.y branch[1] up to, and including commit
871eef1b84. A minimal config is provided (bcmrpi_xenomai_defconfig) in place of the usual bcmrpi_*_defconfigs.Credit for the original 3.2.21 Xenomai support should go to ian-cim as noted in earlier emails - My efforts are limited to backporting and hacks to the gpio interrupts.
Quoted 4 lines
Quoted 1 line
Regards, Paul.
Included in the repository, thanks.
Hi,
I've run into problems compiling the kernel with the above patch from git when sound drivers are enabled. It looks like some DMA code from commit
https://github.com/torvalds/linux/commit/64ccc9c033c6089b2d426dad3c56477ab066c999
was missing. I've added them in the patch inlined below (to be applied after Paul's patch).
Thanks for the work with getting Xenomai on the Pi! :)
(quoted diff) +0 -0
b/include/asm-generic/dma-coherent.h
index abfb268..2be8a2d 100644
include/asm-generic/dma-coherent.h +0 -0
@@ -29,6 +29,7 @@ int dma_mmap_from_coherent(struct device *dev, struct
vm_area_struct *vma,
#else
#define dma_alloc_from_coherent(dev, size, handle, ret) (0) #define dma_release_from_coherent(dev, order, vaddr) (0)
+#define dma_mmap_from_coherent(dev, vma, vaddr, order, ret) (0)
#endif
#endif
(quoted diff) +0 -0
b/include/asm-generic/dma-mapping-common.h
index 2e248d8..9073aeb 100644
include/asm-generic/dma-mapping-common.h +0 -0
@@ -176,7 +176,44 @@ static inline void
dma_sync_single_range_for_device(struct device *dev,
#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, NULL) #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, NULL)
+extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
+ void *cpu_addr, dma_addr_t dma_addr, size_t size);
+
+/**
+ * dma_mmap_attrs - map a coherent DMA allocation into user space
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @vma: vm_area_struct describing requested user mapping
+ * @cpu_addr: kernel CPU-view address returned from dma_alloc_attrs
+ * @handle: device-view address returned from dma_alloc_attrs
+ * @size: size of memory originally requested in dma_alloc_attrs
+ * @attrs: attributes of mapping properties requested in dma_alloc_attrs
+ *
+ * Map a coherent DMA buffer previously allocated by dma_alloc_attrs
+ * into user space. The coherent DMA buffer must not be freed by the
+ * driver until the user space mapping has been released.
+ */
+static inline int
+dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma, void *cpu_addr,
+ dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs)
+{
+ struct dma_map_ops *ops = get_dma_ops(dev); + BUG_ON(!ops); + if (ops->mmap)
+ return ops->mmap(dev, vma, cpu_addr, dma_addr, size, attrs);
+ return dma_common_mmap(dev, vma, cpu_addr, dma_addr, size);
+}
+
+#define dma_mmap_coherent(d, v, c, h, s) dma_mmap_attrs(d, v, c, h, s, NULL) +
+static inline int dma_mmap_writecombine(struct device *dev, struct vm_area_struct *vma,
+ void *cpu_addr, dma_addr_t dma_addr, size_t size)
+{
+ DEFINE_DMA_ATTRS(attrs); + dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); + return dma_mmap_attrs(dev, vma, cpu_addr, dma_addr, size, &attrs);
+}
+
int
dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
void *cpu_addr, dma_addr_t dma_addr, size_t size);
Quoted 8 lines · John Pham
I've run into problems compiling the kernel with the above patch from git when sound drivers are enabled. It looks like some DMA code from commit
https://github.com/torvalds/linux/commit/64ccc9c033c6089b2d426dad3c56477ab066c999was missing. I've added them in the patch inlined below (to be applied after Paul's patch).Thanks for the work with getting Xenomai on the Pi! :)
Sound has never been a high priority for me, so I don't generally enable the drivers - Hence the reason I missed this... That said, got a "real time" voice recognition project surfacing at work.
Could you try the two attached patches - These are intended for the "official" Rasperry Pi kernel from
https://github.com/raspberrypi/linux (rpi-3.8.y branch). Apply the *-pre.patch, followed by the ipipe-core.patch, and finish with the *-post.patch - Any failed hunks or other issues, let me know and I'll take a look when time allows.
Regards, Paul.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipipe-core-3.8.13-RPi-pre.patch
Type: text/x-diff
Size: 5292 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130704/85668b14/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipipe-core-3.8.13-RPi-post.patch
Type: text/x-diff
Size: 12108 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130704/85668b14/attachment-0001.patch>
A message that is not in the archive (sent off-list or not yet received): 32348a0f3aab4463894a5a65efe02ab8@BLUPRD0113HT002.prod.exchangelabs.com
Hi,
They seem to apply and the compiled kernel boots and apparently runs correctly, although I haven't run any xenomai applications on it. I'll post if any problems come up. Thanks!
Quoted 28 lines · Paul
Quoted 8 lines · John Pham
I've run into problems compiling the kernel with the above patch from git when sound drivers are enabled. It looks like some DMA code from commit
https://github.com/torvalds/linux/commit/64ccc9c033c6089b2d426dad3c56477ab066c999was missing. I've added them in the patch inlined below (to be applied after Paul's patch).Thanks for the work with getting Xenomai on the Pi! :)
Sound has never been a high priority for me, so I don't generally enable the drivers - Hence the reason I missed this... That said, got a "real time" voice recognition project surfacing at work.
Could you try the two attached patches - These are intended for the "official" Rasperry Pi kernel from
https://github.com/raspberrypi/linux (rpi-3.8.y branch). Apply the *-pre.patch, followed by the ipipe-core.patch, and finish with the *-post.patch - Any failed hunks or other issues, let me know and I'll take a look when time allows.Regards, Paul.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · Gregory Perry
Any chance of getting similar Xenomai support built into the mainline 3.8 kernel for the BeagleBoard? A patch set for Xenomai support for the BeagleBone was recently submitted to the Xenomai project, mainline kernel support would in turn facilitate direct support from the Xenomai team for the BeagleBone (probably wouldn't hurt to send the Xenomai team a care package of a couple BeagleBoards/Bones etc to increase their enthusiasm about maintaining support for both with their development efforts).
If there are individuals who would actively work on this, sending a couple of boards would be something I can do. I just don't want to go sending out boards that'll sit idle. Contact me with names/emails of people who will actively work this.
Quoted 61 lines
________________________________________
From: [email protected] [[email protected]] on behalf of Paul [[email protected]]
Sent: Thursday, February 14, 2013 7:27 AM
To: [email protected]
Subject: [Xenomai] Xenomai, Raspberry Pi, 3.5.7 kernelAttached, a patch set aimed at providing support for the Broadcom BCM2835 SoC as used in the Raspberry Pi[1].
The first patch assumes that the core-ipipe-3.5.7-arm patch has already been applied or the sources have been pulled from the ipipe git repository[2]. Most of the changes have been pulled from the 3.6.11 kernel sources maintained by the Rasbperry team and adds a number of drivers needed by the BCM2835 chip. Low level changes to the timer support have been made courtesy of ian-cim and his preliminary 3.2.21 patch[3]
Patch number 2 silences a trivial compile time warning and can be skipped..
Patch number three adds a minimal default config (bcmrpi_defconfig) that can be used as a basis for compiling a Xenomai enabled kernel. This patch can also be skipped if a defconfig is not required.Patch number four makes some changes to the way GPIO interrupts are handled - Interrupt latencies are considerably improved (typically in the 15-30uS range).
Work is being undertaken by the Raspberry team to get support built in to the mainline kernel - I believe the window has been missed for 3.8.x, so fingers are crossed for 3.10.x.
Regards, Paul.
[1] www.raspberrypi.org
[2]git://git.denx.de/ipipe.git
[3] www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=12368-------------- next part --------------
A non-text attachment was scrubbed...
Name: raspberry-pi.bz2
Type: application/x-bzip2
Size: 458222 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130214/bb9244d7/attachment.bin>
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.