From nobody Sun Jun 05 11:18:57 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5BC4E1BEAA0E for ; Sun, 5 Jun 2022 11:19:05 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LGDdy6tXGz3Pcr for ; Sun, 5 Jun 2022 11:19:02 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-fb1ae0cd9cso5461201fac.13 for ; Sun, 05 Jun 2022 04:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to; bh=OAD90SpbXjOV3K56hXRlQPwYUNyhOiyRbMwzXcHmU7M=; b=P/S0ZenphVXqYElJGkSBBVgSd5pmnWTh2u5E73+O1O7vZw32HYe586TyfWx+GlzPe3 fhYabLRdxbQ68ZwxuaEytHrr589rmNuVrQ6q2WW2G/Bc2ZXyaG4wUcCwVDY9CPGIaZl6 /zWCVNSqi00AUGHRL9xvfPQcMVt9XW4lzL/sY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to; bh=OAD90SpbXjOV3K56hXRlQPwYUNyhOiyRbMwzXcHmU7M=; b=oyM5oEjX6p6iQ+sRPNBq+w6Kkp8ixuQSXLW2pf5Du+BG02EFXYiFbilHzI1828ybgx fDRL1r1xlytyF4zinmsoe36Zm404j8dKETTy/W5ynSWiYkORzsWVhwb0Tsuw7auvqVxi L/TXfgZ86yWYaEbID1k1U4Eca2s1k0DxHH5rua2JvZpMy2TBm29OMM7gAA2z6QwBIToU 96sCx66zRCx/zeX+wtN7dA0HpwiOtCoH2ap5M/NQQYY/UlDc9tcseaLKMiVY1y80vfOQ 29DVXho8X1vyc+iIMSWjVna/us6CFiKn8krKzGSZ5SUNYnEuWwXb1UJyy3XEQq4rKABw nouA== X-Gm-Message-State: AOAM533swgw/l7IBYszJNjbr7oBc6myAtzrW3/Bho/bwOplmR0t7cOr1 X18PlRX0mxN4cpGwRxNizh3tXC2zxVgvaQ== X-Google-Smtp-Source: ABdhPJzk95HGhgaA5t62L+4YlBAQHPax467lmmua7Yr0qvQZvK7h6LT329rTjvpCfleT9Z48KOIiHg== X-Received: by 2002:a05:6870:42c4:b0:f1:7bfd:b67c with SMTP id z4-20020a05687042c400b000f17bfdb67cmr10610101oah.177.1654427941884; Sun, 05 Jun 2022 04:19:01 -0700 (PDT) Received: from ?IPV6:2804:29b8:5099:52c:378e:75f1:1e7e:4f18? ([2804:29b8:5099:52c:378e:75f1:1e7e:4f18]) by smtp.gmail.com with ESMTPSA id m11-20020a4aedcb000000b00415a9971cfcsm6451482ooh.38.2022.06.05.04.19.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Jun 2022 04:19:01 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------llpUrx2WEDPX6MwXfCsoCfr0" Message-ID: Date: Sun, 5 Jun 2022 08:18:57 -0300 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 From: Otacilio Subject: Re: Wrong number of CPUs detected on RPI3 and FreeBSD 13.1 To: Ronald Klop Cc: freebsd-arm@freebsd.org References: <8fcbebf4-60c3-0ccb-259b-3324b123245c@bsd.com.br> <1047394639.643.1654181685742@localhost> Content-Language: en-US In-Reply-To: <1047394639.643.1654181685742@localhost> X-Rspamd-Queue-Id: 4LGDdy6tXGz3Pcr X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsd.com.br header.s=capeta header.b="P/S0Zenp"; dmarc=none; spf=pass (mx1.freebsd.org: domain of otacilio.neto@bsd.com.br designates 2001:4860:4864:20::2c as permitted sender) smtp.mailfrom=otacilio.neto@bsd.com.br X-Spamd-Result: default: False [-3.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsd.com.br:s=capeta]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:4860:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; DMARC_NA(0.00)[bsd.com.br]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsd.com.br:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2001:4860:4864:20::2c:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-arm]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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: on ofwbus0 > cpu0: on cpulist0 > bcm2835_cpufreq0: on cpu0 > cpu1: on cpulist0 > cpu2: on cpulist0 > cpu3: 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 > *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: on ofwbus0 > cpu0: on cpulist0 > bcm2835_cpufreq0: on cpu0 > cpu1: on cpulist0 > cpu2: on cpulist0 > cpu3: 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: on ofwbus0 > cpu0: on cpulist0 > bcm2835_cpufreq0: on cpu0 > cpu1: on cpulist0 > cpu2: on cpulist0 > cpu3: 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

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--