From owner-freebsd-arm@freebsd.org Tue Oct 15 12:55:12 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 E303215E194 for ; Tue, 15 Oct 2019 12:55:12 +0000 (UTC) (envelope-from soren.schmidt@gmail.com) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 46swPr1gSkz49Z8 for ; Tue, 15 Oct 2019 12:55:11 +0000 (UTC) (envelope-from soren.schmidt@gmail.com) Received: by mail-wm1-x334.google.com with SMTP id y135so2275537wmc.1 for ; Tue, 15 Oct 2019 05:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=yFN2M9iUEXfyf5GUUr7Up4Mto77YeRySgJJgiluKI5w=; b=nPFf9vT0lREgf1J+uSqT93XpJzLuwADLdcRx4H0GoHv1HHqDy9RvE6UtfCXw8J3h9t Eib0D6FKV2h2Fm65n1uk+MS5oKDpvWtgncXRvKZBx+J6lAAGzELD/CBkR+ts2yKqq28Q IH5Zc41UwmxPfeIrMTf4MxBUQHOH/FbgR+S2ve2XCrb/L1AdRKSh1vpflC9qADfeGAMF 5NR5eAvep2eji1WDA1whc5mx3VPPfBmdP2VGWQefvkK1KBqHy2HQj8eIHbiSuPkjOq/N 5PtUvM4sqYP1N1wWf9Qxp5Z2p3pgOjF3CMOOVhRP20jTt2PhDVsQ7P0UNrxbxY9NMED+ IjsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=yFN2M9iUEXfyf5GUUr7Up4Mto77YeRySgJJgiluKI5w=; b=cLAl9QTajUpJn+SOclk8qkGaQw0u6GehTu8yEcoPMTYmTO4sTuoJbaZCXDjopVky8z ugIj7lUK0O5Xy8XIR+4xuQNe9Rekn4Swh0iYKcHf3xCZF6O2xOCn+1wnRweXZgT3snfi 0KqNTQHIzjgoJSzwLFN9Y8SmqXsWtqWMK7+2kNWFkiCYdHmY0RxiBl0Q4MjjhHliwqF5 zdmG3L7kcuJtvRI40+IkfGNNml3NmhmfxpkEM9blg+5JP0mZmG82m/LHlPclx73k7Bx3 /5mV9RY86l4T6+uhVp9UtfTaH3TLBcKOYMvN7UWoA0gem8HO2n8zujcMhq8IVjE0A0Z8 tFmA== X-Gm-Message-State: APjAAAWBh3WdsljDpK/+5fXVKhE3MTuFMEM5BVe/hlGDD6NoF2i+6f/o 4K2vUVFYjCGeVuicTweNo20= X-Google-Smtp-Source: APXvYqzMAPggrocFX6QRg2S6JKDIRDdw2eXdXsV60JvrH/cJSqMx9alvFrTW47XjyJ4r59t34+NwOA== X-Received: by 2002:a1c:a708:: with SMTP id q8mr17752225wme.86.1571144109895; Tue, 15 Oct 2019 05:55:09 -0700 (PDT) Received: from mac.deepcore.dk ([85.27.186.9]) by smtp.gmail.com with ESMTPSA id e3sm20301089wme.39.2019.10.15.05.55.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Oct 2019 05:55:09 -0700 (PDT) From: =?utf-8?Q?S=C3=B8ren_Schmidt?= Message-Id: <07E4329F-3DFD-49FB-A3BC-A63790DCC798@gmail.com> 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? Date: Tue, 15 Oct 2019 14:55:08 +0200 In-Reply-To: Cc: freebsd-arm To: Emmanuel Vadot References: <0AE907CC-0CBC-4A8A-A2D3-71EF37330503@gmail.com> <20191015140210.82d406d7a7b86720e4771206@bidouilliste.com> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 46swPr1gSkz49Z8 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=nPFf9vT0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of sorenschmidt@gmail.com designates 2a00:1450:4864:20::334 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]; 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)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; SUBJECT_ENDS_QUESTION(1.00)[]; 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)[multipart/alternative,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)[4.3.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.90), ipnet: 2a00:1450::/32(-2.85), asn: 15169(-2.11), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:55:13 -0000 > On 15 Oct 2019, at 14.27, S=C3=B8ren Schmidt = wrote: >=20 > Hi Manu >=20 >>=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 >>=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 >=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. >=20 > 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. >=20 > 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. >=20 > 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.. >=20 > I might also just have stared me blind at it :) Found that the start adresse is somewhere else: CPU software entry register offset 00bc in sysctl instead of cpuctl=E2=80=A6= I=E2=80=99ll try that when I get home later today,,, -S=C3=B8ren=