FreeBSD/armv6z/clang on Raspberry Pi 512MB (with U-Boot + ubldr)
Daisuke Aoyama
aoyama at peach.ne.jp
Tue Jan 29 18:15:46 UTC 2013
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 at 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
More information about the freebsd-arm
mailing list