Tartarus changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot v2021.07 is OUT / Merge Window is OPEN until 26 July 2021 / Release v2021.10 is scheduled for 04 October 2021 / http://www.denx.de/wiki/U-Boot / Channel archives at https://libera.irclog.whitequark.org/u-boot
jwillikers has quit [Remote host closed the connection]
vagrantc has quit [Ping timeout: 245 seconds]
mmu_man has quit [Ping timeout: 252 seconds]
agraf has quit [*.net *.split]
agraf_ has joined #u-boot
agraf_ is now known as agraf
cyrozap has quit [*.net *.split]
alan_o has quit [*.net *.split]
urja has quit [*.net *.split]
m4t has quit [*.net *.split]
cyrozap has joined #u-boot
urja has joined #u-boot
alan_o has joined #u-boot
Peng_Fan has quit [Quit: Connection closed for inactivity]
mranostaj has quit [Quit: leaving]
vagrantc has joined #u-boot
vagrantc has quit [Client Quit]
m4t has joined #u-boot
agust has joined #u-boot
fdanis_away is now known as fdanis
sbach has quit [Read error: Connection reset by peer]
sbach has joined #u-boot
<mwalle> btw, anyone noticed broken SPI flash access in latest u-boot master (ls1028a soc, flexspi)? I haven't had the chance to look into it
mckoan|away is now known as mckoan
guillaume_g has joined #u-boot
frieder has joined #u-boot
faruk has joined #u-boot
tnovotny has joined #u-boot
sszy has joined #u-boot
mmu_man has joined #u-boot
mmu_man has quit [Ping timeout: 265 seconds]
tnovotny_ has joined #u-boot
tnovotny has quit [Read error: Connection reset by peer]
tnovotny has joined #u-boot
tnovotny_ has quit [Ping timeout: 268 seconds]
mmu_man has joined #u-boot
mmu_man has quit [Ping timeout: 245 seconds]
pgreco has quit [Quit: ZNC 1.8.2 - https://znc.in]
mmu_man has joined #u-boot
jwillikers has joined #u-boot
mmu_man has quit [Ping timeout: 276 seconds]
tnovotny has quit [Read error: Connection reset by peer]
tnovotny has joined #u-boot
tnovotny_ has joined #u-boot
tnovotny has quit [Ping timeout: 250 seconds]
mckoan has quit [Ping timeout: 258 seconds]
mckoan has joined #u-boot
monstr has joined #u-boot
pgreco has joined #u-boot
mmu_man has joined #u-boot
matthias_bgg has joined #u-boot
tnovotny_ has quit [Quit: Leaving]
matthias_bgg has quit [Remote host closed the connection]
matthias_bgg has joined #u-boot
torez has joined #u-boot
wyre_ is now known as wyre
<Tartarus> mwalle: Try setting CONFIG_SF_DEFAULT_MODE / SPEED to 0 and seeing if that fixes things
* mwalle breaks his board on purpose :p
<mwalle> Tartarus: not really, (MODE was set to 3 before)
<Tartarus> ok, i was asking since there's at least some cases where e2e95e5e254 means that, I gather, if the DT was wrong we now fail, but 0/0 ends up causing things to probe and the old behavior happens, or something along those lines.
mranostaj has joined #u-boot
<mwalle> Tartarus: I'll look into it when I have some free time
guillaume_g has quit [Quit: Konversation terminated!]
<rfs613> mwalle, Tartarus: that's interesting, because I had previously found that the speed could not be changed after the first access. http://u-boot.10912.n7.nabble.com/Speed-mode-setting-via-quot-sf-probe-quot-command-td429620.html
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
mckoan is now known as mckoan|away
fdanis is now known as fdanis_away
frieder has quit [Remote host closed the connection]
monstr has quit [Remote host closed the connection]
override has joined #u-boot
<override> hey, So ive got a board with a working image on it. Now I want to interrupt the bootup process, get the uboot prompt, and make the board boot from the .wic image on the sd-card. what u-boot command do I use to make that happen?
<mwalle> Tartarus: ahh its the classic one. my board has only two IOs connected
<mwalle> apparently u-boot (flexspi?) got support for multi io spi commands
<mwalle> I'll post a patch later, but adding spi_mem_default_supports_op() fixes my issue
<Tartarus> Ah, ok
<mwalle> Tartarus: do we care about a Fixes tag? Because then I'll have to find the offending commit ;)
<Tartarus> mwalle: It's nice but not required.
<mwalle> pratyush: ^ I see various commits regarding spi-nor in u-boot. maybe you have a clue what commit caused the regression
matthias_bgg has quit [Ping timeout: 240 seconds]
<rfs613> override: so the .wic is not a special format, its just a (compressed) raw disk image. So you would boot it the same as you'd boot an image you loaded using "dd". Possibly you'd use "fatload" to fetch kernel + devicetree and then "bootm" to boot it. Or it could be done a dozen other ways.
<override> rfs613: is run sdboot a standard uboot command, or just something the bsp im using might have?
<rfs613> override: that sounds like a custom command/script, try "print sdboot" to see what it actually does.
<override> alright, one unrealted question, when I flash sdcards with wic images, would ubuntu stop moutnung it or something? I dont see the usb icon show up..
<override> I can see the drive under lsblk tho ..
<rfs613> override: you might have to remove the sdcard and then re-insert it, or go into the "file manager" and click on the sdcard to mount it again.
<override> rfs613: im still super unfamiliar with dd even. isnt that used for flashing the actual nand flash or something I have on my baord? for now I just want the baord to boot from the sd card, I dont want to write the wic image to the non volatile storage on the baord (nand flash or whatever that is called)
<rfs613> override: ah, ignore my reference to dd then... I though you were using that previously, and now moved to .wic instead
<override> no, at first I was just using stuff t hat came with the bsp
<override> now im trying to setup the A/B partition scheme for updates
<override> so I just want a uboot command for now thatll just boot hte baord with the wic image on the sd card
<override> so i did a umount on the sd card to let the bmaptool work
<override> now the sdcard wont show up in ubuntu..
<pratyush> mwalle: yeah, my patches for octal DTR support were merged recently. What is the regression you are seeing? Can you bisect it to find the offending commit
<rfs613> override: even if you pop it out and back in again?
bradfa has quit []
<override> yeah
<override> i tried that and a restart even
<override> shows up in lsblk though
matthias_bgg has joined #u-boot
<rfs613> override: okay, does lsbkl show one (or more) partitions?
<override> shows 2
<override> for the card tht is
<override> its showing my actual platter drive and all too
<override> i think..
<rfs613> yup, we only care about the sdcard... so you can manually mount it, or you could try using "gnome-disks" if you want a GUI
<override> or actually i lied
<override> its not showing my sdcard any more
<override> and i get the "disk attached was not readable by this computer" message
<override> I got ubuntu running on parallels .. usb stuff usually works ok for me
<rfs613> ah, that disk attached message is probably coming from windows/mac side
<override> oh crap, maybe im just mixing up stuff
<override> anyway, once I get this sorted
<override> wht uboot command would u sugguest I use
<override> to get the baord to boot the wic image on the sd card?
<rfs613> well, it depends what is in your .wic image... probably the first partition is FAT filesytem, and contains a kernel and devicetree.
<override> yeah, its something similar to that
<rfs613> you can confirm this using "fatls mmc 0:1" command for example, this should show you the contents of 1st partition.
<override> I can share the wic image if that helps???
<rfs613> let's leave that as a last resort...
<override> got it
<override> ok so if I have taht first partition with the kernel and deive tree
<override> then what do i do?
<rfs613> in general, you load them into RAM and then use "bootm" to jump to the linux kernel (in RAM).
<rfs613> you can probably look at the existing u-boot boot commands. Try "print bootcmd" for example.
<override> oh, so I should look up the bootm command?
<override> cool, ill take a look
<rfs613> bootcmd is the default command that is run. This *may* contain the steps you need to boot your board. It may fetch from the internal flash (NAND) rather than sdcard. That's okay, we will adapt it.
<rfs613> alternatively there may be other commands like "run sdboot" or similar, if this exists, it may save you some effort.
<override> got it, ill look at my current bootcmd in a bit
<override> im trying to format my card to some linux firedly format (so ubuntu picks it up atleast) is fat ok
<override> ?
<override> ok i got it to show up in ubuntu
<rfs613> formatting the sdcard is not really necessary, because when you use bmaptool (or "dd" for that mater) you are overwriting the sdcard
matthias_bgg has quit [Ping timeout: 258 seconds]
v0|d has joined #u-boot
<override> rfs613: think my bootcmd is currently caaling some script ... this is what it looks like right now: bootcmd=run distro_bootcmd
<rfs613> override: right, so let's follow the chain, "print distro_bootcmd"
<rfs613> (or "printenv" will print them all...)
<override> bootcmd=run distro_bootcmd
<override> sorry
<override> distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
<override> meant to show you that ^
<override> therres likea shit ton stuff if I do a printenv
<rfs613> yep
<override> should i be greppign for that bootm variable?
<override> sorry, I gotta make the 5pm train hence the typos..
<rfs613> if you like, upload the whole printenv output to a pastebin site (like paste.ubuntu.com or github gists)
<override> oh sure. ill do that. Thanks for helping out
<rfs613> ok, so boot_targets has 4 options (mmc1, mmc0, usb0, and dhcp)
<rfs613> each of those has a corresponding bootcmd_mmc0, bootcmd_mmc1, etc.
<rfs613> so you want sdcard, that will be mmc1 or mmc0
<override> ok
<override> let me make sense of this a little
<urja> https://github.com/u-boot/u-boot/blob/master/doc/README.distro <- this might be a good thing to look through too
<override> one sec
<urja> if you want to know how the distro boot is supposed to work in general :)
<override> oh so this is like a generic way of setting the the bootenv?
<override> how does boot_target tie to bootcmd_mmc0 for instance
<override> boot_targets=mmc1 mmc0 usb0 dhcp why does this have all possible options?
<override> is this some uboot env magic?
<rfs613> override: nope, it's fairly basic shells scripting really
<rfs613> so boot_targets just contains some names, but then, distro_bootcmd is going it try each one of them in a loop.
<rfs613> "for target in ${boot_targets}" that is the loop, in shell syntax.
<urja> boot_targets just defaults to everything (it will go through them in that order looking for one...)
<override> for shoot, didnt read that for loop at first
<override> my bad
<urja> you can set it to the boot order and devices you like (or use run bootcmd_usb0 or like to boot from a specific device once, as detailed in the end of that doc)
<override> got it
<override> you guys suggest i should give the doc a read?
<rfs613> it can't hurt (but may lead to more questions). But from what I see in your boot messages, it will try to boot from mmc1 first. If that doesn't work, it tries mmc0.
<rfs613> I'm guessing that one of those is your "internal" flash, and one is the external sdcard.
<override> oh so nand gets registered as mmc too?
<override> thought that was more of a sd-card thing
<urja> that is also just the default set of boot devices in u-boot (so, if you're bringing this thing up, you might want to set it up right)
<urja> sd-card is mmc
<urja> nand is not
<override> oh so then why are is this uboot distro thing using mmc1 for nand?
<override> like rfs613 pointed out aboove
<override> one of the mmc (mmc1 mmc0) would be my internal flash?
<rfs613> my guess is you have two sdcards... one is external and removable, the other is probably soldered to the board.
<urja> he meant an eMMC
<override> oh got it..
<rfs613> yeah, eMMC, I was trying to remember that name
<override> eMMc got it
<urja> but yeah i'll skip out, if you have a fixed boot plan and it doesnt have a syslinux/pxelinux configuration with it, you can just set bootcmd to what you need to do and ignore the whole distro boot process, too
<override> should target be set to something right now
<override> i dont see anything when i do a printenv target
<rfs613> target gets set as the loop executes
<rfs613> it will get set to mmc1 first, so it will then do "run bootcmd_mmc1".
<override> ohhh ok
<rfs613> if that succeeds, then linux starts booting, so that the end of that.
<override> it loops through everything ... you just get to set the order of things
<override> ok
<rfs613> if it fails, then target gets set to mmc0, and it tries "run bootcmd_mmc0" and so on.
<rfs613> yup exactly
<override> ok coool
<override> thanks for the link to the distro
<rfs613> so it tries both your SD and eMMC already. We don't know which one is which, eg. which one it tries first. But you can figure that out by experimenting.
<override> yep, thanks guys
<override> ill keep buggign you for the next few days
<rfs613> if you do "run bootcmd_mmc0" without the sdcard inserted, and it works, then mmc0 is the internal eMMC.
<override> oh ok
<override> bsp says i can boot from the sd card using run sdboot
<override> ill do a printenv on tht ..
<rfs613> override: seems like the bsp documentation doesn't match up with your printenv output
<override> oh yeah.. i didnt see sdboot in the printenv at all
<override> maybe its usb_boot?
<rfs613> (btw, it seems in your pastebin, that the longer lines are cut off... not a problem for me, but you might want to turn on "line wrap" in your terminal program)
<urja> (yeah, if you've set up an upstream u-boot, then things that were done to the bsp u-boot by the BSP provider no longer apply)
<rfs613> override: yes, there does seem to be a "run usb_boot"
<override> im minicomed into this baord
<override> wheres the line wrap setting again?
<urja> -w
<rfs613> hehe, you'd think that woudl be on by default ;-)
<override> think id have to exit out of minicom or soemthing to setup line wrapping
<override> ok so usb_boot didnt work for the sdcard
<rfs613> you can do it via the menu somewhere.
<override> mayeb thats for some other sort of usb
<rfs613> usb != sd
<rfs613> usb would be a different connector, with a flash drive (or even hard disk) attached.
<override> hmm
<override> maybe i just have to play aorunf with that distro thing to get the boot to work from sdcard
<override> or the run bootcmd_mmc1
<override> thin mmc0 is the sdcard
<rfs613> I would have made it so it checks external first, then internal. Because it's easier that way, you just plug in sdcard and it boots from it, and otherwise it boots from internal.
<rfs613> but depends on who designed your bsp ;-0
<override> appreaciate all your help guys, havent messed around with uboot in a whole , so this chan helps a lot
<override> im aatir in case you all havent seen me asking questions all day long on yocto
<override> rfs613: so how can i write whats on the sd card to the emmc?
<rfs613> override: there are lots of ways ;-)
<override> i can start out with the most basic way
<override> heres what im planning to do
<rfs613> once you've booted into the sdcard, see if you have bmaptool included, if so, you can use that along with the .wic image
<override> my baord would start out with a bsp version of the image, i overwrtite that with my own wic iamge
<override> my wic would have two rootfs partitions
<mwalle> pratyush: bisecting is a bit complictated because I can't reflash that the board that easily. I guess before there were just single i/o commands and now quad i/o commands are used
<override> some how uboot can update the rootfs partition and boot change which one to bootfrom
<mwalle> pratyush: and because the nxp fspi driver doesn't respect the device tree setting that my board only has 2 io lines connected, i'm reading garbage
<override> rfs613: can i have bmaptools in uboot too, or do i have to boot into the full kernel image to be able to bmap?
<override> whats faster bamp or dd?
<rfs613> bmap is faster, because it skips portions that are "empty" (eg. not used), while dd just copies everything.
<override> ok, nice
<override> and bmap neeks linux or can it work off of uboot?
<override> needs*
<rfs613> I've never looked to see if it is implemented in uboot. I suspect only in linux.
<mwalle> pratyush: its commit 71025f013ccb2da5a39e60cec319f1fdef031d3d, disabling CONFIG_SPI_FLASH_SMART_HWCAPS fixes the issue
<pratyush> mwalle: Right, that's what I guessed too. Good to hear you figured out the fix and there is no problem in the core
<override> how do we setup a board to read the initramfs?
<override> trying to see where the order of those things is setup...
<override> how does the hardware figure out where to read the initramfs from when things are powered up?
<rfs613> override: it's part of the same stuff we already were looking at... you load a kernel and devicetree, and possibly an initramfs, before transferring control to Linux
<override> rfs613: im trying to see like the very first thing that happens in the boot up process. like how does the board know that the first partition in emmc is where the initramfs is at?
<override> see what im tryig to get at?
<rfs613> override: the initramfs comes later in the boot process.
<override> who transfers control to uboot?
<override> whats the first program that runs when the baord is powered on
<rfs613> generally there is an internal bootROM that runs first
<override> its not the stuff we have in initramfs?
<rfs613> nope
<override> oh andthe hardware vendor setups bootROM ? where does it live? emmc?
<rfs613> it's inside the chip and you can't change it...
<override> got it..
<rfs613> then there can be several more steps before getting to u-boot
<override> ok
<override> but initramfs comes after u-boot?
<rfs613> but in the simple case u-boot is next, and it's job is to load linux+DTB (and optionally initramfs) into RAM
<override> ook
<rfs613> once those are in RAM, u-boot transfers control to Linux, which then initializes drivers, unpacks the initramfs (if present), and then starts up the first userspace task (PID 1)
<override> you make initramfs sound optional
<override> what good is initramfs for even?
<override> i used to think its necessary to have it in order to boot linux
<override> when we are transitioning into linux from uboot
<override> like it sets up the systemd and all for you or something
<rfs613> it's not required, but it is often used in distros, to better support a wide range of hardware on a single software build.
<override> got it
<override> thanks
<override> and then with the bmap tool. can i over write partitions as well
<override> or just the entire emmc?
<override> and what ubott env variable can you use to tell linux what partition to use for the rootfs?
<rfs613> bmaptool normally operates on the whole device
<override> i see
<mwalle> rfs613: (spi speed) I doubt you can actually set the speed for the flexspi driver on the ls1028a in uboot anyway
<override> A/B patition scheme updates , do they dont they mosty just swap out the rootfs and not the entire emmc ?
<rfs613> override: the way linux knows the rootfs is usually via the kernel commandline, something like root=/dev/mmcblk0p1
<mwalle> rfs613: even if that command would work correctly
<override> rfs613: is there a way I can write to kernel commandline via uboot?
<override> like write kernel env vraibles?
<rfs613> mwalle: i'm testing on a different device, and in my case it's QSPI controller, so maybe it's different
<override> variables*
<rfs613> override: yes, normally it uses "bootargs" variable in u-boot. Though it doesn't seem to be set in your environment.
<override> rfs613: im interesting in finding out how that hand off happens. How does uboot handoff values for env varaibles to the kernel?
<override> does uboot have the exact memory addresses or what?
<rfs613> override: these days it ends up going via the devicetree. There's some good blog posts about this, I can dig up later
* rfs613 has to go collect the kids momentarily...
<override> rfs613: is rfs613 some type of a root file system or is your initials ?
<rfs613> it's my initials and area code ;-)
<override> cool, thanks for all the help rfs613
<override> appreciate it
vagrantc has joined #u-boot
agust has quit [Quit: Leaving.]
torez has quit [Quit: torez]
akaWolf has quit [Ping timeout: 240 seconds]
Gravis has quit [Quit: No Ping reply in 180 seconds.]
Gravis has joined #u-boot
Gravis has quit [Client Quit]
Gravis has joined #u-boot
hanetzer has quit [Quit: WeeChat 3.0.1]
hanetzer has joined #u-boot
hanetzer has joined #u-boot
hanetzer has quit [Changing host]
akaWolf has joined #u-boot