|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-57989FF8-5E8F-4C8A-9D38-169AFCA4C078" xml:lang="en"><title>Baseport Template Implementation Guide</title><shortdesc>Describes the use of the Baseport Template in porting Symbian |
|
13 platform.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-36D13F9C-CD44-4153-A195-CCFB4EBFAD90-GENID-1-2-1-10-1-5-1-4-1-1-6-1-3-1-3-1"><title>General |
|
15 procedure</title> <p>The Baseport Template is a minimal |
|
16 baseport for the Symbian platform that implements the basic functionality |
|
17 of a baseport without supplying any hardware specific code. It provides |
|
18 a skeleton of a working baseport, which base porters can modify in |
|
19 accordance with the instructions in the comments. Porting involves |
|
20 abstraction from hardware and must be performed in a set sequence |
|
21 (for example, the abstraction in the drivers depends on previous abstraction |
|
22 in HAL which depends on previous abstraction in ASIC and so on). Many |
|
23 of the header files are not in the Baseport Template files but are |
|
24 held elsewhere in the code base, for example,<filepath> ..\e32\include\kernel\arm\</filepath></p> </section> |
|
25 <section id="GUID-36D13F9C-CD44-4153-A195-CCFB4EBFAD90-GENID-1-2-1-10-1-5-1-4-1-1-6-1-3-1-3-2"><title>File |
|
26 structure</title> <p>The files which make up the Baseport |
|
27 Template are divided between two directories, ASSP and Variant containing |
|
28 two classes of the same names. This division represents a fundamental |
|
29 feature of the kernel architecture which you are recommended to retain |
|
30 in your implementation of the port. The baseport involves implementing |
|
31 functions to run on the target hardware, but it is useful to distinguish |
|
32 between functionality specific to the CPU (ARM etc) and functionality |
|
33 specific to peripherals with their own processors. ASSP functions |
|
34 must be implemented in accordance with the device hardware, while |
|
35 Variant functions correspond to off chip peripherals. The distinction |
|
36 is not absolutely mandatory (it is possible just to provide a Variant |
|
37 layer) but strongly recommended and assumed in many other areas of |
|
38 the porting process.</p><p>A port with an ASSP/Variant architecture |
|
39 is implemented with two C++ classes and two <filepath>.mpp</filepath> files.</p><ul> |
|
40 <li><p><filepath>...\template_assp\assp.cpp</filepath></p></li> |
|
41 <li><p><filepath>...\template_assp\katemplate.mmp</filepath></p></li> |
|
42 <li><p><filepath>...\template_variant\specific\variant.cpp</filepath></p></li> |
|
43 <li><p><filepath>...\template_variant\vtemplate.mmp</filepath></p></li> |
|
44 </ul><p>For more information see the Base Porting Guide.</p> |
|
45 </section> |
|
46 <section id="GUID-36D13F9C-CD44-4153-A195-CCFB4EBFAD90-GENID-1-2-1-10-1-5-1-4-1-1-6-1-3-1-3-3"><title>Bootstrap</title> <p>The bootstrap is the code that runs after a hardware |
|
47 reset, to initialize the basic system services that enable the kernel |
|
48 to run. Parts of it must be written in assembler (either GNU or ARM) |
|
49 and are specific to the device hardware, while others are written |
|
50 in C++ and are automatically translated into assembler. Bootstrap |
|
51 is implemented as the <filepath>bootstrap/template.s</filepath> file.</p><p>This is supplied as an example only: implementation is entirely |
|
52 dependent on the target hardware.</p><p>For more information see the <xref href="GUID-0C84FD76-87B2-4AD1-B23A-2C5C8668BC4C.dita">Base Porting Guide</xref>.</p> </section> |
|
53 <section id="GUID-36D13F9C-CD44-4153-A195-CCFB4EBFAD90-GENID-1-2-1-10-1-5-1-4-1-1-6-1-3-1-3-4"><title>Interrupt |
|
54 dispatcher</title> <p>The Symbian platform is a real time |
|
55 interrupt driven operating system. To port it you need to determine |
|
56 the number and function of the interrupts in your port and implement |
|
57 the interrupt dispatcher to handle them. Interrupt service routines |
|
58 (ISRs) are held in an array of class <xref href="GUID-2C9B6510-D045-3FA1-AD65-B544E30D34C7.dita"><apiname>SInterruptHandler</apiname></xref> as a member of the <xref href="GUID-5E593C59-BA22-3B70-AAFB-BFE19E22538A.dita"><apiname>TemplateInterrupt</apiname></xref> class defined |
|
59 in <filepath>template_assp_priv.h</filepath>. ISRs are associated |
|
60 with individual interrupt sources defined in the ASSP layer by functions |
|
61 of the Interrupt class such as <xref href="GUID-8DAB6465-BCDE-35FE-8C31-861C13A34526.dita"><apiname>Bind()</apiname></xref> and <xref href="GUID-EAED145E-E4BE-3A0F-BC25-78E1FC13FB55.dita"><apiname>Unbind()</apiname></xref>.</p><ul> |
|
62 <li><p><filepath>...\template_assp\template_assp_priv.h</filepath></p></li> |
|
63 <li><p><filepath>...\template_assp\interrupts.cpp</filepath></p></li> |
|
64 </ul> <p>For more information see the <xref href="GUID-0C84FD76-87B2-4AD1-B23A-2C5C8668BC4C.dita">Base Porting Guide</xref>.</p> </section> |
|
65 <section id="GUID-36D13F9C-CD44-4153-A195-CCFB4EBFAD90-GENID-1-2-1-10-1-5-1-4-1-1-6-1-3-1-3-5"> |
|
66 <title>ASIC</title> <p>The <xref href="GUID-A83A7C3C-7DC0-3B9C-842F-70FCC751365D.dita"><apiname>Asic</apiname></xref> class |
|
67 contains initialization functions which must be called early in the |
|
68 boot process. <xref href="GUID-E73C682E-5824-3C9C-9F98-D99D57473584.dita"><apiname>ASSP</apiname></xref> is derived from <xref href="GUID-A83A7C3C-7DC0-3B9C-842F-70FCC751365D.dita"><apiname>Asic</apiname></xref> and <xref href="GUID-E769B916-E743-3955-B897-07B6DA1C7D1E.dita"><apiname>Variant</apiname></xref> from the ASSP derivation.</p><ul> |
|
69 <li><p><filepath>...\template_assp\template_assp.h</filepath></p></li> |
|
70 <li><p><filepath>...\template_assp\template_assp.cpp</filepath></p></li> |
|
71 </ul> <p>For more information see the <xref href="GUID-0C84FD76-87B2-4AD1-B23A-2C5C8668BC4C.dita">Base Porting Guide</xref>.</p> </section> |
|
72 <section id="GUID-36D13F9C-CD44-4153-A195-CCFB4EBFAD90-GENID-1-2-1-10-1-5-1-4-1-1-6-1-3-1-3-6"> |
|
73 <title>HAL</title> <p>The <xref href="GUID-BD00E7FC-C234-3111-87A5-10F79EB0F2B8.dita"><apiname>HAL</apiname></xref> class |
|
74 abstracts items of hardware specific functionality. You must implement |
|
75 functions to get and set hardware specific attributes in accordance |
|
76 with the hardware used on the target device. The attributes are defined |
|
77 in <filepath>config.hcf</filepath> and <filepath>values.hda</filepath> configuration files.</p><ul> |
|
78 <li><p><filepath>...\template_variant\hal\config.hcf</filepath></p></li> |
|
79 <li><p><filepath>...\template_variant\hal\values.hda</filepath></p></li> |
|
80 </ul><p>The attributes are modified by get and set functions called |
|
81 HAL handlers defined in the relevant hardware drivers.</p><p>For more |
|
82 information see the <xref href="GUID-0C84FD76-87B2-4AD1-B23A-2C5C8668BC4C.dita">Base Porting Guide</xref>.</p> </section> |
|
83 <section id="GUID-36D13F9C-CD44-4153-A195-CCFB4EBFAD90-GENID-1-2-1-10-1-5-1-4-1-1-6-1-3-1-3-7"> |
|
84 <title>Drivers</title> <p>The rest of the work involves |
|
85 porting drivers. A typical implementation would include these drivers:</p><ul> |
|
86 <li><p>DMA Framework <ul> |
|
87 <li><p><filepath>...\template_assp\dmapsl.cpp</filepath></p></li> |
|
88 <li><p><filepath>...\template_assp\dma.mpp</filepath></p></li> |
|
89 </ul></p></li> |
|
90 <li>Digitizer Driver <p><ul> |
|
91 <li><p><filepath>...\template_variant\specific\xyin.cpp</filepath></p></li> |
|
92 <li><p><filepath>...\template_variant\exxytemplate.mmp</filepath></p></li> |
|
93 </ul></p></li> |
|
94 <li>Keyboard Driver <p><ul> |
|
95 <li><p><filepath>...\template_variant\exkey_inttemplate.mmp</filepath></p></li> |
|
96 <li><p><filepath>...\template_variant\specific\keyboard_interrupt.cpp</filepath></p></li> |
|
97 </ul></p></li> |
|
98 <li>LCD Extension <p><ul> |
|
99 <li><p><filepath>...\template_variant\specific\lcd.cpp</filepath></p></li> |
|
100 <li><p><filepath>...\template_variant\exlcdtemplate.mmp</filepath></p></li> |
|
101 </ul></p></li> |
|
102 <li>Serial Port Driver <p><ul> |
|
103 <li><p><filepath>...\template_variant\specific\uart.cpp</filepath></p></li> |
|
104 <li><p><filepath>...\template_variant\datxtemplate.mmp</filepath></p></li> |
|
105 </ul></p></li> |
|
106 <li>Sound Driver <p><ul> |
|
107 <li><p><filepath>...\template\template_variant\specific\soundsc_rx.cpp</filepath> </p></li> |
|
108 <li><p><filepath>...\template\template_variant\specific\soundsc_tx.cpp</filepath> </p></li> |
|
109 <li><p><filepath>...\template\template_variant\soundsctemplate.mmp</filepath> </p></li> |
|
110 </ul></p></li> |
|
111 <li>USB Client Driver Technology<p><ul> |
|
112 <li><p><filepath>...\template_assp\pa_usbc.cpp</filepath></p></li> |
|
113 <li><p><filepath>...\template_assp\usbcc.mmp</filepath></p></li> |
|
114 </ul></p></li> |
|
115 </ul> </section> |
|
116 </conbody></concept> |