M3329D M3329F Application Porting Guide

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 8

M3329D/M3329F Application Porting Guide

1.0

2009-9-17

THIS DOCUMENT CONTAINS PROPRIETARY TECHNICAL INFORMATION WHICH IS THE PROPERTY


OF ALI CORPORATION AND SHALL NOT BE DISCLOSED TO OTHERS IN WHOLE OR IN PART,
REPRODUCED, COPIED, OR USED AS THE BASIS FOR DESIGN, MANUFACTURING, OR SALE OF
APPARATUS WITHOUT WRITTEN PERMISSION OF ALI CORPORATION

Guide of Porting Reference Code to Customer Board


Change History

Revision Issue Date Comments


1.0 2009-09-17 First release

Guide of Porting Reference Code to Customer Board


Contents
1 Introduction.................................................................................................................................................................1
2 Porting Guide..............................................................................................................................................................1
2.1 New Library and Plug In................................................................................................................................1
2.2 New Driver and MW Module In Open source............................................................................................1
2.3 Memory Mapping Modification for MPEG4 Player....................................................................................1
2.4 Modification In Root.c....................................................................................................................................2
2.5 Header File Need Added and Updated.......................................................................................................3
2.6 MPEG4 Porting Guide...................................................................................................................................4

Guide of Porting Reference Code to Customer Board


1 Introduction
This document describ how to porting Application to M3329D/M3329F SDK package. This description
mainly focus on the difference between M3329D/M3329F and M3329E. So, the reader of this document
should know the every detail about M3329E Application Porting.

2 Porting Guide

2.1 New Library and Plug In


Main code: lib
Updated:
boot.o, libcore.a, libplus.a

New added
Libyamadhw.a
Libplus29d.a

Replaced::
For M3329D/F: libyamad.a -> libyamadhw.a
For M3329D/F: libplus.a->libplus29d.a

Main code plug in:


New added:
LIB_PE_VIDEO_ENGINE_AVI.o
LIB_PE_VIDEO_MPEG_S.o
MP4_XXX.o(Depends on Audio supported License)
Bootloader:
Updated:
Boot33.o, boot33os.o, libboot.a, libbootos.a

2.2 New Driver and MW Module In Open source


Updated:
LLD_STO_FLASH,
LLD_NIM_S,
LLD_SMARTCARD
BUS_I2C_SCB
BUS_SCI_UART
FS_MAIN

New added:
BUS_SPE_M33
LLD_VENC_IMG

2.3 Memory Mapping Modification for MPEG4 Player


/*********************MPEG4 memory mapping, start from 0x1000000****************************/

#define SYSTEM_BUF_BLOCK_SIZE 2324


#define SYSTEM_BUF_MAX_BLOCK 4

Guide of Porting Reference Code to Customer Board 1


#ifndef MPEG4_HD_SUPPORT
#define MPEG4_MAX_WIDTH 736//1920
#define MPEG4_MAX_HEIGHT 576//1088
#define MPEG4_TOTAL_LEN 0x7A4000//0x7A3FA8 //15b92a8
#else
#define MPEG4_MAX_WIDTH 1920
#define MPEG4_MAX_HEIGHT 1088
#define MPEG4_TOTAL_LEN 0x15da000 //0x14b92a8+0x120000 = 0x15d92a8
#endif
#define MPEG4_BASE_ADDR ((__MM_OSD_BLOCK_ADDR - MPEG4_TOTAL_LEN)&0XFFFFFFF0)

#define __MM_HEAP_TOP_ADDR ((MPEG4_BASE_ADDR > __MM_MP_BUFFER_ADDR)?


__MM_MP_BUFFER_ADDR:MPEG4_BASE_ADDR)
/*Heap will depends on the large ones*/

Difference between 16M & 32M solution

16M solution do not support PIP,and picture size and mpeg resolution is smaller than 32M
solution.The difference is as following:

#if(SYS_RAM_SIZE == 16)//16M RAM solution


