From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=bBntzlqz; spf=pass (domain: linaro.org, ip: 209.85.166.194, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.194]) by groups.io with SMTP; Sat, 25 May 2019 02:48:00 -0700 Received: by mail-it1-f194.google.com with SMTP id g24so12829844iti.5 for ; Sat, 25 May 2019 02:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=DMtoBpIshsyPYeQQ+FTaVPX2BC1huKvaXYtlpL18iY4=; b=bBntzlqzxT0O9htdo7+2lE2/GsvPl5+pY/K1zyeGZTAii9GxJy9JKDTlhymK8zkR0v Mmg7LRzG7+TokG0UKndLjdCswgV8wZiElhW5aMqRNVddONATvi+a9JYaNJP9P9MP349T aWbTBl8tbzLV0OTtiLFkJ4TXfy+kBwKqfjsMGww8khNTap4DbcGrtpNsWaMmgAggfvhI v0jl3w6C/7blHh/yyjgbjreC3XP31msecfo0nvd9R089X1WNfx92WWOOaEOpW64oaK1y HaUuQPTvIdw2Y056bJaSNIBziwVL7QTWdK94SAP/FG5jPA3M/Jzc9nGSMiMpOQ8Fvs/R /I8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=DMtoBpIshsyPYeQQ+FTaVPX2BC1huKvaXYtlpL18iY4=; b=ChiiEdyyiqnYXUcjt2IhSmIk4eCy5bfvnxLLfizWAcpfNZJrSwCOKg7i63S55yYMRr ntsn/GVCx7o/EcZ+7ddMAIzaEsKuDUPEByfD7QUBWijy421mxr+BYTssfnOZl6VhywWQ VVJaCKXuwIRhUS2/i9/iOq5GJaWqWKtrTRcxfSbbPHLGK2/lVP6G3+7VhZVDqnkjLkb9 Od104GWEpGXy0U+OHhJfzDLR14sy2X5vISrH6+2gSywMye9LI+TyWNQc2ePIwYUf5CnL PBBvbjeo16i4h0++L8W2rVAmDJ+LbTGErhx359hE4/mo7RGPHfsPzeGEOz3ScMlyLns0 Q3VA== X-Gm-Message-State: APjAAAXO9KKpkPzukawG9YgcmV1cZXMCIOZmfKqK0ukWY/8R5pvRD1o6 jghIckWBOqHvxsdWdlEnMjwMQDbHk1AuA82u4RcY7A== X-Google-Smtp-Source: APXvYqz3RXeCd7SaWJX5zEaKC4tDFgDRT0YAAn+QjBVt6/fj7LDup3WVp4ceUIOotcRcH2KthF5ve7CW4I3er67cytU= X-Received: by 2002:a24:ca84:: with SMTP id k126mr20111787itg.104.1558777679324; Sat, 25 May 2019 02:47:59 -0700 (PDT) MIME-Version: 1.0 References: <1558366047-15994-1-git-send-email-mw@semihalf.com> <20190523141426.rvuqh2nfe3vepm4p@bivouac.eciton.net> <41d6e68b2791fd8d@bloch.sibelius.xs4all.nl> In-Reply-To: <41d6e68b2791fd8d@bloch.sibelius.xs4all.nl> From: "Ard Biesheuvel" Date: Sat, 25 May 2019 11:47:45 +0200 Message-ID: Subject: Re: [edk2-platforms: PATCH v2 00/14] Armada7k8k PCIE support To: Mark Kettenis Cc: Leif Lindholm , Marcin Wojtas , edk2-devel-groups-io , =?UTF-8?B?SmFuIETEhWJyb8Wb?= , Grzegorz Jaszczyk , Kostya Porotchkin , Jici Gao , Rebecca Cran , kettenis@openbsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 25 May 2019 at 00:16, Mark Kettenis wrote= : > > > From: Ard Biesheuvel > > Date: Thu, 23 May 2019 19:13:20 +0100 > > Cc: Leif Lindholm , Marcin Wojtas , > > edk2-devel-groups-io , > > Jan D=C4=85bro=C5=9B , > > Grzegorz Jaszczyk , > > Kostya Porotchkin , Jici Gao , > > Rebecca Cran , kettenis@openbsd.org > > Content-Type: text/plain; charset=3D"UTF-8" > > > > On Thu, 23 May 2019 at 19:02, Mark Kettenis wrote: > > > > > > > Date: Thu, 23 May 2019 15:14:27 +0100 > > > > From: Leif Lindholm > > > > > > > > On Thu, May 23, 2019 at 03:27:47PM +0200, Mark Kettenis wrote: > > > > > > From: Marcin Wojtas > > > > > > Date: Mon, 20 May 2019 17:27:13 +0200 > > > > > > > > > > > > Hi, > > > > > > > > > > > > Thank you for thorough review of v1. I submit second > > > > > > version of the Armada7k8k PCIE support. I addressed > > > > > > all comments. There is no functional change to initial > > > > > > patchset, but mostly clean-up and improvements - please > > > > > > refer to the changelog below. > > > > > > > > > > > > The patches are available in the github: > > > > > > https://github.com/MarvellEmbeddedProcessors/edk2-open-platform= /commits/pcie-upstream-r20190520 > > > > > > > > > > > > I'm looking forward to your comments or remarks. > > > > > > > > > > > > Best regards, > > > > > > Marcin > > > > > > > > > > Tested this on my mcbin running OpenBSD. It incovers a small iss= ue in > > > > > our kernel which I'm fixing. Otherwise this seems to work fine. > > > > > > > > > > So tested-by: Mark Kettenis if that matter= s. > > > > > > > > Always helpful, thanks. > > > > > > > > Out of interest, what was the issue? > > > > Could I still expect the 6.5 installer to run on this > > > > hardware/firmware combo? > > > > > > That should still work fine. > > > > > > The issue is with mapping PCI ROMS, which currently fails with the ne= w > > > firmware due to an oversight in the OpenBSD code. There are only a > > > few OpenBSD drivers that attempt to map the PCI ROM. But one of thos= e > > > is radeondrm(4) and I stuck an AMD graphics card into the PCIe slot o= n > > > my machine. > > > > > > There is a bit of a firmware angle to this though. The issue happens > > > because the PCI ROM address register has been set to 0xfffe0000. All > > > the writable address bits in the register are set to 1. While it is > > > possible that the hardware comes up in that state, I suspect this is > > > done by an attempt by the firmware to determine the size of the ROM > > > that doesn't properly restore the original contents of the register. > > > > UEFI deliberately leaves the ROM BARs unassigned, in order to avoid > > wasting valuable 32-bit PCI MMIO space. It enables the BAR temporarily > > to load the ROM, and dispatches it if it can. After that, it changes > > the BAR back to the old unassigned value. > > It seems that that last bit isn't working... > > > > It may be related to the following messages that are printed by the > > > firmware: > > > > > > Image type X64 can't be loaded on AARCH64 UEFI system. > > > Unloading driver at 0x00000000000 > > > > That address value is quite unexpected. > > > > > Connect: PcieRoot(0x0)/Pci(0x0,0x0): Not Found > > > > > > Hmm, that's actually interesting. Maybe I should play with the X86 > > > emulator that Ard added recently to see if that gives me a framebuffe= r > > > console. > > > > > > > Yes, if you add edk2-staging to your PACKAGES_PATH env variable, all > > you need to do is add -D X64EMU_ENABLE to the build command line. > > > > If you do end up testing this, could you please report back with the > > result, i.e., the type of card, PCI PID/VID and whether it all worked > > as expected? Thanks. > > Seems to work fine. The EFI shell and OpenBSD bootloader prompt show > up on both the framebuffer and the serial console. Thanks for the report. ... > X11 works to some extent, but there are artifacts. Half the > characters in my xterms are missing, and there are some random > characters in places where they shouldn't be. That may very well be > an OpenBSD issue though. Strangely enough 3D acceleration seems to > work fine. > This smells like a DMA coherency issue. I recently disabled an optimization in the linux version of the radeon/amdgpu drivers that resulted in similar issues: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?= id=3De02f5c1bb2283cfcee68f2f0feddcc06150f13aa