Ø IPClite(Inter-Processor Communication Lite)是一个简单的ipc软件包,包括ipc初始化及notify通信组件;
Ø IPClite使用了两个CHIPINT和32字节的内部共享内存;
Ø notify是一个可以传送32bit的值给其他CPU的通信组件,可以传送一个32bit的值或指针;
Ø IPClite提供了一个简单双核通信API,详细的介绍会在具体的IPClite案例里面说明。
图 1 双核裸机通信框架
/* Memory Map for ti.OMAPL138
*
* C000_0000 - C7FF_FFFF 800_0000 ( 128 MB) External Memory
* ------------------------------------------------------------------------
* C108_0000 - C1FF_FFFF 200_0000 ( 8 MB) ARM PROG
* C300_0000 - C37F_FFFF 80_0000 ( 8 MB) DSP_PROG (code, data)
*
* 8000_0000 - 8000_001F 800_0000 ( 32 B) Internal Share Memory
* ------------------------------------------------------------------------
* 8000_0000 - 8000_000F 10 ( 16 B) ARM (ipc)
* 8000_0010 - 8000_001F 10 ( 16 B) DSP (ipc)
*/
1.2.2 定义双核共享内存// ============================================================================
// Specify the System Memory Map
// ============================================================================
#define IPC_ARM_START 0x80000000
#define IPC_ARM_SIZE 0x10
#define IPC_DSP_START IPC_ARM_START + IPC_ARM_SIZE
#define IPC_DSP_SIZE 0x10
#define SHARED_IRAM_START IPC_ARM_START + IPC_ARM_SIZE + IPC_DSP_SIZE
#define SHARED_IRAM_SIZE 0x1FFFF - (IPC_ARM_SIZE + IPC_DSP_SIZE)
MEMORY
{
L1P: o = 0x11E00000 l = 0x00008000
L1D: o = 0x11F00000 l = 0x00008000
L2: o = 0x11800000 l = 0x00040000
DDR2: o = 0xC4000000 l = 0x04000000 /* 32MB of DDR2 */
IPC_ARM: o = IPC_ARM_START l = IPC_ARM_SIZE /* 16 bytes for ARM */
IPC_DSP: o = IPC_DSP_START l = IPC_DSP_SIZE /* 16 bytes for DSP */
shared_ram: o = SHARED_IRAM_START l = SHARED_IRAM_SIZE /* Remaining IntRAM */
}
1.2.3 ARM程序使用内存空间SECTIONS
{
. = 0xC1080000;
. = ALIGN(4);
.startcode :
{
*init.o (.text)
}
. = ALIGN(4);
.text :
{
*(.text)
}
. = ALIGN(4);
.data :
{
*(.data)
}
. = ALIGN(4);
_bss_start = .;
.bss :
{
*(.bss)
}
. = ALIGN(4);
_bss_end = .;
_stack = 0xC1FFFFFC;
}
1.2.4 DSP程序使用内存MEMORY
{
L1P: o = 0x11E00000 l = 0x00008000
L1D: o = 0x11F00000 l = 0x00008000
L2: o = 0x11800000 l = 0x00040000
DDR2: o = 0xC3000000 l = 0x00800000 /* 8MB of DDR2 */
IPC_ARM: o = IPC_ARM_START l = IPC_ARM_SIZE /* 16 bytes for ARM */
IPC_DSP: o = IPC_DSP_START l = IPC_DSP_SIZE /* 16 bytes for DSP */
shared_ram: o = SHARED_IRAM_START l = SHARED_IRAM_SIZE /* Remaining IntRAM */
}
// ============================================================================
// Specify the Sections Allocation into Memory
// ============================================================================
SECTIONS
{
GROUP (NEAR_DP_RELATIVE)
{
.neardata
.rodata
.bss
} > DDR2
.cinit > DDR2 // Initialization Tables
.pinit > DDR2 // Constructor Tables
.init_array > DDR2
.const > DDR2 // Constant Data
.switch > DDR2 // Jump Tables
.text > DDR2 // Executable Code
.text:_c_int00: > 0xC3000000 // Entrypoint
.far > DDR2 // Far Global & Static Variables
.fardata > DDR2
.stack > DDR2 // Software System Stack
.sysmem > DDR2 // Dynamic Memory Allocation Area
.cio > DDR2 // C I/O Buffer
.vecs > DDR2 // Interrupt Vectors
}
1.3 程序烧写1.3.1 程序烧写到nand flashnand flash分区说明:
mtd0: 00020000 00020000 "u-boot env"
mtd1: 00080000 00020000 "UBL" --------------> 存放arm.ais镜像
mtd2: 00080000 00020000 "u-boot" --------------> 存放dsp.bin镜像
mtd3: 00400000 00020000 "kernel"
mtd4: 1fae0000 00020000 "filesystem"
烧写arm.ais和dsp.bin
Target# flash_eraseall /dev/mtd1 //擦除nand flash分区mtd1
Target# dd if=arm.ais of=/dev/mtdblock1 //烧写arm.ais到mtdblock1
Target# flash_eraseall /dev/mtd2 //擦除nand flash分区mtd2
Target# dd if=dsp.bin of=/dev/mtdblock2 //烧写dsp.bin到mtdblock2
1.3.2 程序烧写到spi flashspi flash分区说明:
mtd5: 00080000 00001000 "UBL" --------------> 存放arm.ais镜像
mtd6: 00070000 00001000 "U-Boot" --------------> 存放dsp.bin镜像
mtd7: 00010000 00001000 "U-Boot-Env"
mtd8: 00300000 00001000 "Kernel"
烧写arm.ais和dsp.bin
Target# flash_eraseall /dev/mtd5 //擦除spi flash分区
Target# dd if=arm.ais of=/dev/mtdblock5 //烧写arm.ais到mtdblock5
Target# flash_eraseall /dev/mtd6 //擦除spi flash分区
Target# dd if=dsp.bin of=/dev/mtdblock6 //烧写dsp.bin到mtdblock6
1.3.3 程序烧写到SD卡Target# dd if=ipc_polling.ais of=/dev/mmcblk0 seek=10 //烧写arm.ais
Target# dd if=ipc_polling.bin of=/dev/mmcblk0 seek=1034 //烧写dsp.bin
注:SD卡偏移的block单位为:512B。
1.4 交叉编译工具 本章节案例使用交叉编译工具为“arm-2009q1-161-arm-none-eabi”,安装文件在tools目录下,将其拷贝到Ubuntu的omapl138下,并在此安装包所在目录执行如下安装命令:
Host# ./arm-2009q1-161-arm-none-eabi.bin
后续详细帮助在官网
销售邮箱:sales@tronlong.com
技术邮箱:support@tronlong.com
创龙总机:020-8998-6280
技术热线:020-3893-9734
创龙官网:www.tronlong.com
技术论坛:www.51ele.net
线上商城:https://tronlong.taobao.com
TMS320C6748、OMAPL138交流群:227961486、324023586
TI中文论坛:http://www.deyisupport.com/
TI英文论坛:http://e2e.ti.com/
TI官网:www.ti.com
TI WIKI:http://processors.wiki.ti.com/