1#!/bin/sh -eu 2# 3# Copyright 2019 The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16# 17 18tmp="$(mktemp -d)" 19trap "rm -rf $tmp" EXIT 20mkfifo $tmp/port 21 22"$MODEL_BIN" \ 23 -C bp.secureflashloader.fname="$ANDROID_PRODUCT_OUT/boot/bl1.bin" \ 24 -C bp.flashloader0.fname="$ANDROID_PRODUCT_OUT/boot/fip.bin" \ 25 -C cluster0.cpu0.semihosting-cwd="$ANDROID_PRODUCT_OUT/boot" \ 26 -C bp.virtioblockdevice.image_path="$ANDROID_PRODUCT_OUT/system-qemu.img" \ 27 -C bp.mmc.p_mmc_file="$ANDROID_PRODUCT_OUT/userdata.img" \ 28 -C bp.secure_memory=0 \ 29 -C cache_state_modelled=0 \ 30 -C bp.pl011_uart0.unbuffered_output=1 \ 31 -C bp.pl011_uart0.out_file="$ANDROID_PRODUCT_OUT/uart0.log" \ 32 -C bp.pl011_uart1.out_file="$ANDROID_PRODUCT_OUT/uart1.log" \ 33 -C bp.terminal_0.terminal_command="echo %port > $tmp/port" \ 34 -C bp.terminal_1.start_telnet=0 \ 35 -C bp.ve_sysregs.mmbSiteDefault=0 \ 36 -C bp.ve_sysregs.exit_on_shutdown=1 \ 37 -C bp.virtio_net.hostbridge.userNetworking=1 \ 38 -C bp.virtio_net.hostbridge.userNetPorts=5555=5555 \ 39 -C bp.virtio_net.enabled=1 \ 40 -C cluster0.NUM_CORES=1 \ 41 -C cluster0.cpu0.clock_multiplier=20 \ 42 -C cluster0.cpu0.enable_crc32=1 \ 43 -C cluster1.NUM_CORES=0 \ 44 "$@" & 45 46read port < $tmp/port 47telnet localhost $port 48kill -INT %% 49wait 50