xypron changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot 2023.01 / Merge Window is OPEN / Release v2023.04 is scheduled for 2023-04-03 / Channel archives at https://libera.irclog.whitequark.org/u-boot
mmu_man has quit [Ping timeout: 265 seconds]
mmu_man has joined #u-boot
Wouter010067 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter0100670 has joined #u-boot
Leopold has quit [Ping timeout: 255 seconds]
naoki has quit [Quit: naoki]
naoki has joined #u-boot
thopiekar has quit [Ping timeout: 252 seconds]
thopiekar has joined #u-boot
mthall has joined #u-boot
redbrain has quit [Read error: Connection reset by peer]
redbrain has joined #u-boot
mthall has quit [Ping timeout: 264 seconds]
mthall has joined #u-boot
mmu_man has quit [Ping timeout: 246 seconds]
<marex> shyeline: https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html# structured configuration tool used by various projects, comes from Linux
<marex> shyeline: it probably won't help on its own, the bug is likely somewhere in mctl_auto_detect_dram_size() in arch/arm/mach-sunxi/dram_sun50i_h616.c
<marex> so you'd have to sprinkle printf()s and try and find out why does it detect 2 GiB of DRAM on 1 GiB machine sometimes
<marex> probably para->rows or para->cols matches wrongly
mthall has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mthall has joined #u-boot
ikarso has joined #u-boot
goliath has joined #u-boot
<shyeline> Where can i find that file in my sdcard? Do i just whereis?
goliath has quit [Quit: SIGSEGV]
ldevulder has joined #u-boot
guillaume_g has joined #u-boot
mckoan_ is now known as mckoan
torez has joined #u-boot
goliath has joined #u-boot
hanetzer has quit [Remote host closed the connection]
<apalos> sjg1: regarding the EFI cleanup
<apalos> Since I am not really fond of breaking the entire EFI, can we do the cleanup in small steps
<apalos> e.g accept the current pathch once i fix the TPM as well and then we can work together on the DM integration part \
<apalos> because this already cleans up a substantial amount of churn + a useless Kconfig option
<lucenera> Is U-Boot deciding the mount options of the root file system?
<lucenera> I have an ARM device that boots from USB stick formatted in BTRFS. I want to add the compress option.
naoki has quit [Quit: naoki]
sszy has joined #u-boot
naoki has joined #u-boot
davlefou has quit [Ping timeout: 264 seconds]
frieder has joined #u-boot
davlefou has joined #u-boot
mmu_man has joined #u-boot
haritz has quit [Ping timeout: 260 seconds]
haritz has joined #u-boot
haritz has joined #u-boot
haritz has quit [Changing host]
Wouter0100670 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter0100670 has joined #u-boot
frieder has quit [Ping timeout: 256 seconds]
doppo has quit [Read error: Connection reset by peer]
doppo has joined #u-boot
frieder has joined #u-boot
ldevulder has quit [Read error: Connection reset by peer]
ldevulder has joined #u-boot
frieder has quit [Ping timeout: 264 seconds]
frieder has joined #u-boot
PhoenixMage has joined #u-boot
<PhoenixMage> I have a fitImage I want to load, how do I know where in memory I should load it? I am sure its board specific but where should I be able to find the details?
monstr has joined #u-boot
mmu_man has quit [Ping timeout: 268 seconds]
teejay_ is now known as teejay
mmu_man has joined #u-boot
kwizart is now known as kwizart|fedora
kwizart|fedora is now known as nchauvet
nchauvet is now known as kwizart
frieder has quit [Ping timeout: 252 seconds]
frieder has joined #u-boot
frieder has quit [Ping timeout: 268 seconds]
frieder has joined #u-boot
haritz has quit [Ping timeout: 260 seconds]
<sjg1> apalos: Yes that patch is OK, as I said. I suggest putting the sequence of commands you mention in the email into a single command, then calling that code from your event on restart
<sjg1> apalos: Then split the sandbox test into two parts. One that checks that the event is run on start (trivial test) and 2) the update test which just runs the command instead of rebooting
<sjg1> apalos: We need more 'design for test'. I already hit a problem where an EFI test failed and had no idea where to start looking. It is not a useful test for development.
<sjg1> apalos: It is good to have 'happy path' large, functional tests, but we must have smaller tests that we actually rely on for development
<sjg1> apalos: Anyway, this is sideways of your patch. I just wanted to mention it
<Tartarus> lucenera: we pass args to the kernel, in the "bootargs" variable typically, yes
<apalos> sjg1 ok
<apalos> So here's what I am going to do,
<apalos> Clean up some TPM crud, because we are kind of wrong in the way we treat a tpm
<apalos> in order for it to be usable we must start it up from the command line
<apalos> So I'll clean that up and on DM init the TPM will be fully usable
<apalos> I'll adjust the TPM tests
<apalos> and then I'll resend my series with an extra event which runs post preboot commands
<apalos> So people can put whatever they want there
<apalos> (e.g the tftp update as well)
<apalos> but for the command I dont think I can do it like that
<apalos> I'd like u-boot to adhere to the spec without a need for special preboot commands
<apalos> So I'd still much prefer calling the efi_capsule_update function from C
mmu_man has quit [Ping timeout: 260 seconds]
<lucenera> Tartarus The device is a router with modified OpenWrt. Where can I find an example of bootargs syntax?
<Forty-Bot> you probably want rootflags=
ikarso has quit [Quit: Connection closed for inactivity]
<lucenera> Oh, thanks. I'll take a look at it.
mmu_man has joined #u-boot
haritz has joined #u-boot
haritz has joined #u-boot
haritz has quit [Changing host]
goliath has quit [Quit: SIGSEGV]
monstr has quit [Remote host closed the connection]
Wouter0100670 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter0100670 has joined #u-boot
goliath has joined #u-boot
apritzel_ has joined #u-boot
frieder has quit [Remote host closed the connection]
<sjg1> apalos: What is this 'adhere to the spec' stuff you and xypron are referring to?
<sjg1> apalos: I am not suggesting a preboot command. You can still use an event. But the sandbox test needs to work without a reboot, that's all. Design for test
mthall has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
ikarso has joined #u-boot
vagrantc has joined #u-boot
ldevulder has quit [Read error: Connection reset by peer]
ldevulder has joined #u-boot
mckoan is now known as mckoan|away
torez has quit [Quit: torez]
<lucenera> rootflags=commit=5,subvol=@ rw
<lucenera> How could I change this part?
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<rfs613> lucenera: general answer: find out where it is coming from... it could be in the device tree, or it could be set by the bootloader.
<rfs613> since you're on #u-boot channel, we will assume the bootloader is u-boot
<lucenera> It doesn't seem to be in the bootloader.
<lucenera> But I am not very practical. But I can't find anything corresponding.
<rfs613> well, that is the current environment, and you are correct, it doesn't seem to be directly defined in there.
<rfs613> but it could be set by some additoinal scripts, seems there are some of those
<lucenera> Kernel command line: earlyprintk rootwait console=ttyS0,115200 rootfstype=btrfs root=PARTUUID=313f5df8-01 rootflags=commit=5,subvol=@ rw cfg80211.freg=**
<lucenera> Where else could it be?
<lucenera> I ask from your experience.
___nick___ has joined #u-boot
___nick___ has quit [Client Quit]
<rfs613> well it could be in the devicetree.. howeve in this case I think scripts are more likely.
<lucenera> What kind of scripts could I look for? For example /etc/init.d/fstab?
<rfs613> do you see any messages like "Found U-boot script <...>" in the boot before linux?
apritzel_ has quit [Ping timeout: 268 seconds]
___nick___ has joined #u-boot
<lucenera> I cannot find anything similar.
<rfs613> boot_scripts=boot.scr.uimg boot.scr <--- these are likely filenames, based on what is in your u-boot environment
___nick___ has quit [Client Quit]
<lucenera> Yes, in printenv I see them, but in dmesg I do not.
<lucenera> I am now looking for those scripts.
<rfs613> it won't show in dmesg, that is after linux has booted... it would only show in the serial port during u-boot boot.
___nick___ has joined #u-boot
<lucenera> Looks like this is it.
<lucenera> So I should modify that script?
<rfs613> about 10 lines from the bottom you can see rootflags=${rootfsflags}
<rfs613> and those flags were defined earlier in the script depending on what type of rootfs it is
<lucenera> But at the beginning of the file they are defined, right?
<lucenera> Ok, top. Mine is BTRFS.
<lucenera> So if I change there it should fit the way I want it. U-Boot --> Linux --> script?
<rfs613> if you modify the script, on next boot, u-boot should read it, and apply that to bootargs, which gets passed to the linux kernel command line
<rfs613> however, the script has some binary at the start, this is a header, and I think there is also a checksum
<lucenera> Mmm, how could I solve it?
<lucenera> I saw that stuff.
<rfs613> so I believe you need to use mkimage to recompute the header
Gravis has quit [Ping timeout: 260 seconds]
Gravis has joined #u-boot
<rfs613> i've not done this myself, I am trying to find the documentation for doing it...
<lucenera> Like this?
vagrantc has quit [Quit: leaving]
<lucenera> uboot-mkimage - 2021.01-5 - This package includes tools to create U-Boot bootloader images.
<lucenera> On my system, the package exists.
<rfs613> mkimage -T script -n 'Test script' -d boot.txt boot.scr
<lucenera> The aim is to leave everything as it is and only change the rootflags part.
<rfs613> so take the existing .scr and remove the u-boot header... leaving just the text (it starts with "if part uuid ${devtype}" in your case)
<rfs613> then edit this file as you wish
<rfs613> use the mkimage command to convert the exited .txt back to .scr (this will put back on a header with the checksum updated)
<lucenera> Now I try. You have been a great help. Thank you very much.
<rfs613> I hope it works, good luck!
lucenera0 has joined #u-boot
<lucenera0> rfs613 It worked perfectly. Thanks again.
lucenera has quit [Ping timeout: 255 seconds]
lucenera0 is now known as lucenera
lucenera has quit [Ping timeout: 260 seconds]
ikarso has quit [Quit: Connection closed for inactivity]
lucenera has joined #u-boot
<rfs613> lucenera: great, glad to hear it
lucenera has quit [Ping timeout: 248 seconds]
lucenera has joined #u-boot
lucenera0 has joined #u-boot
lucenera has quit [Ping timeout: 264 seconds]
lucenera0 is now known as lucenera
lucenera2 has joined #u-boot
lucenera has quit [Ping timeout: 246 seconds]
lucenera2 is now known as lucenera
<lucenera> In the same uboot script, I also found the part about sfp and ethernet.
<kallisti5[m]> is there a way to dump the dts from the u-boot console?
<kallisti5[m]> (the built-in one)
<kallisti5[m]> fdt list. nevermind 😀
<kallisti5[m]> ok yeah. riscv64 qemu needs to specify reg-shift 0 if that's the intent
<kallisti5[m]> There's too many assumptions to correctly "guess" the default regshift for even the arch + driver combo
<kallisti5[m]> Essentially: qemu-system-riscv64 8250 uart == reg-shift 0 assumed, sifive unmatched 8250 uart == reg-shift 2 assumed
zkrx has quit [*.net *.split]
mvaittin has quit [*.net *.split]
kallisti5[m] has quit [*.net *.split]
zkrx has joined #u-boot
kallisti5[m] has joined #u-boot
mvaittin has joined #u-boot
<kallisti5[m]> ... unless the serial uart on riscv64 has the x86 assumption of reg-shift 0
lucenera0 has joined #u-boot
<kallisti5[m]> AH
<kallisti5[m]> FOUND IT
<kallisti5[m]> drivers/serial/ns16550.c line 555
Wouter0100670 has quit [Quit: The Lounge - https://thelounge.chat]
<kallisti5[m]> 555 plat->reg_shift = dev_read_u32_default(dev, "reg-shift", 0);
lucenera has quit [Ping timeout: 246 seconds]
lucenera0 is now known as lucenera
<kallisti5[m]> if no reg-shift, it assumes 0
Wouter0100670 has joined #u-boot
___nick___ has quit [Ping timeout: 256 seconds]
<kallisti5[m]> oof. but is that from the qemu dtb that's passed to u-boot 🤔
<marex> Tartarus: ns16550 red alert ^
<marex> qschulz: ^
<kallisti5[m]> lol. sorry for the spam. I'm rubber ducking to like 700 people
<marex> kallisti5[m]: no worries, this reg shift mess is not new here
<kallisti5[m]> as I understand it, most serial uart drivers can assume 2. The big exception is x86,x86_64 which assumes 0 for legacy reasons
<kallisti5[m]> that line above in ns16550 says "if no reg-shift property", shift by 0
<kallisti5[m]> which is what the generated u-boot dtb is based on?
<kallisti5[m]> anyway.. i think 8250 (aka ns16550) on riscv64 likely needs to be changed to 2 in all cases. (unless an override is specified by the dtb as reg-shift)
<marex> AFAICT, QEMU builds the DT up from scratch from its hardware model(s)
<kallisti5[m]> ok. then the bug would be in qemu? qemu is setting up a ns16550 on riscv64 virt with an assumed reg-shift of 0... then u-boot is passing on that assumption
<kallisti5[m]> I did a dumpdtb in qemu-system-riscv64, and confirmed the dtb it spits out is also missing the reg-shift property
<marex> kallisti5[m]: isn't the reg-shift property deprecated ?
<kallisti5[m]> if it is, then qemu is doubley wrong for having an assumed reg-shift of anything except 2 on non-x86
<marex> but qemu has to pass it to be compatible with legacy software running on it
<kallisti5[m]> except riscv64 has no legacy software?
<kallisti5[m]> that only covers x86 afaik
<kallisti5[m]> also, physical riscv64 devices like the sifive unmatched have an assumed reg-shift of 2
<kallisti5[m]> I opened https://gitlab.com/qemu-project/qemu/-/issues/1458 as it indeed sounds like a qemu bug that u-boot is just passing on
<kallisti5[m]> though, i wonder how u-boot doesn't have the same issue we have
<kallisti5[m]> maybe the board config defines specify the reg-shift or something?
<marex> kallisti5[m]: are you using u-boot/master or something older ?
<marex> I recall there were some changes related to that very recently
<kallisti5[m]> something a bit older (Dec 2022)
<marex> that might predate the changes
<kallisti5[m]> actually, our qemu u-boot is May 2022
<kallisti5[m]> let me rebuild from master real quick and test again on both the real hardware and qemu
<marex> probably a good idea to try latest first
<kallisti5[m]> eh. it just crashes in some unrelated code :sigh:
<marex> kallisti5[m]: quick git-bisect ?
<kallisti5[m]> with that said, I still see a missing reg-shift property.
<kallisti5[m]> yeah. I'll run through now
lucenera has quit [Ping timeout: 268 seconds]
<kallisti5[m]> bisecting 🥳
lucenera has joined #u-boot
<kallisti5[m]> [1a12796292c026d6e86cf533eaa7a121776236a4] efi_loader: don't use EFI_LOADER_DATA internally
<marex> xypron: ^
lucenera6 has joined #u-boot
lucenera has quit [Ping timeout: 255 seconds]
lucenera6 is now known as lucenera
<xypron> kallisti5[m]: anything wrong with that patch. Or did you make some illegal assumption in Haiku?
<kallisti5[m]> Highly likely we're making some kind of illegal assumption 🥲
lucenera1 has joined #u-boot
lucenera has quit [Ping timeout: 255 seconds]
lucenera1 is now known as lucenera
<kallisti5[m]> We're mapping EFI Loader and Code... is that something we shouldn't be doing?
<kallisti5[m]> actually.. I bet I need to add the other sections there (boot services code / data, conventional memory)
<xypron> kallisti5[m]: If you want to know the location of the bootloader you should use fields from the loaded image protocol on the handle received at the main entry point.
goliath has quit [Quit: SIGSEGV]
<kallisti5[m]> this is the mapping prior to handoff to the kernel
<xypron> kallisti5[m]: look in the spec's ExitBootServices description to see which memory types are reserved after this call.
<kallisti5[m]> I bet y'all were mapping everything which we leveraged somehow accidently
<kallisti5[m]> cool. I'll check
lucenera2 has joined #u-boot
lucenera has quit [Ping timeout: 252 seconds]
lucenera2 is now known as lucenera
<xypron> kallisti5[m]: The device-tree specification says EfiReservedMemoryType must not be mapped.
<kallisti5[m]> Yeah, we only mapped EfiLoaderCode/Data before
<xypron> kallisti5[m]: in the UEFI spec see Table 7.10: Memory Type Usage after ExitBootServices()
<kallisti5[m]> looking at x86, we map BootServices Code/Data and EfiConvMemory before jumping
<kallisti5[m]> I added these three to riscv64, and our memory access error seen with that commit above is solved
<xypron> kallisti5[m]: How about ConventionalMemory which is everything that was never used?
lucenera7 has joined #u-boot
<kallisti5[m]> oh.. doesn't EfiConventionalMemory types exclude reserved types?
<xypron> kallisti5[m]: EfiACPIReclaimMemory may be used after you have consumed the ACPI tables.
<kallisti5[m]> yeah, page 166 shows it's a seperate type
<xypron> kallisti5[m]: All mappable reserved memory is EfiBootServicesData according to the device-treee specification.
<xypron> kallisti5[m]: So you have to read the device-tree to know how you can use it in the kernel.
lucenera has quit [Ping timeout: 252 seconds]
lucenera7 is now known as lucenera
<kallisti5[m]> yeah, we do fully support fdt and use it in our allocations
<xypron> kallisti5[m]: QEMU uses compatible "ns16550a". Documentation/devicetree/bindings/serial/8250.yaml does not make any assumption about the value of reg-shift of ns16550a. Furthermore reg-shift is not marked as required. So if it is missing assume 0. The SiFive Unmatched has compatible "sifive,fu740-c000-uart","sifive,uart0" which is described in Documentation/devicetree/bindings/serial/sifive-serial.yaml. And that document does not
<xypron> know any reg-shift. You have to evaluate the compatible string to determine which driver to use.