[Unit] Description=Unbind ttyAMA0 from pl011 and reload bbserial DefaultDependencies=no After=systemd-modules-load.service local-fs.target Before=bbctrl.service ConditionPathExists=/sys/bus/amba/drivers/uart-pl011 [Service] Type=oneshot RemainAfterExit=yes # Tolerate the device already being bound elsewhere or the module # already being loaded — the goal is the end state (bbserial owns # ttyAMA0), not running the steps. ExecStart=/bin/sh -c '\ echo 3f201000.serial > /sys/bus/amba/drivers/uart-pl011/unbind 2>/dev/null || true; \ /sbin/modprobe -r bbserial 2>/dev/null || true; \ /sbin/modprobe bbserial \ ' [Install] WantedBy=multi-user.target