Tartarus changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot v2022.07 is OUT / Merge Window is OPEN, -next is CLOSED / Release v2022.10 is scheduled for 3 October 2022 / http://www.denx.de/wiki/U-Boot / Channel archives at https://libera.irclog.whitequark.org/u-boot
<clever> unlikely to find that
<clever> marex: one interesting thing ive found, is that the VEC can generate up to 3 analog outputs, in 3 channel mode it can do either YPbCr or RGB, in 2 channel mode it can do s-video, and in 1 channel mode it can do composite
<clever> but at least on all rpi soc's, only 1 DAC is in the silicon, so its limited to composite only
<clever> oh, and ive heard that the bcm2835 has a whole FM radio receiver in it
persmule has quit [Remote host closed the connection]
persmule has joined #u-boot
qschulz has quit [Remote host closed the connection]
qschulz has joined #u-boot
<clever> marex: so, if i was crazy enough to try and port u-boot to another arch, where the spl and uboot proper are 2 files, which arch could i look at to copy bits from?
rabbi[11]58 has joined #u-boot
umbramalison has quit [Quit: %So long and thanks for all the fish%]
umbramalison has joined #u-boot
thopiekar has quit [Ping timeout: 246 seconds]
thopiekar has joined #u-boot
<Forty-Bot> clever: look at riscv
<Forty-Bot> since it's pretty recent
<clever> Forty-Bot: i'll have a look over it if i decide to embark on that crazy idea
niska has quit [Quit: Leaving]
mmu_man has quit [Ping timeout: 268 seconds]
LeSpocky has quit [Ping timeout: 250 seconds]
LeSpocky has joined #u-boot
niska has joined #u-boot
<clever> oh, and one feature i was planning to add to u-boot, another way of passing some device-tree into it on startup, that doesnt use the rpi arm stubs
<clever> this structure is added to the binary at an aligned addr (probably in the SPL stage), and as the u-boot.bin is copied into ram, the header is located, and the dtb_base is modified
<clever> i'm guessing SPL would then need to copy that into the global-data, and then u-boot proper can do something with the dtb before it gets stepped on
vagrantc has quit [Quit: leaving]
rburkholder has joined #u-boot
<clever> but tracing how the rpi u-boot handles the firmware dtb, its odd, and doesnt seem to go thru the SPL code?
<clever> reset: runs save_boot_params, which uses =fw_dtb_pointer to get the addr of something in .data, this is basically the first opcode in u-boot.bin, so its definitely SPL and nothing has been relocated yet
<clever> fw_dtb_pointer is then used by a function under board_init_r, which is in the relocated code??
hanetzer has quit [Quit: WeeChat 3.6]
persmule has quit [Remote host closed the connection]
persmule has joined #u-boot
<marex> clever: which arch ?
<marex> SPL and U-Boot are generally two files (well, two differently configured builds of U-Boot no less)
<clever> marex: rpi arm
<clever> and also lowlevel_init.S from the same file
camus has quit [Remote host closed the connection]
camus has joined #u-boot
rabbi[11]58 has quit [Ping timeout: 252 seconds]
guillaume_g has joined #u-boot
mckoan|away is now known as mckoan
epony has joined #u-boot
epony has left #u-boot [PART]
persmule has quit [Remote host closed the connection]
persmule has joined #u-boot
matthias_bgg has joined #u-boot
sszy has joined #u-boot
apritzel_ has joined #u-boot
zkrx has quit [Ping timeout: 268 seconds]
zkrx has joined #u-boot
mmu_man has joined #u-boot
gsz has joined #u-boot
camus has quit [Quit: camus]
camus has joined #u-boot
minimal has joined #u-boot
jagan has joined #u-boot
hanetzer has joined #u-boot
apritzel_ has quit [Ping timeout: 268 seconds]
WoC has quit [Remote host closed the connection]
<Tartarus> Er
<Tartarus> We could, but don't, take the DT that the Pi firmware passes along
WoC has joined #u-boot
<marex> Tartarus: if you read the backlog, I think you would find out clever is writing a replacement fw
<Tartarus> Ah, ok
<clever> Tartarus: one issue with the official armstubs, is that you need to insert the addr of the firmware dtb and kernel, at an addr just below 256 bytes, but if i want to go stubless and put u-boot at the reset vector, getting a header at that addr could be tricky, and i dont want to force that limit on every future arm kernel
<clever> Tartarus: my solution to that, is to have this structure at a 16-byte aligned addr, anywhere in the arm kernel, and it gets populated with the dtb
<Tartarus> Makes sense
<Tartarus> For a moment I thought you were just dealing with some of the issues U-Boot normally has on Pis because we don't take the DT as passed along
<Tartarus> This is much more complex and interesting :)
<clever> then the _start only has to worry about setting up its own stack, and the initial value of r2/x0 means nothing
<clever> Tartarus: lines 94-145 runs on the VPU, and creates my own custom DTB, its not meant to be compatible with how things like linux boots, its only to ferry over custom variables
<clever> while being both forwards and backwards compatible with other versions of itself
<clever> lines 190-199 selects the right embedded .bin file, so you could bake 3 builds of u-boot into it
<clever> 203-216 copies that .bin to the arm reset vector
<clever> 233-263 finds the inter_arch header and modifies it
<clever> the rest is all code to turn the arm core(s) on
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
apritzel_ has joined #u-boot
tlwoerner_ has quit [Quit: Leaving]
tlwoerner has joined #u-boot
torez has joined #u-boot
persmule has quit [Remote host closed the connection]
persmule has joined #u-boot
umbramalison has quit [Ping timeout: 265 seconds]
mmu_man has quit [Ping timeout: 248 seconds]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
guillaume_g has quit [Quit: Konversation terminated!]
hanetzer has quit [Read error: Connection reset by peer]
hanetzer has joined #u-boot
mmu_man has joined #u-boot
persmule has quit [Remote host closed the connection]
persmule has joined #u-boot
mmu_man has quit [Ping timeout: 248 seconds]
lucascastro has joined #u-boot
mckoan is now known as mckoan|away
umbramalison has joined #u-boot
vagrantc has joined #u-boot
apritzel_ has quit [Ping timeout: 250 seconds]
sszy has quit [Ping timeout: 268 seconds]
lucas__ has joined #u-boot
lucascastro has quit [Read error: Connection reset by peer]
lucas__ has quit [Quit: Leaving]
thopiekar has quit [Ping timeout: 252 seconds]
thopiekar has joined #u-boot
WoC has quit [Remote host closed the connection]
WoC has joined #u-boot
mrnuke has quit [Read error: Connection reset by peer]
mrnuke has joined #u-boot
rabbi[11] has joined #u-boot
ldevulder has quit [Quit: Leaving]
<clever> marex: i think ive identified where u-boot is failing, gd->ram_size doesnt matter, gd->bd->bi_dram does!
<clever> marex: and rpi.c is configured to populate bi_dram from the dtb that is absent
<marex> clever: nice
<clever> there is a weak/default implementation of dram_init_banksize
<clever> 243 gd->bd->bi_dram[0].start = gd->ram_base;
<clever> 244 gd->bd->bi_dram[0].size = get_effective_memsize();
<clever> but if uboot is built with CONFIG_OF_BOARD, rpi.c overrides that, and has no fallback for when dtb parsing fails
<clever> so it then just claims to have 0 bytes of ram
<clever> and things dont go well from there
<marex> clever: if you want to make things simple and compatible, pass a DT from your firmware too
<clever> marex: part of the issue, is that i dont want to be duplicating all of the code for loading and patching a dtb file
<clever> so i'm just passing a stripped down dtb via my own api
<clever> and i need to now modify uboot to read that
<marex> clever: makes sense, just load some small DT blob which you bundle with your firmware and pass it on
<marex> then the next stage(s) would just work without changes
<clever> even simpler!
<marex> no need for your own DT compiler in the firmware, like RPi does
<clever> marex: this is the entire dtb
<clever> only 2 nodes currently, with 5 key/value pairs
<clever> adding a /memory node is next on the list, so i can populate bi_dram
<marex> yep, dont forget to add #address-cells and #size-cells
<marex> :)
<clever> until now, this was only being parsed by my own code with libfdt, so i didnt have to follow the #address-cells rules
<clever> but if i want to recycle some u-boot code, that would be best
mmu_man has joined #u-boot
mmu_man has quit [Ping timeout: 268 seconds]
torez has quit [Quit: torez]
mmu_man has joined #u-boot
gsz has quit [Ping timeout: 246 seconds]
WoC has quit [Quit: Leaving]
WoC has joined #u-boot
vagrantc has quit [Quit: leaving]
WoC has quit [Remote host closed the connection]
WoC has joined #u-boot