Intel Edisonã«Xenomaiãå ¥ããï¼ãã ãWiFiãªã...ï¼ â (æ¬é¡)
前回ã«ç¶ããEdisonã«Xenomaiãå ¥ãã¦ããã¾ãã
Xenomaiç¨ã®ããããä½æãã
ã¾ããã³ã³ãã¤ã«ã«å¿ è¦ãªEdisonç¨ã®Xenomaiããããä½æãã¦ããã¾ããæåã«Xenomaiã®ã³ã¼ããã¨ã£ã¦ãã¾ãããã以ä¸ã§ã¯ãEdisonãLinuxã®ã½ã¼ã¹ã³ã¼ããå±éãããã£ã¬ã¯ããªãåºæºã¨ãã¦ãã¾ãã
$ ls edison-src linux-yocto-3.10-3.10.32.tar.bz2 linux-yocto-3.10-3.10.32 upstream_to_edison.3.10.32.patch linux-yocto-3.10-3.10.32-edison $ git clone git://git.xenomai.org/xenomai-3.git Cloning into 'xenomai-3'... remote: Counting objects: 120758, done. remote: Compressing objects: 100% (20429/20429), done. remote: Total 120758 (delta 98188), reused 119251 (delta 96934) Receiving objects: 100% (120758/120758), 273.37 MiB | 625.00 KiB/s, done. Resolving deltas: 100% (98188/98188), done. Checking connectivity... done. $ ls edison-src linux-yocto-3.10-3.10.32.tar.bz2 linux-yocto-3.10-3.10.32 upstream_to_edison.3.10.32.patch linux-yocto-3.10-3.10.32-edison xenomai-3 $
ç¶ãã¦ãå ã®Yocto Projectã®ã«ã¼ãã«3.10.32ã«å¯¾ãã¦Xenomaiã®ããããå½ã¦ã¾ããXenomaiããããå½ã¦ãã«ã¯ドキュメントã«ããããã«ãã¹ã¯ãªãããå®è¡ãã¦ããã¾ããããããå½ã¦ãããåããããã«ãã£ã¬ã¯ããªåãå¤æ´ãã¦ããã¾ãããã
$ xenomai-3/scripts/prepare-kernel.sh --help usage: prepare-kernel --linux=--ipipe= [--arch= ] [--outpatch= [--filterkvers=y|n] [--filterarch=y|n]] [--forcelink] [--def ault] [--verbose] $ xenomai-3/scripts/prepare-kernel.sh --linux=linux-yocto-3.10-3.10.32 \ checking file arch/x86/Kconfig checking file arch/x86/Kconfig.debug checking file arch/x86/include/asm/apic.h ... checking file mm/mmu_context.c checking file mm/mprotect.c checking file mm/vmalloc.c $ mv linux-yocto-3.10-3.10.32 linux-yocto-3.10-3.10.32-ipipe $ ls edison-src linux-yocto-3.10-3.10.32.tar.bz2 linux-yocto-3.10-3.10.32-edison upstream_to_edison.3.10.32.patch linux-yocto-3.10-3.10.32-ipipe xenomai-3 $ä»åº¦ã¯Xenomaiããããå½ã¦ãã«ã¼ãã«ã½ã¼ã¹ã³ã¼ãã«Edisonããããå½ã¦ã¦ããã¾ããããã§ä½¿ç¨ããã®ã¯ãååä½æãã3.10.32ç¨ã®ãããã§ãã$ cd linux-yocto-3.10-3.10.32-ipipe/ $ patch -p1 < ../upstream_to_edison.3.10.32.patch patching file Documentation/kernel-parameters.txt patching file arch/x86/Kconfig Hunk #1 succeeded at 446 (offset 4 lines). ... patching file kernel/power/process.c patching file kernel/printk.c patching file sound/soc/codecs/sn95031.c $ find . -name "*.rej" ./arch/x86/kernel/apic/io_apic.c.rej $
ãã®ã¨ããã²ã¨ã¤ã®ãã¡ã¤ã«(arch/x86/kernel/apic/io_apic.c)ã§ãããé©ç¨å¤±æã¨ãªãã¾ããããã«ã¤ãã¦ã¯ãæåã§ä¿®æ£ãã¦ããã¾ãã2656è¡ç®ãã以ä¸ã®ããã«ä¿®æ£ãã¾ããstatic struct irq_chip ioapic_chip __read_mostly = { .name = "IO-APIC", .irq_startup = startup_ioapic_irq, .irq_mask = mask_ioapic_irq, .irq_unmask = unmask_ioapic_irq, .irq_ack = ack_apic_edge, .irq_eoi = ack_apic_level, .irq_set_affinity = native_ioapic_set_affinity, .irq_retrigger = ioapic_retrigger_irq, #ifdef CONFIG_IPIPE #ifdef CONFIG_SMP .irq_move = move_xxapic_irq, #endif .irq_hold = hold_ioapic_irq, .irq_release = release_ioapic_irq, #endif };ããããããããâââââstatic struct irq_chip ioapic_chip __read_mostly = { .name = "IO-APIC", .irq_startup = startup_ioapic_irq, .irq_mask = mask_ioapic_irq, .irq_unmask = unmask_ioapic_irq, .irq_ack = ack_apic_edge, .irq_eoi = ack_apic_level, .irq_set_affinity = native_ioapic_set_affinity, .irq_set_wake = ioapic_set_wake, .irq_retrigger = ioapic_retrigger_irq, #ifdef CONFIG_IPIPE #ifdef CONFIG_SMP .irq_move = move_xxapic_irq, #endif .irq_hold = hold_ioapic_irq, .irq_release = release_ioapic_irq, #endif .flags = IRQCHIP_SKIP_SET_WAKE, };ä¿®æ£ãããããããé©ç¨æã«åºæ¥ãä½è¨ãªãã¡ã¤ã«ãåé¤ãã¾ããEmacsã§ç·¨éããå ´åã«ã¯ãç·¨éæã®ããã¯ã¢ãããã¡ã¤ã«ï¼arch/x86/kernel/apic/io_apic.c~ï¼ãæ¶ãã¾ãããããã®å¾ããããå½ã¦ããã¨ãå¿ããªãããã«ããã£ã¬ã¯ããªåãå¤æ´ãã¦ããã¾ãããã$ find . -name "*.rej" -exec rm {} \; $ find . -name "*.orig" -exec rm {} \; $ cd .. $ mv linux-yocto-3.10-3.10.32-ipipe linux-yocto-3.10-3.10.32-ipipe-edison $ ls edison-src linux-yocto-3.10-3.10.32.tar.bz2 linux-yocto-3.10-3.10.32-edison upstream_to_edison.3.10.32.patch linux-yocto-3.10-3.10.32-ipipe-edison xenomai-3 $
ããã§ãEdisonç¨ã®Xenomaiããããä½ããã¨ãåºæ¥ã¾ããä½æãããããã¯ååä½æãããããã¨åãå ´æã«ã³ãã¼ãã¾ããããããã§ãããã®ä½æãå®äºã§ãã$ diff -Narup *-3.10.32-edison *-3.10.32-ipipe-edison > xenomai-3.0-3.10.32.patch $ cp xenomai-3.0-3.10.32.patch edison-src/device-software/meta-edison/recipes-kernel/linux/files/ $ã³ã³ãã¤ã«ç°å¢ã®ä¿®æ£
ã«ã¼ãã«ã®ãã«ãæã«ä½æããXenomaiããããé©ç¨ã§ãããããlinux-yocto_3.10.bbappendãä¿®æ£ãã¦ããã¾ããä¿®æ£ã¯ä»¥ä¸ã®èµ¤ãé¨åã追å ããã ãã§ããFILESEXTRAPATHS_prepend := "${THISDIR}/files:" COMPATIBLE_MACHINE = "edison" LINUX_VERSION = "3.10.32" SRCREV_machine = "61dde96f97bb5b1ed4c11caf9a857d55ad8f6e17" SRCREV_meta = "e46e0e44708e23533f8df904cebf23a352e9053a" SRC_URI += "file://defconfig" SRC_URI += "file://upstream_to_edison.3.10.32.patch" SRC_URI += "file://xenomai-3.0-3.10.32.patch" do_configure() { cp "${WORKDIR}/defconfig" "${B}/.config" } do_kernel_configme() { cp "${WORKDIR}/defconfig" "${B}/.config" } do_patch() { cd ${S} git apply "${WORKDIR}/upstream_to_edison.3.10.32.patch" git apply "${WORKDIR}/xenomai-3.0-3.10.32.patch" }次ã«ãWiFié¢ä¿ãä¿®æ£ãã¾ãã Edisonã®WiFiããã³Bluetoothã®ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¯ãã«ã¼ãã«ã¨ã¯å¥ã«edison-src/broadcom_cwsãã£ã¬ã¯ããªã«ç¨æããã¦ãã¾ããã«ã¼ãã«ã®ãã«ãå¾ããããã®ã¢ã¸ã¥ã¼ã«ããã«ããã¦çµã¿è¾¼ãã§ãã¾ãã ç¾ç¶ãWiFiã¢ã¸ã¥ã¼ã«ã¯Xenomaiã«ã¼ãã«ä¸ã§ãã®ã¾ã¾ã§ã¯åä½ããªããããä»åã¯ã¯ããã¾ãã ãªããBluetoothã¢ã¸ã¥ã¼ã«ã¯ããããã¦åä½ã¯ãã¾ãããä¸å®å®ã§ãã WiFiã¢ã¸ã¥ã¼ã«ã®ãã«ããããªãããã«ããã«ã¯ãedison-src/device-software/meta-edison-distro/recipes-core/imagesãã£ã¬ã¯ããªã«ããedison-image.bbãä¿®æ£ãã¾ãã 81è¡ç®ãã以ä¸ã®ããã«èµ¤ãé¨åãã³ã¡ã³ãã¢ã¦ããã¾ããBluetoothã¢ã¸ã¥ã¼ã«ããã«ãããªãå ´åã¯bcm43340-btã¨bluetooth-rfkill-eventã®è¡ãã³ã¡ã³ãã¢ã¦ããã¾ãã ï¼ã¡ãªã¿ã«ãEdisonèµ·åå¾ã«WiFiã使ããªããã°åé¡ãªãã®ã§ããã®ä¿®æ£ã¯å¿ é ã§ã¯ããã¾ãããï¼# Wifi firmware #IMAGE_INSTALL += "bcm43340-fw" # Bluetooth Firmware patch for 43340 and its patch utility IMAGE_INSTALL += "bcm43340-bt" # service daemon that listens to rfkill events and trigger FW patch download IMAGE_INSTALL += "bluetooth-rfkill-event" # Wifi driver built as a kernel module #IMAGE_INSTALL += "bcm43340-mod"åºæ¥ä¸ãã£ãEdisonã®ã¤ã¡ã¼ã¸ãEdisonã«æ¸ãè¾¼ãã æã«ã¯ã次ã®èµ·åæã«ä¸æ¦å ¨ä½ã®è¨å®ãè¡ããã¾ãããã®æWiFiã®è¨å®ãè¡ããããã®æã«ã¢ã¸ã¥ã¼ã«ãçµã¿è¾¼ã¾ãã¾ããXenomaiãçµã¿è¾¼ãã ã«ã¼ãã«ã§ã¯ãã®ã¨ããã³ã°ãã¦ãã¾ãã¾ãã®ã§ã以ä¸ã§ã¯ãã®è¨å®ãããªãããã«ä¿®æ£ãã¾ãã Edisonã¸ã®ã¤ã¡ã¼ã¸ã®æ´æ°æ¹æ³ã«ã¯2éããããUSBçµç±ã§ãã¡ã¤ã«ãã³ãã¼ãã¦"reboot ota"ããæ¹æ³ã¨ãdfu-utilを使う方法ãããã¾ããããããåä½ããã¹ã¯ãªãããç°ãªãã åè ã¯edison-src/device-software/meta-edison-distro/recipes-core/ota-update/files/ota-update.sh å¾è ã¯edison-src/device-software/meta-edison-distro/recipes-core/first-install/files/first-install.sh ã¨ãªãã¾ãã ãããããã¡ã¤ã«ã®æå¾ãã9è¡ç®ä»è¿ã®ã# Setup Access Point SSID and passphraseã以ä¸2è¡ãã³ã¡ã³ãã¢ã¦ããã¾ãã# Setup Access Point SSID and passphrase #setup_ap_ssid_and_passphrase #fi_assert $? "Generating Wifi Access Point SSID and passphrase"ããã§ã²ã¨ã¾ãä¿®æ£ã¯å®äºã§ããã«ã¼ãã«ã¨ã¤ã¡ã¼ã¸ã®ãã«ã
ãã¨ã¯ã«ã¼ãã«ããã«ãããEdisonã®ã¤ã¡ã¼ã¸ãæ§ç¯ãã¾ãã 念ã®ãããã«ã¼ãã«ãcleanãã¦ãããã«ããã¾ãã$ cd edison-src/build $ bitbake virtual/kernel -c clean $ bitbake virtual/kernelãã®ã¨ãããã«ãã¨ã©ã¼ãçºçãã¾ããããã¯ä½¿ç¨ããã«ã¼ãã«ã®è¨å®ãã¡ã¤ã«ï¼.configï¼ãå ã®Edisonãªãªã¸ãã«ã®ãã®ã§ããããã®ä¸ã«ã¯Xenomaié¢é£ã®è¨å®é ç®ããªãããã§ãï¼å é¨çã«make oldconfigãè¡ããæ°ããé ç®ã§ã¯å ¥åãæ±ãã¦ããããï¼ã ããã§ã¯æ示çã«ã«ã¼ãã«ã®è¨å®ãè¡ãã¾ãã$ bitbake virtual/kernel -c menuconfigãã®ä¸ã§ã¯ã以ä¸ã®è¨å®ãè¡ãã¾ãããã¦ãå¾ã¯ããä¸åº¦ã«ã¼ãã«ã®ãã«ãã¨Edisonã¤ã¡ã¼ã¸ã®ä½æã§ãã
- [General setup]--->[Local version - append to kernel release]
- "-poky-edison"ã¨ãªã£ã¦ã¾ãã®ã§ãXenomaiã ã¨åããããã«è¨å®ãã¾ãããããã¨ãã°"-poky-edison-ipipe"ãªã©ã
- [Xenomai/cobalt]
- æå¹ã«ãã¾ãã
- [Processor type and features]--->[Interrupt pipeline]
- æå¹ã«ãã¾ããï¼[Xenomi/cobalt]ãæå¹ã ã¨ãããããã§ã«æå¹ã«ãªã£ã¦ãã¾ããï¼
- [Power management and ACPI options]--->[CPU Frequency scaling]--->[CPU Frequency scaling]
- ç¡å¹ã«ãã¾ãã
- [Power management and ACPI options]--->[CPU idle PM support]
- ç¡å¹ã«ãã¾ãã
- [Device Drivers]--->[Network device support]--->[Wireless LAN]
- ç¡å¹ã«ãã¾ããï¼WiFiã¢ã¸ã¥ã¼ã«ã®ãã«ãã®ã¨ããã¨åæ§ãXenomaiä¸ã§ä½¿ç¨ããªããã°ç¡å¹ã«ããªãã¦ããããã©â¦ï¼
$ bitbake virtual/kernel ... $ bitbake edison-image ... $ ../device-software/utils/flash/postBuild.sh以ä¸ã§ãEdisonç¨ã®Xenomaiã«ã¼ãã«ã®ãã«ããåºæ¥ã¾ãããåºæ¥ä¸ãã£ãtoFlashãã£ã¬ã¯ããªå ã®ãã¡ã¤ã«ãEdisonã«è»¢éããEdisonä¸ã§"reboot ota"ã§åèµ·åããã¨ãXenomaiã«ã¼ãã«ã§èµ·åããã¯ãã§ãããããã«
ç¾ç¶ã以ä¸ã®èª²é¡ãæ®ã£ã¦ãã¾ãããã¤ã«ãªããåããã¾ããããå°ããã¤ãã£ã¦ãããã¨æãã¾ãã ä½ãæ å ±ãããã¾ããããæãã¦ããã ããã¨ãããããã§ãã ã§ã¯ã§ã¯ã
- Xenomaiç¨ã®ããã°ã©ã ãä½æããããã®ãã«ãç°å¢ãæ´ãã
- Bluetoothã¢ã¸ã¥ã¼ã«ãä¸å®å®ãªã®ã§ãä¿®æ£ãå¿ è¦ã
- WiFiã¢ã¸ã¥ã¼ã«ãåä½ã§ãããããä¿®æ£ãå¿ è¦ã