From 6f0dde5f151caa47048be8ebd8dcb17b544aba97 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 24 Dec 2025 12:43:56 +0000 Subject: T8120: Add AMA support AMA console for ARM devices --- data/templates/grub/grub_common.j2 | 2 +- data/templates/grub/grub_compat.j2 | 4 +++- data/templates/grub/grub_options.j2 | 7 ++++++- data/templates/grub/grub_vyos_version.j2 | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'data') diff --git a/data/templates/grub/grub_common.j2 b/data/templates/grub/grub_common.j2 index 5e9b95cc0..86fdbdf60 100644 --- a/data/templates/grub/grub_common.j2 +++ b/data/templates/grub/grub_common.j2 @@ -7,7 +7,7 @@ fi # create and activate serial console function setup_serial { # initialize the first serial port by default - if [ "${console_type}" == "ttyS" ]; then + if [ "${console_type}" = "ttyS" -o "${console_type}" = "ttyAMA" ]; then if [ "${console_num}" == "0" ]; then serial --unit=0 --speed=${console_speed} else diff --git a/data/templates/grub/grub_compat.j2 b/data/templates/grub/grub_compat.j2 index 8fb4f71dc..7f930a11f 100644 --- a/data/templates/grub/grub_compat.j2 +++ b/data/templates/grub/grub_compat.j2 @@ -12,7 +12,7 @@ {% macro console_name(type) -%} {% if type == 'tty' -%} KVM -{%- elif type == 'ttyS' -%} +{%- elif type == 'ttyS' or type == 'ttyAMA' -%} Serial {%- else -%} Unknown @@ -23,6 +23,8 @@ console=ttyS0,{{ console_speed }} console=tty0 {%- elif type == 'ttyS' -%} console=tty0 console=ttyS0,{{ console_speed }} +{%- elif type == 'ttyAMA' -%} + console=tty0 console=ttyAMA0,{{ console_speed }} {%- else -%} console=tty0 console=ttyS0,{{ console_speed }} {%- endif %} diff --git a/data/templates/grub/grub_options.j2 b/data/templates/grub/grub_options.j2 index a00bf4e37..0f2f15caf 100644 --- a/data/templates/grub/grub_options.j2 +++ b/data/templates/grub/grub_options.j2 @@ -28,7 +28,12 @@ submenu "Boot options" { configfile ${prefix}/grub.cfg.d/*vyos-menu*.cfg } menuentry "ttyS (serial)" { - set console_type="ttyS" + if [ "${grub_cpu}" = "arm64" ]; then + set serial_console="ttyAMA" + else + set serial_console="ttyS" + fi + set console_type="$serial_console" export console_type setup_serial configfile ${prefix}/grub.cfg.d/*vyos-menu*.cfg diff --git a/data/templates/grub/grub_vyos_version.j2 b/data/templates/grub/grub_vyos_version.j2 index de85f1419..3f76d7467 100644 --- a/data/templates/grub/grub_vyos_version.j2 +++ b/data/templates/grub/grub_vyos_version.j2 @@ -11,7 +11,7 @@ {% endif %} menuentry "{{ version_name }}" --id {{ version_uuid }} { set boot_opts="{{ boot_opts_rendered }}" - if [ "${console_type}" == "ttyS" ]; then + if [ "${console_type}" = "ttyS" -o "${console_type}" = "ttyAMA" ]; then set console_opts="console=${console_type}${console_num},${console_speed}" else set console_opts="console=${console_type}${console_num}" -- cgit v1.2.3