From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f174.google.com ([209.85.208.174]) by ewsd; Wed Jun 3 21:46:51 EDT 2020 Received: by mail-lj1-f174.google.com with SMTP id 9so5204965ljc.8 for <9front@9front.org>; Wed, 03 Jun 2020 18:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=wM1wphzbrdWAJpM/KM0Y1O8BZpz4JjbR6rUKJcJJzyA=; b=iio48x4eSCX7S6iWamCbq6K8XIRk9IL8rANLhUk7Qlwq2aPGzONAq+tlQS9aTJeOdh OiCSfD2Cc9pMRMICMro7NYewCRtzR6XUgVrbRLgFpFVrq9aKAQHMRnMcjh6jtaI4Q+1Y TsUjFjbuTtA/we8NEww/AeA1uy6FyyfP6pzx+GlT9at6uJZXgiC+jDuTYv/nXAczyAfi 5sa5+o6pzpx7VBqgWL53varik4MAXPrU3yf/jO2Gqv9O+UGjaVDhgKPy9y7k/xWGHajc namfJxtBqsjT7d4CaxfJp9QzKDee3QAtnd1rsjL5YpNcNPXarOyyPOequZbm/h971SAf p1RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=wM1wphzbrdWAJpM/KM0Y1O8BZpz4JjbR6rUKJcJJzyA=; b=NegKUL7UNpPX6cJbjG0e413hUQttfB/ezhJZyUVV+306n8wnhaKssc2ASfn2qL6awa z3SSPgq5D/F4LjTLXtOf4DLP9x8KHgkgSck20igI2Doyi67PzQXtwuJPyd0PhOq28Fsi s5COjDjTX5ntHgnML/vqaEb8dJZTHGXApt8OMotwOMBB8F3ddCP3wSpO0htcJtDP0mw7 F4qX/4+tfBBaWeqTcj2LFM0ZrV6x2060bqxh/NaBSRvY9vzPp34PTAouuOjPG5rrfIUj 5UZA975xFg5YZqeuarcKY7plNnGo+OGS6/0SvkK1kUSPFCyLCv5kcY6XfMZBKTej7yKU IOtw== X-Gm-Message-State: AOAM5335a6mhQL3mM0f61T8QO9Mzp28yGRc4a11ly9NWc0TlLA+6y1vD Ut6U7eIgjw68clBq3vLK2nkYnxsbpfE= X-Google-Smtp-Source: ABdhPJzfPj62oV5VLRYwkzdt2DE6RSK8GKuIWpXAYoAknxPGebxl/y3h5Z19tByBpqroXR5CmTNvhg== X-Received: by 2002:a2e:7c03:: with SMTP id x3mr847694ljc.113.1591235207551; Wed, 03 Jun 2020 18:46:47 -0700 (PDT) Return-Path: Received: from ubuntu-nuc.jimerickson.info ([2604:2d80:4985:52f1:6d34:307f:ec7f:4308]) by smtp.gmail.com with ESMTPSA id e18sm883483lja.55.2020.06.03.18.46.46 for <9front@9front.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jun 2020 18:46:46 -0700 (PDT) Subject: Re: [9front] 9front and raspberry pi 4 8gb model To: 9front@9front.org References: <13EA58AC8E0972EE3030384A62640586@felloff.net> From: JimErickson Message-ID: <75b28514-feb1-0681-cdca-4575b8a3ee59@gmail.com> Date: Wed, 3 Jun 2020 20:46:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <13EA58AC8E0972EE3030384A62640586@felloff.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: GPU content-driven markup sorry cinap but the pre-compiled kernels did not work with the latest release and neither did the patch and resulting kernel. the end results are the same, mainly that the keyboard and mouse are not detected. i know that you are very busy, but is there anything else i can do to help out? On 6/3/20 12:58 PM, cinap_lenrek@felloff.net wrote: > the firmware is loaded by the gpu. it is just that you need to issue a > firmware command to the gpu firmware after mapping the pcie devices. > > richard miller sent me a patch, his toubleshooting is documented here: > > https://github.com/raspberrypi/firmware/issues/1402 > > the adapted and untested patch for 9front is below. > > if you have a pi4 with 8GB, it would be great if you can try it. > > just apply the patch below and build a kernel in /sys/src/9/bcm64 > with: 'mk CONF=pi4'. or you can try out the kernels i'v just build: > > http://felloff.net/usr/cinap_lenrek/9pi4 (raw kernel) > http://felloff.net/usr/cinap_lenrek/s9pi4 (a.out with debug symbols) > > the resulting 9pi4 raw kernel can be put into the sdcard image > from the latest release. > > diff -r ff6b294d07a9 sys/src/9/bcm/vcore.c > --- a/sys/src/9/bcm/vcore.c Mon Jun 01 00:07:01 2020 +0200 > +++ b/sys/src/9/bcm/vcore.c Wed Jun 03 19:17:09 2020 +0200 > @@ -53,6 +53,7 @@ > TagSetEgpioConf = 0x00038043, > > TagGettemp = 0x00030006, > + TagXhciReset = 0x00030058, > TagFballoc = 0x00040001, > TagFbfree = 0x00048001, > TagFbblank = 0x00040002, > @@ -413,3 +414,19 @@ > buf[1] = on; > vcreq(TagSetEgpioState, buf, sizeof(buf), sizeof(buf)); > } > + > +/* > + * Notify gpu that xhci firmware might need loading. This is for some > + * pi4 board versions which are missing the eeprom chip for the vl805, > + * requiring its firmware to come from the boot eeprom instead. > + */ > +int > +xhcireset(int devaddr) > +{ > + u32int buf[1]; > + > + buf[0] = devaddr; > + if(vcreq(TagXhciReset, buf, sizeof(buf), sizeof(buf[0])) == sizeof(buf[0])) > + return buf[0]; > + return -1; > +} > diff -r ff6b294d07a9 sys/src/9/bcm64/archbcm4.c > --- a/sys/src/9/bcm64/archbcm4.c Mon Jun 01 00:07:01 2020 +0200 > +++ b/sys/src/9/bcm64/archbcm4.c Wed Jun 03 19:55:12 2020 +0200 > @@ -172,5 +172,20 @@ > void > archbcm4link(void) > { > + Pcidev *p; > + > + /* > + * The firmware resets PCI before starting the host OS because > + * without SDRAM the VL805 makes inbound requests to page-in firmware > + * from SDRAM. If the OS has a different PCI mapping that would all break. > + * There's no way to pause and move the mappings and it's not really desirable > + * for the firmware to dictate the PCI configuration. Consequently, the mailbox > + * is required so that the OS can reset the VLI after asserting PCI chip reset. > + */ > + if((p = pcimatch(nil, 0x1106, 0x3483)) != nil){ > + iprint("VL805 reset...\n"); > + xhcireset(BUSBNO(p->tbdf)<<20 | BUSDNO(p->tbdf)<<15 | BUSFNO(p->tbdf)<<12); > + } > + > // addclock0link(wdogfeed, HZ); > } > diff -r ff6b294d07a9 sys/src/9/bcm64/fns.h > --- a/sys/src/9/bcm64/fns.h Mon Jun 01 00:07:01 2020 +0200 > +++ b/sys/src/9/bcm64/fns.h Wed Jun 03 19:17:09 2020 +0200 > @@ -170,6 +170,7 @@ > extern void vgpinit(void); > extern void vgpset(uint port, int on); > extern void egpset(uint port, int on); > +extern int xhcireset(int devaddr); > > /* bootargs */ > extern void bootargsinit(uintptr); > diff -r ff6b294d07a9 sys/src/9/bcm64/pi4 > --- a/sys/src/9/bcm64/pi4 Mon Jun 01 00:07:01 2020 +0200 > +++ b/sys/src/9/bcm64/pi4 Wed Jun 03 19:17:09 2020 +0200 > @@ -27,11 +27,11 @@ > link > gisb > pci > - archbcm4 > + archbcm4 pci > + usbxhci pci archbcm4 > ethergenet ethermii > ethermedium > loopbackmedium > - usbxhci pci > > ip > tcp > > -- > cinap