Skip to content

Commit acc067e

Browse files
JianyuWang0623xiaoxiang781216
authored andcommitted
docs/qemu-armv8a: add doc for fastboot tcp
Add document for fastboot TCP network device. Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
1 parent bb1cc40 commit acc067e

File tree

1 file changed

+72
-0
lines changed
  • Documentation/platforms/arm64/qemu/boards/qemu-armv8a

1 file changed

+72
-0
lines changed

Documentation/platforms/arm64/qemu/boards/qemu-armv8a/index.rst

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,78 @@ Steps for Using NuttX as IVSHMEM host and guest
438438
server recv data normal exit
439439
server Complete ret 0, errno 0
440440

441+
fastboot
442+
--------
443+
Fastboot TCP network device configuration with reference to qemu-armv8a:netnsh.
444+
More details about usage of fastboot, please refer to `fastbootd — NuttX latest documentation <https://nuttx.apache.org/docs/latest/applications/system/fastboot/index.html>`_.
445+
446+
You can run the configuration procedure::
447+
448+
$ ./tools/configure.sh -l qemu-armv8a:fastboot
449+
$ make
450+
$ dd if=/dev/zero of=./mydisk-1gb.img bs=1M count=1024
451+
452+
To test it, there are two example ways:
453+
454+
1. NAT::
455+
456+
# a. Add "hostfwd=tcp:127.0.0.1:15002-10.0.2.15:5554" for option "-netdev"
457+
qemu-system-aarch64 -cpu cortex-a53 -nographic \
458+
-machine virt,virtualization=on,gic-version=3 \
459+
-chardev stdio,id=con,mux=on -serial chardev:con \
460+
-global virtio-mmio.force-legacy=false \
461+
-device virtio-serial-device,bus=virtio-mmio-bus.0 \
462+
-chardev socket,telnet=on,host=127.0.0.1,port=3450,server=on,wait=off,id=foo \
463+
-device virtconsole,chardev=foo \
464+
-device virtio-rng-device,bus=virtio-mmio-bus.1 \
465+
-netdev user,id=u1,hostfwd=tcp:127.0.0.1:10023-10.0.2.15:23,hostfwd=tcp:127.0.0.1:15002-10.0.2.15:5554 \
466+
-device virtio-net-device,netdev=u1,bus=virtio-mmio-bus.2 \
467+
-drive file=./mydisk-1gb.img,if=none,format=raw,id=hd \
468+
-device virtio-blk-device,bus=virtio-mmio-bus.3,drive=hd \
469+
-mon chardev=con,mode=readline -kernel ./nuttx
470+
471+
# b. Run fastboot daemon on qemu device
472+
fastbootd &
473+
474+
# c. Exec fastboot command on host side with device IP and PORT
475+
fastboot -s tcp:127.0.0.1:15002 getvar version
476+
477+
2. Bridge::
478+
479+
# a. Set option "-netdev" to "-netdev bridge,br=br0,id=u1"
480+
qemu-system-aarch64 -cpu cortex-a53 -nographic \
481+
-machine virt,virtualization=on,gic-version=3 \
482+
-chardev stdio,id=con,mux=on -serial chardev:con \
483+
-global virtio-mmio.force-legacy=false \
484+
-device virtio-serial-device,bus=virtio-mmio-bus.0 \
485+
-chardev socket,telnet=on,host=127.0.0.1,port=3450,server=on,wait=off,id=foo \
486+
-device virtconsole,chardev=foo \
487+
-device virtio-rng-device,bus=virtio-mmio-bus.1 \
488+
-netdev bridge,br=br0,id=u1 \
489+
-device virtio-net-device,netdev=u1,bus=virtio-mmio-bus.2 \
490+
-drive file=./mydisk-1gb.img,if=none,format=raw,id=hd \
491+
-device virtio-blk-device,bus=virtio-mmio-bus.3,drive=hd \
492+
-mon chardev=con,mode=readline -kernel ./nuttx
493+
494+
# b. Init network bridge and ACL for host
495+
sudo ip link add name br0 type bridge
496+
ip addr add 192.168.100.1/24 brd + dev br0
497+
ip link set br0 up
498+
sysctl -w net.ipv4.ip_forward=1
499+
iptables -t filter -A FORWARD -i br0 -j ACCEPT
500+
iptables -t filter -A FORWARD -o br0 -j ACCEPT
501+
echo "allow all" | sudo tee /etc/qemu/${USER}.conf
502+
echo "include /etc/qemu/${USER}.conf" | sudo tee --append /etc/qemu/bridge.conf
503+
sudo chown root:${USER} /etc/qemu/${USER}.conf
504+
sudo chmod 640 /etc/qemu/${USER}.conf
505+
506+
# c. Configure IP address for qemu device, and run fastboot daemon
507+
ifconfig eth0 192.168.100.2
508+
fastbootd &
509+
510+
# d. Exec fastboot command on host side with device IP
511+
fastboot -s tcp:192.168.100.2 getvar version
512+
441513
Status
442514
======
443515

0 commit comments

Comments
 (0)