]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Documentation/ArmVExpressInstructions.txt
Add ArmPlatformPkg from ARM Ltd. patch.
[mirror_edk2.git] / ArmPlatformPkg / Documentation / ArmVExpressInstructions.txt
1 =======================================
2 = ARM Versatile Express Documentation =
3 =======================================
4
5 Status
6 ------
7 Build and Run on EDK2 Subversion revision 11251
8 Requirements
9 - RVCTv3 (untested) or RVCTv4 or ARMGCC (Code Sourcery q201009)
10 - Using Ubuntu: gcc, make, uuid-dev
11 - Using Cygwin: gcc, make, e2fsprogs (needed for uuid.h)
12
13 Serial Terminal settings
14 - Baud Rates: 38400
15 - Data: 8 bit
16 - Parity: None
17 - Flow Control: None
18
19
20 Use ICE debugger with Versatile Express
21 ---------------------------------------
22 Prior to use ICE debugger with Versatile Express, you will need to update the version of the ICE's firmware.
23 If you have not installed RealView 4.0 SP3, do it.
24 Open "RealView ICE Update" and "Install Firmware Update ...". Install "[ARM_INSTALL_PATH]\RVI\Firmware\3.4\11\ARM-RVI-3.4.0-25-base.rvi" and "[ARM_INSTALL_PATH]\RVI\Firmware\3.4\22\ARM-RVI-3.4.59-59-patch.rvi".
25
26
27 Howto build UEFI Versatile Express
28 ----------------------------------
29 For Cygwin
30 ----------
31
32 For the first time
33 ******************
34 1. Get EDK2 from Tianocore Subversion repository
35 svn co https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2 edk2 --username guest
36
37 2. Get FatPkg from EDK2 SVN repository:
38 cd edk2
39 svn co https://edk2-fatdriver2.svn.sourceforge.net/svnroot/edk2-fatdriver2/trunk/FatPkg FatPkg --username guest
40
41 3. Set up the environment. And build the EDK2\92s tools
42 export EDK_TOOLS_PATH=`pwd`/BaseTools
43 . edksetup.sh `pwd`/BaseTools/
44 make -C $EDK_TOOLS_PATH
45
46 4. Build the ARM Versatile Express UEFI Firmware
47 build -a ARM -p ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc -t RVCTCYGWIN
48
49 5. Edit the ARM Versatile Express configuration file config.txt to declare the location of the UEFI firmware in NOR Flash
50 TOTALIMAGES: 5 ;Number of Images (Max : 32)
51 NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
52 NOR0ADDRESS: BOOT ;Image Flash Address
53 NOR0FILE: \SOFTWARE\bm_v209.axf ;Image File Name
54 NOR1UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE
55 NOR1ADDRESS: 44000000 ;Image Flash Address
56 NOR1FILE: \SOFTWARE\sec_uefi.bin ;Image File Name
57 NOR1LOAD: 0 ;Image Load Address
58 NOR1ENTRY: 0 ;Image Entry Point
59 NOR2UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE
60 NOR2ADDRESS: 45000000 ;Image Flash Address
61 NOR2FILE: \SOFTWARE\uefi.bin ;Image File Name
62 NOR2LOAD: 45000000 ;Image Load Address
63 NOR2ENTRY: 45000000 ;Image Entry Point
64 NOR3UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE
65 NOR3ADDRESS: 46000000 ;Image Flash Address
66 NOR3FILE: \SOFTWARE\kernel.bin ;Image File Name
67 NOR3LOAD: 46000000 ;Image Load Address
68 NOR3ENTRY: 46000000 ;Image Entry Point
69 NOR4UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE
70 NOR4ADDRESS: 40000000 ;Image Flash Address
71 NOR4NAME: BOOTSCRIPT ;Image Name
72 NOR4FILE: \SOFTWARE\bootscr.txt ;Image File Name
73
74 6. To select second NOR Flash as a booting device, replace in the ARM Versatile Express file \SITE1\HBI0191B\board.txt:
75 SCC: 0x004 0x00001F09
76 By:
77 SCC: 0x004 0x10001F09
78
79 7. Copy Build/ArmVExpress-CTA9x4/DEBUG_RVCTCYGWIN/FV/SEC_ARMVEXPRESS_EFI.fd to the ARM Versatile Express mass storage (available when the board is connected through USB to your host machine) under the folder SOTWARE and name sec_uefi.bin. Example for cygwin:
80 cp Build/ArmVExpress-CTA9x4/DEBUG_RVCTCYGWIN/FV/SEC_ARMVEXPRESS_EFI.fd /cygdrive/e/SOFTWARE/sec_uefi.bin
81
82 8. Start the ARM Versatile Express board. You should read \93Waiting for firmware at 0x80000000 ...\94 on the serial port.
83
84 9. Copy ARMVEXPRESS_EFI.fd at 0x80000000 with RealView Debugger
85 readfile,raw,nowarn "[EDK2_PATH]\Build\ArmVExpress-CTA9x4\DEBUG_RVCTCYGWIN\FV\ARMVEXPRESS_EFI.fd"=0x80000000
86
87 10. Resume the execution from RealView Debugger
88
89 For all subsequent times
90 ************************
91 1. Build ARM Versatile Express UEFI Firmware
92 build -a ARM -p ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc -t RVCTCYGWIN
93
94 2. Start the ARM Versatile Express board. You should read \93Waiting for firmware at 0x80000000 ...\94 on the serial port.
95
96 3. Copy ARMVEXPRESS_EFI.fd at 0x80000000 with RealView Debugger
97 readfile,raw,nowarn "[EDK2_PATH]\Build\ArmVExpress-CTA9x4\DEBUG_RVCTCYGWIN\FV\ARMVEXPRESS_EFI.fd"=0x80000000
98
99 4. Resume the execution
100
101
102 For RealView Compiler Toolchain on Windows
103 ------------------------------------------
104 The command line window needs to be the one from Visual Studio to get the environment variables required to get some development tools (the windows compiler for BaseTools and `nmake`).
105 The EDK2 toolchain name for ARM RealView Compiler Toolchain under a Windows environment is `RVCT`. The EDK2 build system will automatically pick up the RVCT toolchain defined in your PATH. If you want to use a specific version, set the environment variable 'RVCT_TOOLS_PATH':
106 set RVCT_TOOLS_PATH=[YOUR_TOOLCHAIN_PATH]
107
108
109 For RealView Compiler Toolchain on Linux
110 ----------------------------------------
111 The EDK2 toolchain name for ARM RealView under a Linux environment is `RVCTLINUX`. The EDK2 build system will automatically pick up the RVCT toolchain defined in your PATH. If you want to use a specific version, set the environment variable 'RVCT_TOOLS_PATH':
112 export RVCT_TOOLS_PATH=[YOUR_TOOLCHAIN_PATH]
113
114
115 For ARM GNU GCC on Linux
116 ------------------------
117 The EDK2 toolchain name for ARM RealView under a Linux environment is `ARMGCC`. EDK2 requires Bash Shell to be built on Linux.
118 The ARMGCC toolchain is expected to be found in your PATH. ARM Edk2 has been tested with 'CodeSourcery G++ Lite 2010.09-51 - EABI Version'.
119 If you decide to use a specific version, set the environment variable 'ARMGCC_TOOLS_PATH':
120 export ARMGCC_TOOLS_PATH=[YOUR_CODESOURCERY_TOOLCHAIN_PATH]
121 Example:
122 export ARMGCC_TOOLS_PATH=/Work/arm-2010.09/bin/
123 Compiling UEFI ArmVE as a standalone firmware
124 The full ArmVe UEFI firmware can be written into NOR Flash to allow the entire boot sequence to be done after a cold boot.
125
126
127 To support the standalone mode:
128 -------------------------------
129 build -a ARM -p ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc -t RVCTCYGWIN -D EDK2_ARMVE_STANDALONE=1
130 ARMVEXPRESS_EFI.fd is required to be copied into the ARM Versatile Express board:
131 cp Build/ArmVExpress-CTA9x4-Standalone/DEBUG_RVCTCYGWIN/FV/SEC_ARMVEXPRESS_EFI.fd /cygdrive/e/SOFTWARE/sec_uefi.bin
132 cp Build/ArmVExpress-CTA9x4-Standalone/DEBUG_RVCTCYGWIN/FV/ARMVEXPRESS_EFI.fd /cygdrive/e/SOFTWARE/uefi.bin
133
134
135 Trustzone Support
136 -----------------
137 ArmVE's UEFI supports booting Trustzone (two worlds: Secure and Normal Worlds) and No Trustzone (one world: the CPU remains in Secure World) supports. Trustzone support is enabled by Enabling SMC TZASC in the Test Chip SCC Register 1. This register can only be changed by editing the configuration file of your Versatile Express board: E:\SITE1\HBI0191B\board.txt Changing:
138 SCC: 0x004 0x10001F09
139 For:
140 SCC: 0x004 0x10003F09
141
142
143 Booting Linux
144 -------------
145 ArmVe's BDS expects a Linux kernel at 0x46000000 (2nd NOR Flash). This location is also defined in the config.txt file of the motherboard (same file as the one that defines UEFI firmwares location). The Linux kernel at this location is a copy of \SOFTWARE\kernel.bin as refered in config.txt.
146 To boot on a different kernel, you will need to edit [EDK2_ROOT]\ArmVePkg\Bds\BdsEntry.c
147 #define LINUX_KERNEL L"VenHw(02118005-9DA7-443a-92D5-781F022AEDBB)/MemoryMapped(0,0x46000000,0x462F0000)"
148 #define FDT 0
149 #define LINUX_ATAG "rdinit=/bin/ash debug earlyprintk console=ttyAMA0,38400 mem=1G"
150 The macros LINUX_KERNEL and FDT expect a UEFI Device Path.
151
152 Example of UEFI Device Path:
153
154 // Load FDT binary from the Firmware Volume (mapped at 0x80000000)
155 #define LINUX_KERNEL L"MemoryMapped(11,0x80000000,0x6FEFFFFF)\\zImage.fdt"
156
157 // Linux Kernel from a SD Card
158 #define LINUX_KERNEL L"VenHw(621B6FA5-4DC1-476F-B9D8-52C557D81070)/HD(1,MBR,0x00000000,0xF9,0x3C8907)\\boot\\zImage.fdt"
159
160 // Kernel from SATA HD - Partition 2
161 #define LINUX_KERNEL L"Acpi(PNP0A03,0)/Pci(0|0)/Pci(0|0)/Pci(5|0)/Pci(0|0)/Sata(0,0,0)/HD(2,MBR,0x00076730,0x1F21BF,0x1F21BF)\\boot\\zImage.fdt"
162
163 // Kernel from NOR Flash
164 #define LINUX_KERNEL L"VenHw(02118005-9DA7-443a-92D5-781F022AEDBB)/MemoryMapped(0,0x46000000,0x462F0000)"
165
166
167 UEFI Memory Maps for ARM Versatile Express
168 ------------------------------------------
169 Figure 1: EFI Memory Map in the Temporary Memory
170 See ArmVExpressMemoryMaps_TemporaryMemoryMap.png
171
172 Figure 2: CPU Core stack in the Temporary Memory
173 See ArmVExpressMemoryMaps_TemporaryStack.png
174
175 Figure 3: EFI Memory Map in the Permanent Memory
176 See ArmVExpressMemoryMaps_PermanentMemoryMap.png