Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Aug 2021 11:51:14 +0100
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        Sleep Walker <s199p.wa1k9r@gmail.com>
Cc:        Free BSD <freebsd-arm@freebsd.org>
Subject:   Re: FreeBSD-13.0-CURRENT on Baikal-m(aarch64) SoC
Message-ID:  <0B22D0E6-2510-4CE8-9DE2-E72EB1BB5665@fubar.geek.nz>
In-Reply-To: <CAHa8N890iPFJsSuRRQU-aOcC2qBbcwE7QGk38fP2EVkDuwpDyA@mail.gmail.com>
References:  <CAHa8N890iPFJsSuRRQU-aOcC2qBbcwE7QGk38fP2EVkDuwpDyA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 25 Aug 2021, at 09:34, Sleep Walker <s199p.wa1k9r@gmail.com> wrote:
>=20
> Hi!
>=20
> I am trying to add support for the new SoC Baikal-M in FreeBSD.
> https://www.baikalelectronics.com/products/338/
> =
https://www.cnx-software.com/2021/08/10/desktop-and-all-in-one-arm-linux-c=
omputers-launched-with-baikal-m-processor/
>=20
> The system is already starting in multi-user mode, but only one core =
out of
> eight is detected.
> To find out the reason, I slightly changed the code by adding the =
output of
> the error code.
> sys/arm64/arm64/mp_machdep.c
> =
--------------------------------------------------------------------------=
-----------------------------------------------
>        printf("Starting CPU %u (%lx)\n", cpuid, target_cpu);
>        pa =3D pmap_extract(kernel_pmap, (vm_offset_t)mpentry);
>        err =3D psci_cpu_on(target_cpu, pa, cpuid);
>=20
>        if (err !=3D PSCI_RETVAL_SUCCESS) {
>                printf("Starting CPU %u (%lx) psci_cpu_on return =
(%d)\n",
> cpuid, target_cpu, err);
>                /*
>                 * Panic here if INVARIANTS are enabled and PSCI failed =
to
>                 * start the requested CPU.  psci_cpu_on() returns
> PSCI_MISSING
>                 * to indicate we are unable to use it to start the =
given
> CPU.
>                 */
>                KASSERT(err =3D=3D PSCI_MISSING ||
>                    (mp_quirks & MP_QUIRK_CPULIST) =3D=3D =
MP_QUIRK_CPULIST,
>                    ("Failed to start CPU %u (%lx), error %d\n",
>                    cpuid, target_cpu, err));
>                pcpu_destroy(pcpup);
>                kmem_free((vm_offset_t)dpcpu[cpuid - 1], DPCPU_SIZE);
>                dpcpu[cpuid - 1] =3D NULL;
>                kmem_free((vm_offset_t)bootstacks[cpuid], PAGE_SIZE);
>                bootstacks[cpuid] =3D NULL;
>                mp_ncpus--;
>                return (false);
>        }
> =
--------------------------------------------------------------------------=
------------------------------------------------
> I got the following log
> ---------------------------------
> Starting CPU 1 (1)
> Starting psci_cpu_on(1, f22008c8, 1)
> Starting CPU 1 (1) psci_cpu_on return (-9)
> Starting CPU 1 (100)
> Starting psci_cpu_on(100, f22008c8, 1)
> Starting CPU 1 (100) psci_cpu_on return (-9)
> Starting CPU 1 (101)
> ......
> ----------------------------------

The firmware thinks this address is invalid. =46rom the version of the =
Trusted Firmware-A I found it checks if the address is within one of the =
three DRAM banks and not within the secure region. These two checks =
should pass. It then tries to read the fdt memory node and check if the =
address is within one of the regions it provides. It can also file if it =
is unable to read this node, or the entry point is not within one of the =
memory regions the node describes.

Are you able to get a dump of the /memory@80000000 node from the =
firmware? e.g. from loader.efi the following commands should work =
(assuming it=E2=80=99s passed into loader by the firmware):

fdt cd /memory@80000000
fdt prop

Andrew




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0B22D0E6-2510-4CE8-9DE2-E72EB1BB5665>