9front - general discussion about 9front
 help / color / mirror / Atom feed
From: JimErickson <jimerickso@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] 9front and raspberry pi 4 8gb model
Date: Wed, 3 Jun 2020 20:46:44 -0500	[thread overview]
Message-ID: <75b28514-feb1-0681-cdca-4575b8a3ee59@gmail.com> (raw)
In-Reply-To: <13EA58AC8E0972EE3030384A62640586@felloff.net>

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


  parent reply	other threads:[~2020-06-04  1:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 23:12 JimErickson
2020-06-02 23:23 ` [9front] " Eli Cohen
2020-06-03  7:34   ` hiro
2020-06-03 13:05     ` JimErickson
2020-06-03 17:58       ` cinap_lenrek
2020-06-03 18:28         ` hiro
2020-06-04  1:46         ` JimErickson [this message]
2020-06-04  1:57           ` ori
2020-06-04 15:30             ` JimErickson
2020-06-04 17:21               ` cinap_lenrek
2020-06-05  0:14                 ` JimErickson
2020-07-02 19:27                   ` cinap_lenrek
2020-07-02 22:27                     ` Roman Shaposhnik
2020-06-11 17:46                 ` cinap_lenrek
2020-06-13 18:58                   ` Roman Shaposhnik
2020-06-14  1:56                     ` cinap_lenrek
2020-06-14  2:43                       ` Roman Shaposhnik
2020-06-04 17:37       ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=75b28514-feb1-0681-cdca-4575b8a3ee59@gmail.com \
    --to=jimerickso@gmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).