#define PIP_DISABLE
#define __MM_MP_BUFFER_LEN ((__MM_DMX_REC_START_ADDR -
__MM_PVR_VOB_BUFFER_ADDR)&0XFFFFFF00)
#define MPEG4_MAX_WIDTH 736//1920
#define MPEG4_MAX_HEIGHT 576//1088
#define MPEG4_TOTAL_LEN 0x7A5000
#else
#define __MM_MP_BUFFER_LEN (0xb00000)
#define MPEG4_MAX_WIDTH 1920
#define MPEG4_MAX_HEIGHT 1088
#define MPEG4_TOTAL_LEN 0x15da000 //0x14b92a8+0x120000 = 0x15d92a8
//Media player buffer enlarged for HD MPEG4 decode and large scale pictures
#endif

2.4 Modification In Root.c


New added:
1. PDD_Init() //For power down enable

Deleted:
1.Flash driver software protection disabled.
chunk_id = 0x02FD0100;/*The id of chunk after maincode*/
chunk_init(SYS_FLASH_BASE_ADDR,SYS_FLASH_SIZE);
p_offset = chunk_goto(&chunk_id,0xFFFFFFFF,1);
p_offset = p_offset - SYS_FLASH_BASE_ADDR;
if((UINT32)p_offset < SYS_FLASH_SIZE)
{
//libc_printf("Protected address %x:%x\n",p_offset,SYS_FLASH_SIZE);
sto_flash_soft_protect(p_offset,SYS_FLASH_SIZE);
}

Updated
1. Snd_m33_attach() //Parameter change to enable HW Xlator.

Guide of Porting Reference Code to Customer Board 2



snd_config.output_config.enable_hw_accelerator = TRUE;
snd_m33_attach(&snd_config);

2.Osd_m33_attch() - > osd_m33f_attach()
OSD_DRIVER_CONFIG osd_c_config;

MEMSET((void *)&osd_c_config,0,sizeof(OSD_DRIVER_CONFIG));
osd_c_config.uMemBase = __MM_OSD_START_ADDR;
osd_c_config.uMemSize = __MM_OSD_LEN;
osd_c_config.bStaticBlock = TRUE;
osd_c_config.bDirectDraw = FALSE;
osd_c_config.bCacheable = TRUE;
osd_c_config.bVFilterEnable = FALSE; // if use hw PIP, enable it
osd_c_config.bP2NScaleInNormalPlay = TRUE;
osd_c_config.bP2NScaleInSubtitlePlay = TRUE;
osd_c_config.uDViewScaleRatio[OSD_PAL][0] = 384;
osd_c_config.uDViewScaleRatio[OSD_PAL][1] = 510;
osd_c_config.uDViewScaleRatio[OSD_NTSC][0] = 384;
osd_c_config.uDViewScaleRatio[OSD_NTSC][1] = 426;
osd_c_config.af_par[0].id = 0;
osd_c_config.af_par[0].vd = 1;
osd_c_config.af_par[0].af = 1;
osd_m33f_attach("OSD_M33F_0",&osd_c_config);

MEMSET((void *)&osd_c_config,0,sizeof(OSD_DRIVER_CONFIG));
osd_c_config.uMemBase = __MM_OSD_START_ADDR + __MM_OSD_LEN;
osd_c_config.uMemSize = __MM_OSD_LEN;
osd_c_config.bStaticBlock = TRUE;
osd_c_config.bDirectDraw = FALSE;
osd_c_config.bCacheable = TRUE;
osd_c_config.bVFilterEnable = FALSE; // if use hw PIP, enable it
osd_c_config.bP2NScaleInNormalPlay = TRUE;
osd_c_config.bP2NScaleInSubtitlePlay = TRUE;
osd_c_config.uDViewScaleRatio[OSD_PAL][0] = 384;
osd_c_config.uDViewScaleRatio[OSD_PAL][1] = 510;
osd_c_config.uDViewScaleRatio[OSD_NTSC][0] = 384;
osd_c_config.uDViewScaleRatio[OSD_NTSC][1] = 426;
osd_c_config.af_par[0].id = 0;
osd_c_config.af_par[0].vd = 1;
osd_c_config.af_par[0].af = 1;
osd_m33f_attach("OSD_M33F_1",&osd_c_config);
3, CI unsupported in M3329D.

