In different boards the systemctl behaved in different manner. For most of the boards to disable linux serial debug console and use it for user purpose use this command
systemctl disable serial-getty@ttyS0.service systemctl disable getty@ttyS0
In some boards this method didn’t workout an alternate way was to use this command
systemctl mask serial-getty@ttyAMA0.service
To get non root access to serial port add it to dialout group, some systems don’t add debug console to dialout group so edit /etc/inittab and change the permissions.
Happy Hacking 🙂