From owner-freebsd-arm@freebsd.org Tue Oct 15 12:27:42 2019 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9EA315D7FA for ; Tue, 15 Oct 2019 12:27:42 +0000 (UTC) (envelope-from soren.schmidt@gmail.com) Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46svp61qC4z484V for ; Tue, 15 Oct 2019 12:27:42 +0000 (UTC) (envelope-from soren.schmidt@gmail.com) Received: by mail-wm1-x32f.google.com with SMTP id p7so20668094wmp.4 for ; Tue, 15 Oct 2019 05:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rYyiUv9Q601/QW/7m8iNGLjMVSEdPy2XC7hzaCOWfyY=; b=lhZLKKy0CktILl8Os/6w2/myVQy/8YSsp4qXliNY6bn40U1yoKel94+7baIV8FW5Hy cW3KQqUN+dJFh1xf4QE6P+pdDa0Daoen6upux0KiMqqjKRVoWJACA7iG44oljyqWKkrU DYvXe98IeqydYziQ6KNGNlD1GZYRvxWMTeiq8WdEFzkM9GoKTwFWH8fGE8hMNq0L/oDN gN6I2n1VxggNTFaHaa3dzLXDSjgfYcbb4uqdg8k45+pGWKq9eYXkjl5PhMCNmDhiaNX3 nm3M8foIx3QkYgYTOJRujXaUeGu1uHNPfH+0KsUaKBDyBT4A2SGlzPxRtt+wvCqU8W6u wpyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rYyiUv9Q601/QW/7m8iNGLjMVSEdPy2XC7hzaCOWfyY=; b=s69nX2Xv2LxoAV3LGpXX/7bDh/Kk/Gzj+OUBimmyyb3Nga1VmMnAArO0wKhRm7XTzk l2Jx0L2InkrmQjHatpRkMkrRyHHyVPRIyJ9AnYoR6+piZzd5FMkgekbqnDFabkxboTMf OlG6L+U9IxZzVzp5npMWZEjAQPBcywh4zFNBrtqcxIIR/4enNnx2Iuxl9frTjv6NwyO/ g4klChxyQZ5NQtnvKiXX9gEizVcnwwFFPaIfope/WOJrs+QrXgG9lmhmAQaPfRq39uHH q+V2HXcgbOeoHFzQ0GW1HvT/fyD0zg7El2RSjH/lQWKjHgB2xig9w/aXoCP3I6mFdcZD thaw== X-Gm-Message-State: APjAAAUY+t5/0lTR9g3gnDQDKTYfjdFVhAgZAcpEB47BRPvie16KvPTH 9SX/SJPYeGmMfGsqKnBbwFnBmEJA X-Google-Smtp-Source: APXvYqxc5BZZcpZ9fBOU/Q7dM88EzKOOt3QP9UcW2/OCFbSEjQ/o8BR2wiyOzeXF9YarF5VnCF4ABA== X-Received: by 2002:a1c:1f8d:: with SMTP id f135mr19108871wmf.156.1571142460706; Tue, 15 Oct 2019 05:27:40 -0700 (PDT) Received: from mac.deepcore.dk ([85.27.186.9]) by smtp.gmail.com with ESMTPSA id h7sm19718914wrs.15.2019.10.15.05.27.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Oct 2019 05:27:40 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Trouble starting AP cpu's on all winner R40/V40 chip, help needed? From: =?utf-8?Q?S=C3=B8ren_Schmidt?= In-Reply-To: <20191015140210.82d406d7a7b86720e4771206@bidouilliste.com> Date: Tue, 15 Oct 2019 14:27:39 +0200 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: References: <0AE907CC-0CBC-4A8A-A2D3-71EF37330503@gmail.com> <20191015140210.82d406d7a7b86720e4771206@bidouilliste.com> To: Emmanuel Vadot X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 46svp61qC4z484V X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=lhZLKKy0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of sorenschmidt@gmail.com designates 2a00:1450:4864:20::32f as permitted sender) smtp.mailfrom=sorenschmidt@gmail.com X-Spamd-Result: default: False [-1.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[f.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (-8.91), ipnet: 2a00:1450::/32(-2.85), asn: 15169(-2.11), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2019 12:27:43 -0000 Hi Manu >=20 >> Hi all >>=20 >> I found some time to wrestle the allwinner R40/v40 I?ve sitting = around, but I?m bashing my head against getting the AP?s booted = properly. >>=20 >> I don?t seem to be able to get the CPU to run at all, or (more = likely) I don?t have a way to get them startet at ?mpentry? to get them = going correctly. >>=20 >> I?m not sure I understand how those AP?s gets their starting address, = the only reference to ?mpentry? is aw_mp.c: >>=20 >>=20 >> bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_P_REG0, >> pmap_kextract((vm_offset_t)mpentry)); >>=20 >> This is used on all all winner cpu?s (more or less) but according til = the R40/v40 docs that register doesn?t exist which would explain the = failure? >=20 > R40 seems to use different registers for cpu bringup, so you will need > to define a new platform for it in aw_machdep.c and defines some new > function for ap bringup in aw_mp.c > The User Manual section 3.2 of the R40 have all the needed info. >=20 Yeps, already did that, and I can reset the cores etc, that seems to = work (register bits flips), but there are no mention of regs to put the = starting address into. Chap 3.2 doesn=E2=80=99t mention anything in that regard (at least in = the docs I=E2=80=99ve found online) its moved to chap 4.2 in the latest = R40/V40/T3 docs I=E2=80=99ve found bu still no mention of starting = address. I looks somewhat like the A20 ie it has control for 2 cpu=E2=80=99s the = last two are missing from the register ref, which suggests to me that = the docs might be inaccurate at best. I looked into =E2=80=9CTina-linux=E2=80=9D that they made for it, but I = havn=E2=80=99t found out how they start it there either.. I might also just have stared me blind at it :) -S=C3=B8ren