From owner-freebsd-arm@FreeBSD.ORG Tue Jan 29 18:15:46 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E1897318 for ; Tue, 29 Jan 2013 18:15:46 +0000 (UTC) (envelope-from aoyama@peach.ne.jp) Received: from moon.peach.ne.jp (moon.peach.ne.jp [203.141.148.98]) by mx1.freebsd.org (Postfix) with ESMTP id 72D95E5F for ; Tue, 29 Jan 2013 18:15:46 +0000 (UTC) Received: from moon.peach.ne.jp (localhost [127.0.0.1]) by moon.peach.ne.jp (Postfix) with ESMTP id 89A1E39E09 for ; Wed, 30 Jan 2013 03:09:58 +0900 (JST) Received: from artemis (unknown [172.18.0.20]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by moon.peach.ne.jp (Postfix) with ESMTPSA id 7567739D62 for ; Wed, 30 Jan 2013 03:09:58 +0900 (JST) Message-ID: From: "Daisuke Aoyama" To: References: <2659960079254C38ACD2F1DCBB7A1A19@ad.peach.ne.jp> In-Reply-To: Subject: Re: FreeBSD/armv6z/clang on Raspberry Pi 512MB (with U-Boot + ubldr) Date: Wed, 30 Jan 2013 03:10:15 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 18:15:46 -0000 I've updated clang RPI code based on SVN r246066. This is OABI version. I plan to try EABI next if possible. major change: o update base tree to SVN r246066. o implement -mload-store-multiple/-mno-load-store-multiple option in clang/llvm. (workaround only) o re-enable __clear_cache() in libgcc. o bugfix bcm2835_dma inline asm code, etc. o use bcm2835_dma_wb/wbinv in SDHCI. o add USB LAN and wireless LAN driver module. (loaded by devd automatically) o move swap to head of partition. o use label mount instead of /dev/mmcsd0s2a,/dev/mmcsd0s2b. o add wireless lan, quota, ipfw and IPv6 to kernel config. o change default HS mode is enabled. To prevent a fault on ldm/stm generated by clang, all files are complied with: CFLAGS=-O2 -mno-global-merge -mno-load-store-multiple -fno-strict-aliasing -pipe -mabi=apcs-gnu -march=armv6z -mtune=arm1176jzf-s -mfloat-abi=soft To reduce time in DMA intr, it uses bcm2835_dma_wb/wbinv directly. Now it gets 20.7MB/s DMA transfer rate on class 10 SD card. (depend on card spec) It's 30% faster than bus_space_XXX/bus_dmamap_XXX. >root@raspberry-pi:~ # dd if=/dev/mmcsd0 of=/dev/null bs=1m count=32 >32+0 records in >32+0 records out >33554432 bytes transferred in 1.617316 secs (20746986 bytes/sec) Known issue: DMA intr might be delayed by slow interrupt handler. (arm/intr.c:arm_handler_execute specific, should be remapped DMA IRQ to low number) You can get the pre-build image from my archives: http://www.peach.ne.jp/archives/rpi/ Download and decompress it, then write it to SD. This image requires SD 8GB or more. I'm using it as headless server. So, you need a serial console for seeing full boot log. If you want the video out, please remove the line of "set console=comconsole" in /boot/loader.rc. Using config is here: http://www.peach.ne.jp/archives/rpi/config/RPI-B-test15 The source/patch is here: http://www.peach.ne.jp/archives/rpi/patch/ For more info, please read old ML or Japanese blog: http://lists.freebsd.org/pipermail/freebsd-arm/2013-January/004555.html http://lists.freebsd.org/pipermail/freebsd-arm/2013-January/004541.html http://lists.freebsd.org/pipermail/freebsd-arm/2013-January/004507.html http://lists.freebsd.org/pipermail/freebsd-arm/2012-December/004421.html http://lists.freebsd.org/pipermail/freebsd-arm/2012-December/004331.html http://shell.peach.ne.jp/aoyama/ ---------------------------------------------------------------------- How to build/install the kernel: # fetch -o /usr http://www.peach.ne.jp/archives/rpi/patch/src-246066-20130130.patch.gz # fetch -o /usr/src/sys/arm/conf http://www.peach.ne.jp/archives/rpi/config/RPI-B-test15 # fetch -o /usr/src/sys/arm/broadcom/bcm2835 http://www.peach.ne.jp/archives/rpi/patch/bcm2835_asm.S # fetch -o /usr/src/sys/arm/broadcom/bcm2835 http://www.peach.ne.jp/archives/rpi/patch/bcm2835_asm.h # fetch -o /usr/src/sys/arm/broadcom/bcm2835 http://www.peach.ne.jp/archives/rpi/patch/bcm2835_dma.c # fetch -o /usr/src/sys/arm/broadcom/bcm2835 http://www.peach.ne.jp/archives/rpi/patch/bcm2835_dma.h # cd /usr/src # gzcat /usr/src-246066-20130130.patch.gz | patch # make buildkernel KERNCONF=RPI-B-test15 WITH_FDT=yes (wait about 50 minutes) # make installkernel KERNCONF=RPI-B-test15 ---------------------------------------------------------------------- Enjoy clang world in Raspberry Pi! Thank you. -- Daisuke Aoyama