ryantrinkle has joined #nixos-aarch64
h0m1 has quit [Ping timeout: 246 seconds]
h0m1 has joined #nixos-aarch64
DigitalKiwi has quit [Quit: quite.]
DigitalKiwi has joined #nixos-aarch64
ryantrinkle has quit [Ping timeout: 268 seconds]
ryantrinkle has joined #nixos-aarch64
ryantrinkle has quit [Ping timeout: 265 seconds]
orivej has joined #nixos-aarch64
<samueldr> oh, I wasn't home during a good while today
<samueldr> (in case you want to get started before I'm available)
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zupo has joined #nixos-aarch64
zupo has quit [Client Quit]
<betaboon> good morning
<clever> morning
<betaboon> samueldr: I'm using that commit on top of mobile-nixos master. building against nixos-unstable. doesnt work for me. not sure if it is due to wrongly configured aarch64 remote builder or due to wrong nixpkgs commit
<clever> samueldr: i just realized, my custom bootcode.bin could add gpt support to the pi
grw has quit [*.net *.split]
samueldr has quit [*.net *.split]
Aleksejs has quit [*.net *.split]
grw has joined #nixos-aarch64
Aleksejs has joined #nixos-aarch64
samueldr has joined #nixos-aarch64
<clever> samueldr: reading the rpi docs more, it claims the spi interface can be clocked at up to 125mhz (and faster, if you overclock the gpu), but they only rate the IO pads to support up to 30.5khz (not sure where exactly that limit comes from)
<betaboon> clever: where does it say the io pads support only up to 30.5 ? oO
<clever> The practical SPI clock will be lower as the I/O pads can not transmit or receive
<clever> signals at such high speed. The lowest SPI clock frequency with a 250 MHz system clock is
<clever> 30.5 KHz.
<clever> from page 2`1
<clever> 21*
<betaboon> yeah. as i read that sentence that just means: the lowest possible spi clock frequency (as in the highest possible speed_field) at a system clock of 250Mhz is 30.5Khz.
<clever> oh wait
<clever> yeah, i misread that
<clever> so, the spi block can be anywhere between 30.5khz and 125mhz
<betaboon> yeah sounds like it
<clever> but, it can only be an spi master
<clever> so it cant emulate an SD card
<betaboon> do you wanna replace the spi-chip with a sd-card-reader ? XD
<clever> i'm currently on page 51, reading all the gory details of the dma engine
<clever> betaboon: we where previously discussing having something emulate an sd card, so another device would think the pi itself is an sd card
<betaboon> ah ok. for what purpose ?
<clever> so you can swap out the image without having to re-flash the card
<clever> betaboon: also, have a look at page 5 of the pdf, that explains why the docs often give conflicting addresses for IO devices in ram
<clever> betaboon: from the image, that looks perfect, but all of the descriptions and data mention lcd??
<betaboon> clever: yeah i dunno what this dgus stuff is. maybe that thing is just abusing the sd-card formfactor
<clever> i'm down to page 54, and i'm seeing dma features i heard mentioned before
<clever> the dma engine can either do plain linear copy from src->dest, or it can do 2d image copies, with strides
<betaboon> clever: or you could use something like this: https://www.amazon.com/gp/product/B00GEBTFNM ?
<clever> so, you can tell it to copy 10 rows of pixel data, that are 5 bytes long each, and to add +16 to the source addr after each row, but +32 to the dest addr, after each row
<clever> betaboon: i think the flashair only goes from card->cloud, and only supports fat32
<betaboon> ah ic XD
<clever> those types of devices tend to cheat, and read their own internal fat32, and upload it without the camera being aware
<clever> and the "internet passthru" allows cameras that are aware of the extra features, to use it as a wifi card
<clever> the stride stuff in the dma engine, allows many things
<clever> the intended use, is to update a sub-section of an image
<clever> for example, my main monitor is 1280x1024
<clever> if i want to draw a 800x600 image to the screen, i would copy 800 pixel long segments, but increment the destination by 1280
<clever> so it wraps around, and hits the same column, on the next row
<clever> but, you can abuse it, and set a stride of 0, to make it write to the same addr infinitely
<clever> which could be a fifo on a uart
<clever> you can also tie the dma engine to the fifo full/emtpy signaling, so it will properly wait for the fifo to drain
<clever> and it can dynamically adjust its priority on the AXI bus, to ensure the fifo never runs dry (or overflows)
<clever> it also supports creating a linked list of operations for the dma engine to perform, so your instructions can be artibtraily complex
<clever> and there are 16 channels, that can all be doing dma in parallel
<clever> ahhh, the axi stuff will stall reads automatically, but the apb<>axi bridge cant, so you only need the special dreq channels when dealing with apb
<clever> (i still have no idea WHAT apb actually is though, lol)
<clever> neat
<clever> page 61 also answers a critical question i was having
<clever> which components are on the APB bus, and require special dma handling
<clever> the units of note, pcm/pwm/spi/i2c/mmc/uart/sd/hdmi/scaler
<clever> thats still in the realm of sdio
<clever> i'm thinking of something that acts as a full memory card, but you can just point it to a .img on disk
<betaboon> that would be neat after all
<clever> aha, the dma engine even has a /dev/null destination, which the hardware specially handles, allowing it to read faster
<clever> and the intended usage, is to read something via the L2 cache, to pre-load data into the cache
orivej has quit [Ping timeout: 240 seconds]
<betaboon> clever: so you want to use something like this: https://www.sparkfun.com/products/9419 but instead of putting a sdcard in, emulate all the spi directly with a rpi, right ?
<clever> betaboon: it doesnt have to be an rpi, but everything else is correct
<betaboon> well yeah, something that can speak spi XD
<clever> it could just be a micro-controller that can support up to 100mhz spi slave, plus usb2.0 slave
<clever> it would need a limited understanding of the SD protocol, along with the ability to stall reads
<clever> then it can relay everything out the usb, and reply when it gets a block from the host disk
<clever> of note, both the rpi (and i think the avr) require that the spi clock be under half the system clock
<clever> for the rpi, half of 250mhz is 125mhz
<clever> but for the avr, half of 20mhz is only 10mhz
<clever> and even if it could deal with the spi at 100mhz, it would be receiving 12,500,000 bytes per second, .... which would only leave you with 1 clock cycle to read the spi bus, and deal with it (if you want to keep the fifo in check)
zupo has joined #nixos-aarch64
<betaboon> that somehow sounds like fpga-land ?
<clever> that was also one idea we bounced around
<clever> but a larger fifo, with the ability to just tell the host, "i got the command, please wait" would also work
<clever> page 66 of the pdf starts talking about the SD controller within the rpi
<clever> and mentions that it has its own clock, coming from the main clocking module
<clever> strings ~/apps/rpi/firmware/boot/start.elf | grep freq --color | grep sdram
<clever> and i see: sdram_freq sdram_freq_min max_sdram_freq
<betaboon> i think i'm of no real use with this stuff XD just getting acquainted with jtag for hardware hacking xD
<clever> so, with the current firmware, you can freely change the clock rates of the SD interface, for experimentation
<clever> betaboon: are you on a recent version of nixos-unstable?
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<clever> section 6, page 89, the gpio block!!
<betaboon> clever: on my local system ? no.
<betaboon> 19.09
<clever> ah
<clever> though you could still use -I if you want to try out my changes
<clever> oh wait, i switched to fetchTarball, nvm, its always building with unstable
<betaboon> you lost me :/
<clever> betaboon: this is what ive been working on lately
<clever> if you run nix-build -A firmware, you will get a result/bootcode.bin
<clever> that is then capable of booting linux on an rpi
<clever> and the source is all in plain view!
<betaboon> nice
<clever> the only part not open at that point, is the boot rom (a mask rom) which is etched into the cpu at the factory
<clever> its primary job is to load bootcode.bin and execute it
<betaboon> bbl
orivej has joined #nixos-aarch64
zupo has joined #nixos-aarch64
ryantrinkle has joined #nixos-aarch64
andi- has quit [Remote host closed the connection]
andi- has joined #nixos-aarch64
orivej has quit [Ping timeout: 240 seconds]
lopsided98 has quit [Quit: No Ping reply in 180 seconds.]
clever has quit [Ping timeout: 240 seconds]
clever has joined #nixos-aarch64
lopsided98 has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has joined #nixos-aarch64
lopsided98 has quit [Ping timeout: 250 seconds]
lopsided98 has joined #nixos-aarch64
Thra11 has quit [Ping timeout: 265 seconds]
orivej has quit [Ping timeout: 276 seconds]
Thra11 has joined #nixos-aarch64
orivej has joined #nixos-aarch64
Thra11 has quit [Ping timeout: 245 seconds]
Thra11 has joined #nixos-aarch64
bdju has quit [Ping timeout: 265 seconds]
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bdju has joined #nixos-aarch64
<betaboon> samueldr could you hit me it when you're around ? :)
zupo has joined #nixos-aarch64
* samueldr strikes betaboon
* betaboon is now awake xD
<clever> samueldr: how big did you say a u-boot blob was?
<betaboon> better than coffee
<samueldr> clever: ~6xxKiB for sunxi with defconfig
<clever> samueldr: what about without an SPL?
<samueldr> oh
<samueldr> unknown
<clever> the rpi open firmware, takes an arm chainloader
<clever> which it will just shove at physical address 0, and set the arm loose
<clever> if i just replace that whole thing, with a u-boot
<clever> and its already fully in ram, then you dont need an spl
<clever> the current arm chainloader will read: cmdline.txt, rpi.dtb, zImage, from the SD card, and then execute zImage
* samueldr is building u-boot for rpi3
<samueldr> that image I figure will not need an SPL
<betaboon> samueldr no that i have been granted access to the aarch64 community builder i tried to build `android-device` of examples/demo on mobile-nixos master + your linked commit (lightdm) applied on top against nixos-unstable. but it fails with `attribute 'targetPlatform' missing, at ... meson/default.nix:98:17`. any advice ?
<samueldr> betaboon: is the nix output first tracing that it's cross-compiling? (we are)
<samueldr> if so, then I guess we need to do something about that detection
<betaboon> samueldr: yes it is
<samueldr> right, so adding the aarch64 machine does nothing in this case, since mobile-nixos forcibly (and erroneously here) assumes cross-compilation
<samueldr> personally, I just checkout the project on the builder directly, but that's because my internet upload speed is potato
<betaboon> samueldr: this is what I'm doing (just for the record) https://gist.github.com/betaboon/044d3e3964ec365866b4e2e8c7987ed6
<samueldr> so since I nix-build on a aarch64 build, it doesn't try to detect cross-compilation
<samueldr> clever: -r-xr-xr-x 1 root root 500K Dec 31 1969 u-boot.bin
<betaboon> ah that detection comes from within mobile-nixos. i see
<samueldr> it looks suspiciously round
<samueldr> betaboon: exactly
<clever> samueldr: and too bloated to fit into the spi flash
<clever> samueldr: if you could shave maybe 20 or 30kb off, it would be a perfect fit
<samueldr> I'm sure *you* could,
<clever> what was your expr?
<samueldr> I'm thinking something like disabling USB or ethernet
<samueldr> and it's _suspiciously_ round
<clever> those are the main benefits you would gain :P
<samueldr> sure, but that's a first step
<clever> oh
<clever> but does u-boot even supports pi4's ethernet and usb?
<samueldr> I'm sure there are other subsystems that defconfig enables that could be removed
<samueldr> no idea
<clever> then they likely have to go, and be re-done
<samueldr> btw that was a build for the rpi3 one
<samueldr> and in the end, it was ls that rounded it
<samueldr> irb(main):001:0> 511448.0 / 1024 / 1024
<samueldr> => 0.48775482177734375
<samueldr> oops
<samueldr> irb(main):002:0> 511448.0 / 1024
<samueldr> => 499.4609375
<clever> what was your nix-build cmd?
<samueldr> $ env -i nix-build -I nixpkgs=/Users/samuel/tmp/nixpkgs/nixpkgs -E 'let plat = (import <nixpkgs> {}).pkgsCross.aarch64-multiplatform; in plat' -A ubootRaspberryPi3_64bit
<samueldr> I have a wrapper script that puts the whole bit in front of `-A`
<clever> gc ate my vc4 toolchain again
<clever> its in nixpkgs, but not hydra
<samueldr> betaboon: you could try neutering modules/system-target.nix
<samueldr> betaboon: I guess something could be done about that as a parameter
<samueldr> but I think *actually* detecting if aarch64 build is possible might require IFD
<betaboon> I'm just looking into it. cannot promise anythin tho XD
<samueldr> unless a clever trick can be done
<samueldr> betaboon: if you empty the config form that file it should stop automatically configuring cross-compilation
<clever> samueldr: i would add hostSystem and targetSystem params to the default.nix
<clever> samueldr: so you can nix-build --argstr hostSystem aarch64-linux, to force it to do `import <nixpkgs> { system = "aarch64-linux"; }`
<clever> host should default to builtins.currentSystem
<clever> targetSystem, do you plan to support v7? ...
<samueldr> yes, and x86_64
<clever> then youll need to fetch that from the target device
<samueldr> that's already what I do
<clever> ah, so the root default.nix cant pick that
<samueldr> in the config
<clever> and the system depends on the target, if you want to build many
<clever> yeah, now its getting complex
<samueldr> what I'd need is to detect whether the current builder can or cannot do cross-compilation
<clever> maybe just a bool flag?
<clever> --arg doCross false
<clever> let the user decide
<samueldr> yeah, that's the manual way I was thinking about implementing
<samueldr> but it would have been nice to detect that :)
<clever> yeah
<samueldr> just like I can already detect the need for cross-compilation
<clever> oh, builtins.readFile /etc/nix/machines
<clever> thats not ifd, because its not a derivation
<samueldr> thanks, I hate it :)
<samueldr> can't machines be passed on the CLI?
<clever> yes, --options builders and --builders
<clever> then all hope is lost :P
<samueldr> though, do you think it's possible to detect it using IFD?
<clever> dont think so
<samueldr> right, the try* builtins can't "unfail" a failing build I guess?
<betaboon> samueldr: could we just check `nix.machines` in system-target.nix to determine if we should set `nixpkgs.crossSystem` ?
<samueldr> it's not using your machine's configuration.nix
<clever> betaboon: you cant access nixos config
<samueldr> you could, you shouldn't :)
<clever> nixops would like you get in your way
<samueldr> I'm confused... the cross detection is an older thing implemented when I experimented at first
<samueldr> I disabled what I thought was configuring it
<samueldr> ah, the kernel it's building is x86, so I guess it is well disabled, but configuring the system wrongly
<samueldr> localSystem can/should always be set anyway
<betaboon> i see. havent looked into cross-building alot yet.
<samueldr> it's getting better, but still an uphill battle
<betaboon> now its building. on the community builder :)
<betaboon> thanks a lot
<samueldr> betaboon: I think it was you who got a OP3 for this, right?
<betaboon> samueldr: yep
<samueldr> btw, both OP3 and OP3T were verified to boot the same kernel, and it was documented in other projects already as sharing the same builds
<betaboon> i have one as my daily driver. and got a used one off of ebay for 35€ oO
<samueldr> good pricing there :)
<betaboon> yeah. was a no brainer XD
<samueldr> I got one as a target for porting since it was revealed to be the most likely device to be unused in a drawer among european folks
<betaboon> (it has a non oem screen tho. but it works :) )
<samueldr> so, a likely device that a couple contributors would go on "oh, I have this"
<samueldr> and frankly, it looks like a good device
<samueldr> no experience with it outside of booting it to unlock the bootloader though
<betaboon> it's a decent device. 6GB of ram and a snapdragon 820 (quadcore 2x2.15Ghz + 2x1.6Ghz) and usb-c
<samueldr> yeah
<samueldr> 821 for the 3T
<samueldr> but for all intents and purposes, a drop-in replacement here
<betaboon> i was toying with the idea of having a nixos-environment on it, then connect it via usb-c to my office-monitor and connect bluetooth keyboard+mouse to it and have a full portable workstation XD
<samueldr> does it have eDP out?
<samueldr> finding information on the matter is EXTREMELY HARD on the internet
<samueldr> from a quick search, no
<samueldr> what I mean by "on the matter" is a list of devices supporting it
<samueldr> when you search device-by-device generally you get a confidence level
<samueldr> here it looks like 80% chances it cannot
<samueldr> be wary, there are some usb dongles that purport to do that, and they do seem to work, even through micro-USB
<samueldr> but in reality it's a custom chip that installs a package on the device to do screen mirroring through ADB
<betaboon> yeah quick search makes me believe its not possible with this device
<betaboon> meh. well i still have another usecase xD
<samueldr> I got a razer phone 2 (cheap) this week _because_ it supports eDP out
<samueldr> and verified it
<samueldr> it does
<samueldr> US/Canada razer.com shop has it at 299$USD 399$CAD
<samueldr> though not sure yet it's a good mobile-nixos device, but it's at least a plausible one, since it has easy^W trivial bootloader unlock, and has sources
<samueldr> but right now I'm having troubles getting it to build the kernel
<betaboon> samueldr: https://webcache.googleusercontent.com/search?q=cache:uKhQrugW-BoJ:https://www.wikiwand.com/en/List_of_devices_with_video_output_over_USB-C+&cd=23&hl=en&ct=clnk&gl=de this has a list of devices supporting video-output via usb-c (way down there is smartphones)
<samueldr> yeah, old deleted wikipedia page
<samueldr> but it's not like a list of all devices
<samueldr> just random anecdotal reports
<betaboon> yeah
<samueldr> oh, nice, OP7 apparently can
<samueldr> oh wow that detailed filter thing is... montruous!
<samueldr> but might be good
<betaboon> very confusing website, but the link i send you filters for video out displayport
<samueldr> I think the results are not ideal
<samueldr> since it seems to include MHL devices
<samueldr> e.g. Nexus 7 2013
<samueldr> I don't even see where the display port option is
<samueldr> it's a monstruous page indeed
<samueldr> ah, found it
<samueldr> Audio/Video Interfaces
<betaboon> there are shortcuts to the sections in the top left. but yeah weird page
<betaboon> samueldr: while trying to build libjack2 fails to build. same for you ? oO
<samueldr> setting the connector to type-c in the audio/video settings seem to result in better reuslts
<samueldr> betaboon: yes, there's a PR in staging for that
<{^_^}> #73779 (by worldofpeace, 1 week ago, merged): jack2: 1.9.13 -> 1.9.14, fix build arm
<betaboon> damn there are many smartphone models ...
<samueldr> that's... an understatement
<samueldr> apparently supports type-c hdmi
<betaboon> that thing looks crazy XD
<samueldr> damn it TCL
<samueldr> and damn it Blackberry
<samueldr> apparently the KEY2 support it too
<samueldr> but no bootloader unlock
<betaboon> brb gonna get something to eat
<samueldr> so the gemini, too, apparently
<samueldr> would need further confirmation whether it's HDMI or something else
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has quit [Ping timeout: 268 seconds]
bdju has quit [Quit: leaving]
tune has joined #nixos-aarch64
WilliButz has quit [Quit: WeeChat 2.6]
WilliButz has joined #nixos-aarch64