快乐虾http://blog.csdn.net/lights_joy/lights@hb165.com本文适用于ADI bf561 DSP优视科技BV561EVB开发板uClinux-2008r1.5-rc3欢迎转载,但请保留作者信息Bfin-uclinux的内核从08r1.5-rc3开始支持SMP,今天试着编译了一个内核,下面是个记录。首先将bfin_patch/smp_patch/smp_bf561.patch文件复制到uclinux内核的根目录下,执行:patch -p0 < ./smp_bf561.patch将此补丁打上。接着make menuconfig,选上驱动,再make,用u-boot引导:Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)Memory available: 57660k/65536k RAM, (4772k init code, 1036k kernel code, 421k data, 1024k dma, 620k reserved)Blackfin Scratchpad data SRAM: 4 KBPDA for CPU0 reserved at ffb00000Blackfin DATA_A SRAM: 16 KBBlackfin DATA_B SRAM: 16 KBBlackfin Instruction SRAM: 16 KBMount-cache hash table entries: 512CoreB bootstrap code to SRAM ff600000 via DMA.Booting Core B.Instruction Cache Enabled for CPU1Data Cache Enabled for CPU1 (write-through)PDA for CPU1 reserved at ff700000Brought up 2 CPUsSMP: Total of 2 processors activated (1171.45 BogoMIPS).migration_cost=4000NET: Registered protocol family 16Blackfin GPIO ControllerBlackfin DMA Controllerezkit_init(): registering device resourcesNET: Registered protocol family 2IP route cache hash table entries: 1024 (order: 0, 4096 bytes)TCP established hash table entries: 2048 (order: 2, 24576 bytes)TCP bind hash table entries: 2048 (order: 2, 16384 bytes)TCP: Hash tables configured (established 2048 bind 2048)TCP reno registeredio scheduler noop registeredio scheduler anticipatory registered (default)io scheduler cfq registeredbfin-wdt: initialized: timeout=20 sec (nowayout=0)Serial: Blackfin serial driverbfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 35) is a BFIN-UARTRAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksizePPP generic driver version 2.4.2SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).SLIP linefill/keepalive option.dm9000 Ethernet Driverbfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@16i2c /dev entries driveri2c-gpio i2c-gpio.0: using pins 1 (SDA) and 0 (SCL)TCP cubic registeredNET: Registered protocol family 1NET: Registered protocol family 17Freeing unused kernel memory: 4772k freeddma_alloc_init: dma_page @ 0x00602000 - 256 pages at 0x03f00000_____________________________________a8888b./ Welcome to the uClinux distribution /d888888b./__/8P"YP"Y88/| ||_|____ (TM)|8|o||o|88_____/| |_ ______ / // /|8'.88/| || |_ /| | | | //|8`._.' Y8./| |__ | | | | | |_| | //|d/`8b.//____||_|_| |_|/____|/_//_/|dP.Y8b./For embedded processors including|d8:'"`::88b/the Analog Devices Blackfin/d8"'Y88b/___________________________________/:8P':8888a.:_a88PFor further information, check out:._/"Yaa_:.| 88P|- http://blackfin.uclinux.org//YP"`| 8P`.- http://docs.blackfin.uclinux.org///.___.d|.'- http://www.uclinux.org/`--..__)8888P`._.'jgs/a:f- http://www.analog.com/blackfinHave a lot of fun...BusyBox v1.4.1 (2009-01-10 22:19:59 CST) Built-in shell (msh)Enter 'help' for a list of built-in commands.root:/> 看一下cpuinfo:root:/> cat /proc/cpuinfoBoard Name:ADDS-BF561-EZKITBoard Memory:64 MBKernel Memory:64 MBMMU:noneFPU:noneSystem Clock:118800000 HzCPU0:ADSP-BF561 Rev. 0.5Core Clock:594000000 HzBogoMips:1171.45Calibration:585728000 loopsI-CACHE:OND-CACHE:ON (write-through)DBANK-A:CACHEDBANK-B:CACHEI-CACHE Size:16KBD-CACHE Size:32KBI-CACHE Setup:4 Sub-banks/4 Ways, 32 Lines/WayD-CACHE Setup:2 Super-banks/4 Sub-banks/2 Ways, 64 Lines/WayCPU1:ADSP-BF561 Rev. 0.5Core Clock:594000000 HzBogoMips:1171.45Calibration:585728000 loopsI-CACHE:OND-CACHE:ON (write-through)DBANK-A:CACHEDBANK-B:CACHEI-CACHE Size:16KBD-CACHE Size:32KBI-CACHE Setup:4 Sub-banks/4 Ways, 32 Lines/WayD-CACHE Setup:2 Super-banks/4 Sub-banks/2 Ways, 64 Lines/Way有意思,有时间得仔细研究一下了。当然,这个SMP还有一些限制:This SMP patch was made for 2008R1. Limitations in current work are listed below.1. Only support the cache policy: WriteThrough.2. Disabled Memory Optimizations, we moved these functions to SDRAM.3. Kernel module and applications can't be load into L1 memory, neither alloc data from L1 memory.4. Not have L2 memory management function, but you can define variables that located in L2.5. Applications that built with -mstack-check-l1, or calling uClibc's thread manage API may fail. Toolchain guys will work on it.6. Both the Cores have the same interrupt settings, ie, both the core will response to the peripheral interrupt. Because each vector have a spin lock, except the tick interrupt, so only one Core will do the act things. 7. Use GPTIMER0 instead of the CoreTimer, as the tick timer.8. Not support power management.期待下一版的功能更加完善!