Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jun 2022 08:18:57 -0300
From:      Otacilio <otacilio.neto@bsd.com.br>
To:        Ronald Klop <ronald-lists@klop.ws>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Wrong number of CPUs detected on RPI3 and FreeBSD 13.1
Message-ID:  <c9a9cd2a-9386-ce2e-6319-def8a801ac57@bsd.com.br>
In-Reply-To: <1047394639.643.1654181685742@localhost>
References:  <8fcbebf4-60c3-0ccb-259b-3324b123245c@bsd.com.br> <1047394639.643.1654181685742@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------llpUrx2WEDPX6MwXfCsoCfr0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

After some debug I found that this routine is returning -1:

vi +50 /usr/src/sys/dev/psci/psci.h

/* Handler to let us call into the PSCI/SMCCC firmware */
extern psci_callfn_t psci_callfn;
static inline int
psci_call(register_t a, register_t b, register_t c, register_t d)
{

         return (psci_callfn(a, b, c, d, 0, 0, 0, 0, NULL));
}

/*
  * PSCI return codes.
  */
#define PSCI_RETVAL_SUCCESS             0
#define PSCI_RETVAL_NOT_SUPPORTED       -1
#define PSCI_RETVAL_INVALID_PARAMS      -2

Someone can give-me a hint about the function of psci_callfn ?

Thanks a lot


