-
Notifications
You must be signed in to change notification settings - Fork 7
/
init.resc
39 lines (31 loc) · 1.1 KB
/
init.resc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
:name: Zynq-7000 SoC
:description: This script runs Linux on Zynq-7000 SoC.
using sysbus
$name?="Zynq"
mach create $name
machine LoadPlatformDescription @action/device/zynq_7000/platform.repl
showAnalyzer uart0
sysbus Redirect 0xC0000000 0x0 0x10000000
$bin?=@images/vmlinux
$rootfs?=@images/rootfs.cpio
$dtb?=@images/zynq-test.dtb
# Set timer frequency
ttc0 Frequency 33333333
ttc1 Frequency 33333333
# rootfs
machine LoadPlatformDescriptionFromString 'virtio: Storage.VirtIOBlockDevice @ sysbus 0xe0104000 { IRQ -> gic@63 }'
virtio LoadImage @images/rootfs.img true
# This setting increases emulation speed, thus mitigates networks errors and speedup user scripts.
machine SetAdvanceImmediately true
# Set registers
cpu SetRegisterUnsafe 0 0x000
cpu SetRegisterUnsafe 1 0xD32 # processor variant (cortex-a9)
cpu SetRegisterUnsafe 2 0x100 # device tree address
macro reset
"""
sysbus LoadELF $bin
sysbus LoadFdt $dtb 0x100 "console=ttyPS0,115200 root=/dev/ram0 rw init=/init initrd=0x1a000000,32M" false
sysbus ZeroRange 0x1a000000 0x800000
sysbus LoadBinary $rootfs 0x1a000000
"""
runMacro $reset