00:46
CarlFK1 has quit [Quit: Leaving.]
00:49
CarlFK1 has joined ##raspberrypi-internals
00:57
CarlFK1 has quit [Read error: Connection reset by peer]
00:57
CarlFK1 has joined ##raspberrypi-internals
01:09
CarlFK1 has quit [Quit: Leaving.]
01:09
CarlFK1 has joined ##raspberrypi-internals
01:28
CarlFK1 has quit [Quit: Leaving.]
01:28
CarlFK has joined ##raspberrypi-internals
01:47
jcea has quit [Ping timeout: 272 seconds]
02:35
<
CarlFK >
clever: woo. I see stuff: 1.322518 [EMMC:init_card]: Identification complete, changing clock to 50MHz for data mode ...
02:35
<
clever >
CarlFK: yep, that would be the SD routines coming online, so it can mount fat and load the kernel/dtb
02:37
<
CarlFK >
1.360240 [LDR:find_and_mount]: Mounting boot partitiion ...
02:37
<
CarlFK >
[MBRDISK:disk_initialize]: Mounting FAT partition 0 of type 0xc
02:37
<
CarlFK >
1.371993 [LDR:find_and_mount]: Boot partition mounted!
02:37
<
CarlFK >
panic(): "attempted to read zImage, but it does not exist"@loader.cc:157
02:37
<
clever >
CarlFK: yep, the open firmware expects the kernel to be called zImage, rather then the wonky naming scheme RPF uses
02:45
<
CarlFK >
ack. I left my sd card dongle at home.
02:45
<
clever >
CarlFK: which model of pi are you using?
02:46
<
clever >
that one can boot from a usb drive, and lk-overlay supports usb
02:47
<
clever >
so you can use any usb stick, instead of the SD card
03:02
<
CarlFK >
9.796101 [EMMC:init_card]: ERROR: Failed to query card voltage!
03:02
<
CarlFK >
panic(): "failed to reinitialize the eMMC controller"@drivers/sdhost_impl.cc:624
03:03
<
clever >
CarlFK: was this with the rpi-open-firmware build or the lk-overlay build?
03:04
<
CarlFK >
this: ~/rpi-open-firmware$ scp result/bootcode.bin
03:04
<
clever >
yeah, that one lacks usb support
03:04
<
clever >
you need to switch to lk-overlay
03:05
<
clever >
one minute
03:07
<
clever >
[clever@amd-nixos:~/apps/rpi/lk-overlay]$ nix-build -A vc4.vc4.stage1 -o stage1
03:07
<
clever >
[clever@amd-nixos:~/apps/rpi/lk-overlay]$ nix-build -A vc4.vc4.stage2 -o stage2
03:08
<
clever >
copy stage1/lk.bin to bootcode.bin on the fat32 partition
03:08
<
clever >
and copy stage2/lk.elf to /boot/lk.elf on the ext4 partition
03:10
<
CarlFK >
[nix-shell:~/lk-overlay]$ time make PROJECT=rpi3-bootcode
03:11
<
clever >
CarlFK: for booting linux, you want vc4-stage1 and vc4-stage2, rather then rpi3-bootcode
03:11
<
clever >
and stage2 needs some other stuff, nix automates all of it
03:12
<
CarlFK >
Will what I did build that eventually?
03:12
<
CarlFK >
im doing 3 other boring admin things and need to get them done even though this is way more interesting
03:12
<
clever >
rpi3-bootcode is just a demo app, that includes a shell over the serial port and nothing more
03:12
<
clever >
so it wont be able to boot linux
03:13
<
clever >
vc4-stage1 is a proper bootloader, that will load a 2nd stage from ext4, over sd or usb
03:14
<
CarlFK >
vc4-stage1 go.
03:25
<
CarlFK >
clever: time make PROJECT=vc4-stage1 done. where is it?
03:25
<
clever >
CarlFK: build-vc4-stage1 i believe
03:26
<
clever >
you should see it at the end in `ls -ltrh`
03:38
<
CarlFK >
generating image: build-vc4-stage1/lk.bin
03:38
<
clever >
yep, copy that onto the fat32 paritition, and rename it to bootcode.bin
03:48
<
CarlFK >
booting... seems to be in a loop. likely because there isn't anything else useful on the usb drive
03:49
<
CarlFK >
30.975486 [EMMC:restart_controller]: hcfg 0xA, cdiv 0x7D0, edm 0x10800, hsts 0x40
03:49
<
CarlFK >
31.004172 [EMMC:restart_controller]: Restarting the eMMC controller ...
03:49
<
clever >
CarlFK: what partitions are on the usb drive?
03:49
<
CarlFK >
just a fat32
03:49
<
CarlFK >
and no kernel
03:50
<
clever >
you need an ext4 partition as well, on the 2nd slot of the MBR
03:50
<
CarlFK >
actually, there isn't even a partition .. sda is all fat32
03:50
<
CarlFK >
so neat, that works. if that is neet. it was handy.
03:50
<
clever >
ah, lk-overlay cant handle that
03:50
<
clever >
but its neat that the rpi rom can
03:55
<
CarlFK >
woot. time to grab a burrito from burrito house. bb in 10 min.
04:21
<
clever >
gotta head to bed now, we can chat more tomorrow!
04:37
<
CarlFK >
sure thing. sleep well!
05:30
Stromeko has quit [Quit: Going… gone.]
05:32
Stromeko has joined ##raspberrypi-internals
07:13
CarlFK has quit [Ping timeout: 252 seconds]
07:47
CarlFK has joined ##raspberrypi-internals
11:46
<
clever >
CarlFK: morning
11:56
jcea has joined ##raspberrypi-internals
14:57
<
CarlFK >
clever: morning to you too
15:02
<
clever >
CarlFK: this is a sample script, that generates a disk image, with the proper partition tables, and FS's, with the firmware pre-filled
15:02
<
clever >
`nix build .?submodules=1#disk_image` is enough to have nix build everything for you
15:03
<
clever >
[clever@amd-nixos:~/apps/rpi/lk-overlay]$ fdisk -l result/disk-image.img
15:03
<
clever >
Device Boot Start End Sectors Size Id Type
15:03
<
clever >
result/disk-image.img1 2048 67583 65536 32M c W95 FAT32 (LBA)
15:03
<
clever >
result/disk-image.img2 67584 131071 63488 31M 83 Linux
15:03
<
clever >
and boom, a disk image that should boot stage2
15:06
<
CarlFK >
[nix-shell:~/lk-overlay]$ nix build .?submodules=1#disk_image
15:06
<
CarlFK >
error: experimental Nix feature 'nix-command' is disabled; add '--extra-experimental-features nix-command' to enable it
15:06
<
CarlFK >
add that where?
15:06
<
clever >
[root@amd-nixos:~]# grep flakes /etc/nix/nix.conf
15:06
<
clever >
experimental-features = nix-command flakes
15:06
<
clever >
CarlFK: adding this like to that file makes it permanent, then you never have to think about it
15:08
<
CarlFK >
added... now
15:08
<
CarlFK >
error: flake 'git+file:///home/videoteam/lk-overlay?submodules=1' does not provide attribute 'packages.x86_64-linux.disk_image', 'legacyPackages.x86_64-linux.disk_image' or 'disk_image'
15:08
<
clever >
i added that, and then didnt push, lol
15:09
<
CarlFK >
I've never done such a thing [smug face]
15:09
<
clever >
try a `git pull` and then re build
15:14
<
CarlFK >
its doing stuff
15:38
jcea has quit [Ping timeout: 246 seconds]
15:54
<
clever >
CarlFK: ah, ive got some floating point math in there, to benchmark code, and it works fine on vc4/vpu
15:54
<
clever >
but on arm, it cant run, because arm manages the FPU differently
15:54
<
clever >
i fixed it months ago, but never pushed!
15:58
<
CarlFK >
push all the things!
16:06
<
CarlFK >
push more!
16:07
<
clever >
ah, pointer size in that case
16:07
<
clever >
gcc complains when i try to %x a pointer, so i cast it to uint32 to make it happy
16:07
<
clever >
but on aarch64, a pointer is 64bit!
16:08
<
clever >
CarlFK: pushed!
16:16
<
clever >
CarlFK: CI now passes
16:40
<
CarlFK >
error: a 'x86_64-linux' with features {kvm} is required to build '/nix/store/hbrrj96q6pmf70qv02d8finbqqnikq20-disk-image.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, nixos-test, uid-range}
16:40
<
clever >
CarlFK: does /dev/kvm exist?
16:41
<
CarlFK >
ls: cannot access '/dev/kvm': No such file or directory
16:41
<
clever >
intel or amd?
16:41
<
CarlFK >
model name : AMD Athlon(tm) 64 Processor 3500+
16:41
<
CarlFK >
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl cpuid extd_apicid pni cx16 lahf_lm svm extapic cr8_legacy 3dnowprefetch vmmcall
16:41
<
clever >
modprobe kvm-amd
16:44
<
CarlFK >
[nix-shell:~/lk-overlay]$ sudo modprobe kvm-amd
16:44
<
CarlFK >
modprobe: ERROR: could not insert 'kvm_amd': Operation not supported
16:44
<
clever >
check dmesg?
16:44
<
CarlFK >
[222346.165070] kvm: support for 'kvm_amd' disabled by bios
16:44
<
clever >
but kvm is optional
16:44
<
clever >
if you want, i can add an override
16:45
<
CarlFK >
please do. I
16:46
<
CarlFK >
the box is 10 min away. and im not sure about monitor/keyboard. so bios setup.. not easy.
16:50
<
clever >
nix-repl> packages.x86_64-linux.disk_image.requiredSystemFeatures
16:50
<
clever >
this is the bit i need to clear...
16:51
<
clever >
looks like i need to whack it with overrideDerivation
16:54
<
clever >
CarlFK: pushed!
16:54
<
clever >
if kvm is missing, then qemu will just use TCG, which is slower but still gets the job done
16:54
<
clever >
its only a 64mb disk image, so its not going to kill anything
17:31
<
CarlFK >
[nix-shell:~/lk-overlay]$ nix build .?submodules=1#disk_image
17:31
<
CarlFK >
no error, but also no anything?
17:32
<
clever >
CarlFK: `nix build` is silent on sucess, check `ls -ltrh` and you should see a recently modified symlink
17:36
<
CarlFK >
got it. result -> /nix/store/xbyrdr35wkwvx4rf4dlh22j08paaqfla-disk-image
17:36
<
clever >
CarlFK: and then `ls -l result/` and youll see a disk image
18:08
CompanionCube has joined ##raspberrypi-internals
18:16
<
CarlFK >
result -> /nix/store/xbyrdr35wkwvx4rf4dlh22j08paaqfla-disk-image
18:16
<
CarlFK >
Ill get to booting later - don't have pi stuff handy here.
18:19
<
clever >
CarlFK: ive also been working on something here to help with that kind of problem, a pico-w with uart/jtag/reset pins connected up on an rpi
18:19
<
clever >
so you can remotely debug the pi
18:36
HerculeP has joined ##raspberrypi-internals
18:39
Herc has quit [Ping timeout: 252 seconds]
18:43
gruetzkopf has quit [Read error: Connection reset by peer]
18:43
gruetzkopf has joined ##raspberrypi-internals
18:45
<
CarlFK >
I was looking into jtag hat to debug a pi ... whada ya got?
18:51
HerculeP is now known as Herc
18:59
<
clever >
CarlFK: normally, i rig the gpio of one rpi to the jtag(on the gpio) of a second pi
18:59
<
clever >
but that then means i have 2 pi's tied up for a single debugging task
19:00
<
clever >
my plan, is to use a pico-w for the same task
19:41
<
CarlFK >
pico-w - connect to that over usb?
19:42
<
clever >
if i was doing usb, it could just be a pico
22:00
jcea has joined ##raspberrypi-internals
23:54
jcea has quit [Ping timeout: 246 seconds]