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
qschulz has quit [Remote host closed the connection]
qschulz has joined #u-boot
swiftgeek has quit [Ping timeout: 252 seconds]
swiftgeek has joined #u-boot
[[R]] has quit [Quit: ZNC 1.8.2 - https://znc.in]
[[R]] has joined #u-boot
jwillikers has quit [Remote host closed the connection]
matthias_bgg has quit [Ping timeout: 255 seconds]
matthias_bgg has joined #u-boot
mmu_man has quit [Ping timeout: 245 seconds]
mwalle has quit [Quit: WeeChat 2.3]
agust has joined #u-boot
fdanis_away is now known as fdanis
frieder has joined #u-boot
matthias_bgg has quit [Ping timeout: 245 seconds]
<wyre> cambrian_invader, I have not mtd command
<wyre> apparently I cannot see it in help output
<wyre> also ... when I do 'mtd list' I have a message saying 'mtdids not defined, no default present'
<wyre> I can see a variable in the environment like 'mtdparts=mtdparts=gpmi-nand:4m(boot),8m(kernel),1m(dtb),-(rootfs)'
<wyre> but I'm not sure what's this
Net147 has quit [Ping timeout: 268 seconds]
Net147 has joined #u-boot
Net147 has quit [Changing host]
Net147 has joined #u-boot
mckoan|away is now known as mckoan
mwalle has joined #u-boot
tnovotny has joined #u-boot
matthias_bgg has joined #u-boot
<Forty-Bot> wyre: one too many 'mtdparts='s?
<wyre> Forty-Bot, I don't get your point 🤔
<Forty-Bot> mtdparts=mtdparts=
<wyre> Forty-Bot, this is the output of printenv https://bpa.st/2HPA
<wyre> and it is defined so by the manufacturer
<Forty-Bot> right, so do something like `env set mtdparts gpmi-nand:4m(boot),8m(kernel),1m(dtb),-(rootfs`
<milkylainen_> )'
<Forty-Bot> that too
<wyre> ok, I guess now is well set
<wyre> but why is this?
<Forty-Bot> someone did `env set mtdparts mtdparts=foo` for whatever reason
<wyre> I mean, mtdparts is a command, I can see it in cli
<wyre> when I run help
<wyre> so ... why it's at the same time a variable?
<Forty-Bot> oh, yeah you can use that to manually define partitions iirc
<Forty-Bot> but according to jagen it's deprecated
<wyre> jagen? 🤔
<Forty-Bot> he's the maintainer of the flash subsystem
<wyre> also ... I still have the same output when I run mtdparts: 'mtdids not defined, no default present'
<wyre> oh
<wyre> then what should I use?
<wyre> I'd appreciate so much a guide/tutorial/example on how to perform the whole flashing process
<wyre> because I'd like to flash the nand memory from a tftp using the U-Boot cli
<Forty-Bot> oh
<Forty-Bot> it should be mtdids
<Forty-Bot> or rather
<Forty-Bot> you need mtdids as well
<wyre> Forty-Bot, I have not that command
<Forty-Bot> it's a variable
<wyre> oh, but I have not defined 🤔
<wyre> how should I set it?
<Forty-Bot> uh
<milkylainen_> wyre: I think you'll have a hard time getting answers to very specific questions like configuration details. That would depend on what you are trying to do.
<wyre> definitely I'd need a manual/guide on how do this 😥
<Forty-Bot> I think something like `gpmi-nand=nand0`?
<Forty-Bot> idk, I only did this for spi flash
<wyre> milkylainen_, I'm trying to flash the nand from a tftp using the u-boot cli
<Forty-Bot> wyre: this is undocumented for whatever reason :l
<milkylainen_> wyre: board? default configuration?
<wyre> do you mean the default uboot env?
<milkylainen_> wyre: yes. but the actual code would help. Seems your vendor has their code behind a login portal.
<wyre> milkylainen_, what code are we talking about? 🤔
<milkylainen_> wyre: the bsp that they provide. But we're talking u-boot here. So the actual u-boot code they use in their BSP
<marex> Forty-Bot: mtdparts command is deprecated ? that sounds bogus
<wyre> milkylainen_, well, the manufacturer understands the BSP as a Ubuntu VM where you can perform the yocto image building process
<wyre> but I'm not sure this is related with the u-boot code that they used in the SoM 🤔
<marex> wyre: what are you trying to do, list mtd partitions in u-boot ?
<wyre> marex, for example, that should be good
<wyre> (I'm not sure if mtd partitions are the same than nand partitions)
<wyre> also I'm not sure this nand have actually been partitioned before 🤔
<marex> there are technically no partitions as you probably think of them -- as hard drive partitions
<marex> it is a virtual construct of offsets and sizes, nothing more
<marex> and u-boot version ?
<marex> also, which soc, mx6ull ?
<wyre> marex, yes, Microgea mx6ull
<wyre> is "2016.07-gfab75f3-dirty" the U-Boot version?
<marex> oh, so downstream fork of downstream
<marex> what happens if you run 'mtdparts default' ?
<marex> then printenv mtdparts ; printenv mtdids
<wyre> "mtdids not defined, no default present"
<wyre> ## Error: "mtdparts" not defined
<wyre> ## Error: "mtdids" not defined
<marex> is the nand even detected on boot ?
<marex> nand info
<wyre> but this is strange because I've just defined at leaste mtdparts a moment ago
<marex> maybe this old fork does not support env command
<milkylainen_> mtdparts is not defined properly and mtdids not defined at all.
<marex> so it seems
<wyre> => printenv mtdparts
<wyre> mtdparts=mtdparts=gpmi-nand:4m(boot),8m(kernel),1m(dtb),-(rootfs)
<wyre> that's the default environment
<milkylainen_> setenv mtdparts gpmi-nand:4m(boot),8m(kernel),1m(dtb),-(rootfs)
<wyre> but as Forty-Bot it's apparently bad defined
<marex> mainline says this
<marex> configs/imx6ul_geam_nand_defconfig-CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
<marex> configs/imx6ul_geam_nand_defconfig:CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-nand:2m(spl),2m(uboot),1m(env),8m(kernel),1m(dtb),-(rootfs)"
<marex> so
<wyre> now it's properly defined
<milkylainen_> marex: I think maybe they're using it as kernelcmdline.
<marex> setenv mtdids "nand0=gpmi-nand" ; setenv mtdparts '"mtdparts=gpmi-nand:2m(spl),2m(uboot),1m(env),8m(kernel),1m(dtb),-(rootfs)'
<marex> saveenv
<milkylainen_> which would mean $(mtdparts) != mtdparts=$(mtdparts)
<milkylainen_> Could be why.
<milkylainen_> (idiots).
<marex> milkylainen_: I was under the impression we are trying to list mtdparts in u-boot first ?
<milkylainen_> yes.
<milkylainen_> setenv bootargs ${bootargs_tmp} ${mtdparts} root=/dev/mmcblk${mmcdev}p2 rootwait rw
<milkylainen_> but they've botched the variable-.
<wyre> marex, aren't you missing a "?
<wyre> in setenv mtdids "nand0=gpmi-nand" ; setenv mtdparts '"mtdparts=gpmi-nand:2m(spl),2m(uboot),1m(env),8m(kernel),1m(dtb),-(rootfs)'
<wyre> apparently you have to close the '", right?
<wyre> and isn't redundant?
<milkylainen_> I think setenv can do without it.
<milkylainen_> without ".
<milkylainen_> So either terminate it or ignore the captions.
<milkylainen_> s/'/"
<wyre> but I don't know why mtdparts is set as mtdparts=...
<wyre> and also ... why defining mtdids to nand0=gpmi-nand apparently I have an output for the parts defined in mtdparts variable
<wyre> also ... why I need a partition for uboot in the nand?
<marex> wyre: there is one extra " in the second setenv
<wyre> where is installed the uboot that I'm using right now?
<wyre> marex, sure, check the last link I pasted
<wyre> I'm worried about potentially break the U-Boot I'm using right know
<wyre> is it installed in NAND?
<wyre> because apparently without this u-boot instance I couldn't flash anything, NAND or an sdcard 😢
<wyre> well, the sdcard is flashed in my PC, but it's booted from this U-Boot instance by running bootcmd_mmc
<marex> per the mtdparts, the bootloader is likely in nand
<wyre> so if I flash wrongly the nand I could lost this bootloader and make unusable the SoM? marex
<marex> I think so
<wyre> and how's this done the first time?
<marex> if you have a way to recover the SoM, you can try erasing the first few MiB and see what happens
<marex> what, initial programming ?
<wyre> I'm not sure how can I recover the SoM...
<marex> there is USB SDP, there is JTAG
<wyre> marex, how the manufacturer flash the U-Boot initially in the NAND?
<marex> there is USB SDP, there is JTAG
<wyre> marex, what's SDP?
<marex> nxp protocol for code upload/execution via usb otg
<marex> see the mx6ull datasheet, boot section, there should be something about usb
matthias_bgg has quit [Ping timeout: 265 seconds]
<mwalle> wyre: or preprogrammed parts
<marex> mwalle: with NAND the GPMI NAND bad block markers might be a problem
<mwalle> marex: why? they should be skipped of course, but IIRC I've seen preprogrammed NAND flashes
<mwalle> or what is special on the fsl controller?
<wyre> so I have to be extremely careful when flashing the nand, right?
<wyre> is U-Boot part of the yocto image?
<marex> mwalle: the gpmi nand has some funny bad block marker stuff, thats why nxp needs kobs-ng to populate it
<mwalle> marex: i see, thanks. good to know to ditch NAND boot on imx ;)
<wyre> I mean, I can see in the manufacturer manual https://www.engicam.com/get_attachment.html/rem/custom/files/114421/ct10000_id101223_t100003/GEAM6ULSW_manual_Yocto_2.0.5.pdf the yocto build process should produce a u-boot.imx file :think
<wyre> I can see in fact this u-boot-sd-1.0-r0.imx file
<wyre> but I'm not sure how to use this, because apparently I just have to flash the rootfs.wic with dd in the sdcard
<wyre> and then I can boot the zImage from u-boot
<mwalle> wyre: do you have that eval board with the SOM?
<mwalle> I see JM3 there, where you can select between NAND and SD1 boot
<mwalle> oh and an unnamed jumper (?) just above the usb-c connector to boot from usb otg (that is the SDP mode marex mentioned)
<wyre> mwalle, I have the MicroDev 2.0, yes
<wyre> and the jumper is the JM2
<mwalle> so usb boot should always work, regardless whats in your NAND, but I guess you need special tools for that
<wyre> usb boot? ... I didn't know that exists even
<mwalle> and choosing sd card boot you should be able to leave the NAND untouched, so you could safely play around with it
<mwalle> (and if flash nand from there then once you got it to boot solely from sdcard)
<mwalle> wyre: well its not really usb-boot.. the imx6 will enter a special device mode which then appears as a USB device on your host
<mwalle> wyre: i'd go for the sdcard boot. chances are, that your image will just works with the sdcard boot if you dd the wic onto the sdcard
<wyre> mwalle, the sdcard boot still requires U-Boot, I think
<wyre> I cannot directly boot the sdcard
<mwalle> wyre: right, but the uboot should also be on the sdcard
<wyre> also the .wic file produced is 922MB large, which apparently will not fit in the NAND 😢
<mwalle> wyre: AFAIK the wic is a yocto sdcard/emmc/usb image
<wyre> mwalle, in which partition? boot or root? I'd say boot but I just can see here the dtb files and the zImage
<mwalle> wyre: no its a whole image dd if=bla.wic of=/dev/sdz bs=1M
<mwalle> where sdz is your sdcard device
<mwalle> see also chapter 5 of your mentioned manual
<mwalle> but there its called .sdcard, not .wic
<mwalle> and it also mentions that it contains a bootloader
tnovotny has quit [Read error: Connection reset by peer]
tnovotny_ has joined #u-boot
<wyre> 🤔 you are right, apparently when the jumper is closed it's able to boot from the sd directly
<wyre> so should I be able to flash the NAND from this system?
<wyre> there are a few scripts that are apparently used for flashing the NAND from a tftp https://bpa.st/G2LA
<wyre> how could I check the nand status from here?
<wyre> I can see here different mtd disks https://bpa.st/QJBQ
<wyre> or blocks ...
<wyre> but they are like disks ... 4M, 8M, 1M and 499M
<wyre> I guess those are for boot, kernel, dtb and rootfs, right?
<wyre> that's because mtdparts is defined as mtdparts=mtdparts=gpmi-nand:4m(boot),8m(kernel),1m(dtb),-(rootfs) ?
<wyre> are these blocks mutable?
<wyre> or they have a fixed size?
mmu_man has joined #u-boot
matthias_bgg has joined #u-boot
<mwalle> wyre: the manual tells you how to flash it. if you don't care about the current NAND contents, I'd say it is safe to flash from the sdcard system
<mwalle> because even if something goes wrong, you can reflash it from the sdcard system
lukma has quit [Quit: leaving]
lukma has joined #u-boot
jwillikers has joined #u-boot
LokeshVutla has joined #u-boot
jwillikers has quit [Remote host closed the connection]
Peng_Fan has joined #u-boot
jwillikers has joined #u-boot
torez has joined #u-boot
matthias_bgg has quit [Ping timeout: 246 seconds]
matthias_bgg has joined #u-boot
vagrantc has joined #u-boot
gsz has joined #u-boot
mmu_man has quit [Ping timeout: 246 seconds]
tnovotny_ has quit [Quit: Leaving]
brujah has joined #u-boot
brujah_ has joined #u-boot
gsz has quit [Quit: leaving]
mmu_man has joined #u-boot
brujah has quit [Quit: Leaving]
brujah_ has quit [Quit: Leaving]
mckoan is now known as mckoan|away
<sjg1> milkylainen_: cyrozap For U-Boot it is CONFIG_I8042_KEYB to disable it
<milkylainen_> sjg1: tnx. I did find it eventually. Looks like my problem was a combination of things.
<milkylainen_> 16550 uarts enabled (not properly probed, but used later on?) and no usb start because of the configuration being a bit obtuse.
<milkylainen_> There are some bits in the serial configuration that are... strange from my perspective.
fdanis is now known as fdanis_away
<milkylainen_> config PREBOOT
<milkylainen_> string "preboot default value"
<milkylainen_> depends on USE_PREBOOT && !USE_DEFAULT_ENV_FILE
<milkylainen_> default "usb start" if USB_KEYBOARD
<milkylainen_> Seems kinda strange. "You have your own env file, so we need not add preboot"...
<milkylainen_> Also.
<milkylainen_> CONFIG_SERIAL_SEARCH_ALL.
<milkylainen_> If not selected, 16550's get instantiated but never probed?
<milkylainen_> CONFIG_SERIAL_PROBE_ALL
<milkylainen_> Rather confusing...
LokeshVutla has quit [Remote host closed the connection]
vagrantc has quit [Quit: leaving]
frieder has quit [Read error: Connection reset by peer]
<milkylainen_> Do I have to use the pesky "usb start" if I want an usb keyboard to work in U-boot?
akaWolf has quit [Ping timeout: 268 seconds]
crb has quit [Ping timeout: 250 seconds]
crb has joined #u-boot
akaWolf has joined #u-boot
matthias_bgg has quit [Ping timeout: 258 seconds]
crb has quit [Ping timeout: 250 seconds]
<Slimey> is there a method of testing uboot on hardware before I write it to flash?
agust has quit [Quit: Leaving.]
jwillikers has quit [Remote host closed the connection]
torez has quit [Quit: torez]
<marex> Slimey: there are many, which SoC / hardware / do you have in mind ?
<marex> dang, env_get_bootm_size() returns total DRAM size, which fails if your DRAM is in 32bit space and you have two banks with gap between those banks
<marex> Tartarus: sjg1: ^
<Tartarus> marex: first thought is isn't that what bootm_size / bootm_low I think it is are supposed to be for?
<marex> Tartarus: it should likely return the size of the first bank only
<Tartarus> milkylainen_: Yes, you need usb start to start USB
<marex> which in most cases is the same as total DRAM size on arm32
<Tartarus> marex: Not sure about that. Since we have env vars to say what to use/where
<Tartarus> But I don't have the code in front of me
<marex> well, DT is relocated to end of start-of-ram + bootm_size
<marex> the default bootm_size is total size of ram
<marex> if you have e.g. two split banks, say ... 0x7000_0000..0x8fffffff and 0xb0000000-0xcfffffff , then your DT ends up a bit below 0xafffffff
<marex> and that's a non-existing memory, right there
<marex> so I think the safe default should be the first bank, not total DRAM size
<marex> and yes, it does not match what README says about bootm_size , but then I would argue README should be updated , because it seems a lot of code depends on this area to be continuous
<Tartarus> Yeah, the code around discontiguous memory needs to be checked a bit
<Tartarus> afk
<dgilmore> anyone have an idea why after https://source.denx.de/u-boot/u-boot/-/commit/346df7d4fa62afc578d820b3a18815eec765074f was commited SPI would stop working correctly on rockchip devices?
<dgilmore> I have seen on a couple of rk3399 devices that the SPL will get loaded from SPI, but the SPL is unable to find and load u-boot.itb
<marex> dgilmore: the pointers get relocated in SPL maybe ?
<dgilmore> marex: maybe
<dgilmore> I will do some more digging
sigmaris has quit [Quit: ZNC - https://znc.in]
sigmaris has joined #u-boot
<marex> dgilmore: thanks
Harm has quit [Ping timeout: 255 seconds]
jwillikers has joined #u-boot
jwillikers has quit [Remote host closed the connection]
<Tartarus> marex: I looked over the code again, I don't see why the answer for your situation isn't to use bootm_low/bootm_size/bootm_mapsize as needed for your situation. We have those env vars and a function to reference them rather than just gd->ram_* directly to allow for discontig memory, etc.
<Tartarus> afk dinner
<marex> Tartarus: because those env vars are overrides, not something you should tweak by default
<marex> Tartarus: but that's OK, I already have a patch
<sjg1> marex: Tartarus Re env_get_bootm_size(), it uses just the first bank
<marex> sjg1: since when ?