Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jan 2013 03:10:15 +0900
From:      "Daisuke Aoyama" <aoyama@peach.ne.jp>
To:        <freebsd-arm@freebsd.org>
Subject:   Re: FreeBSD/armv6z/clang on Raspberry Pi 512MB (with U-Boot + ubldr)
Message-ID:  <D867259F89CF44409C2359527D0263D4@ad.peach.ne.jp>
In-Reply-To: <E48DEAF481F74C69A1BC7A01F2B8E74A@ad.peach.ne.jp>
References:  <B5F827FF91C94FF2AFEE00194A2BB2C5@ad.peach.ne.jp> <B508111FCE534B2CBA61F4D1EC1078D3@ad.peach.ne.jp> <D3ABE3919EA74D668DB060952B5CD8C0@ad.peach.ne.jp> <2659960079254C38ACD2F1DCBB7A1A19@ad.peach.ne.jp> <E48DEAF481F74C69A1BC7A01F2B8E74A@ad.peach.ne.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
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
 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D867259F89CF44409C2359527D0263D4>