<lovesegfault> samueldr: does uboot on RPi4 work already?
<lovesegfault> I just got a new pi (the 8GB one) that I want to set up with uboot
<samueldr> I can't confirm for the 8GB variant
<samueldr> but it should
<{^_^}> #97883 (by samueldr, 1 week ago, open): Use U-Boot for the Raspberry Pi 4-specific image
<lovesegfault> is hydra building images?
<lovesegfault> oh, nice
<samueldr> not yet
<samueldr> but it's quite mechanical
<samueldr> no real compilation
<samueldr> so build it on your existing rpi4 install I guess
<samueldr> oh
<samueldr> no
<samueldr> I'm lying
<lovesegfault> :D
<samueldr> there's a kernel update in there
<samueldr> see, the actual changes wouldn't take much time on a pi4, only the time to build the image (and u-boot)
<samueldr> but that kernel update
<samueldr> might take a hot minute
<lovesegfault> I have a beefy aarch64 builder
<samueldr> oh
<lovesegfault> eMag 32-core
<samueldr> I would like something at home with enough power for workstation use (including building)
<samueldr> though you could checkout the PR and revert the kernel update
<samueldr> since all the changes were made without the kernel update
<samueldr> oh
<samueldr> no
<samueldr> I forgot about the cma change
<lovesegfault> lying again? 🤣
<samueldr> you'd need to also drop that change
<lovesegfault> checking out that branch of yours
<lovesegfault> rebasing onto nixos-unstable-small
<samueldr> having additional testing would be nice :)
<samueldr> I think *my* only leftover task is making sure the wiki is updated
<lovesegfault> Is this what I want? `nix-build ./nixos/release.nix -A sd_image_raspberrypi4`
<samueldr> if it builds, most likely yes
* lovesegfault builds
<samueldr> I mean, that looks good, but I don't know if it's the right file right attrname
<lovesegfault> I think it's the right attr, I may be misremembering from the last time clever taught me how to do thi
<lovesegfault> s/thi$/this/
h0m1 has quit [Quit: WeeChat 2.9]
h0m1 has joined #nixos-aarch64
<lovesegfault> kernel is building
<lovesegfault> built
<lovesegfault> building zfs (?!)
<lovesegfault> well, it built
<lovesegfault> I need to go find my micro-hdmi to hdmi adapter
<lovesegfault> brb
<lovesegfault> writing image
<lovesegfault> samueldr: it works!
<lovesegfault> and boots
<lovesegfault> time to ssh into
<lovesegfault> *it
<lovesegfault> annoyingly seems like the TOFU info is wrong
<samueldr> TOFU info?
<samueldr> what I'd be more interested in knowing is if the dtbo stuff you were doing works just as well
<lovesegfault> Oh, nvm, I'm being dumb
<lovesegfault> I gotta run passwd before I can ssh
<samueldr> yeah :)
<samueldr> secure by default, annoying first use
<lovesegfault> Alright, ssh'd in, all is working
<lovesegfault> going to try the dtbo stuff with uboot now
<lovesegfault> brace yerselves
<lovesegfault> samueldr: do I need to start fresh or can I "convert" a system that was using not-uboot to uboot
<lovesegfault> i.e. do I need to wipe my sd and flash the new image
qyliss has quit [Quit: bye]
<samueldr> in theory you should be able to convert, but it takes manual steps... maybe
<samueldr> there's something in the nixos options for raspberry pi + u-boot, but I have literally no idea if that'll work
<lovesegfault> I'll start fresh, it's no biggie
<lovesegfault> I already think this is going to work
<samueldr> I have a strong belief it should just wor
<samueldr> just work*
<samueldr> sure, u-boot won't be on the display
<samueldr> but otherwise things should
<lovesegfault> Yeah, I'm working on it right now
<samueldr> I feel something is quite off with a kernel I'm trying to use as a basis for a new device in mobile nixos
<samueldr> it looks like the kernel as it is shouldn't compile, at all, meanwhile there are binaries purportedly built from that user's source code tree
qyliss has joined #nixos-aarch64
<samueldr> really hard to gauge because I still don't have a definitely-known-working kernel and testing protocol on that device yet
<lovesegfault> this has to change, right?
<samueldr> yes right
<samueldr> boot.loader.generic-extlinux-compatible and relevant options
<samueldr> though I say that
<samueldr> it's literally only that one
<samueldr> and dropping the raspberryPi specific options
<samueldr> oh right
<samueldr> that's one bit that can't (?) be done declaratively with the u-boot setup yet
<samueldr> or maybe it can
<samueldr> though you're right it's something that should be possible to do
h0m2 has joined #nixos-aarch64
<samueldr> for the time being you'll have to (non-declaratively, yuck) set it up
<samueldr> think of it as if you had to change a bios option
<samueldr> config.txt is the config of the "raspberry pi bios"
rajivr has joined #nixos-aarch64
<lovesegfault> Got it
<samueldr> though just as this... wouldn't it be nice to declaratively configure your computer's bios too? :)
<lovesegfault> it would be amazing
h0m1 has quit [Ping timeout: 272 seconds]
<lovesegfault> flashing the other RPi
veleiro has joined #nixos-aarch64
<lovesegfault> samueldr: got an error :D
<samueldr> details would help
<samueldr> you kept the raspberry pi 4 kernel option, right?
<samueldr> "Error at 'compatible': FDT_ERR_NOTFOUND
<samueldr> that is possibly because it tries to apply the overlay to something that can't
<lovesegfault> kernelPackages = pkgs.linuxPackages_rpi4;
<lovesegfault> this is still set, yeah
<samueldr> and at any rate, shouldn't work differently because of u-boot or not
<samueldr> that's... weird
<lovesegfault> it's not just uboot, it's that your patches bring in the new kernel as well
<samueldr> right
<samueldr> maybe the overlay causes issues being applied to *that* new dtb
<lovesegfault> yeah
<veleiro> what's it mean "NixOS only supports x86-64"?
<samueldr> veleiro: hm?
<samueldr> where do you see that?
<veleiro> well another nix user with a good system config mentioned it to me
<{^_^}> nrdxp/nixflk#18 (by nrdxp, 6 weeks ago, open): initial multiArch support
<lovesegfault> that's not true
<veleiro> i suppose i'm still fuzzy on NixOS supporting other arch
<lovesegfault> NixOS supports AArch64
<veleiro> i mean, images for other arches arent offered on nixos.org
<lovesegfault> You need to fetch them from hydra
<samueldr> i686 is available out of nixos.org
<samueldr> >> NixOS currently runs on 32-bit and 64-bit x86 machines (i686-linux and x86_64-linux), and experimentally on ARM.
<samueldr> that's what the site says
<samueldr> though it should be updated to specify AArch64
<samueldr> and it's not really much experimental
<veleiro> ah yes, thats a good summary
<samueldr> that's an old quote
<samueldr> I'd say AArch64 is almost prime-time ready, many of the issues are not NixOS specific
<samueldr> or caused not by lack of support, but lack of "people hours" to drive the support
<samueldr> the whole technical stack is there and working and solid
<veleiro> isn't there still too much variation in aarch64 platforms to offer "working"
<veleiro> installs?
<veleiro> for end users getting into nixos
<samueldr> here's where the good ol' "arm is different" comes in :)
<samueldr> it's not
<samueldr> x86_64 support relies on mainline kernel support
<samueldr> AArch64 support relies on mainline kernel support
<samueldr> so it's a bit out of our hands the situation with multiple boards, for _official_ support
<samueldr> but we're building this with agnosticity in mind
<samueldr> the mainline-based universal "default" image for AArch64 assume somehow U-Boot (recent enough) will be available to boot the system
<veleiro> so you'd offer images to devices rather than arch?
<samueldr> there's also the UEFI AArch64 iso, which as long as the AArch64 device boots from UEFI, works
<samueldr> nope, still a universal image
<samueldr> it's just much less of a problem than some people think, at least for making things work well enough to allow the end-user to change the kernel to one that has better support for their board
<samueldr> and it's becoming months after months less of an issue, with the good work from the Linux communities all around
<samueldr> so, to circle back to "nixflk", whatever this repo is supposed to be, they're talking as themselves, I don't know that this is a project of even the "nix-community" enlarged community
<lovesegfault> FWIW: I have a nixos config repo that supports AArch64 systems just fine https://github.com/lovesegfault/nix-config
<lovesegfault> grr, few things upset me as much as building newsboat
<veleiro> samueldr: i've been looking for a good way to build multiple systems and
<veleiro> share configs
<samueldr> I couldn't say for that *with flakes*, but otherwise with NixOS it just work in my experience
<veleiro> i have one already based on https://github.com/cmacrae/config but i like
<veleiro> nixflk better now
<veleiro> flake additions is just a plus
<veleiro> RFC for a starting point to a nix machine config to replace configuration.nix?
<veleiro> probably silly
knerten2 has joined #nixos-aarch64
<veleiro> coelmickens was pretty shiny too but he was changing a lot really fast
<veleiro> colemickens*
<colemickens> veleiro: fwiw I think I've settled on most of my flake.nix changes across my repos
knerten1 has quit [Ping timeout: 240 seconds]
<colemickens> but I've been cribbing from others tbh
<veleiro> good to know
<veleiro> highly made use of nixpkgs-wayland for sway, thats where i found u
<veleiro> my PBP is unusable :( and i was using it daily
<veleiro> structural integrity is terrible and i cant repair it enough
<veleiro> they also have no replacement keyboard+chassis for ANSI in stock
<clever> samueldr: pkgsCross.armv7l-hf-multiplatform.pkgsStatic.python38 fails to build even bash for me, is that known?
<samueldr> I don't know about it
<samueldr> that's it
<clever> e-final-gcc-debug-9.3.0/lib/gcc/armv7l-unknown-linux-musleabihf/9.3.0/crtbeginT.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
<lovesegfault> samueldr: that PR fails to boot for me
<lovesegfault> I get a zillion GPIO errors in early boot
<lovesegfault> and it then never finds my root partition
<lovesegfault> Unfortunately I can't send the errors to you b/c I don't have a capture card
<clever> lovesegfault: serial adapter?
<lovesegfault> that I do have
<clever> lovesegfault: you should be able to configure it to send all the kernel logs to the serial port
<lovesegfault> where is the UART on the Pi?
<clever> lovesegfault: https://pinout.xyz/pinout/uart
<lovesegfault> nice
<clever> lovesegfault: you will also need enable_uart=1 in config.txt, and it will probably be ttyS0, but maybe ttyAMA0 depending on the model
<clever> so youll also want a console=ttyxx in the kernel cmdline
cole-h has quit [Quit: Goodbye]
cole-h has joined #nixos-aarch64
<samueldr> lovesegfault: do you have cma= on your kernel command line? if so remove it
orivej has quit [Ping timeout: 260 seconds]
<lovesegfault> samueldr: Aha, I do have that
<samueldr> to be done: add note about that on the nixos wiki page about rpi4
<samueldr> adding cma= will break access to the sd card (among other things)
<samueldr> any communication with the firmware will be broken
<lovesegfault> Will do
<lovesegfault> Follow up: time is borken on my RPi
<lovesegfault> I remember this issue
<lovesegfault> there was some file somewhere I had to delete
<lovesegfault> but I can't find it now
<samueldr> are you sure? time being "broken" is "normal"
<samueldr> no RTC
<lovesegfault> Local time: Mon 1979-12-31 17:28:22 PST
<lovesegfault> right, but NTP isn't working
<samueldr> right
justanotheruser has quit [Ping timeout: 272 seconds]
<lovesegfault> `rm -rf {/var/lib/systemd/timesync,/var/lib/private/systemd/timesync}`
<lovesegfault> this thing
<lovesegfault> rebooted without the cma arg
<lovesegfault> working like a charm :)
justanotheruser has joined #nixos-aarch64
orivej has joined #nixos-aarch64
<lovesegfault> Now the final battle: trying to get the screen working :D
<lovesegfault> Error at 'compatible': FDT_ERR_NOTFOUND
* lovesegfault makes failure sounds
<lovesegfault> hmm it does say it has fixes for kernel 5.4
<lovesegfault> going to fiddle with manually applying things again
<lovesegfault> well, first issue seems to be the crappy RPi python library doesn't recognize this as a RPi
orivej has quit [Ping timeout: 258 seconds]
<clever> lovesegfault: youve got one of the hyperpixel displays on your pi?
<lovesegfault> yeah
<clever> lovesegfault: got a pi3 also?
<lovesegfault> been getting it to work over the weekend
<lovesegfault> I have a Pi4
<lovesegfault> I do have a Pi3 as well, but I'm hacking on my Pi4
<clever> ive not tested my code on a pi4 yet, but i'm interested in how my opensource drivers would act on that display
<lovesegfault> I'd be happy to help you test :)
<clever> the 4 moves some things around, so testing on a 3 would be simpler, if you have one on-hand
<lovesegfault> Let me dig it out
<clever> lovesegfault: 800x480 or 720x720?
<lovesegfault> the former
<clever> [clever@amd-nixos:~/apps/rpi/hyperpixel4]$ git checkout pi3
<clever> [clever@amd-nixos:~/apps/rpi/hyperpixel4]$ head install.sh -n30
<clever> "hdmi_timings=480 0 10 16 59 800 0 15 113 15 0 0 0 60 0 32000000 6"
<clever> 500mhz / 14 should give roughly the right fps...
<lovesegfault> Welp, I'm out of ideas for their dts file: OF: resolver: overlay phandle fixup failed: -22
<clever> lovesegfault: mainline linux renamed several fields in the dts, so you cant mix overlays from rpi and mainline
<lovesegfault> wonderful :p
<lovesegfault> clever: setting up my RPi3
<clever> just plugged mine in too, about to confirm the changes boot
<clever> VPU now at 250mhz, PLLC_CORE0 at 1000mhz, PLLC at 2000mhz
<lovesegfault> clever: remind me how to build an sd_image for RPi3 from nixpkgs again
<clever> lovesegfault: you wont need that image for my test
<clever> my test entirely ignores linux and even the arm cores
<lovesegfault> I will need _an_ image
<lovesegfault> This sd card is blank
<clever> for my test, just format it with 2 partitions, #1 must be fat32, #2 must be ext2 (not 4)
<lovesegfault> alright, size of the first part?
<clever> 32mb would be plenty
<lovesegfault> msdos or gpt?
<clever> msdos
<clever> part1 must have a typecode of 0xc i believe
<clever> just need to tweak the clocks a bit...
<clever> VPU now at 125mhz, PLLC_CORE0 at 500mhz, PLLC at 2000mhz
<clever> ok, that should do it
<lovesegfault> Number Start End Size Type File system Flags
<lovesegfault> 1 1.00MiB 512MiB 511MiB primary fat32 boot
<lovesegfault> 2 513MiB 244224MiB 243711MiB primary ext2 lba
<clever> i think thats good
<lovesegfault> alright mkfs'ing
<clever> DPI clock measured at 0
<clever> ok, thats not it
<clever> ah, pllc_per
<clever> VPU now at 250mhz, PLLC_CORE0 at 500mhz, PLLC at 2000mhz
<clever> DPI clock measured at 35714000
<clever> ok, that looks perfect
<clever> now to turn the pins on, and ship it!
<lovesegfault> main challenge right now is finding a micro usb cable
<lovesegfault> alright, I'm ready to test
<lovesegfault> screen is on the RPi, micro sd is formatted
<lovesegfault> I have a power supply
<clever> and i think i have the binaries ready
<clever> copying...
<clever> lovesegfault: bootcode.bin goes on the fat32, lk.elf goes onto the ext2, umount both, then boot the pi, and see what happens!
<lovesegfault> on it
<lovesegfault> how do I know if this works?
<lovesegfault> I just see a black screen
<lovesegfault> no output via hdmi either
<clever> a: there should be a white pixel in the top-left corner
<clever> b: i made a mistake in some of the width/height controls
<lovesegfault> I don't see a white pixel
<clever> updating the code...
<lovesegfault> it powers on, like I see the black backlight
<lovesegfault> make it all purple
<lovesegfault> then there will be no mistake :P
<clever> going for the fade test then
<clever> lovesegfault: re-uploaded the lk.elf
<lovesegfault> re-copying
<clever> oh, i missed another pair of 10's!
<clever> so it will now be showing a small 10x10 square in top-left
<lovesegfault> I see nada :/
<clever> it should start out black, and slowly fade to blue
<clever> it will take 4 mins to hit solid blue
<lovesegfault> alright, let's see
<clever> "dpi_output_format=0x7f226"
<clever> let me see how important this part is...
<lovesegfault> it's just black
<clever> output format is 6, which i already have
<clever> rgb order is 2, GRB, but i set it to RGB, so the colors would be mixed up
<clever> ah, pixel clock should be inverted, thats definitely going to mess with things
<lovesegfault> how many mA does my power source need to provide? This thing maxes out at 0.2 mA
<clever> yeah, this code will need several more iterations and some close debugging
<clever> i think this code could run down at 120mA, but the screen may add to that
<clever> i should just buy my own and test here, its clearly got buts
<clever> bugs*
<lovesegfault> correction: max is 0.2A
<lovesegfault> Well, conclusion: the hyperpixel can work using the RPi kernel and uboot. It cannot work with the new 5.4 kernel
<clever> lovesegfault: oh, i think i noticed another big typo...
<lovesegfault> :D
<clever> int ret = wait_queue_block(&waiter, 100000);
<lovesegfault> upload it and I'll test it again
<clever> it wont boot until 100 seconds after power-on
<clever> its waiting for xmodem transfer over serial
<clever> updated both bootcode.bin and lk.elf
<clever> it should now boot after just 10 seconds
<lovesegfault> copying
<lovesegfault> Nothing :(
<lovesegfault> I think I may have done something wrong when partitioning?
<lovesegfault> maybe it isn't even booting at all
<clever> na, it doesnt look right on my scope either
<clever> i'll just need to get my own screen
<lovesegfault> You're in the US, right?
<clever> canada
<lovesegfault> Ah, I was going to say digikey has them
<lovesegfault> and they delivered it at lightning speed to me
<clever> there is a digikey.ca
<clever> lovesegfault: so far, all of my debug has looked like: https://www.youtube.com/watch?v=hmpZRTuJZ30
<lovesegfault> That looks calmer than i'd expect?
<clever> thats a single pixel moving from topleft to bottom right
<clever> plus vsync
<lovesegfault> I see, what pin are you reading off of?
<clever> hsync and vsync are on gpio 2/3
<clever> and the image data is on 4-27
<clever> i was probing 2 and 4 in that video
<lovesegfault> I see
<lovesegfault> I gotta get a scope
<clever> oops, wrong one
<clever> this shows where each of them is on the header
<clever> framebuffer at 0xc152b524 is 480x800 with stride 480
<clever> oh, it would help if i ran hvs_configure_channel
<clever> lk.elf updated again, now its doing something
<lovesegfault> copying
<lovesegfault> booting
<clever> its not doing what it should, but it might be more visible now
<clever> you may get flashing stripes of blue
<clever> or stripes of blue that slowly fade in over 4mins
<clever> plus stripes of white that dont fade in
<lovesegfault> nada, just backlight :/
<clever> let me automate decoding dpi_output_format=0x7f226 ...
<clever> lovesegfault: oh, fun!
<clever> output format 6 is DPI_OUTPUT_FORMAT_18BIT_666_CFG2
<clever> # define DPI_FORMAT_18BIT_666_RGB_2 5
<clever> which maps to 5 in the hw, lol
<clever> ah, but its just a -1 to convert
<clever> lovesegfault: aha, that display wants hsync and vsync disabled
<clever> lovesegfault: lk.elf updated
<clever> given that its not using vsync, getting the DE signal right is a lot more important
<lovesegfault> clever: trying again in a second
<lovesegfault> had to shower
<lovesegfault> nada
<lovesegfault> Can you reboot the pi via your code?
<clever> yeah, but it wont show much
<clever> it is configured to print serial on gpio 14 right now
<clever> so if you hook up a uart adapter, youll see boot logs
<lovesegfault> I can't the "shield" is covering all the GPIO ports
<clever> the logs will still be there without the shield
<lovesegfault> and I don't have a breadboard & jumpers handy
<clever> so it would sitll confirm if its booting
<lovesegfault> alright, let me find my USB to serial
<lovesegfault> done
<lovesegfault> clever: idk if this will work
<clever> lovesegfault: as long as its 3.3v level, it should work fine
<lovesegfault> with the header connector instead of individual wires
<clever> ftdi rx to pi tx (14), gnd to gnd
<clever> lovesegfault: WARNING!!!
<clever> lovesegfault: thats a 5v ftdi cable, it will probably fry the gpio pin!!!
* lovesegfault stops
<lovesegfault> let me find the exact model I have
<clever> lovesegfault: a volt meter on the pins would let you confirm
<lovesegfault> alright, i'll get my multimeter
<clever> because gnd rx and tx are labeled right on the pins
<clever> it also has a jumper on the bottom to switch between 5v and 3.3v
<samueldr> clever: that still doesn't solve my issue of never knowing whether rx or tx on the board labels rx and tx according to the board's vieewpoint or the other way around :)
<clever> samueldr: the rx on the ftdi is input to the ftdi
<clever> and the rx on the pi is input to the pi
<clever> so you just tie tx->rx and tx->rx, done!
<samueldr> but can I trust all documentation for boards to properly label that? :)
<lovesegfault> yep, reading 5.1v across VCC/GND
<clever> the problem is the other guys, that label rx ad tx, because they expect idiots that do tx->tx
<lovesegfault> going to nag one of these https://www.adafruit.com/product/3589
<clever> lovesegfault: ah, that one looks nice
<clever> it might even fit under the display, but you need to be aware of gpio 15
cole-h has quit [Quit: Goodbye]
<clever> 15 is the uart rx on the pi, so the usb adapter will be trying to transmit into 15
<clever> but 15 is also green bit 5 on the hyperpixel
<clever> so both the usb and pi will be trying to drive the same pin
<lovesegfault> this is a good opportunity for me to nag some jumpers too
* clever gets link
<clever> lovesegfault: these ones are a bit expensive, and i forget exactly which variant i got, but i have a mix of M/M, M/F and F/F ones
<clever> M/F are good for connecting my pi to the ftdi or a breadboard
<clever> F/F are good for connecting 2 pi's together
<clever> M/M are less useful, you can do the same thing by just stripping the ends of scrap wire
<lovesegfault> Oh, those are nice
<lovesegfault> I'm nagging these
<clever> yep, those ones look almost identical
<clever> and its 40 instead of 100, so cheaper too
<clever> sparkfun has packs of 10 and 100, for each variant
<lovesegfault> I have to say, few things are as satisfying to me as needing a tool and just having the exact tool I need
<clever> and then people call you a hoarder because you have 8 CRT's
<lovesegfault> lol
<lovesegfault> I tried to explain to my wife why I need a literal mountain of different cables
<lovesegfault> and how if I throw any away there will come a time where I will need it
<clever> this would be my pi3? connected to the ftdi, with the M/F cables
<clever> and this is the pi3 and pi4 cross-connected, so one can run openocd, to jtag debug the other
<lovesegfault> nice :D
<clever> the ftdi is also in the mix, and i ran out of gnd's so i have a breadboard to connect 3 male ends to gether
<lovesegfault> here's an idea
<clever> and now i need a M/M connector, to do breadboard<->ftdi
<lovesegfault> take the sd off of your pi, dd it into an image, and I'll dd that into my sd
<clever> the M/M ones have a bit more of a standard size, so they fit better
<lovesegfault> I guess that will eliminate any doubt in me having made a mistake partitioning
<clever> my card is 8gig, and the files are <2mb, lol
<clever> but i could just generate a .img with nix, lets see
lafa has joined #nixos-aarch64
<clever> step 1
<clever> > vmTools.runInLinuxVM
<{^_^}> <LAMBDA>
<clever> lovesegfault: this is a magic function, that takes any derivation, then runs the builder in qemu as root
<lovesegfault> :O
juliosueiras has quit [Ping timeout: 240 seconds]
<clever> disk_image = pkgs.vmTools.runInLinuxVM (pkgs.runCommand "disk-image" { preVM = ""; postVM = ""; } ''...'')
<clever> lovesegfault: this will run ... in a vm as root
<clever> preVM = ''diskImage=$out/disk-image.img ; truncate $diskImage -s 64m'';
<clever> but it will map this file to /dev/vda
alp has joined #nixos-aarch64
<lovesegfault> samueldr: does NixOS work with the Pi Zero W?
<clever> lovesegfault: i would expect it to, but youll need the armv6 build
<lovesegfault> yikes
<clever> lovesegfault: pi0/pi1 are both armv6
<lovesegfault> That's a shame
<clever> lovesegfault: the 0/1 also lack a dedicated arm L2 cache
<clever> which cripples it pretty hard
<lovesegfault> Oh yeah
<lovesegfault> that's brutal
<clever> lovesegfault: i believe it has 16kb each of L1i and L1d
<clever> lovesegfault: then it shares the 128kb L2 with the GPU, which could be using it for anything
<clever> lovesegfault: it boots!
Darkmatter66_ has joined #nixos-aarch64
Darkmatter66 has quit [Ping timeout: 260 seconds]
orivej has joined #nixos-aarch64
veleiro has quit [Ping timeout: 264 seconds]
alp has quit [Remote host closed the connection]
alp has joined #nixos-aarch64
orivej has quit [Ping timeout: 256 seconds]
superherointj has joined #nixos-aarch64
veleiro has joined #nixos-aarch64
alp has quit [Ping timeout: 240 seconds]
alp has joined #nixos-aarch64
juliosueiras has joined #nixos-aarch64
orivej has joined #nixos-aarch64
cole-h has joined #nixos-aarch64
justanotheruser has quit [Quit: WeeChat 2.9]
justanotheruser has joined #nixos-aarch64
mica[m] has joined #nixos-aarch64
mica[m] has left #nixos-aarch64 ["User left"]
orivej has quit [Ping timeout: 272 seconds]
alp has quit [Ping timeout: 272 seconds]
alp has joined #nixos-aarch64
rajivr has quit [Quit: Connection closed for inactivity]
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alp has quit [Ping timeout: 272 seconds]
<lovesegfault> clever: good morning :D
<lovesegfault> trying it oyt
alp has joined #nixos-aarch64
Thra11 has joined #nixos-aarch64
h0m2 has quit [Quit: WeeChat 2.9]
h0m1 has joined #nixos-aarch64
zupo has joined #nixos-aarch64
justanotheruser has quit [Ping timeout: 240 seconds]
justanotheruser has joined #nixos-aarch64
<lovesegfault> samueldr: here's my verdict on your PR after a weekend of testing: It's good, but the old RPi kernel needs to remain since a bunch of stuff in the Pi ecosystem still relies on it
<samueldr> we have a problem
<lovesegfault> dum-dum-dum
<samueldr> the old kernel is AFAIUI not going to be updated anymore
<samueldr> (but I do understand where you are coming from)
<samueldr> see: this is why relying on vendor specific things is problematic!
<lovesegfault> I think we can default to the new one
<lovesegfault> and just leave the old one around until the ecosystem moves a little bit forward
<samueldr> let the users .override to the previous one?
<samueldr> the raspberry pi foundation is as closed as many vendors ecosystems are :(
<lovesegfault> Right, that is true
<lovesegfault> my feeling is for those running headless RPi setups the transition will be painless
<lovesegfault> it will literally make no difference
<samueldr> yeah, the real issues (all the time) with the raspberry pi stuff is the additional hardware
<samueldr> though I wonder how we should proceed
<samueldr> this is going to break people's stuff without a warning
<lovesegfault> anyone who is using the MIPI CSI-2 iface, or have a head(ful? ed?) setup will be in pain
<samueldr> *could* be in pain
<samueldr> which makes the situation kind of worse
<samueldr> if it was outright broken, it would end up being fixed
<samueldr> but as different things are at different levels of brokenness, it's pretty sure it will end up with different levels of fixed
<lovesegfault> Yeah :/
<samueldr> one thing we could do, but a bad solution to the problem
<samueldr> force the user to pick
<samueldr> break build for linux_rpi4
<samueldr> force them to use something like linux_rpi4.override { branch = "4.9"; }
<lovesegfault> I was thinking `linux_rpi4` is 5.4, and `linux_rpi4_legacy` is 4.9
<samueldr> hm, anyway .override wouldn't apply the overlay to the packages attrset
<samueldr> but I really don't want to have an explosion of linux_* attrnames either
<samueldr> it's already pretty bad with linux_rpi*
<lovesegfault> Yeah, that's understandable
<lovesegfault> Although I do feel that eventually we should just drop support for the RPi1 kernel
<samueldr> why?
<lovesegfault> these things are cheap and the 1 is _old_ and unmaintained by upstream by now
<samueldr> no
<samueldr> the raspberry pi 0 is built on the same SoC and everything
<samueldr> still part of the ecosystem
<lovesegfault> ah, yikes
* lovesegfault sighs
<samueldr> and anyway dropping it would be bad
<samueldr> well, we need a proper plan forward in that case
<samueldr> because they are still used and useful devices
<lovesegfault> fair enough
<samueldr> and uh
<samueldr> let me think
<samueldr> I guess it depends on mainline
<lovesegfault> here's a salient question: do you see the situation with Pi's needing custom kernels improving in the near future?
<samueldr> no/yes
<samueldr> they don't seem to care about that
<samueldr> but mainline linux always improves
<samueldr> so the raspberry pi themselves will never really need custom kernels
<samueldr> but the ecosystem built on the custom stuff, yes :(
<samueldr> so yeah, to go back to 1/0
<lovesegfault> Hm
<samueldr> I guess it depends on whether 1/0 uses mainline already, and that mainline is good enough
<samueldr> it might be something we see as an "external" repo of prebuilt cached artifacts by the nixos org if this ever becomes a thing
<samueldr> (that's something I'd like to see, some things like community-supported kernels for specific devices cached but not part of Nixpkgs proper)
<lovesegfault> I have to say, I don't see having more kernelPackages* is that bad. I mean, I get that it is annoying, but I think having proper support for more hardware >>> having less packages to build/choose from
<samueldr> the real issue is not having more attributes
<samueldr> the real issue is support level
<samueldr> they're not even well supported at the time being
<samueldr> we don't do timely updates
<samueldr> it takes effort and specialized hardware to test
<samueldr> (specialized being just the dang devices)
<samueldr> the project itself should only target mainline linux
<samueldr> NixOS that is
<samueldr> unless we can get funding to have people *working* on better support, I suppose
<lovesegfault> Fair enough
<lovesegfault> oh, this reminds me
<lovesegfault> the Python GPIO library doesn't recognize a 5.4 kernel Pi as a Pi
<lovesegfault> it fails to be imported saying the device isn't a RPi :^)
<lovesegfault> Oh, this reminds me, I need to test uboot + 4.9 kernel + hyperpixel
alp has quit [Ping timeout: 272 seconds]
bennofs_ has joined #nixos-aarch64
bennofs has quit [Ping timeout: 272 seconds]
<samueldr> yes please
<samueldr> that'd give us a much more definitive answer as to what to do nex
<samueldr> next*
<lovesegfault> Alright, I'm on it
alp has joined #nixos-aarch64
t184256 has left #nixos-aarch64 ["Error from remote client"]
t184256 has joined #nixos-aarch64
<lovesegfault> samueldr: fascinating
<lovesegfault> even with the 4.9 kernel the shitty RPi GPIO lib doesn't recognize it as a Pi if you boot with U-Boot
<lovesegfault> is the custom bootloader setting some MSR?
<samueldr> I guess the answer would be: look what the lib checks for
<samueldr> it's possible the firmware sets some values in the in-memory FDT that is not present in the kernel-shipped dts
<lovesegfault> let's see
<samueldr> (reminder that FDT is flattened device tree, which is a file commonly shipped with a .dtb extension)
<lovesegfault> source/py_gpio.c
<lovesegfault> error is here
<lovesegfault> L1008
<samueldr> config.txt mutates the in-memory FDT for many use cases, so it wouldn't surprise me
<lovesegfault> the check is func get_rpi_info
<lovesegfault> which is cpuinfo.c L34
<samueldr> I guess follow the flow and check for yourself
<lovesegfault> yeah, checking
<samueldr> for stuff under /proc/device-tree pipe through xxd or something aware of \0 (NUL bytes)
<lovesegfault> Well, before any of this
<lovesegfault> How do I check whether the overlay was applied?
<samueldr> best method would be using `dtc /proc/device-tree` to decompile it and check whether things are there
* lovesegfault does that
<lovesegfault> I don't _think_ it's applied
* lovesegfault tried by hand
<samueldr> the rpi gpio lib should still identify that as a raspberry pi
<samueldr> regardless of your overlay being applied or not
<lovesegfault> Right, I just want to tackle that issue after I'm sure the overlay is loading
NinjaTrappeur has quit [Quit: WeeChat 2.8]
NinjaTrappeur has joined #nixos-aarch64
<lovesegfault> idk what I did
<lovesegfault> my hdmi output is now just a rainbow
<lovesegfault> :P
<samueldr> that means generally that the firmware hasn't been able to start anything
<samueldr> one of the first few things the firmware does is send a 2×2 texture to the videocore display, which ends up stretched on the displa
<samueldr> display*
<samueldr> and is how that rainbow is made!
<samueldr> (texture? might be a triangle pair)
<lovesegfault> I think my sd suicided
<lovesegfault> dingit
* lovesegfault sighs
<lovesegfault> alright, flashing new card
veleiro has quit [Read error: Connection reset by peer]
alp has quit [Ping timeout: 272 seconds]
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alp has joined #nixos-aarch64
<samueldr> yay, went back to the drawing board, restarted fresh from the OEM's source code dump rather than that user's kernel tree with great success
<samueldr> not syncing: Attempted to kill init! exitcode=0x00000200
<samueldr> (it _is_ great success when the kernel ends up logging correctly!)
<lovesegfault> do I need to do anything special when I'm writing a derivation that statically links a C program?
<heywoodlh> samueldr: if you have any suggestions and can spare some cycles I'd be curious to know if you have any ideas why razer-cheryl-wip is not building.
<samueldr> right
<samueldr> you weren't there when I ended up trying, and yeah, turns out it'S not building
<samueldr> not sure at the moment
<heywoodlh> Ah, okay, cool
<samueldr> I forgot what it was
<samueldr> (looking at cheryl2 right now)
<heywoodlh> Haha okay, would it help if I tried to build again and shared the trace?
<samueldr> it might make me remember
<heywoodlh> K, will build again
lafa has quit [Remote host closed the connection]
<lovesegfault> samueldr: I can't get that dtbo to apply anymore, not even manually
<lovesegfault> [ 383.021420] OF: changeset: add_property failed @/__symbols__/i2c_gpio
<lovesegfault> ,locate dtoverlay
<lovesegfault> ,find dtoverlay
<{^_^}> ,find is temporarily unimplemented
<{^_^}> Couldn't find in any packages
<samueldr> it is ,locate, ,locate sometimes takes some time
<{^_^}> raspberrypi/firmware#1401 (by dutchcompo, 16 weeks ago, open): dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24 gives the rainbow screen and no boot
<lovesegfault> seems relevant
<heywoodlh> (Regarding the razer-cheryl-wip build)
<samueldr> right
<samueldr> compare the options named MDSS enabled in both the walleye and cheryl1
<samueldr> (well, cheryl)
<heywoodlh> Okay, will do
<samueldr> hmmm! Failed to execute /init (error -8)
<samueldr> ENOEXEC 8 Exec format error
<samueldr> great
<samueldr> boot.kernelParams = [ "printk_ratelimit=0" ]; # really useful
<lovesegfault> eh, samueldr, what do I do if I need two different revisions of the same repo to build my pkg? :P
<lovesegfault> actually
<lovesegfault> I'll split them
<samueldr> well
<samueldr> you could split them
<lovesegfault> one will be only the init and the other only the dtbo
<samueldr> :)
<heywoodlh> samueldr: only difference in razer-cheryl vs walleye is this is enabled in walleye: CONFIG_FB_MSM_MDSS_HDMI_PANEL=y
<heywoodlh> So just enabled and am rebuilding
<samueldr> I wouldn't hold much hope
<heywoodlh> Why's that?
<samueldr> well, because then you won't be in total despair that it didn't fix it :)
<heywoodlh> Oh wait. I forgot that the "# [blank is not set" aren't just comments
<samueldr> haha
<heywoodlh> So there were two other config options that were not set
<heywoodlh> They sure made that intuitive.
<samueldr> razer could also have had enough customizations in the mdss drivers that it doesn't work the same
<samueldr> or that they are not even using the same mdss drivers!
<samueldr> and yeah, their reasoning is that you should be using the "interfaces", either make menuconfig or any other
<samueldr> rather than edit the files manually
<heywoodlh> Sure that makes sense. Well, let's hope that the config changes I made allow the image to build
<heywoodlh> And hopefully that the kernel will actually load this time
<heywoodlh> No, that's too hopeful. I'll hope it doesn't even build so that way I'm not disappointed :D
<samueldr> on my razer-cheryl2 there are conditions that makes the kernel *totally* not load
<samueldr> when it does, it's hanging on the boot logo, but actually visible using `fastboot devices`
<samueldr> CONFIG_BUILD_ARM64_DT_OVERLAY=y # is an option I had to enable to make it work
<samueldr> but yeah, you still need to have something building first
<heywoodlh> Just curious. Does it matter what order the kernel config options are in?
<samueldr> AFAIK no
<heywoodlh> Okay good
<samueldr> though what I usually do is stage the changes, normalize, then check what changed
<samueldr> because sometimes it adds more options that were in a disabled subset of options
<samueldr> and soon I might be adding a change that forces kernel configs to be normalized
<heywoodlh> That's a good way to handle things.
<samueldr> basically normalizing passes it through whatever scheme the kernel wants you to use
<heywoodlh> That makes sense. Good to know.
<samueldr> the main drawback that'll bring is that a simple kernel version bump would force the user to re-normalize
<samueldr> well, not user, the maintainer
<samueldr> but at the same time, that forces the config to be actually what's in use
<heywoodlh> I think you mentioned it in your talk that you got a grant and you're able to work on mobile NixOS full-time. Did I get that right?
<samueldr> yep
<heywoodlh> That's so awesome. Are you still working on it full-time?
<samueldr> yes
<samueldr> except for the last couple weeks where I was working on the nixos.org website redesign, where I basically took some time off :)
* samueldr crosses fingers
<samueldr> hopefully I can get this correctly booting (again) and only be left with understanding why it's not showing anything on the display
<heywoodlh> Super cool. That sounds like an achieved dream, congrats.
<heywoodlh> I forgot to normalize the config before re-running the build. The build failed, though.
<heywoodlh> So I'm re-normalizing the config and re-building now
<heywoodlh> It was a different build failure though
<samueldr> when the build runs it does basically the equivalent to normalizing
<samueldr> so it should fail the same new way
<heywoodlh> Ah. That's not great. Well, I'll post the trace when this build fails.
<lovesegfault> samueldr: Why is enable_uart needed?
<lovesegfault> I believe it's breaking the screen
<lovesegfault> since as clever noted the DPI iface and the UART share a pin
<samueldr> lovesegfault: for u-boot, it is needed
<samueldr> and uh
<samueldr> ugh
<samueldr> look at the comment, it's explained where to look for
<samueldr> and IIRC if that's not there U-Boot is quite unhappy
<samueldr> and uh... ugh
<samueldr> I really don't know what could be done from there on
<heywoodlh> samueldr: I was mistaken. Same trace on building razer-cheryl.
<samueldr> hm
<heywoodlh> So it seems the config changes I took from walleye didn't help
<samueldr> and compare with a config extracted from a boot.img built from that same kernel tree?
<samueldr> of open the file where it fails and look if there are #ifdefs around where it fails
<samueldr> it might be that we're exercising an unused code path
<samueldr> rotting code is not uncommon in vendor kernels
<lovesegfault> well i'm setting it to 0 and going to see what happens
<lovesegfault> samueldr: yep, that breaks it :D
<lovesegfault> check this out
<samueldr> I mean, I knew full well once you said that that it was a possibilty
superherointj_ has joined #nixos-aarch64
superherointj_ has quit [Client Quit]
superherointj has quit [Quit: Leaving]
<lovesegfault> Yeah, I simply cannot get this thing to work with U-Boot
<lovesegfault> samueldr: when is our RPi fw from in nixpkgs?
<lovesegfault> as in: how old is it
<samueldr> whatever the date in the version field says
<samueldr> oh neat
<samueldr> [ 42.381244] $ reboot bootloader
<samueldr> ~80% sure this is from the menu code that ran while not being able to display
<samueldr> yes Creating LVGL::LVContainer as screen.
<samueldr> great, so I'm back at having code running
<lovesegfault> samueldr: making a PR, there's a new release
<samueldr> there's always a newer release :)
<Jake[m]> [lovesegfault](https://matrix.to/#/@freenode_lovesegfault:matrix.org): I might be telling you things you already know, but I didn't quite realize that nixos is not gonna touch your firmware. If you want to upgrade it, you need to use `rpi-eeprom`. I'm not sure actually if the raspberry pi firmware in nixpkgs is relevant at all for the rpi4. I use
<Jake[m]> [this](https://github.com/NixOS/nixpkgs/issues/63720#issuecomment-647893093) nix expression, so you can bump the version there and use that, but there's also [this issue](https://github.com/NixOS/nixpkgs/issues/63720#issuecomment-668168606), not sure if it got resolved.
<lovesegfault> Jake[m]: I did _not_ know about this
<samueldr> the eeprom is an additional part of the puzzle
<lovesegfault> As if I needed any more parts to this mess :P
<Jake[m]> Haha samueldr I feel like I always don't really know what's going on but get something working and then you break it down and explain what's actually going on. What are the other pieces of the puzzle? Sorry if it wasn't relevant to what you were talking about.
<samueldr> oh
<samueldr> the boot puzzle
<samueldr> the rpi4 [somehow] ends up loading the eeprom firmware, which in turn is what is loading the firmware partition on the storage medium
<samueldr> AFAIK in this instance it should change nothing, that eeprom firmware is mostly tasked into getting the "conventional" raspberry pi firmware loaded
<samueldr> then that firmware loads *something* to boot
<samueldr> which conventionally is the linux kernel
<colemickens> hm, I got the stuff for rpi-eeprom-config from a github comment in a nix related repo but I don't know where. now its just part of my nixcfg
<Jake[m]> [colemickens](https://matrix.to/#/@colemickens:matrix.org): I linked it above dwai.
<Jake[m]> If we're thinking of the same comment.
<samueldr> AFAIK it should never be needed to update it, except to get more ways to boot or fixes in earlier boot
<colemickens> oh yeah, fancy Matrix links :) I see, and it is.
<samueldr> otherwise _their_ own ways to provide the OS will fail badly
<samueldr> I could be wrong!
<Jake[m]> So is the conventional firmware start.elf or something, and that's managed by NixOS?
<samueldr> half managed, depending
<samueldr> ideally it shouldn't be "managed"
<samueldr> it should be just like u-boot or your computer bios
<Jake[m]> So it's not nixos's job, it's the users job to put something like uboot where the eeprom stuff can see it that can then load the kernel provided by NixOS? So uboot will replace start.elf but not the eeprom part?
<samueldr> it shouldn't be our job, in my opinion, or else we're going to be left working overtime to support all platforms
<samueldr> but we still need to tie some loose ends to make this work right
<samueldr> we can't support all the different platforms special needs
<samueldr> we need to move forward into a universal "just works" ARM ecosystem
<samueldr> which U-Boot has a basic implementation of
<samueldr> it's just like we started supporting a custom boot method for, let's say, dell laptops
<samueldr> that's not a good thing
<samueldr> there are standards slowly developing around ARM and booting
<samueldr> I'm thinking I should research the topic and propose a talk for nixcon, how we (I) propose ARM booting with NixOS should be done
<samueldr> a "detailed high level oveview"
<samueldr> so nothing about exception levels in ARM, nothing about how ARM platforms actually work
<samueldr> but what big pieces people all around the ARM communities are working towards
<samueldr> e.g. talk about EBBR, SBBR, presenting what it means for SBCs
<samueldr> though whew, a big chunk of work in not that much time :/