9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] 9front on Raspberry Pi 400
Date: Sun, 24 Jan 2021 00:42:44 +0100	[thread overview]
Message-ID: <C46BC2704F7391F743BBD3D3620A4041@felloff.net> (raw)
In-Reply-To: <010001773118295c-3721f6c3-e1a4-403a-bbcf-dd0197450fd6-000000@email.amazonses.com>

> Cinap, 

> Thank you for the response. 

> As for me building the kernel - I did not build the user space previously.
> I was thinking that I just wanted a kernel. Why build the whole user space?
> But I was wrong. I understand. So by building the user space, I got a stripped
> kernel that was much more akin to what was in the last 9front image,
> with the new kernel weighing in at 4.8MB. Unfortunately, the new kernel exhibits
> the same problems as before.

of course, we havnt changed anything.

> Some minor changes in the bootup screen, but I don’t think anything that is newly notable.

the kernel makes it to bootargs prompt.

if you had a serial console, you might even be able to type commands.

> I will include a transcription of it again below.

> I have tried to use different USB mice and external keyboard
> None of these are responsive during the 9front boot.

> They do work in raspian or labs 9 on the pi400.
> The xhcireset(BUSBNO(p->tbdf)<<20 | BUSDNO(p->tbdf)<<15 | BUSFNO(p->tbdf)<<12);
> was mentioned when addressing this in the labs version - so maybe the sdhc errors
> is preventing usb detection? Looking for the labs boot, none of the usb devices
> start to work until after I see "usb/hub... usb/kb... usb/kb... usb/kb... usb/kb... time…” 
> come up in the startup, just after the detection of the additional cores.
> Is there any similar message I should be seeing in 9front?

no. there are no such messages expected.

this is all done in the following shell script, which gets
built into the kernel: /sys/src/9/boot/nusbrc

if you want, you could modify that script and add a -d flag to nusb/usbd
invocation.

> I’m providing the raspian dmesg. I don’t know if it is of any use, but maybe you
> can glean what is hooked to which USB hub. When I booted this I had the lenovo
> mouse in the USB 2.0 port and the keyboard and Raspberry Pi (Pixart) mouse in USB 3.0 ports.

thanks! that was helpfull...

ok, none of the devices seem to appear on the dwc controller, which is good.

> Certainly if there’s any other information I need or can provide - just ask. 

is it possible to connect to the uart? i do not know how accessible
it is, but it makes troubleshooting much easier. if you have a plan9
machine that can act as a fileserver, we can even netboot new kernels
from the bootargs line without having to swap sdcards.

i made you a kernel image that you can try that checks if any of the gic
interrupts have been locked down by firmware:

http://felloff.net/usr/cinap_lenrek/9pi4	(kernel to copy on sdcard)
http://felloff.net/usr/cinap_lenrek/s9pi4	(kernel with debug symbols, for acid)
http://felloff.net/usr/cinap_lenrek/gic.c	(the changed file)

