(toppers-users 4495) Re: Android up and running on Xilinx ZC702, a few safeG questions

Daniel Sangorrin daniel.sangorrin @ gmail.com
2016年 1月 22日 (金) 21:04:08 JST


Hi Jonathan,

I'm glad that you were able to complete the installation of Android
on the ZC702.

I think you may be a bit confused about the booting process of SafeG.
I'll explain it in sequential steps as they are executed.

1.- BOOT.bin: this actually contains several binaries and optionally
an FPGA design. For our purposes the most important thing to know is
that it contains u-boot, the bootloader. From the u-boot prompt you
need to load the following binaries into memory:

 mmcinfo
 fatload mmc 0 0x8000 zImage
 fatload mmc 0 0x1000000 devicetree.dtb
 fatload mmc 0 0x800000 ramdisk8M.image.gz
 fatload mmc 0 0x1c000000 monitor.bin
 fatload mmc 0 0x1c100000 fmp_t_com.bin
 go 0x1c000000

2.- monitor.bin: as you can see above, the SafeG monitor (monitor.bin)
is the next executed binary. SafeG performs a software and hardware
(Trustzone) initialization and then hands over the execution to the
real-time operating system (RTOS) which in this case is TOPPERS FMP.

3.- fmp_t_com.bin: this is the RTOS FMP which contains a demo
application for using the shared memory. It also contains a background
task that, when the RTOS becomes idle, calls the SafeG monitor to
switch to the non-trust side (Linux)

4.- zImage: finally Linux starts booting, it parses the device tree
for registering hardware device drivers (and to obtain its boot
parameters in this case) and mounts the filesystem (the ramdisk
image).

To summarize, on your working Android installation you should only
need to replace the following two binaries, and add monitor.bin and
fmp_t_com.bin from the prebuilt package:

- devicetree.dtb: update the memory description on your device tree
(e.g.: zynq-zc702.dts) as in
safeg-1.0/patches/target/zynq/devicetree.dts so that Linux can only
use memory from 0x00000000 to 0x1b000000. Also specify the ramdisk
location in the boot parameters (initrd=0x800000,8M ) if necessary.

memory {
device_type = "memory";
reg = <0x00000000 0x1b000000>;
};

$ make ARCH=arm CROSS_COMPILE=xxxx- dtbs <-- use this to generate the
devicetree.dtb again and copy it to your SDCard.

- zImage: you need to patch your Android kernel sources with the
patches at safeg-1.0/patches/target/zynq. (2_NS_linux_com.patch is
optional, so start with 1_NS_linux_base.patch).
Unless your Android kernel version is close to the one for that patch
(3.6.6), you will probably have conflicts when trying to apply it
directly. Instead of doing that, try to apply it manually by
inspecting the modifications and copy&pasting them into your kernel
sources.

Thanks,
Daniel


On Fri, Jan 22, 2016 at 5:39 AM, Jonathan Sherman
<jonmsherman08 @ gmail.com> wrote:
> Dear Daniel,
>
> I have successfully installed Android (Gingerbread 2.3) on my Xilinx ZC702
> board.  The next step seems tricky, so whats currently on my SD card for
> android is BOOT.bin,devicetree.dtb,zImage,ramdisk8M.image.gz,root.img, and
> startup.sh, do I just add the monitor.bin, and fmp.bin, and replace the
> BOOT.bin with safeG's BOOT.bin? I'm also assuming I keep Android's
> devicetree.dtb, I guess I'm confused on what to do next once I have Android
> running on the board.
>
> Thanks,
>
> Jonathan Sherman