9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@iitbombay.org>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] Plan9 on Raspberry Pi 400?
Date: Fri, 15 Jan 2021 19:03:30 -0800	[thread overview]
Message-ID: <C326318A-E287-4038-A851-4DE572ADBEA3@iitbombay.org> (raw)
In-Reply-To: <C706D12D-1ED0-4DDB-92C6-24096275F9F3@ntnu.no>

[-- Attachment #1: Type: text/plain, Size: 7015 bytes --]

USB boot is supposed to work on pi400 as well so I thought there would be no need for any firmware loading....

> On Jan 15, 2021, at 2:52 PM, Michael Engel <michael.engel@ntnu.no> wrote:
> 
> I assume loading the firmware via Linux first won't help since a PCIe reset probably also 
> resets the USB controller.
> 
> However, I just checked Richard's kernel source and it seems the firmware loading functionality
> is already included, there is a call to
> 
>        xhcireset(BUSBNO(hp->tbdf)<<20 | BUSDNO(hp->tbdf)<<15 | BUSFNO(hp->tbdf)<<12);
> 
> in http://9p.io/sources/contrib/miller/9/bcm/usbxhci.c <http://9p.io/sources/contrib/miller/9/bcm/usbxhci.c>
> 
> The comment for xhcireset in http://9p.io/sources/contrib/miller/9/bcm/vcore.c <http://9p.io/sources/contrib/miller/9/bcm/vcore.c> confirms this:
> /*
> * 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.
> */
> 
> It seems that this source code is more recent than the images for the SD card and kernel in 
> http://9p.io/sources/contrib/miller/ <http://9p.io/sources/contrib/miller/> - I'll try building a kernel based on the updated sources.
> 
> - Michael
> 
> 
>> On 15 Jan 2021, at 23:32, Bakul Shah <bakul@iitbombay.org> wrote:
>> 
>> Can you netboot Linux followed by netbooting Paln9 and have a working USB?
>> 
>>> On Jan 15, 2021, at 1:17 PM, Michael Engel <michael.engel@ntnu.no> wrote:
>>> 
>>> Hi,
>>> 
>>> I didn't test Plan 9 on my RPi 400 so far, but I think the reason for the USB problems 
>>> is the following:
>>> 
>>> The Raspberry Pi 400 (along with the Compute Module 4 and the 8 GB RAM version 
>>> of the RPI4) uses a new stepping C0 of the BCM2711. This version does not have a 
>>> dedicated EEPROM for the firmware of the xHCI USB controller and needs an 
>>> additional property mailbox call for loading the xHCI firmware after PCIe reset. 
>>> 
>>> Some code to load the firmware can be found in the circle bare-metal library (l. 88ff):
>>> https://github.com/rsta2/circle/blob/Step42.1/lib/usb/xhcidevice.cpp
>>> 
>>> -- Michael
>>> 
>>> 
>>>> On 15 Jan 2021, at 20:54, Mack Wallace <mackbw@mapinternet.com> wrote:
>>>> 
>>>> I took that microSD card that has the bootable image without USB and put it into a traditional Pi4. It boots on that without a problem and has mouse and keyboard. I notices that after the additional CPU cores are detected, that is mentions usb/hub… usb/kbd….  The image when booting on the Pi 400 never provides those messages.
>>>> 
>>>> Regards,
>>>> 
>>>> Mack 
>>>> 
>>>>> On Jan 15, 2021, at 1:44 PM, Mack Wallace <mackbw@mapinternet.com> wrote:
>>>>> 
>>>>> Dear Skip,
>>>>> 
>>>>> That pushed the ball forward significantly, but I still have issues. (But thank you, every little advancement helps.) So with that flag, I was able to get Richard’s port to boot into Glenda’s account (showing acme, faces, stats, etc). However, I do not seem to have any USB; no mouse; nor keyboard. Stats is moving on the screen, so things are not too locked up. I did try rebooting with an external keyboard and another mouse. Still nothing. The external keyboard doesn’t respond to anything (no caps lock nor num lock.) One mouse is in the USB 2.0 port, another and the external keyboard are in the USB 3.0 ports. 
>>>>> 
>>>>> on boot, I see the following:
>>>>> usbxhci: 0x1106 0x3483 port 600000000 size 0x1000 irq0
>>>>> #u/usb/ep1.0: xhci port 0x0 irq 0
>>>>> 
>>>>> The line before is #l for the network,
>>>>> The line after is the detection of the other three cores.
>>>>> 
>>>>> The changing of the enable_gic=1 on the 9front image seemed to have to effect.
>>>>> 
>>>>> Thanks again!
>>>>> 
>>>>> Mack
>>>>> 
>>>>> 
>>>>> On Jan 14, 2021, at 8:15 PM, Skip Tavakkolian <skip.tavakkolian@gmail.com> wrote:
>>>>>> 
>>>>>> I'm using a RPi400 with Richard's port. I'm netbooting without issues and up for days.  The only issue I had was forgetting to set 'enable_gic=1' as Richard instructed in the sources. Pi4 works ok without it, pi400 doesn't.
>>>>>> 
>>>>>> 
>>>>>> On Thu, Jan 14, 2021, 3:39 PM Mack Wallace <mackbw@mapinternet.com> wrote:
>>>>>> Thank you for the reply Stuart, but no luck.
>>>>>> 
>>>>>> I did download Mr. Miller’s image. It would not boot at all until I replaced the files that you mention, but the kernel in that image locks up after detecting the fourth core of the CPU. However, from that failure I learned that those files, (start_cd.elf, start4cd.elf, fixup_cd.dat, fixup4cd.dat) are necessary for the Pi to boot, and that those with the bootcode.bin and presumably, but it doesn’t seem to matter whether I use bcm2711-rpi-4-b.dtb or bcm2711-rpi-400.dtb - the dtbs are vital to the process. - and that all those files simply need to be copied into the fat partition/boot directory.
>>>>>> 
>>>>>> So I burned another image (actually many, trying different SD cards, and different configurations, older kernels, etc) and replaced all the files I’ve mentioned with the ones from https://github.com/raspberrypi/firmware/tree/master/boot (hopefully that’s where I should get them). My most recent iteration just has the single error repeated:
>>>>>> 
>>>>>> sdhc: read error intr 2008002 stat 1fff0000
>>>>>> 
>>>>>> This occurs many times. In the middle of these errors is 
>>>>>> 
>>>>>> /dev/sdM0: BCM SD Host Controller 02 Version 10
>>>>>> 
>>>>>> then the error repeats itself over 50 times before printing out the lines
>>>>>> /dev/sdM0/data
>>>>>> bootargs is (tcp, tls, il, local!device)[]
>>>>>> 
>>>>>> At no time during this process is the keyboard or mouse responsive. Though the mouse icon did become visible during the boot process. 
>>>>>> 
>>>>>> I am hoping I am wrong, but I am thinking there is some sort of driver issue. At the very least, checking what media there is to mount, or reading the SD card. And then possibly for other things, but the former could be gumming up the works for everything else.
>>>>>> 
>>>>>> 
>>>>>>> On Jan 14, 2021, at 6:05 PM, Stuart Morrow <morrow.stuart@gmail.com> wrote:
>>>>>>> 
>>>>>>> Try copying the .dtb *and* the start4 and fixup4.
>>>> 
>>>> 9fans / 9fans / see discussions + participants + delivery options Permalink
> 
> ------------------------------------------
> 9fans: 9fans
> Permalink: https://9fans.topicbox.com/groups/9fans/T0178132f3d2ed689-M4ea16344e3a69dd362d2644c <https://9fans.topicbox.com/groups/9fans/T0178132f3d2ed689-M4ea16344e3a69dd362d2644c>
> Delivery options: https://9fans.topicbox.com/groups/9fans/subscription <https://9fans.topicbox.com/groups/9fans/subscription>

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T0178132f3d2ed689-Meeebf6e95b6234082af60b40
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 29013 bytes --]

  parent reply	other threads:[~2021-01-16  3:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 21:34 Mack Wallace
2021-01-14 23:05 ` Stuart Morrow
2021-01-14 23:37   ` Mack Wallace
2021-01-15  1:15     ` Skip Tavakkolian
2021-01-15 18:44       ` Mack Wallace
2021-01-15 19:54         ` Mack Wallace
2021-01-15 21:17           ` Michael Engel
2021-01-15 21:58             ` Stuart Morrow
2021-01-15 22:32             ` Bakul Shah
2021-01-15 22:52               ` Michael Engel
2021-01-16  0:31                 ` Mack Wallace
2021-01-16  1:01                   ` Michael Engel
2021-01-16 10:24                     ` Richard Miller
2021-01-16 11:28                       ` Michael Engel
2021-01-18 14:51                   ` Richard Miller
2021-01-18 15:42                     ` Mack Wallace
2021-01-18 16:54                       ` ori
2021-01-19  8:20                         ` hiro
2021-01-19  0:54                       ` Stuart Morrow
2021-01-19  4:13                         ` Lucio De Re
2021-01-19  9:52                           ` Richard Miller
2021-01-20 15:25                             ` Mack Wallace
2021-01-16  3:03                 ` Bakul Shah [this message]
2021-01-16  7:19         ` Skip Tavakkolian
2021-01-16 16:15       ` Skip Tavakkolian
2021-01-16 17:12 Richard Miller
2021-01-16 21:24 ` Skip Tavakkolian
2021-01-16 22:14   ` Bakul Shah
2021-01-17  7:11     ` Skip Tavakkolian

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=C326318A-E287-4038-A851-4DE572ADBEA3@iitbombay.org \
    --to=bakul@iitbombay.org \
    --cc=9fans@9fans.net \
    /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).