diff -r ab3f119403ba sys/src/9/bcm64/gic.c
--- a/sys/src/9/bcm64/gic.c	Sat Jan 23 18:42:46 2021 +0100
+++ b/sys/src/9/bcm64/gic.c	Sun Jan 24 00:36:33 2021 +0100
@@ -126,6 +126,7 @@
 intrsoff(void)
 {
 	int i, n;
+	u32int mask;
 
 	intrcpushutdown();
 
@@ -138,8 +139,17 @@
 	for(i = 0; i < n; i += 32){
 		dregs[GICD_ISENABLER0 + (i/32)] = -1;
 		coherence();
+		mask = ~dregs[GICD_ISENABLER0 + (i/32)];
+		if(mask)
+			print("intrsoff: GIC intids [%d-%d]: %.8ux are locked in disable state\n",
+				i, i+31, mask);
+		coherence();
 		dregs[GICD_ICENABLER0 + (i/32)] = -1;
 		coherence();
+		mask = dregs[GICD_ISENABLER0 + (i/32)];
+		if(mask)
+			print("intrsoff: GIC intids [%d-%d]: %.8ux are locked in enable state\n",
+				i, i+31, mask);
 	}
 	for(i = 0; i < n; i += 4){
 		dregs[GICD_IPRIORITYR0 + (i/4)] = 0;
@@ -202,10 +212,10 @@
 }
 
 void
-intrenable(int irq, void (*f)(Ureg*, void*), void *a, int tbdf, char*)
+intrenable(int irq, void (*f)(Ureg*, void*), void *a, int tbdf, char *name)
 {
 	Vctl *v;
-	u32int intid;
+	u32int intid, mask;
 	int cpu, prio;
 
 	if(BUSTYPE(tbdf) == BusPCI){
@@ -231,7 +241,7 @@
 	case IRQmbox2:
 	case IRQmbox3:
 	case IRQlocaltmr:
-		print("irqenable: missing documentation for local irq %d\n", irq);
+		print("irqenable: missing documentation for local irq %d, %s\n", irq, name);
 		return;
 
 	default:
@@ -252,7 +262,7 @@
 	v->f = f;
 	v->a = a;
 
-	lock(&vctllock);
+	ilock(&vctllock);
 	if(irq == IRQfiq){
 		vfiq = v;
 		prio = 0;
@@ -280,10 +290,14 @@
 	coherence();
 
 	/* turn on */
-	dregs[GICD_ISENABLER0 + (intid/32)] = 1 << (intid%32);
+	mask = 1 << (intid%32);
+	dregs[GICD_ISENABLER0 + (intid/32)] = mask;
 	coherence();
+	mask &= dregs[GICD_ISENABLER0 + (intid/32)];
+	iunlock(&vctllock);
 
-	unlock(&vctllock);
+	if(mask == 0)
+		print("intrenable: GIC intid %ud did not enable irq %d, %s\n", intid, irq, name);
 }
 
 void

This is how a normal boot on the pi4 8GB model with the change looks like
(yes, usb works, i have usb keyboard attached):

127 holes free
0x008a0000 0x3e600000 1037434880
1037434880 bytes free
can't initialise 0x0x16 framebuffer 

Plan 9
intrsoff: GIC intids [0-31]: 01ff0000 are locked in disable state
intrsoff: GIC intids [0-31]: 0000ffff are locked in enable state
cpu0: 1500MHz ARM Cortex-A72 r0p3
8102M memory: 998M kernel data, 7104M user, 31384M swap
pcienable PCI.0.0.0: pcr 0->7
pcienable PCI.1.0.0: pcr 0->2
bus dev type     vid  did  intl memory
0   0/0 06 04 00 14e4 2711   0  ioa:00000000-00001000 4096 mema:600000000-600100000 1048576 ->1
1   0/0 0c 03 30 1106 3483   0  0:600000004 4096 
#l0: genet: 1000Mbps port 0xFFFFFFFFBD580000 irq 189 ea dca632b1adfe
usbxhci: cpu2: 1500MHz ARM Cortex-A72 r0p3
cpu3: 1500MHz ARM Cortex-A72 r0p3
cpu1: 1500MHz ARM Cortex-A72 r0p3
0x1106 0x3483: port 600000000 size 4096 irq 0
#l0: phy1 id 600d84a2 oui 80361

/dev/sdM0: BCM SD Host Controller 02 Version 10
/dev/sdM0/data	
/dev/sdM0/dos	 dos
/dev/sdM0/fs	 hjfs
/dev/sdM0/nvram
/dev/sdM0/plan9
bootargs is (tcp, tls, il, local!device)[tls] 

> Thanks again,

> Mack 

--
cinap

  reply	other threads:[~2021-01-25  0:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 17:23 Mack Wallace
2021-01-23 16:11 ` cinap_lenrek
2021-01-23 21:08   ` Mack Wallace
2021-01-23 21:13   ` Mack Wallace
2021-01-23 23:42     ` cinap_lenrek [this message]
2021-01-24 15:01       ` cinap_lenrek
2021-01-26  3:33         ` Mack Wallace
2021-01-26  3:35         ` Mack Wallace
2021-01-26 11:21           ` cinap_lenrek
2021-01-26 12:09           ` cinap_lenrek
2021-01-27  2:32             ` Mack Wallace
2021-01-27 14:30               ` cinap_lenrek
2021-01-27 17:04               ` cinap_lenrek
2021-01-27 17:57               ` cinap_lenrek
2021-01-29 14:58               ` cinap_lenrek
2021-01-30  2:43                 ` Mack Wallace
2021-01-30  5:54                   ` cinap_lenrek
2021-01-30 19:23                     ` Mack Wallace
2021-01-30 19:41                       ` cinap_lenrek
2021-01-30 19:46                       ` cinap_lenrek
2021-02-01  1:16                         ` Mack Wallace

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=C46BC2704F7391F743BBD3D3620A4041@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --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).