/srv/irclogs.ubuntu.com/2015/11/04/#ubuntu-arm.txt

dTalHello chaps. I've added Hugh Greenberg's PPA for xf86-input-cmt, but no packages are available on my ARM Chromebook. I can see that the packages don't seem to be built for ARM, but the peculiar thing is I can't even "apt-get source" them.02:30
dTalNever mind!02:34
=== rsalveti_ is now known as rsalveti
=== ojn_ is now known as ojn
ogra_alai, yo15:57
ali1234hi15:57
alaiogra_, hi15:58
ogra_so the only way to successfully load dtbs on the rpi2 is to load them via config.txt and the binary blob15:58
ogra_alai, lol, sorry i meant ali123415:58
ali1234why would that be a thing?15:58
ogra_the blob stuff the dtb (and overlays) into 0x100 ... and uboot needs to load it from there15:58
ali1234okay so you can't load overlays directly with u-boot15:59
ali1234that is because u-boot doesn't understand them15:59
ogra_if you do a fatload or tftp load it will not initialize correctly15:59
ogra_and uboot will set ATAGs ...15:59
ali1234okay, i will test this :)15:59
ogra_so your kernel boots but you end up without /proc/device-tree and not all HW features work15:59
ogra_for snappy i chainload uboot from the blob ... and let the blob handle all dtb bits ...16:00
ali1234yes, obviously we must always chainload from the blob16:00
ogra_in uboot i only call "fdt 0x100" to load it16:00
ogra_there are some extras you want to actually get the board serial and MAC though16:01
ogra_(RaspberryPi2)ubuntu@rpi2:~$ fw_printenv |grep ^loadfdt16:01
ogra_loadfdt=fdt addr 0x100; fdt get value args /chosen bootargs16:01
ogra_thats what i use in snappy16:01
ali1234so what i'm using is pxe16:02
ogra_i then add ${args} to the commandline16:02
ali1234or rather the u-boot pxe emulation16:02
ogra_that way the serial and MAC (which only the blob knows) are handed over16:02
ogra_and you can have the codecs working etc16:02
ali1234vmlinuz-4.2.0-1014-raspi2 yeah?16:03
ogra_right16:03
ogra_and /lib/firmware/4.2.0-1014-raspi2 for the dtb files16:03
ogra_(and the overlay subdir)16:03
ali1234i won't need the overlay because u-boot can't load that...16:04
ogra_right, but you want bcm2708-rpi-b-plus.dtb16:05
ogra_err16:05
ali12342-b16:05
ogra_bcm2709-rpi-2-b.dtb16:05
ogra_right, sorry16:05
ali1234yeah, same name as the foundation one16:05
ali1234i already have an identical named file on my server16:05
ogra_well, you want the one that matches your kernel :)16:05
ali1234nah, it doesn't really matter too much16:06
ogra_else you make a mess16:06
ogra_sure it does16:06
ali1234i'm using one built for 3.18 on a 4.1 kernel right now16:06
ali1234it works fine16:06
ogra_it is directly tied to the enabled devices from the kernel config, else you will only have half the stuff working16:06
ali1234yes, but those don't change much16:06
ali1234anyway, enough chat16:06
ogra_note that this kernel is using the ubuntu config16:07
ogra_same as -generic16:07
ogra_so you really dont want to use a foundation 3.18 dtb here :)16:07
ali1234okay here we go16:09
ali1234aw typos16:11
ali1234ogra_: it booted, i have /proc/device-tree16:16
ogra_and you have system serial and the actual HW MAC in your system ?16:16
ogra_(RaspberryPi2)ubuntu@rpi2:~$ cat /proc/cpuinfo |grep ^Serial16:17
ogra_Serial: 000000008b04db1c16:17
ali1234http://paste.ubuntu.com/13102443/16:17
ali1234no, serial is 016:17
ogra_right16:17
ali1234but that is an entirely different thing16:17
ogra_so no video codecs for you and your IP will chane on every boot16:17
ogra_i'm surprised though ... what uboot version is that ?16:18
ali1234HEAD from two days ago16:18
ogra_mine is about 8 weeks old and it doesnt work here16:18
ogra_aha16:18
ogra_so perhaps it has seen some fixes16:18
ali1234must have16:18
ali1234anyway the serial number thing is not something that is stored on the SD card16:19
ogra_in any case i need the serial since people that want to build snappy kodi appliances will want to use the codecs :)16:19
ali1234the point of this whole thing was to prove you could boot a pi with nothing except u-boot and config.txt16:19
ali1234and the firmware bins16:19
ogra_the serial gets added to the devicetree by the blob when it loads it16:19
ali1234oh. well that's just stupid...16:19
ogra_as gets the MAC16:19
ogra_the blob is the only thing that talks to the HW on that level16:20
ali1234well i'll pass this on to the LTSP flks as they will no doubt want to use codecs too16:20
ogra_i discussed that with alkis quite a bit in the last weeks :)16:21
ogra_so he is aware i guess :)16:21
ogra_ali1234, so you are sure it isnt using the dtb that the blob has put into 0x100 ?16:22
ali1234since two days ago?16:22
ogra_i see you are loading to the same address16:22
ogra_no, over the past weeks16:23
ali1234yes because my config.txt is completely empty except for the line kernel=u-boot.txt16:23
ogra_we didnt talk the last two days16:23
ogra_your confi.txt has no influence on the dtb16:23
ogra_only on the overlays16:23
ali1234ogra_: well it was two days ago he asked on raspberry pi and i got it working16:23
ogra_the dtb name and path are hardcoded in the blob16:23
ali1234hmm good point16:23
ogra_do you have the dtb on Sd next to the blob ?16:24
ali1234yep16:24
ogra_tyr renaming it or removing it and see if it still boots16:24
ali1234although surely if it was doing that, it would have a serial number?16:24
ali1234also if i overwrote it, how can it use it?16:24
ali1234trying now anyway16:24
ogra_(though that wont still tell if uboot actually overwrites 0x100 ...)16:24
ogra_you will only have the serial if you handed it to the kernel cmdline16:25
ogra_bcm2709.boardrev=0xa01041 bcm2709.serial=0x8b04db1c smsc95xx.macaddr=B8:27:EB:04:DB:1C16:25
ogra_you need these three on the cmdline16:25
ogra_fdt get value args /chosen bootargs16:26
ogra_in uboot after you loaded the dtb16:26
ogra_then make sure to have ${args} on your cmdline and uboot shoudl expand it16:26
ali1234oh, so that could just be hard coded in the pxe config?16:26
ogra_well, but it will only be populated in the dtb the blob did put to 0x10016:27
ogra_i'm not sure what happens if you overwrite that area with your tftp retrieved dtb16:27
ali1234why does it need to be on the command line and the dtb?16:27
ogra_the kernel needs it on the cmdline16:27
ali1234yeah it booted with the dt renamed16:27
ali1234the sd card one that is16:27
ogra_cool !16:27
ogra_i guess i'll take a look then ...16:28
* ogra_ needs to update the snappy device tarball anyway for the rpi 16:28
ali1234let me add those numbers on my command line16:28
ogra_so what i wonder now is if you can use a fake dtb for the blob ... just to get the args populated ...16:28
ogra_... then overwrite it from uboot with a dtb you load16:28
ogra_and if that still boots16:28
ogra_that way you get the cake and the tea :)16:29
ali1234i don't understand16:29
ali1234you mean like pass a fake dt in and then extract out the bits the blob added?16:30
ali1234why even use a fake one?16:30
ali1234just use the real one...16:30
ogra_because the blob will try to add to it16:30
ali1234it's going to get overwritten anyway16:30
ogra_right16:30
ogra_but first you want to extract the args from it16:30
ali1234yes we want the blob to add to it16:30
ogra_to get the HW data the bkob did read16:31
ali1234so use a fake one because it will be easier?16:31
ali1234because there's less space to search16:31
ogra_i doubt the blob will add the stuff if there isnt *some* dtb16:31
ali1234okay my pi now has that serial number you pasted here16:31
ogra_well, thats mine :P16:31
ogra_it comes from the chip16:32
ogra_and you need it to obtain the codecs from broadcom .... they get tied to the device via the serial16:32
ali1234yeah16:32
ali1234so wouldn't the codecs work even if /proc/cpu shows the wrong serial?16:33
ogra_to get your serial you need to get it from the blob ... and thats only possible via the in memory dtb ... which is most likely gine once you overwrite it by loading yours16:33
ali1234sure sure16:33
ali1234but i mean if the codecs relied on /proc/cpu to validate... then there would be lots of piracy16:34
ogra_broadcom will give you a codec that only works on a specific serial ... and i would expect they keep track if they have given it out already16:34
ogra_i also guess there is more to it than the cpuinfo serial that gets checked against16:34
ogra_i.e. if the codec takes action i would expect it to verify the number against the actual SoC16:35
ali1234so at this point we need u-boot to be able to manipulate overlays etc16:35
ali1234then we can do this properly16:35
ogra_right, i havent seen a way to do this16:36
ogra_in snappy i fully rely on the blob for all dtb actiions by now16:36
ali1234yeah, can't do that when booting from the network16:36
ogra_has at least the advantage that all upstream docs still match :)16:36
ogra_you can ... but its ugly16:37
ogra_you can obtain the dtb via tftp ... fatwrtite it, set a flag and reboot16:37
ali1234hah, like the old N900 multiboot method16:37
ali1234reflash the kernel every time you switch OS16:37
ogra_as i said ... ugly16:37
ali1234no thanks :)16:38
ogra_(gets even more ugly if you want to clone the overlays subdir every time)16:38
ali1234hmm16:40
ali1234actually16:40
ali1234you now mkknlimg?16:40
ogra_for unboot.bin, yeah16:40
ali1234well i didn't run the rpi mkknlimg on my u-boot.bin16:41
ali1234which means the blob won't think it supports device tree16:41
ogra_(RaspberryPi2)ubuntu@rpi2:~$ grep uboot /boot/uboot/config.txt16:41
ogra_kernel=uboot.bin16:41
ali1234which means it won't set any device tree16:41
ogra_ah16:41
ali1234if you put a vmlinuz directly into /boot without running mkknlimg on it, not /proc/device-tree16:42
ogra_right, cant do that on snappy16:42
ali1234can't do what?16:42
ogra_so nothing i ever bothered to experiment with16:42
ogra_our kernel lives in a subdir thats selected via uboot scriptery16:43
ali1234okay that doesn't matter16:43
ali1234the thing is that mkknlimg appends a tag to the elf binary you run it on16:43
ali1234the blob look sat that tag to determine if device tree is supported16:43
ogra_right, which is needed by the blob16:43
ali1234so my u-boot does not have that tag16:43
ogra_but only for the first thng you load via the kernel= option in confi.txt16:44
ali1234yes which is u-boot.bin16:44
ogra_right16:44
ali1234which means that the blob will not put device tree at 0x10016:44
ali1234because it does not think u-boot supports device tree16:44
ogra_oh, for you you mean16:44
ali1234yes for me16:44
ogra_yeah16:44
ali1234who else? ;)16:44
ali1234anyway so the question then is how did they pass the serial numbers before dt support was added?16:45
ali1234using those kernel params you showed?16:45
ogra_ATAGs :P16:45
ali1234if so we can rip the serial etc from ATAGS16:45
ogra_try it16:45
ali1234because those are like a million times easier to parse in u-boot16:45
ogra_but i fear if they dropped ATAG support from their kernel their last iteration of the blob might have dropped it too16:46
ogra_you ahve to check16:46
ali1234that would certainly explain why the kernel failed to boot when i loaded no DT16:46
ali1234if there were no ATAGs either...16:46
ogra_well, for me it also fails if i load an old dtb because oi forgot to replace it16:47
ali1234but no it must still support them because i booted a kernel without DT support when going direct from the blob16:47
ali1234hmm16:47
ogra_well, try to read them then16:47
ali1234i will16:47
ali1234also did you run mkknlimg on your u-boot?16:48
ali1234if you use the blob for dt management then i think you must have...16:48
* ogra_ wonders what we talked about the last ten minutes :P16:48
ogra_yes, i use mkknlimg on my uboot.bin and define it as kernel= in config.txt16:48
ogra_so that the user can define overlays and dt options in config.txt ... uboot just passes the dt trhough16:49
ogra_(all i need uboot for is the kernel and initrd selection and the auto-fallback functioality of snappy)16:50
ali1234would be nice to have a boot menu for different kernel testing... i should set that up properly at some point16:51
ogra_yeah, thats trivial with uboot16:51
ogra_especially since the rpi one has framebuffer support by default16:51
ali1234i only have serial and ssh on my pi16:52
ali1234a failsafe initrd would be handy too16:52
ogra_reimplementin snappy ? :)16:52
ali1234well snappy doesn't work on the model a :P16:52
ogra_(we call it recovery there though)16:52
ali1234and about that16:52
ali1234i did an rdepends on all those snappy packages16:53
ogra_yeah, old HW is old HW16:53
ali1234it was absolutely huge so i gave up16:53
ogra_an rdepends ?16:53
ogra_on what now ?16:53
ali1234remember we talked about porting snappy to raspbian?16:53
ogra_vaguely16:54
ali1234well it looks really hard16:54
ali1234even with jessie16:54
ogra_yeah, its a bit bloated currently16:54
ogra_we'll do some cleanup work soon16:54
ogra_snappy source is now on github btw16:55
ogra_(for the snappy binary)16:55
ali1234i calculated all the packages in the snappy core image that aren't in jessie, and then did an rdepends on them and calculated the list of those packages not in jessie16:57
ali1234the first list was about 20 packages, the second was about 80 packages16:57
ogra_did you talk to alan bell ?16:57
ali1234not recently16:57
ali1234i know he was trying to set up a compile farm some time ago16:57
ogra_he actually wanted to rebuild the archive on his cluster16:57
ali1234i funded part of his kickstarter :)16:58
ogra_doing the same raspbian did to debian but based on the ubuntu archive16:58
ogra_not sure where that went16:58
ali1234afaik nowhere16:58
ogra_(simply rebuilding everything as armv6)16:58
ali1234okay so i just dumped 0x100 and it looks like ATAGs to me16:58
ogra_and ? any valuable data in there ?16:59
ali1234http://paste.ubuntu.com/13102809/16:59
ogra_or just random basics16:59
ali1234the serial for one thing16:59
ogra_yeah16:59
ogra_!16:59
ogra_nice one16:59
ali1234so the way we did this on N900 was just to not touch the atags set by previous bootloader17:01
ali1234but u-boot upstream did not like that very much17:02
ali1234but the point being we never actually parsed them17:02
ali1234and we can't reuse atags when booting device tree17:02
ali1234erm...17:05
ali1234u-boot has a command "fdt get"17:05
ali1234we can just use that to read from the blob's fdt before overwriting it?17:05
ali1234is also has "set"17:05
ogra_i think that didnt work last time i tried17:06
ogra_(didnt boot anymore)17:06
ali1234how does a bootloader pass the command line to the kernel when booting with device tree?17:13
ali1234in general i mean...17:13
ali1234also, multiple device tree blobs are allowed?17:15
ali1234so then pass an empty one to the initial bootloader and then load ours into a different place?17:16
ali1234that might just work...17:16
ali1234or maybe even none at all17:17
ali1234hmm17:17
ali1234i need to run mkknlimg on my u-boot17:17
ogra_heh17:18
ali1234ogra_: mkknlimg refused to operate on my u-boot.bin, any hints?18:08
ogra_hmm, not really18:08
ali1234* Is this a valid kernel? In pass-through mode.18:08
ogra_there is a way to make it ignore that but i dont hav emy notes around18:09
ali1234okay i'll check the source18:09
ali1234ah you force the flags --dtok and --283x18:10
ali1234dunno what the atter does18:10
ali1234ah, for open source kernels18:11
ali1234ogra_: got u-boot tagged now. with no dt file at all, the broadcom blob always puts atags in 0x100 regardless18:39

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!