2.5 Modification in Bootloader


Updated
1.Osd_m33_attch_min() - > osd_m33f_attach_mini()
OSD_DRIVER_CONFIG osd_c_config;

MEMSET((void *)&osd_c_config,0,sizeof(OSD_DRIVER_CONFIG));
osd_c_config.uMemBase = __MM_OSD_START_ADDR;
osd_c_config.uMemSize = __MM_OSD_LEN;
osd_c_config.bStaticBlock = TRUE;
osd_c_config.bDirectDraw = FALSE;
osd_c_config.bCacheable = TRUE;
osd_c_config.bVFilterEnable = FALSE; // if use hw PIP, enable it

Guide of Porting Reference Code to Customer Board 3


osd_c_config.bP2NScaleInNormalPlay = TRUE;
osd_c_config.bP2NScaleInSubtitlePlay = TRUE;
osd_c_config.uDViewScaleRatio[OSD_PAL][0] = 384;
osd_c_config.uDViewScaleRatio[OSD_PAL][1] = 510;
osd_c_config.uDViewScaleRatio[OSD_NTSC][0] = 384;
osd_c_config.uDViewScaleRatio[OSD_NTSC][1] = 426;
osd_c_config.af_par[0].id = 0;
osd_c_config.af_par[0].vd = 1;
osd_c_config.af_par[0].af = 1;
osd_m33f_attach_mini("OSD_M33F_0",&osd_c_config);

2.6 Header File Need Added and Updated

Module Update New added Reasons


Libcore.a /bus/usb2/usb.h IC HW change.
/hld/smc/smc.h
/hld/smc/smc.h
/hld/snd/snd.h
/hld/decv/decv.h
/hld/dis/vpo.h
/hld/osd/osddrv.h osddrv_dev.h
/hld/venc/venc.h venc_dev.h
Libplus29d.a /libstorage/libfs2/fs_main.c /libfs2/fs_main.h To support MPEG4 Media
/libpvr/lib_pvr.h Player
/libvfs/vfs.h
/libfs2/errno.h
Libplus.a /libpvr/lib_pvr.h 1 PVR part, api
/libmp/pe.h <pvr_attach()> param
be changed, lib_pvr.h
need match the
libplus.a!
MP part, structure
pe_config be named
PeConfig now, so pe.h
need match the
libplus.a
ML Open /libpub/lib_frontend.h Libpub bug fixing and arch
/libpub/lib_pub.h fine tune.
Source
Driver Open /hld/net/net.h For ethernet Application.
Source /hld/net/w5300_socket.h

2.7 MPEG4 Porting Guide


1. Memory mapping changed:
Please refer to 2.5

2. Plug-in added
Updated ldscript_29d.ld to support plug-in mode.
LIB_PE_VIDEO_ENGINE_AVI.o (For playing mpeg4 stream. Please put it in sdk\plugin)
LIB_PE_VIDEO_MPEG_S.o (For playing old mpeg2 stream. Please put it in sdk\plugin)

3. C Files updated

Guide of Porting Reference Code to Customer Board 4


Updated C File Reasons
Win_mpeg_player.c Add subtitle display.
Decreases refresh time to save CPU resource.
Add multi-audio menu.
Add multi-subtitle menu.
Win_audio.c Add change audio track for multi-audio avi file.
Win_subtitle.c Add change language track for multi-language
subtitle.
Mp_udisk.c Display avi file in file list.
Pe.c Add pe_cache initialize.
Pe_cache.c Enhanced pe_cahe to speed up transfer data to
mpeg4 player.

Guide of Porting Reference Code to Customer Board 5

You might also like