00:03
<
samueldr >
>> [ 5.898888] systemd[1]: Set hostname to <nixos>.
00:03
<
samueldr >
so it's in stage-2 now
00:03
<
samueldr >
but still nothing on the display
00:05
alp has quit [Remote host closed the connection]
00:05
alp has joined #nixos-aarch64
00:11
alp has quit [Ping timeout: 272 seconds]
00:24
cole-h has quit [Quit: Goodbye]
00:45
rajivr has joined #nixos-aarch64
01:14
Mirrexagon has quit [Ping timeout: 264 seconds]
01:19
Mirrexagon has joined #nixos-aarch64
01:22
h0m1 has quit [Ping timeout: 246 seconds]
01:24
h0m1 has joined #nixos-aarch64
01:36
Mirrexagon has quit [Ping timeout: 256 seconds]
01:41
juliosueiras has quit [Ping timeout: 272 seconds]
01:49
Mirrexagon has joined #nixos-aarch64
01:49
knerten2 has quit [Remote host closed the connection]
02:31
<
samueldr >
oh neat, I don't know why I didn't try this earlier, looks like the usb gadget for networking is the standard gsi.rndis
02:33
<
samueldr >
finally, I can have a peek around!
02:51
justanotheruser has quit [Ping timeout: 272 seconds]
04:06
ninjin_ has quit [Ping timeout: 240 seconds]
04:07
ninjin_ has joined #nixos-aarch64
04:15
<
lovesegfault >
samueldr: alright, to close up the topic
04:15
<
lovesegfault >
(and with a cc. to clever)
04:16
<
lovesegfault >
Old bootloader + Kernel 4.9: Works
04:16
<
lovesegfault >
U-boot + Kernel 4.9: Doesn't work
04:16
<
lovesegfault >
U-boot + Kernel 5.4: Doesn't work
04:18
<
lovesegfault >
I suspect it's because of U-boot always enabling the UART which in turn jumbles the DPI-over-GPIO
04:18
<
samueldr >
highly probable
04:21
<
lovesegfault >
I'd like to try 5.4 + old bootloader
04:21
<
lovesegfault >
we'll see
04:22
<
lovesegfault >
Oh, also: `hardware.deviceTree` is
_broken_ with the traditional bootloader
04:23
<
samueldr >
it would at least give a sample size of (1) to know about misc. hardwar
04:23
<
samueldr >
misc. hardware*
04:23
<
lovesegfault >
it may or may not work with uBoot, I couldn't find out because I could never get the screen to work
04:47
orivej has joined #nixos-aarch64
04:52
<
lovesegfault >
samueldr: is there some way I can dump a file in /boot via a NixOS config option?
04:52
<
lovesegfault >
almost like a `environment.etc` thing
04:52
<
samueldr >
not really
04:53
<
lovesegfault >
that's a shame
04:53
<
lovesegfault >
basically means there is no way to package the hyperpixel anymore
04:54
<
lovesegfault >
since deviceTree is broken
04:54
<
clever >
lovesegfault: the uart is only on 2 DPI color pins
04:55
<
clever >
lovesegfault: so the DPI should still work, but the colors will be messed up
04:56
<
lovesegfault >
clever: Hmm, that doesn't match my observations :P
04:56
<
lovesegfault >
unless the colors are so messed up it's all black
04:57
<
clever >
does linux still boot?
04:57
<
lovesegfault >
Yeah, linux booted fine
04:57
<
clever >
cat /sys/kernel/debug/pinctrl/*.gpio-pinctrl-bcm2835/pins
04:57
<
clever >
pins ~0-27 should be in alt2 mode
04:57
<
clever >
some pins may be unused
04:57
<
clever >
compare what the pins file has, between working and broken
04:57
<
lovesegfault >
let me cook up another rpi image
04:58
<
lovesegfault >
I don't want to mess up this one that is working
04:59
<
lovesegfault >
this is what it looks like in a working system
05:00
<
clever >
10/11, 18/19, 26/27 are holes in the mapping
05:00
<
clever >
that matches up with mode 6 in the documents
05:00
orivej has quit [Ping timeout: 272 seconds]
05:00
<
lovesegfault >
yep, I see that
05:01
<
clever >
the rest are all in alt2, so the DPI peripheral can control things
05:01
<
lovesegfault >
let's see what happens when I bake the image I was using previously
05:01
<
clever >
that also acts as a hint, on what i should do when trying to drive it
05:02
<
lovesegfault >
flashing...
05:03
<
lovesegfault >
flashed
05:03
<
lovesegfault >
clever: any last log/data you want from the working system before I swap out sd cards?
05:03
<
clever >
yeeah, one sec
05:05
<
clever >
then nix-build -A arm7.utils
05:05
<
clever >
that will cross-compile some utils
05:05
<
clever >
then nix-copy-closure the path over to the pi, and run the pv_dumper
05:05
<
lovesegfault >
clever: this is the RPi4 again
05:06
<
clever >
that should be fine
05:06
<
lovesegfault >
I thought it was arm8?
05:06
<
clever >
it can still run arm7 code
05:06
<
lovesegfault >
Right, alright
05:06
<
clever >
as long as 32bit is enabled in the kernel
05:06
<
clever >
and nix deals with getting a compatible libc
05:06
<
clever >
so all of the other complications vanish
05:06
<
lovesegfault >
alright, I'm building those tools
05:07
<
lovesegfault >
done
05:07
<
clever >
pv_dumper will print all of the config for the graphics system
05:07
<
clever >
which would let you put the system into the same state again, without the drivers/firmware
05:07
justanotheruser has joined #nixos-aarch64
05:08
<
lovesegfault >
nix copying to device
05:10
<
lovesegfault >
anything else before I reboot?
05:11
<
clever >
that looks good
05:11
<
lovesegfault >
going down
05:11
orivej has joined #nixos-aarch64
05:11
<
lovesegfault >
the hyperpixel doesn't just go black when you `sudo shutdown now`
05:11
<
lovesegfault >
it slowly fades into a black backlight
05:12
<
clever >
sounds like the lcd driver wasnt turned off properly, but it just stopped refreshing
05:12
<
clever >
and the lcd was left to fade
05:13
alp has joined #nixos-aarch64
05:13
<
lovesegfault >
first boot successful, deploying config
05:14
<
clever >
pixel clock: XOSC / 1.687500 == 32.000000
05:14
<
clever >
i notice that the pi4 can use the crystal for DPI clock, because its 54mhz vs 19.2mhz
05:15
<
clever >
but its using fractional division, so it may have some dotcrawl
05:21
<
lovesegfault >
rebooting into new config
05:24
<
samueldr >
neat, confirmed that with DRM I can get something happening with the display
05:24
<
samueldr >
though not neat... it seems that whoever wrote the kernel drivers didn't need "old-school" framebuffer support
05:24
<
samueldr >
so the kernel doesn't support that AFAIK
05:25
<
samueldr >
so I guess I need to implement a DRM-backed version of the graphical tooling
05:25
zupo has joined #nixos-aarch64
05:25
<
lovesegfault >
clever: alright I'm in a baseline uBoot + 4.9 system. What would you like me to try?
05:26
<
clever >
lovesegfault: re-cat pins, and re-run pv_dumper, how do they differ?
05:26
<
lovesegfault >
pins are completely different, getting them into gist right now
05:28
<
lovesegfault >
mind you: I am making no effort to load the dtbo and have not set anything into the config.txt
05:28
<
lovesegfault >
so it's really vanilla
05:28
<
lovesegfault >
getting you the pv_dumper
05:28
<
clever >
ah, youll want to try and make it work, and see how closely it matches up
05:29
<
lovesegfault >
alright, I'll do that after the pv_dump
05:29
<
lovesegfault >
at least we'll have a baseline, even if useless
05:30
<
clever >
of note, pins shows that 14/15 is in alt5 mode
05:30
<
clever >
which is the aux uart
05:31
<
lovesegfault >
alright, next set of data will be as follows: no attempt to load DTBOs, but setting all of the expected things in the config.txt (manually)
05:32
<
lovesegfault >
here's what my config.txt looks like
05:32
<
lovesegfault >
rebooting
05:33
<
lovesegfault >
so, immediately: there is no output on the HDMI during early boot
05:33
<
lovesegfault >
after a few seconds HDMI displays the rainbow square
05:33
<
lovesegfault >
nothing on screen, which is expected. ssh'ing in...
05:33
<
lovesegfault >
well, maybe
05:34
<
lovesegfault >
it's gone into four flashes mode (rainbow on HDMI, green LED flashes four times every few seconds) which I have learned means "busted"
05:35
<
lovesegfault >
going to pop in the sd card and remove the dtoverlay lines, since those overlays aren't there to be loaded in the first place, and see if that helps
05:35
<
clever >
that means it cant find start4.elf on the fat32 partition
05:37
<
lovesegfault >
same
05:37
<
lovesegfault >
disabling all my additions
05:38
<
lovesegfault >
alright, with everything uncommented it boots fine again
05:38
<
lovesegfault >
so, something in that clause at the very bottom is causing issues
05:39
<
clever >
whats in that last clause?
05:39
<
lovesegfault >
this is what I added
05:39
<
lovesegfault >
which caused it to not even boot
05:39
<
lovesegfault >
removing the dtoverlay portions made no difference
05:40
<
lovesegfault >
so one of these makes it not boot
05:40
<
clever >
ah, not sure why those would break it
05:41
<
clever >
uart_2ndstage=1 and a uart adapter may give hints
05:41
<
lovesegfault >
we're back to me not having one (yet) :(
05:42
<
clever >
you can abuse a 2nd pi as a uart adapter
05:43
<
clever >
cross-link tx->rx, gnd<->gnd, and then enable_uart=1 on the "adapter" pi
05:44
<
lovesegfault >
let me see if I can find jumpers
05:47
<
lovesegfault >
Hm, no
05:47
<
lovesegfault >
any UART debugging will have to wait until later in the week
05:48
<
lovesegfault >
trying to add the dtbo's
_and then_ enable those gpio_dpi things
05:49
<
lovesegfault >
it doesn't crash
05:49
<
lovesegfault >
doesn't work but doesn't crash
05:50
<
lovesegfault >
current config
05:50
<
lovesegfault >
boots, nothing on display
05:50
<
lovesegfault >
reading pins
05:50
<
clever >
adding config, pins, and pv_dumper to the same gist can help
05:50
<
lovesegfault >
clever: you're right, I'll do that
05:52
<
lovesegfault >
combined
05:52
<
lovesegfault >
you can see the pins are in the
_wrong_ state
05:52
<
lovesegfault >
s/state/mode/
05:53
<
clever >
yep, PV is configured, but altmodes are wrong
05:53
<
clever >
my theory, is that u-boot undid the dtoverlay=
05:53
<
clever >
so you have to setup the overlay with nix+uboot
05:53
<
lovesegfault >
let's try that as well
05:54
<
lovesegfault >
oh, wait, I forgot the init service!
05:54
<
lovesegfault >
let's see if that does anything
05:55
<
clever >
if you read the service, what does it do?
05:55
<
lovesegfault >
it runs a C thing, one second
05:57
<
clever >
looks like its writing some things over SPI
05:57
<
clever >
but if the pins are in the wrong altmode, it will never show an image
05:59
<
clever >
but there is no SPI controller on those pins
05:59
<
lovesegfault >
post init-service
05:59
<
clever >
so its having to bit-bang the SPI
05:59
<
lovesegfault >
now adding the dtbo's to Nix' deviceTree paraphernalia
05:59
<
clever >
that might also explain why my code never worked
05:59
<
clever >
it might be dpi with extra init
06:02
<
lovesegfault >
rebooting with the dtbo's applied via `hardware.deviceTree`
06:03
<
lovesegfault >
nope
06:03
<
lovesegfault >
gathering data
06:04
<
lovesegfault >
I swear this thing just doesn't apply the dtbo
06:04
<
lovesegfault >
going to try giving it the dts source
06:04
<
clever >
lets look at the source, what does hardware.deviceTree actually do?
06:05
<
lovesegfault >
clever: wait, I have an idea
06:05
<
clever >
modules/hardware/device-tree.nix: cfg = config.hardware.deviceTree;
06:05
<
clever >
32 example = literalExample
06:05
<
clever >
33 "[\"\${pkgs.deviceTree_rpi.overlays}/w1-gpio.dtbo\"]";
06:05
<
clever >
36 A path containing device tree overlays (.dtbo) to be applied to all
06:05
<
clever >
54 then pkgs.deviceTree.applyOverlays cfg.base cfg.overlays else cfg.base;
06:05
<
clever >
53 hardware.deviceTree.package = if (cfg.overlays != [])
06:05
<
clever >
so the hardware.deviceTree.package will contain the result of applying the overlay
06:06
<
clever >
and it just runs fdtoverlay in a derivation, to apply each one
06:06
<
clever >
10 for dtb in $(find ${base} -name "*.dtb" ); do
06:06
<
clever >
11 outDtb=$out/$(realpath --relative-to "${base}" "$dtb")
06:06
<
clever >
and it will patch every dtb in the input
06:07
<
clever >
nixos/modules/system/activation/top-level.nix: ln -s ${config.hardware.deviceTree.package} $out/dtbs
06:07
<
clever >
lovesegfault: and it should then put the patched dtb in /run/current-system/dtbs, if you run dtc on one, you can view the source
06:08
<
clever >
boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh: echo " FDTDIR ../nixos/$(basename $dtbs)"
06:10
<
lovesegfault >
clever: check my PM to you
06:11
<
clever >
lovesegfault: checking the source above, it definitely wants a dtbo
06:11
<
clever >
lovesegfault: try another build, and lets look at the result
06:12
<
lovesegfault >
you can ./result (i.e. run) to deploy to the system
06:13
<
clever >
line 141 says what pins are part of dpi
06:13
<
clever >
so if something wants dpi_gpio0, it knows how to give it
06:13
* lovesegfault
nods
06:13
<
clever >
644 is 18bit dpi
06:13
<
clever >
instead of 24bit dpi
06:14
<
lovesegfault >
aha!
06:14
<
clever >
and aha, dpi is status="disabled";
06:14
<
clever >
which dtbo did you apply?
06:14
<
lovesegfault >
all three
06:15
<
clever >
none of those enable dpi
06:16
<
lovesegfault >
let me check something
06:16
<
clever >
i think whats happening, is that the enable_dpi_lcd=1 is doing its own overlays
06:16
<
clever >
which dont exist in any dtbo file
06:17
<
clever >
so you have to compare `dtc /proc/device-tree` between with&without, then write your own overlay to fix it
06:17
<
samueldr >
it's like they're trying to make it harder to use anything else than their secret sauce :(
06:17
<
clever >
samueldr: this is kind of what dtb was meant to do, and uboot is breaking stuff
06:17
<
samueldr >
that's totally orthogonal
06:17
<
clever >
dtb describes the hw, and the firmware is generating dtb that accurately describes the state
06:18
<
clever >
but then uboot goes "no, i know better" and uses its own dtb
06:18
<
samueldr >
why aren't those dtbo "sauces" available outside of the blackbox of the firmware?
06:18
<
clever >
yeah, that is still a good point
06:18
<
samueldr >
but yeah, I do agree that if u-boot was using the board-native FDT it'd be better
06:18
<
clever >
its probably just a complexity thing, a lot of this dtbo is dynamically generated based on config.txt
06:19
<
samueldr >
probably
06:19
<
clever >
so it would be rather complex to make a dtbo for every combination
06:19
<
samueldr >
though it'd be nice to have that state machine be publicly documented
06:19
<
samueldr >
because that's going to hurt mainline too
06:19
<
lovesegfault >
the screen flashes during early boot, which tells me something is kind of working
06:19
<
clever >
thats why i want better open source
06:19
<
clever >
so that whole mess is just plainly visible, and can be changed freely
06:19
<
lovesegfault >
clever: with & without uboot you mean?
06:20
<
clever >
lovesegfault: the firmware might setup DPI properly, but then linux takes over, and changes the unused pins to input
06:20
<
lovesegfault >
I see
06:20
<
lovesegfault >
let's do it! I'll pop in the working card
06:20
<
samueldr >
ugh, kind of stuck right now :| the fact that the razer phone 2 uses DRM is causing trouble
06:20
<
clever >
lovesegfault: yeah, compare `dtc /proc/device-tree` when its fully working, to how it looks with uboot and it partially working
06:20
<
lovesegfault >
or, actually, let me dump this one first
06:20
zupo has quit [Ping timeout: 260 seconds]
06:21
<
samueldr >
I guess the "better" way to solve it is to make the DRM-based framebuffer emulation work
06:21
<
samueldr >
as it's more universal and would allow framebuffer-only stuff to work
06:21
<
clever >
samueldr: which DRM? heh
06:21
<
samueldr >
the good stuff
06:21
<
samueldr >
Linux's direct rendering
06:21
<
clever >
on the pi, thats what the legacy route did, just give linux a pointer and the w/h
06:22
<
clever >
and linux exposed it as /dev/fb0
06:22
<
samueldr >
there's already stuff in the kernel for fbdev emulation
06:22
<
clever >
but then you have no 2d accel, and when you get up to 4k, performance suffers
06:22
<
lovesegfault >
clever: popped in the working one
06:22
<
samueldr >
but it somehow doesn't seem to work here
06:22
<
samueldr >
which is what I'll need to investigate
06:22
<
clever >
lovesegfault: hping2 is also handy to know when its booted
06:22
<
samueldr >
but now that I've confirmed it
_is_ that problem, I can at least move on and test
06:22
<
samueldr >
and gsi.rndis working is great, that means I can actually run things in stage-1 to test
06:24
<
lovesegfault >
clever: check out the diff
06:24
<
clever >
try `diff -u --color`
06:24
<
clever >
it makes it more readable
06:24
cole-h has joined #nixos-aarch64
06:24
<
samueldr >
oh, neat, also remembered why stage-2 ssh was broken
06:25
<
clever >
lovesegfault: reading...
06:25
<
samueldr >
a big leftover TODO if stage-1 sshd is running it'll trample on the port and not release it
06:25
<
clever >
model differs slightly, not an issue
06:25
<
clever >
i see an i2c bus, with ft6236 nodes, for compatible=goodix,gt911
06:26
<
lovesegfault >
that's the touchscreen on this thing, I think
06:26
<
clever >
that should be present on both, if uboot was applying the overlay i saw earlier
06:26
<
lovesegfault >
which I haven't bothered testing yet
06:26
<
clever >
but if its touchscreen, we can ignore it or now
06:26
<
lovesegfault >
right
06:26
<
lovesegfault >
dpi18!
06:26
<
lovesegfault >
and uart as well
06:26
<
clever >
dpi18_pins is missing on one of them, yeah
06:26
<
clever >
and the uart is using different pins,
*decodes*
06:27
<
{^_^} >
attempt to call something which is not a function but an integer, at (string):324:1
06:27
<
samueldr >
turns out X11 tries hard
06:27
<
clever >
which is bluetooth
06:27
<
lovesegfault >
that's in the RPi FW version
06:27
<
lovesegfault >
right?
06:28
* lovesegfault
forgot the diff order
06:28
<
clever >
ah, but the difference is minor
06:28
<
clever >
its just the hw flow control
06:28
<
clever >
so bluetooth may suffer, but minor
06:28
<
clever >
the entire framebuffer node is missing, it was 800 x 480, which i think is your lcd?
06:29
alp has quit [Ping timeout: 272 seconds]
06:29
<
clever >
and the address for that node is dynamic, so there is no way to ever make it with a dtbo
06:29
* lovesegfault
chefs hands
06:29
<
clever >
it depends on where the gpu malloc() decided to put things
06:29
<
clever >
aha, and that linux,revision is a good hint
06:30
<
clever >
thats only done by the firmware (closed and open), but not uboot
06:30
<
clever >
.... so why is it in the reverse end of the diff! lol
06:31
<
clever >
and the model, rev 1.2 feels like its done by the firmware
06:31
<
lovesegfault >
wait, there's another comaparison I want to run
06:31
<
clever >
that implies that uboot is adding the framebuffer, when the firmware wasnt
06:31
<
clever >
reading each dts seperately
06:32
<
clever >
..... device-tree-working.dump has status="disabled"; on the dpi
06:34
<
lovesegfault >
compare device-tree-equal.dump
06:34
<
lovesegfault >
I removed the config.txt that disabled i2
06:34
<
lovesegfault >
*i2c
06:34
<
lovesegfault >
on uBoot
06:34
<
lovesegfault >
should look more similar
06:35
zupo has joined #nixos-aarch64
06:35
<
clever >
i2c2_iknowwhatimdoing = [00 00 00 15 73 74 61 74 75 73 00];
06:35
<
clever >
yeah, now i'm just confused
06:35
<
clever >
these dumps say that the dpi is never enabled
06:37
<
lovesegfault >
well the big difference is this dpi18_pins clause
06:38
<
clever >
yeah, but nothing refers to it that i can see
06:38
<
clever >
dpi18_pins {
06:38
<
clever >
phandle = <0xc8>;
06:39
<
clever >
something should have a c8 in it...
06:39
<
clever >
rpi_backlight {
06:39
<
clever >
pinctrl-0 = <0xc8>;
06:39
<
lovesegfault >
( samueldr let me know if you want a link to the tmate we're using to hack on )
06:39
zupo has quit [Ping timeout: 246 seconds]
06:39
<
clever >
dpi_18bit_gpio0 {
06:39
<
clever >
phandle = <0x88>;
06:39
<
lovesegfault >
wtf is mailbox
06:40
<
clever >
so only dpi18_pins is used, by rpi_backlight
06:40
<
clever >
mailbox is how the arm and vpu talk to eachother
06:40
<
clever >
basically, its just a pair of FIFO's
06:40
<
clever >
you write a 32bit sample to one end, and the other party can read the 32bit sample back out
06:41
<
clever >
the write side has flags to say if there is room to write more
06:41
<
clever >
the read side has flags to say if you can read, which can trigger an IRQ
06:41
<
lovesegfault >
all of the rpi_backlight is missing
06:41
<
lovesegfault >
but
_why_
06:42
<
clever >
the gpios contains 15 and 19
06:42
<
clever >
that could either be absolute pin#'s, or offsets within the list for dpi18_pins
06:42
<
clever >
you would have to check the source of gpio-backlight to know for sure
06:42
<
clever >
pins may also act as a hint...
06:42
<
lovesegfault >
Where does that live even?
06:43
<
clever >
pin 15 (gpio15) function alt2 in hi; irq 0 (none)
06:43
<
clever >
pin 19 (gpio19) function gpio_out in hi; irq 0 (none)
06:43
<
lovesegfault >
right, in mode 6 pin 19 is unused
06:43
<
clever >
so 19 still being an output, implies its the backlight
06:44
<
clever >
can you ssh into the working card?
06:44
<
clever >
we can check something more on that angle
06:44
<
lovesegfault >
yep, one moment so I can swap out
06:44
<
lovesegfault >
booting
06:45
<
lovesegfault >
screen is working, FWIW
06:46
<
clever >
[root@aurelius:/sys/devices/platform/rpi_backlight/backlight/rpi_backlight]# cat brightness
06:46
<
clever >
gone dark?
06:46
<
lovesegfault >
screen off
06:46
<
clever >
and if you hit it with a bright light, you should see image still?
06:46
<
lovesegfault >
trying
06:46
<
clever >
[root@aurelius:/sys/devices/platform/rpi_backlight/backlight/rpi_backlight]# echo 0 > brightness
06:47
<
lovesegfault >
try displaying something more interesting on the tty
06:47
<
lovesegfault >
like htop
06:47
<
lovesegfault >
might make it easier to eval
06:48
<
lovesegfault >
nope
06:48
polarfire has joined #nixos-aarch64
06:48
<
lovesegfault >
I can't see it at least
06:48
<
lovesegfault >
it was there
06:48
<
clever >
i can confirm that 19 is changing when we turn it on/off
06:49
<
clever >
but the panel might be doing more then just backlight
06:49
<
clever >
it could be going into a low-power state and turning the lcd off too
06:49
<
lovesegfault >
Maybe
06:49
<
ehmry >
is there a trick to getting menuconfig working? instructions in the manual don't work
06:49
<
clever >
so in addition to the right pins being in alt2, you must also setup the gpio-backlight properly
06:49
<
clever >
ehmry: what error does it fail with?
06:49
<
lovesegfault >
FTR: with the non-working setup the backlight stays always-on
06:49
<
lovesegfault >
which matches our observations
06:50
<
clever >
lovesegfault: most pins have a pullup, causing it to stick on
06:50
<
lovesegfault >
clever: maybe we need to force uBoot to load i2c_gpio and gpio_backlight early?
06:50
<
lovesegfault >
using like boot.initrd.kernelModules or w/e
06:50
<
clever >
lovesegfault: the order it loads in doesnt really matter much
06:51
<
clever >
ehmry: you have to mess with pkgconfig a bit, to get the host ncurses into scope
06:52
zupo has joined #nixos-aarch64
06:53
<
lovesegfault >
I wonder if in the non-working one gpio-backlight was loaded at all
06:53
<
clever >
lovesegfault: lets investigate how its working more...
06:54
<
clever >
[ 0.882374] bcm2708_fb soc:fb: FB found 1 display(s)
06:54
<
clever >
lovesegfault: ahhhh, thats why dpi is disabled in dtb
06:54
<
lovesegfault >
why does it find only one? I have HDMI plugged in
06:54
<
clever >
lovesegfault: your still using the legacy graphics api's
06:54
<
lovesegfault >
I am?
06:54
<
clever >
lovesegfault: hdmi only works if you set a config.txt to enable 2-screen mode
06:54
<
clever >
[ 0.887215] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 480x800
06:54
<
clever >
because your using the legacy api, that makes a lot more sense
06:55
<
clever >
linux (and by extension uboot) should just not touch the altmode for most pins
06:55
<
lovesegfault >
can we make it use the non-legacy one and see?
06:55
<
clever >
and the backlight is the only thing in the dtb, so linux can do stuff a framebuffer cant
06:55
<
clever >
you then use the mailbox api (linked above) to ask the GPU firmware for the addr of a framebuffer
06:55
<
clever >
and the GPU does all of the work for you
06:56
<
lovesegfault >
Oh, this is probably b/c it's the old 4.9 kernel
06:56
<
samueldr >
thanks, nah, I'm fed up enough with my own display issues :)
06:56
<
clever >
i think you want `dtoverlay=vc4-fkms-v3d`
06:57
<
clever >
that will then properly describe everything in the dtb file
06:57
<
clever >
but its missing from your overlays folder, so you have to copy one over
06:59
<
ehmry >
clever: that works if I also set NIX_CFLAGS_LINK
06:59
<
lovesegfault >
clever: let's see, can I reboot?
06:59
<
clever >
lovesegfault: yep
06:59
<
lovesegfault >
coming up...
06:59
<
clever >
ehmry: yeah, thats how i fixed it in the past, but digging in, i found that linux is using pkgconfig to find the link flags on its own
07:00
<
lovesegfault >
screen is up
07:00
<
samueldr >
I found that there may be bugs in that implementation
07:00
<
samueldr >
version-dependent
07:00
<
clever >
[ 6.156009] vc4-drm soc:gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops [vc4])
07:00
<
lovesegfault >
noice
07:00
<
clever >
lovesegfault: your now using the firmware kms driver
07:00
<
clever >
[ 6.195224] vc4-drm soc:gpu: fb0: DRM emulated frame buffer device
07:00
<
lovesegfault >
awesome
07:00
<
ehmry >
whatever, the kernel is a shitfest
07:00
<
clever >
and then its emulating a framebuffer over kms!
07:01
zupo_ has joined #nixos-aarch64
07:01
<
samueldr >
but that nconf-cfg.sh script is not really good IIRC
07:02
polarfire has quit [Quit: WeeChat 2.7.1]
07:02
<
clever >
lovesegfault: ah yeah, pi4, the driver doesnt support direct control yet, so dpi will still be status = disabled
07:03
<
clever >
lovesegfault: dtoverlay=vc4-kms-v3d-pi4 would give linux more control, but that driver is currently unfinished
07:03
<
clever >
so i'm thinking the problem might be the uboot build
07:03
<
clever >
because linux is clearly leaving the unused pins alone
07:03
<
clever >
why is that changing?
07:03
<
lovesegfault >
Right, the only variable changing here is uBoot
07:03
<
lovesegfault >
well, ish
07:03
<
clever >
what was the storepath to the broken build? dont need to boot it
07:04
<
lovesegfault >
let me get it
07:04
<
lovesegfault >
can I close the nvim diff?
07:04
zupo has quit [Ping timeout: 256 seconds]
07:05
<
clever >
system("/nix/store/3zm9jxia7wv8sgghrv3qfxg2pv09wgpa-extlinux-conf-builder.sh -g 20 -t 5 -c $out") == 0 or exit 1;
07:05
<
clever >
lovesegfault: this script gets ran to update /boot and build the rollback menu
07:06
* lovesegfault
nods
07:06
<
clever >
samueldr: oh, but doesnt nixos ignore the uboot binary in /firmware/ ?
07:06
<
samueldr >
what do you mean?
07:06
<
clever >
nixos just updates cfg and never the uboot binary
07:06
<
lovesegfault >
AIUI if it's in /boot/firmware NixOS doesn't touch it
07:06
<
clever >
so how do we get the drv for the uboot binary, thats in this img?
07:07
<
samueldr >
well, there is something for the raspberry pi (only) that might update it
07:07
<
lovesegfault >
(in a u-boot configuration)
07:07
<
clever >
which attr path is it coming from
07:07
<
clever >
lovesegfault: and which nixpkgs are you building the img from?
07:08
<
clever >
lovesegfault: `niv show nixpkgs`
07:09
<
lovesegfault >
ubootRaspberryPi4_64bit
07:09
<
clever >
nix-repl> ubootRaspberryPi4_64bit
07:09
<
clever >
error: undefined variable 'ubootRaspberryPi4_64bit' at (string):1:1
07:10
<
clever >
lovesegfault: this nixpkgs lacks the pi4 uboot
07:10
<
lovesegfault >
... but I updated it today
07:11
<
clever >
thats a commit from sept 15th
07:12
<
clever >
now its on sept 10th!!
07:12
<
lovesegfault >
WERE GOING BACK IN TIME
07:12
alp has joined #nixos-aarch64
07:12
<
lovesegfault >
ok, therest a sept. 19th commit right before
07:12
<
clever >
samueldr: whats the deal with nixpkgs-channels, do we still want to use that for the nixos-unstable branch?
07:13
<
lovesegfault >
I thought nixpkgs-channels was deprecated and we should just use nixpkgs now
07:14
<
clever >
lets just read master
07:14
<
lovesegfault >
are we going insane
07:14
<
clever >
samueldr: ubootRaspberryPi4_64bit isnt even in master.....
07:14
<
clever >
but it is in 3a13b44e862c0a6b86de975aa1a0c9dea1e4adc9!
07:15
<
lovesegfault >
what is happening
07:16
<
lovesegfault >
how can there be a commit that doesn't exist in any branches
07:16
<
clever >
your remotes, notice who is within them
07:16
<
clever >
[clever@amd-nixos:~/apps/nixpkgs]$ git fetch samueldr
07:16
<
clever >
[clever@amd-nixos:~/apps/nixpkgs]$ gitk 3a13b44e862c0a6b86de975aa1a0c9dea1e4adc9
07:17
<
clever >
[clever@amd-nixos:~/apps/nixpkgs]$ git branch --contains=3a13b44e862c0a6b86de975aa1a0c9dea1e4adc9 -a remotes/samueldr/feature/raspberrypi4-with-u-boot
07:17
<
clever >
lovesegfault: thre it is1
07:17
<
clever >
needed a -a on your contains
07:18
<
lovesegfault >
rebase it onto `nixos-unstable`?
07:19
<
clever >
> pkgsCross.aarch64-multiplatform.ubootRaspberryPi4_64bit
07:19
<
{^_^} >
attribute 'ubootRaspberryPi4_64bit' missing, at (string):324:1
07:19
<
clever >
going to investigate from this one, starting in nixpkgs rev ee5ceca0b03072b0eb95a5216b5e4b0ffd04daf1
07:20
<
clever >
lovesegfault: your shell is breaking nix-shell, i cant run bash functions nix provides
07:20
<
lovesegfault >
clever: beware, there's a bug in my shell that if you nest nix-shells it hates you
07:20
<
lovesegfault >
let me disable that, one moment
07:22
<
lovesegfault >
building...
07:22
<
lovesegfault >
deploying...
07:23
<
lovesegfault >
going to restart tmate
07:23
<
lovesegfault >
sent new onw
07:24
<
lovesegfault >
it will look similar, but won't be zsh
07:25
<
clever >
you could potentially also use that to detect it, and switch to bash only in nix-shell
07:25
<
clever >
IN_NIX_SHELL
07:25
<
lovesegfault >
I used this zsh plugin that tried to auto-do that
07:25
<
lovesegfault >
but it kind of sucked
07:25
<
clever >
viins ❯ nix show-derivation /nix/store/xcbmv7m9cf45wskh8qfzj4dz823rgrzr-uboot-rpi_4_defconfig-2020.07-aarch64-unknown-linux-gnu.drv
07:25
<
lovesegfault >
this is a good opportunity to get rid of it :P
07:25
<
clever >
ok, so we have some configure and cmake flags, we have a defconfig
07:26
<
clever >
we have some makeFlags and an installPhase
07:26
<
clever >
and a postPatch
07:26
<
clever >
and we have a configurePhase i missed somehow
07:27
<
clever >
so we must eval $configurePhase, not run configurePhase
07:27
<
clever >
viins ❯ phases="configurePhase" genericBuild
07:27
<
clever >
and thats a handy way to do it
07:28
<
lovesegfault >
is it doing something?
07:28
<
clever >
can you open another window again?
07:29
<
clever >
i dont use tmate hotkeys much, i use screen more
07:29
<
lovesegfault >
ctrl+a <release> "
07:29
<
lovesegfault >
or ctrl+a <release> %
07:29
<
clever >
and i'm already inside a screen session
07:29
<
clever >
so i have to ctrl+a a something
07:30
<
clever >
id say just ctrl+c
07:31
<
clever >
take that l!
07:31
<
lovesegfault >
hahahaa
07:31
<
clever >
ok, so gpio, where is that...
07:32
<
clever >
299 * If the firmware provided a valid FDT at boot time, let's expose it in
07:32
<
clever >
300 * ${fdt_addr} so it may be passed unmodified to the kernel.
07:33
<
clever >
but thats not the problem anymore
07:33
<
clever >
the legacy framebuffer api should work even if uboot messes with dtb, you just loose backlight control
07:33
<
lovesegfault >
so, an interesting thing, if you try and apply the dtbo's to the 5.4 kernel you get an error about FDT_MAGIC
07:34
<
clever >
344 eth_env_set_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac);
07:34
<
clever >
and this is something i also had to RE and reproduce
07:34
<
clever >
dynamic content that has to be added to dtb
07:34
<
lovesegfault >
yikes
07:34
<
clever >
basically, the network card in all pi's, lacks the rom for its mac addr
07:35
<
clever >
the firmware generates one based on the serial# of the CPU, and then puts it into the dtb
07:35
<
clever >
linux then respects that, and you get a predictable and static mac
07:35
orivej has quit [Ping timeout: 265 seconds]
07:35
<
clever >
then uboot throws it out and loads its own dtb, so it has to re-do that
07:36
<
clever >
484 * For now, we simply always add the simplefb DT node. Later, we
07:36
<
clever >
485 * should be more intelligent, and e.g. only do this if no enabled DT
07:36
<
clever >
486 * node exists for the "real" graphics driver.
07:36
<
clever >
aha, that explains the diff we saw before
07:36
<
clever >
488 lcd_dt_simplefb_add_node(blob);
07:36
* lovesegfault
nods
07:36
<
clever >
also, are your line#'s black on black? lol
07:36
<
clever >
i can only see them when i paste
07:36
<
lovesegfault >
light grey on dark grey :D
07:37
<
lovesegfault >
the tmate f's up my colorscheme for $reasons
07:37
<
clever >
lowlevel_init.S is pretty simple, it just runs VERY early in uboot startup, to save the dtb addr
07:38
strikerlulu has joined #nixos-aarch64
07:38
<
clever >
so later code can reference it
07:39
<
clever >
lovesegfault: ok, so bcm2835_gpio_direction_input and bcm2835_gpio_direction_output can modify the altmode...
07:39
<
lovesegfault >
does that just always run?
07:39
<
clever >
lovesegfault: and nothing else can, so uboot isnt capable of setting it to a certain mode, only in or out
07:40
<
clever >
lovesegfault: and both are shoved into a dm_gpio_ops, and registered in the system
07:41
<
strikerlulu >
does nixos mobile has an telegram/discord group ?
07:41
<
lovesegfault >
samueldr ^
07:42
<
clever >
lovesegfault: and then drivers/pinctrl/broadcom/pinctrl-bcm283x.c has a copy of bcm283x_pinctrl_get_gpio_mux
07:42
<
lovesegfault >
so whenever uboot sets up pinctrl it's just overriding the altmode on the whole gpio?
07:42
<
clever >
lovesegfault: maybe, it might be setting everything to in...
07:42
<
lovesegfault >
right
07:43
<
clever >
and bcm2835_gpio_set_func_id can set the altmode, why did i not see that earlier...
07:43
<
clever >
its using BCM2835_GPIO_FSEL_BANK
07:43
<
clever >
ah, just didnt search right
07:44
<
clever >
lovesegfault: so bcm2835_gpio_set_func_id can also set it to alt2 for ex
07:44
<
clever >
lovesegfault: so it has a pinctrl driver to set altmodes, and then a gpio driver to set in/out and drive it as gpio
07:45
<
lovesegfault >
so it just steps on it's own toes?
07:45
<
clever >
lovesegfault: so the big question, what does it do with those on startup...
07:47
<
clever >
cmd/gpio.c: gpio_direction_input(gpio);
07:47
<
clever >
lovesegfault: there is a gpio cmd, so you can just drive things from the uboot script
07:47
<
clever >
post/post.c: gpio_direction_input(gpio);
07:47
<
lovesegfault >
fascinating
07:48
<
lovesegfault >
#gpio=0-25=a2
07:48
<
lovesegfault >
#gpio=19=op,dh
07:48
<
lovesegfault >
from someone's random config
07:48
<
lovesegfault >
matches what we expect?
07:48
<
clever >
that sounds like config.txt syntax, to set the modes we want, roughly
07:48
* lovesegfault
nods
07:49
strikerlulu has left #nixos-aarch64 ["ERC (IRC client for Emacs 27.1)"]
07:49
<
lovesegfault >
want to try that out on the non-working sd-card?
07:49
<
clever >
post/post.c can only mess with a single pin, and only if CONFIG_SYS_POST_HOTKEYS_GPIO has been set
07:49
<
clever >
lovesegfault: uboot runs after config.txt, and would just break things again
07:50
cole-h has quit [Quit: Goodbye]
07:50
zupo_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:53
<
clever >
lovesegfault: aha, pinctrl_config_one configures one pin, pinctrl_select_state_simple does something
07:53
<
clever >
pinctrl_select_state_full calls pinctrl_config_one in a loop
07:54
<
clever >
pinctrl_select_state then wraps it
07:55
<
clever >
i think this is to apply things like the dpi_18bit_gpio0 we saw before
07:55
<
clever >
pinctrl_select_state also does something
07:56
<
clever >
lovesegfault: yeah, i'm at a bit of a loss, all i can think of is the brute force solution, change the pins back from the CLI after booting
07:57
<
lovesegfault >
how hard is it to do that?
07:57
<
lovesegfault >
let me boot the broken one
07:58
<
clever >
lovesegfault: hping is betetr then normal ping, but needs root
07:58
<
clever >
lovesegfault: hping2 192.168.2.5 -S -p 22
07:58
<
clever >
instead of sending icmp pings, it sends tcp SYN's to 22
07:58
<
clever >
so you can tell if 22 is open or closed
07:58
<
lovesegfault >
oh, nice
07:58
<
clever >
it can even ping a specific machine, behind a router
07:58
<
clever >
because the port forwarding relays it to the right box
07:59
<
lovesegfault >
screen is black with backlight on
07:59
<
lovesegfault >
it's interesting that they're not all hi nor all lo
07:59
zupo has joined #nixos-aarch64
07:59
<
clever >
ok, whats that CLI tool to manipulate gpio
08:00
<
clever >
it would have to be a pi specific one
08:00
<
lovesegfault >
trying to find it
08:01
<
lovesegfault >
there's libgpiod, and a python lib
08:01
<
lovesegfault >
idk if there's a cli
08:03
Darkmatter66 has joined #nixos-aarch64
08:04
Darkmatter66_ has quit [Ping timeout: 256 seconds]
08:04
<
lovesegfault >
you'll need a zillion -l's no?
08:06
<
lovesegfault >
every file needs another file :D
08:06
<
clever >
normally the makefile would handle it
08:06
<
lovesegfault >
right, is there no makefile?
08:06
<
clever >
but its broken and the helper scripts try to make install :P
08:07
<
clever >
and thats not the nix way
08:07
<
lovesegfault >
yikes
08:07
<
lovesegfault >
can we just patch out the make installs from the script?
08:08
<
clever >
shouldnt take too long to iterate this
08:08
* lovesegfault
watches
08:09
<
clever >
this tool has way too many features, lol
08:09
<
lovesegfault >
it's bananas
08:14
<
clever >
[nix-shell:~/WiringPi/gpio]# gcc gpio.c -I ../wiringPi/ -I../devLib/ ../wiringPi/wiringPi.c readall.c ../devLib/gertboard.c ../devLib/piFace.c ../wiringPi/mcp*.c -lpthread -lm -lrt -lcrypt ../wiringPi/wiringPiI2C.c ../wiringPi/wiringPiSPI.c ../wiringPi/softPwm.c ../wiringPi/piHiPri.c ../wiringPi/softTone.c ../wiringPi/wpiExtensions.c ../wiringPi/sn3218.c ../wiringPi/htu21d.c ../wiringPi/bmp180.c ../wiringPi/sr595.c ../wiringPi/pcf8574.c ../wiringP
08:14
<
lovesegfault >
so close
08:15
<
lovesegfault >
clever: giving the adjective "maker" a whole new purpose
08:15
<
clever >
and of course, it doesnt work! lol
08:16
<
clever >
the revision field is missing from cpuinfo, because your using the "wrong" kernel
08:16
<
lovesegfault >
b/c uBoot doesn't set the revision
08:16
<
lovesegfault >
the RPi fw does
08:16
<
clever >
ok, brute force answer :P
08:17
<
lovesegfault >
If we get this to work I'm going to open my new scotch
08:17
<
clever >
now i have to ctrl+a a a S
08:17
<
lovesegfault >
SaaS soon enough
08:19
<
lovesegfault >
idk why nix-shell is so slow on this thing
08:24
<
lovesegfault >
inb4 rpi explodes 🤣
08:27
<
clever >
ok, 0-9 should be alt2
08:28
<
lovesegfault >
something happened!!
08:28
<
lovesegfault >
I see text!!
08:28
<
clever >
messed up colors?
08:28
<
lovesegfault >
the colors are all jumped
08:28
<
lovesegfault >
*jumbled
08:28
<
clever >
because i didnt get all of the pins
08:28
<
lovesegfault >
it's all green
08:28
<
clever >
i only set 0-9, so if we check the dpi readme
08:29
<
clever >
thats the blue channel only
08:29
<
clever >
but the pixel order may have swapped them around
08:29
<
lovesegfault >
so the background which should be black is green
08:29
<
lovesegfault >
the letters that should be white are blue
08:29
<
clever >
next, we want 12-17
08:30
<
lovesegfault >
it looks right!
08:30
<
clever >
green should now be under our control
08:30
<
clever >
but not red
08:30
<
lovesegfault >
yes, red is wrong
08:30
<
clever >
20-26 is red channel
08:31
<
clever >
now red is also setup
08:31
<
lovesegfault >
you wrote 21 instead of 26
08:31
<
lovesegfault >
YUSSSS
08:32
<
lovesegfault >
it looks perfect
08:32
<
lovesegfault >
all colorful garbage
08:32
<
clever >
how about now? lol
08:32
lafa has joined #nixos-aarch64
08:33
<
lovesegfault >
I can just run this at boot, I think
08:33
<
lovesegfault >
and it should work
08:33
<
lovesegfault >
(as a systemd unit that runs right before hyperpixel4-init)
08:34
<
clever >
oh, build slaves
08:36
<
lovesegfault >
alright, let me add it to the overlay, deploy and we can see if it just works
08:36
<
clever >
it wont control the backlight yet, but there are other options for that
08:36
<
clever >
[root@aurelius:/sys/class/gpio]# echo 19 > export
08:36
<
lovesegfault >
black screen
08:36
<
clever >
[root@aurelius:/sys/class/gpio/gpio19]# echo out > direction
08:37
<
clever >
[root@aurelius:/sys/class/gpio/gpio19]# echo 0 > value
08:37
<
clever >
you can still manually tweak GPIO like this
08:37
<
lovesegfault >
sweet
08:37
<
clever >
a dtbo to re-add the backlight would be nicer, but not reqired
08:37
<
lovesegfault >
do I even need the dtbo's anymore?
08:37
<
clever >
only if you want touch
08:37
<
lovesegfault >
is touch working here?
08:38
<
lovesegfault >
I don't think it is
08:38
<
clever >
i think its missing from the overlays nixos gave uboot
08:39
<
lovesegfault >
shouldn't be ...
08:39
<
clever >
ft6236 goodix,gt911
08:40
<
clever >
lets search for those on the left
08:40
<
clever >
thats the current build its running
08:40
<
clever >
it hasnt changed since booting
08:41
* lovesegfault
shrugs
08:42
<
clever >
i suspect you also dont need the hyperpixel4-init at all
08:42
<
clever >
try a cold boot without it?
08:42
<
lovesegfault >
I will, just want to add the C program to the overlay
08:42
<
clever >
full power cycle, to ensure the screen is reset
08:42
<
lovesegfault >
what's the fetcher for just a text file?
08:43
<
clever >
fetchurl can get it
08:43
<
clever >
but the unpackPhase will need a tweak
08:43
<
lovesegfault >
what's the tweak?
08:43
<
clever >
unpackPhase = "cp $src main.c ; sourceRoot=.";
08:44
<
clever >
the default expects a tar with a dir
08:44
<
clever >
then shove the rest into installPhase and/or buildPhase
08:46
<
lovesegfault >
hackialization
08:47
<
lovesegfault >
ready for a reboot?
08:47
<
lovesegfault >
hit it!
08:48
<
lovesegfault >
screen working during shutdown
08:48
<
lovesegfault >
coming up, still blank
08:48
<
clever >
you could also shove this into the initrd, to run it sooner
08:48
<
lovesegfault >
screen is blank
08:49
<
clever >
it ran after boot
08:49
<
lovesegfault >
I think we do need that init thing
08:49
<
clever >
pins are in the right states
08:50
<
lovesegfault >
check it out
08:50
<
lovesegfault >
it will run on activation
08:50
<
lovesegfault >
and we'll see if the screen somes up
08:50
<
lovesegfault >
screen is up
08:50
<
clever >
yeah, definitely needed
08:50
<
lovesegfault >
let's try a cold boot
08:50
<
clever >
thats why i couldnt get it to work with my kernel
08:51
<
clever >
i didnt know about that extra step
08:51
* lovesegfault
nods
08:51
<
lovesegfault >
we can embed their init code into the hack
08:51
<
lovesegfault >
it's just C code anyway
08:51
<
lovesegfault >
screen is up and running!
08:52
<
lovesegfault >
let's see if the dtbo's need to be here at all
08:52
<
lovesegfault >
works :D
08:53
<
clever >
next thing would be to do the init sooner, in the initrd
08:54
<
lovesegfault >
actually I think if I save it like this it won't work
08:54
<
lovesegfault >
it'll refuse to boot
08:54
<
lovesegfault >
but let's try
08:55
<
lovesegfault >
works :D
08:56
<
clever >
ah, was on the wrong system, heh
08:56
<
lovesegfault >
I love it when I reboot my laptop trying to reboot another system
08:56
<
clever >
earlyMountScript sounds like the earliest we can do it
08:57
<
clever >
i once implemented reboot in little-kernel
08:57
<
clever >
then i ran reboot, as NON ROOT, outside the serial terminal client
08:57
<
clever >
without any prompt, without even root, it rebooted, lol
08:57
<
lovesegfault >
the earliest I see is boot.initrd.postDeviceCommands?
08:57
<
lovesegfault >
lol, non-root reboot is evil
08:58
* lovesegfault
nods
08:58
<
clever >
i logged in from a physical terminal, so i had special perms
08:59
<
clever >
ok, so now hyperpixel4-hack is in $PATH at initrd time
09:00
<
lovesegfault >
can we run init that early too?
09:00
<
clever >
postDeviceCommands is 241
09:00
<
clever >
earlyMountScript is 113
09:00
<
lovesegfault >
should be easy to embed into hack
09:00
<
clever >
yeah, easily
09:01
<
clever >
ah, but earlyMountScript is special
09:01
<
clever >
preDeviceCommands should work fine
09:02
<
clever >
i think that will do it
09:02
<
clever >
oh, that reminds me
09:05
<
lovesegfault >
should I deploy it?
09:06
<
lovesegfault >
let's see
09:06
<
clever >
you can also `ssh IP sudo reboot`
09:07
<
lovesegfault >
came up right before stage =
09:07
<
lovesegfault >
came up right before stage 1
09:07
<
lovesegfault >
working fine :D
09:08
<
clever >
line 219 is when it ran out init hack
09:08
<
clever >
67 is when it says its in stage1
09:08
<
lovesegfault >
Maybe my eyes fooled me
09:08
<
clever >
but the print from 67 is likely still on the screen
09:08
<
lovesegfault >
right, that's it
09:09
<
lovesegfault >
do you want to see if it'll work with kernel 5.4? :D
09:11
<
clever >
2 more builds for my haskell example to be ready
09:12
<
clever >
to even start the build, lol
09:12
<
lovesegfault >
fingers crossed!
09:12
<
clever >
note, this is all eval time builds for IFD, lol
09:12
<
lovesegfault >
it works!
09:12
<
lovesegfault >
cc. samueldr
09:14
<
clever >
now the actual build can begin
09:15
<
clever >
200 builds to go
09:16
<
lovesegfault >
send the builds up to stcg-us-0005-03
09:16
<
clever >
ah, just copy-closure the drv over
09:17
* lovesegfault
nods
09:17
<
clever >
you can still run `nix build` on a drv, to get the good UI
09:17
<
clever >
is that machine x86 or aarch64?
09:17
<
clever >
good, ive not tested any native arm builds yet
09:18
<
clever >
one user tried to do an arm->vpu cross, and it broke horribly
09:18
<
lovesegfault >
this one is aarch64
09:18
<
clever >
rpi-open-firmware assumes your host is always x86
09:19
<
lovesegfault >
goes brrrr
09:20
<
clever >
the closure of this build is rather bloated
09:20
<
clever >
i was more focused on having it work then having it build fast
09:21
<
lovesegfault >
well, hopefully this box helps with the speed part
09:22
<
clever >
the crazy thing i did in hs-gpio, is MMIO, from haskell
09:24
<
clever >
i think its building 2 ghc's now
09:24
<
lovesegfault >
oh no
09:25
<
lovesegfault >
ghc is
_so_ slow to build
09:25
<
clever >
an x86 and an arm
09:25
<
clever >
its building them in parallel
09:30
<
clever >
lovesegfault: now up to qemu-user, for template haskell
09:31
* lovesegfault
nods
09:32
<
clever >
lovesegfault: why do i prefer haskell over rust? lol
09:32
<
lovesegfault >
I do not know :P
09:33
<
clever >
something else is coming up elsewhere
09:34
<
lovesegfault >
what does that mean?
09:34
<
clever >
distractions in another chat
09:34
<
lovesegfault >
Ah :D
09:35
<
clever >
i dont think the sysfs-gpio can do mode switching
09:35
<
clever >
only in/out
09:37
<
lovesegfault >
Oh, you're right
09:38
<
lovesegfault >
seems like that is even higher level
09:38
<
clever >
you either need something pi specific, or just direct MMIO
09:38
<
lovesegfault >
what are we using from bcm_host.h?
09:38
<
clever >
bcm_host_get_peripheral_address()
09:38
<
clever >
it tells you what addr to mmap, because it varies from model to model
09:39
<
lovesegfault >
alright, I'll just wrap that
09:43
<
lovesegfault >
I don't think I'm doing the right thing
09:44
<
lovesegfault >
how do I get an arm lib in a nix-shell?
09:44
<
clever >
pkgsCross.armsomething.stdenv.mkDerivation
09:45
<
clever >
you may instead want pkgsCross.armsomething.callPackage
09:45
<
clever >
so everything is arm
09:46
<
lovesegfault >
oh boy
09:46
<
lovesegfault >
is it building all of tust
09:46
<
lovesegfault >
rust
09:46
<
lovesegfault >
it is
09:46
<
lovesegfault >
nope
09:48
<
srk >
I'm trying to add ghc8.10.2-binary and it's pulling llvm 7..
09:48
<
srk >
I have 6, 9, 10 already built but not 7 :D
09:57
wrench[m] has left #nixos-aarch64 ["User left"]
09:57
<
clever >
lovesegfault: hows the build going for hs-gpio?
10:00
<
lovesegfault >
ghc still
10:00
<
clever >
and only 1 build, its hit a bottleneck
10:03
<
lovesegfault >
installPhase!!
10:04
<
lovesegfault >
it's past ghc
10:04
<
clever >
now its building haskell libs
10:04
<
clever >
in a cross manner
10:06
<
clever >
i prefer screen, because you can shuffle the tabs around
10:06
<
clever >
and watch both builds at once
10:06
<
lovesegfault >
I know tmux (which tmate is just a wrapper of) is super powerful, but I don't know how to use all of it
10:11
<
clever >
ah, brick is pretty late in the dep chain
10:12
<
lovesegfault >
I don't know how to cross-dev rust with Nix
10:12
<
clever >
yep, done!
10:13
<
clever >
lovesegfault: now copy-closure that to the pi
10:14
<
clever >
then ssh into the pi, and run `nix-env -i` on it
10:15
<
clever >
this shows the altmode of each pin, in realtime
10:16
<
clever >
brick can also accept input, so it could also allow changing modes, with some more code
10:16
<
lovesegfault >
I'm going to work on that Rust code this week
10:16
<
clever >
and that would let you quickly play around
10:16
<
lovesegfault >
and package it up nicely and then try an wrap it in a NixOS option
10:17
<
lovesegfault >
Thanks for all the help clever!
10:17
<
lovesegfault >
clever++
10:17
<
{^_^} >
clever's karma got increased to 510
10:17
<
clever >
[detached (from session default)]
10:17
<
lovesegfault >
killed it
10:17
<
lovesegfault >
phew
10:17
<
lovesegfault >
3 am
10:17
<
lovesegfault >
time to nap :D
10:18
<
lovesegfault >
woah
10:18
<
clever >
# TZ=America/Moncton date
10:18
<
clever >
Tue Sep 22 07:18:09 ADT 2020
10:18
<
clever >
you can set TZ temporarily, to view the time in any given zone
10:32
orivej has joined #nixos-aarch64
11:19
zupo has quit [Ping timeout: 260 seconds]
11:25
quinn has quit [Ping timeout: 246 seconds]
11:31
zupo has joined #nixos-aarch64
11:34
quinn has joined #nixos-aarch64
11:37
zupo has quit [Ping timeout: 272 seconds]
11:37
zupo_ has joined #nixos-aarch64
11:49
zupo_ has quit [Ping timeout: 256 seconds]
12:01
<
Dandellion >
I'm trying to build a u-boot arm image, but when I build it I get
12:02
<
Dandellion >
`You must set the option ‘boot.loader.grub.devices’ or 'boot.loader.grub.mirroredBoots' to make the system bootable.`
12:02
<
Dandellion >
even though grub.enable is false
12:05
juliosueiras has joined #nixos-aarch64
12:09
<
sphalerite >
Dandellion: maybe it's enabled elsewhere? Try setting it to lib.mkForce false instead of false
12:12
<
Dandellion >
yep, tried that too pretty confusing
12:19
juliosueiras has quit [Ping timeout: 260 seconds]
12:42
<
Dandellion >
here's a trace if that's helpful
13:16
<
srk >
Dandellion: and the input config?
13:42
Darkmatter66 has quit [Ping timeout: 260 seconds]
13:46
juliosueiras has joined #nixos-aarch64
13:53
<
Dandellion >
I'll share in a bit
13:54
<
Dandellion >
I moved some things around (which wasnt supposed to fix anything) and now it works
13:54
<
Dandellion >
¯\_(ツ)_/¯
14:10
alp has quit [Ping timeout: 272 seconds]
14:14
juliosueiras has quit [Ping timeout: 272 seconds]
14:27
superherointj has joined #nixos-aarch64
14:41
Darkmatter66 has joined #nixos-aarch64
14:58
zupo has joined #nixos-aarch64
15:14
alp has joined #nixos-aarch64
15:15
juliosueiras has joined #nixos-aarch64
15:18
veleiro has joined #nixos-aarch64
15:19
<
veleiro >
has anyone thought of routers with nixos as a base? running LuCi etc
15:27
<
gchristensen >
#nixos-on-your-router
15:27
<
gchristensen >
also I think vyos was looking at that
15:28
<
clever >
veleiro: i have a random dual-socket server mobo acting as my router, running nixos of course
15:30
<
veleiro >
yeah i could use nonrouter-specific board, of course
15:31
<
veleiro >
routers are definitely beefier than they use to be
15:37
<
clever >
veleiro: the router my ISP supplied, will mem-leak itself to death in 29.5 days (like clockwork) if you poll its status page once a minute
15:40
<
Ke >
if you get something like espressobin or macchiatobin, nixos should run just fine
15:40
<
veleiro >
i have a turris omnia
15:40
<
Ke >
I run nixos in a vm on mcbin, though not doing routing
15:41
<
veleiro >
it does containers though, so i could do a nixos container
15:41
<
veleiro >
the openwrt-based distro is weak and made for small hardware for sure
15:41
<
Ke >
well if you have the storage, nixos is not absurdly heavy
15:41
<
Ke >
not starting everything under the sun by default helps a lot
15:42
<
veleiro >
not as light as busybox though
15:42
<
veleiro >
in this case, it doesnt need to be and that's why i ask
15:42
<
veleiro >
seems silly to use a container on top of a tiny-designed OS
15:42
<
Ke >
still anyway espressobin is not absurdly massive for home router
15:43
<
Ke >
and ISA compatible with aarch64
15:46
<
veleiro >
that's pretty cool. havent heard of it
15:46
<
veleiro >
good price
15:48
<
srk >
veleiro: omnia has one issue - no distro config support enabled for its u-boot
15:48
<
clever >
gchristensen: one crazy idea i had recently, using a CM4 (pi4 compute module) as the core of a router
15:49
<
srk >
and no easy way to fix that
15:49
<
clever >
the pi4 SoC uses RGMII to connect to its ethernet PHY
15:49
<
clever >
you can get a gigabit switch IC, that has 5 ethernet ports, 1 RGMII port, and vlan tagging support
15:49
<
veleiro >
ahhh, shame.
15:50
<
clever >
then you just vlan tag the WAN and LAN into seperate vlans, and make the RGMII a trunk port
15:50
<
srk >
like you can just build recent uboot with distro config enabled but it won't fit into SPL, the only way is to get some ancient ubuntu and build their own older u-boot with it
15:51
<
Ke >
clever: can you get such switches reasonably, I was looking, but most inxpensive and otherwise reasonable units were 100M
15:51
<
Ke >
is in not a enterprise grade rack switch
15:52
<
clever >
Ke: let me check my links...
15:52
<
Ke >
vlan switches with static config and reasonable size are common for video surveillance it seemed
15:54
<
Ke >
my mcbin is though currently in a state that does not warrant any extensions
15:55
<
Ke >
the hw maybe broken
16:03
tilpner has quit [Remote host closed the connection]
16:03
tilpner has joined #nixos-aarch64
16:05
tilpner has quit [Remote host closed the connection]
16:05
zupo_ has joined #nixos-aarch64
16:06
tilpner has joined #nixos-aarch64
16:08
zupo has quit [Ping timeout: 264 seconds]
16:10
<
clever >
Ke: this chip has 3 gigabit ports, 2 with builtin PHY, 1 with raw RGMII
16:10
<
clever >
"Full VLAN and QoS support"
16:17
juliosueiras has quit [Ping timeout: 240 seconds]
16:19
<
Ke >
right, but you need board and assembly for that
16:20
<
clever >
Ke: you would already need a custom board to use the CM4
16:21
<
clever >
so you would just make a custom host board for the CM4, that includes the above chip, and has 2 ethernet ports
16:23
cole-h has joined #nixos-aarch64
16:49
juliosueiras has joined #nixos-aarch64
17:09
alp has quit [Ping timeout: 272 seconds]
17:17
alp has joined #nixos-aarch64
17:23
rajivr has quit [Quit: Connection closed for inactivity]
17:26
zupo_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:29
zupo has joined #nixos-aarch64
17:38
alp has quit [Ping timeout: 272 seconds]
17:52
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:10
zupo has joined #nixos-aarch64
18:22
<
sphalerite >
veleiro: at work, we use NixOS'd APU2 boards as routers for our smaller office and for off-site events.
18:22
<
sphalerite >
veleiro: one of my colleagues has duplicated that setup at home as well
18:23
<
sphalerite >
I think Ke was considering doing that too?
18:38
ar has quit [Quit: leaving]
18:43
ar has joined #nixos-aarch64
18:55
AmandaC has quit [Remote host closed the connection]
18:57
AmandaC has joined #nixos-aarch64
19:04
<
makefu >
hi all, what is the current status of cross-compiling a complete system (with configuration.nix). to be more precise, i would like to build a system derivation for my raspberrypi1. my idea was to start with the arm6 image from dezgeg and then cross-build every time i would like to change the system, then nix-copy-closure and switch-to-configuration. i am sure it has been done before me
19:05
<
samueldr >
if you wend up cross-compiling, you're better off just cross-compiling from the start
19:05
<
samueldr >
and results vary
19:06
<
samueldr >
the main important bits are the workarounds
19:06
<
lovesegfault >
samueldr: did you end up seeing the perversity me and clever arrived at to get that screen working?
19:06
<
clever >
ive found that a surprising number of shell scripts have the x86 bash in #! when i cross-compile all of nixos
19:06
<
clever >
but it somehow still boots, so i havent looked into it closely yet
19:06
<
samueldr >
lovesegfault: didn't read through any of it
19:06
<
clever >
samueldr: something (possibly uboot) is undoing the gpio mode config
19:06
<
samueldr >
highly likely
19:06
<
clever >
samueldr: that gist will revert things back to the correct modes
19:07
<
lovesegfault >
only took us a few hours :P
19:07
<
samueldr >
so does that allow configuring the display even without config.txt twiddling?
19:07
<
clever >
samueldr: you still need the config.txt entries, because of how dpi works on the 4
19:07
<
lovesegfault >
You don't need any dtbo's though
19:07
<
clever >
samueldr: with pi4, all video output goes via the firmware, due to incomplete linux drivers
19:07
<
makefu >
samueldr: awesome, exactly what i was looking for!
19:08
<
clever >
samueldr: so you must tell the firmware to configure DPI properly
19:08
<
samueldr >
makefu: it should work with a Nixpkgs from 10 days ago, if it doesn't from today
19:08
<
samueldr >
clever: okay
19:08
bennofs_ has quit [Read error: Connection reset by peer]
19:09
<
samueldr >
meanwhile I'm digging into the vendor kernel to see why fbdev emulation doesn't work, and there's already a pretty clear sign it tries to set it up but it fails
19:09
bennofs has joined #nixos-aarch64
19:09
<
samueldr >
so adding some logging until I can understand what's missing
19:09
<
clever >
samueldr: without any overlays, linux will use the legacy mailbox api to configure framebuffers, and the dpi stuff in config.txt causes the framebuffer to lead to dpi
19:10
<
clever >
but dpi only works if the pins remain in the correct mode
19:10
<
clever >
and the hyperpixel itself only shows an image if the init program is ran
19:10
<
clever >
gpio19 also acts as a toggle for the backlight and lcd driver
19:10
<
clever >
but without an overlay, linux wont know that
19:11
<
clever >
and its getting late here, i should get off to bed now
20:11
zupo_ has joined #nixos-aarch64
20:15
zupo has quit [Ping timeout: 272 seconds]
21:01
jumper149 has joined #nixos-aarch64
21:01
zupo_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:04
zupo has joined #nixos-aarch64
21:21
superherointj has quit [Quit: Leaving]
21:28
jumper149 has quit [Quit: WeeChat 2.9]
21:29
alp has joined #nixos-aarch64
21:37
kiren has joined #nixos-aarch64
21:38
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:46
juliosueiras has quit [Read error: Connection reset by peer]
21:50
juliosueiras has joined #nixos-aarch64
21:50
alp has quit [Ping timeout: 272 seconds]
21:52
alp has joined #nixos-aarch64
21:55
zupo has joined #nixos-aarch64
22:03
alp has quit [Remote host closed the connection]
22:04
claudiii has quit [Ping timeout: 240 seconds]
22:04
alp has joined #nixos-aarch64
22:04
jackdk has quit [Read error: Connection reset by peer]
22:05
jackdk has joined #nixos-aarch64
22:06
claudiii has joined #nixos-aarch64
22:11
alp has quit [Ping timeout: 272 seconds]
22:26
alp has joined #nixos-aarch64
22:36
orivej has quit [Ping timeout: 246 seconds]
22:43
Darkmatter66_ has joined #nixos-aarch64
22:45
Darkmatter66 has quit [Ping timeout: 260 seconds]
22:48
alp has quit [Ping timeout: 272 seconds]
22:50
alp has joined #nixos-aarch64
22:51
Mirrexagon has quit [Ping timeout: 240 seconds]
23:00
cole-h has quit [Quit: Goodbye]
23:01
cole-h has joined #nixos-aarch64
23:02
orivej has joined #nixos-aarch64
23:03
Mirrexagon has joined #nixos-aarch64
23:10
alp has quit [Ping timeout: 272 seconds]
23:41
alp has joined #nixos-aarch64
23:51
<
lovesegfault >
clever: rust code is coming along nicely :)