Em 02/06/2022 11:54, Ronald Klop escreveu:
> No solution, just a data point. My RPI3B+ works fine.
>
> $ cat /var/run/dmesg.boot  | grep CPU
> Starting CPU 1 (1)
> Starting CPU 2 (2)
> Starting CPU 3 (3)
> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
> cpulist0: <Open Firmware CPU Group> on ofwbus0
> cpu0: <Open Firmware CPU> on cpulist0
> bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
> cpu1: <Open Firmware CPU> on cpulist0
> cpu2: <Open Firmware CPU> on cpulist0
> cpu3: <Open Firmware CPU> on cpulist0
> armv8crypto0: CPU lacks AES instructions
> CPU  0: ARM Cortex-A53 r0p4 affinity:  0
> CPU  1: ARM Cortex-A53 r0p4 affinity:  1
> CPU  2: ARM Cortex-A53 r0p4 affinity:  2
> CPU  3: ARM Cortex-A53 r0p4 affinity:  3
>
> $ uname -a
> FreeBSD rpi3 13.1-RELEASE FreeBSD 13.1-RELEASE 
> releng/13.1-n250148-fc952ac2212 GENERIC arm64
>
> $ sysctl hw.model
> hw.model: ARM Cortex-A53 r0p4
>
> # ofwdump -a -P model  | head -n5
> Node 0x48:
>   model:
>     52 61 73 70 62 65 72 72 79 20 50 69 20 33 20 4d 6f 64 65 6c
>     20 42 20 50 6c 75 73 20 52 65 76 20 31 2e 33 00
>     'Raspberry Pi 3 Model B Plus Rev 1.3'
>
> I don't know how to help further, but maybe this gives a difference to 
> dive into.
>
> Regards,
> Ronald.
>
> *Van:* Otacilio <otacilio.neto@bsd.com.br>
> *Datum:* donderdag, 2 juni 2022 14:04
> *Aan:* freebsd-arm@freebsd.org
> *Onderwerp:* Wrong number of CPUs detected on RPI3 and FreeBSD 13.1
>
>     Dears
>
>
>     Yesterday I have finished a upgrade from source code of a FreeBSD
>     12.2 to FreeBSD 13.1 running on RPI3. After upgrade, this machine
>     only one CPU is detected.
>
>     RPI3 with problem
>
>     [ota@azul ~]$ cat /var/run/dmesg.boot  | grep CPU
>     Starting CPU 1 (1)
>     Starting CPU 1 (2)
>     Starting CPU 1 (3)
>     FreeBSD/SMP: Multiprocessor System Detected: 1 CPUs
>     cpulist0: <Open Firmware CPU Group> on ofwbus0
>     cpu0: <Open Firmware CPU> on cpulist0
>     bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
>     cpu1: <Open Firmware CPU> on cpulist0
>     cpu2: <Open Firmware CPU> on cpulist0
>     cpu3: <Open Firmware CPU> on cpulist0
>     armv8crypto0: CPU lacks AES instructions
>     CPU  0: ARM Cortex-A53 r0p4 affinity:  0
>     [ota@azul ~]$ uname -a
>     FreeBSD azul 13.1-RELEASE FreeBSD 13.1-RELEASE
>     releng/13.1-n250148-fc952ac2212 GENERIC arm64
>
>     Another system running on a rpi4 the CPUs detected and initialized
>     are ok:
>
>     RPI4 running OK
>
>     [ota@verde ~]$ cat /var/run/dmesg.boot  | grep CPU
>     Starting CPU 1 (1)
>     Starting CPU 2 (2)
>     Starting CPU 3 (3)
>     FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
>     cpulist0: <Open Firmware CPU Group> on ofwbus0
>     cpu0: <Open Firmware CPU> on cpulist0
>     bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
>     cpu1: <Open Firmware CPU> on cpulist0
>     cpu2: <Open Firmware CPU> on cpulist0
>     cpu3: <Open Firmware CPU> on cpulist0
>     armv8crypto0: CPU lacks AES instructions
>     CPU  0: ARM Cortex-A72 r0p3 affinity:  0
>     CPU  1: ARM Cortex-A72 r0p3 affinity:  1
>     CPU  2: ARM Cortex-A72 r0p3 affinity:  2
>     CPU  3: ARM Cortex-A72 r0p3 affinity:  3
>     [ota@verde ~]$ uname -a
>     FreeBSD verde 13.1-RELEASE FreeBSD 13.1-RELEASE
>     releng/13.1-n250148-fc952ac2212 GENERIC arm64
>
>
>     Someone can give-me a hint about how to solve this?
>
>
>     Thanks a lot
>
>     ------------------------------------------------------------------------
>
--------------llpUrx2WEDPX6MwXfCsoCfr0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>After some debug I found that this routine is returning -1:<br>
    </p>
    <p>vi +50 /usr/src/sys/dev/psci/psci.h</p>
    <p>/* Handler to let us call into the PSCI/SMCCC firmware */<br>
      extern psci_callfn_t psci_callfn;<br>
      static inline int<br>
      psci_call(register_t a, register_t b, register_t c, register_t d)<br>
      {<br>
      <br>
              return (psci_callfn(a, b, c, d, 0, 0, 0, 0, NULL));<br>
      }<br>
      <br>
      /*<br>
       * PSCI return codes.<br>
       */<br>
      #define PSCI_RETVAL_SUCCESS             0<br>
      #define PSCI_RETVAL_NOT_SUPPORTED       -1<br>
      #define PSCI_RETVAL_INVALID_PARAMS      -2<br>
    </p>
    <p>Someone can give-me a hint about the function of psci_callfn ?</p>
    <p>Thanks a lot<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Em 02/06/2022 11:54, Ronald Klop
      escreveu:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1047394639.643.1654181685742@localhost">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      No solution, just a data point. My RPI3B+ works fine.<br>
      <br>
      $ cat /var/run/dmesg.boot  | grep CPU<br>
      Starting CPU 1 (1)<br>
      Starting CPU 2 (2)<br>
      Starting CPU 3 (3)<br>
      FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs<br>
      cpulist0: &lt;Open Firmware CPU Group&gt; on ofwbus0<br>
      cpu0: &lt;Open Firmware CPU&gt; on cpulist0<br>
      bcm2835_cpufreq0: &lt;CPU Frequency Control&gt; on cpu0<br>
      cpu1: &lt;Open Firmware CPU&gt; on cpulist0<br>
      cpu2: &lt;Open Firmware CPU&gt; on cpulist0<br>
      cpu3: &lt;Open Firmware CPU&gt; on cpulist0<br>
      armv8crypto0: CPU lacks AES instructions<br>
      CPU  0: ARM Cortex-A53 r0p4 affinity:  0<br>
      CPU  1: ARM Cortex-A53 r0p4 affinity:  1<br>
      CPU  2: ARM Cortex-A53 r0p4 affinity:  2<br>
      CPU  3: ARM Cortex-A53 r0p4 affinity:  3<br>
      <br>
      $ uname -a<br>
      FreeBSD rpi3 13.1-RELEASE FreeBSD 13.1-RELEASE
      releng/13.1-n250148-fc952ac2212 GENERIC arm64<br>
      <br>
      $ sysctl hw.model<br>
      hw.model: ARM Cortex-A53 r0p4<br>
      <br>
      # ofwdump -a -P model  | head -n5<br>
      Node 0x48:<br>
        model:<br>
          52 61 73 70 62 65 72 72 79 20 50 69 20 33 20 4d 6f 64 65 6c<br>
          20 42 20 50 6c 75 73 20 52 65 76 20 31 2e 33 00<br>
          'Raspberry Pi 3 Model B Plus Rev 1.3'<br>
      <br>
      I don't know how to help further, but maybe this gives a
      difference to dive into.<br>
      <br>
      Regards,<br>
      Ronald.<br>
      <br>
       
      <p><strong>Van:</strong> Otacilio <a
          class="moz-txt-link-rfc2396E"
          href="mailto:otacilio.neto@bsd.com.br">&lt;otacilio.neto@bsd.com.br&gt;</a><br>
        <strong>Datum:</strong> donderdag, 2 juni 2022 14:04<br>
        <strong>Aan:</strong> <a class="moz-txt-link-abbreviated
          moz-txt-link-freetext" href="mailto:freebsd-arm@freebsd.org">freebsd-arm@freebsd.org</a><br>
        <strong>Onderwerp:</strong> Wrong number of CPUs detected on
        RPI3 and FreeBSD 13.1</p>
      <blockquote style="padding-right: 0px; padding-left: 5px;
        margin-left: 5px; border-left: #000000 2px solid; margin-right:
        0px">
        <div class="MessageRFC822Viewer" id="P">
          <div class="TextPlainViewer" id="P.P">Dears<br>
            <br>
            <br>
            Yesterday I have finished a upgrade from source code of a
            FreeBSD 12.2 to FreeBSD 13.1 running on RPI3. After upgrade,
            this machine only one CPU is detected.<br>
            <br>
            RPI3 with problem<br>
            <br>
            [ota@azul ~]$ cat /var/run/dmesg.boot  | grep CPU<br>
            Starting CPU 1 (1)<br>
            Starting CPU 1 (2)<br>
            Starting CPU 1 (3)<br>
            FreeBSD/SMP: Multiprocessor System Detected: 1 CPUs<br>
            cpulist0: &lt;Open Firmware CPU Group&gt; on ofwbus0<br>
            cpu0: &lt;Open Firmware CPU&gt; on cpulist0<br>
            bcm2835_cpufreq0: &lt;CPU Frequency Control&gt; on cpu0<br>
            cpu1: &lt;Open Firmware CPU&gt; on cpulist0<br>
            cpu2: &lt;Open Firmware CPU&gt; on cpulist0<br>
            cpu3: &lt;Open Firmware CPU&gt; on cpulist0<br>
            armv8crypto0: CPU lacks AES instructions<br>
            CPU  0: ARM Cortex-A53 r0p4 affinity:  0<br>
            [ota@azul ~]$ uname -a<br>
            FreeBSD azul 13.1-RELEASE FreeBSD 13.1-RELEASE
            releng/13.1-n250148-fc952ac2212 GENERIC arm64<br>
            <br>
            Another system running on a rpi4 the CPUs detected and
            initialized are ok:<br>
            <br>
            RPI4 running OK<br>
            <br>
            [ota@verde ~]$ cat /var/run/dmesg.boot  | grep CPU<br>
            Starting CPU 1 (1)<br>
            Starting CPU 2 (2)<br>
            Starting CPU 3 (3)<br>
            FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs<br>
            cpulist0: &lt;Open Firmware CPU Group&gt; on ofwbus0<br>
            cpu0: &lt;Open Firmware CPU&gt; on cpulist0<br>
            bcm2835_cpufreq0: &lt;CPU Frequency Control&gt; on cpu0<br>
            cpu1: &lt;Open Firmware CPU&gt; on cpulist0<br>
            cpu2: &lt;Open Firmware CPU&gt; on cpulist0<br>
            cpu3: &lt;Open Firmware CPU&gt; on cpulist0<br>
            armv8crypto0: CPU lacks AES instructions<br>
            CPU  0: ARM Cortex-A72 r0p3 affinity:  0<br>
            CPU  1: ARM Cortex-A72 r0p3 affinity:  1<br>
            CPU  2: ARM Cortex-A72 r0p3 affinity:  2<br>
            CPU  3: ARM Cortex-A72 r0p3 affinity:  3<br>
            [ota@verde ~]$ uname -a<br>
            FreeBSD verde 13.1-RELEASE FreeBSD 13.1-RELEASE
            releng/13.1-n250148-fc952ac2212 GENERIC arm64<br>
            <br>
            <br>
            Someone can give-me a hint about how to solve this?<br>
            <br>
            <br>
            Thanks a lot<br>
            <br>
             </div>
          <hr></div>
      </blockquote>
    </blockquote>
  </body>
</html>

--------------llpUrx2WEDPX6MwXfCsoCfr0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c9a9cd2a-9386-ce2e-6319-def8a801ac57>