<stgl>
Hi, I am reverse engineering a device which has a serial port exposed on which I found u-boot output. I can stop autoboot with a key press and drop to the shell and the U-Boot> prompt appears. Problem is it doesn't echo any characters I type and nothing happens if I enter "sleep 10", "panic" or "help"
<stgl>
It does print U-Boot> again if I press enter though, so I think it is reading the serial input
<stgl>
Is there some built-in feature of u-boot that achieves this? Or is this some kind of obfuscation hack by the manufacturer?
enok has quit [Ping timeout: 252 seconds]
slobodan_ has joined #u-boot
enok has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
naoki has joined #u-boot
naoki has quit [Client Quit]
stefanro has quit [Ping timeout: 255 seconds]
enok has quit [Ping timeout: 256 seconds]
stefanro has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
gsz has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
slobodan_ has quit [Ping timeout: 256 seconds]
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
mmu_man has joined #u-boot
slobodan has joined #u-boot
stefanro has quit [Ping timeout: 272 seconds]
dsimic has quit [Ping timeout: 255 seconds]
dsimic has joined #u-boot
KREYREN has quit [Remote host closed the connection]
FergusL has quit [Changing host]
FergusL has joined #u-boot
stefanro has joined #u-boot
tgamblin has quit [Ping timeout: 264 seconds]
monstr has quit [Ping timeout: 252 seconds]
prabhakarlad has joined #u-boot
mmu_man has quit [Ping timeout: 252 seconds]
enok has joined #u-boot
mmu_man has joined #u-boot
monstr has joined #u-boot
Clamor has quit [Ping timeout: 268 seconds]
stefanro has quit [Ping timeout: 255 seconds]
Clamor has joined #u-boot
stefanro has joined #u-boot
edwinistrator24 has joined #u-boot
edwinistrator2 has quit [Ping timeout: 260 seconds]
<tlwoerner>
i only have 5 boards on which to test eMMC-vs-SDcard boot, but 2 of them don't seem to like my eMMC module
<tlwoerner>
so i'm not able to test this very extensively
<qschulz>
tlwoerner: I forgot to answer to your mail for meta-rockchip, sorry for that. I think we may have a hard time using /dev/disk/by-label because I **think** those are created by udev?
<qschulz>
and udev isn't necessarily installed on the image
<tlwoerner>
it doesn't look like the fw_{printenv|setenv} tool understand LABELs, so unfortunately we'll have to hard-code /dev/mmcblk{0|1}p5 for /etc/fw_env.config
<qschulz>
tlwoerner: /dev/disk/by-label/u-boot-env is just a path
<tlwoerner>
oh!! nice
<tlwoerner>
yes, i now realize that's what you said, but the light hadn't turned on :-/
<qschulz>
tlwoerner: do you have the logs of the SPL too?
<qschulz>
tlwoerner: no clue if it's supposed to work, but can you try with https://paste.ack.tf/91777c? I have a feeling this Card error message is only for SD cards
<tlwoerner>
not using this patch and hard-coding the location of the environment via CONFIG_SYS_MMC_ENV_DEV works (i.e. the hardware is fine)
<qschulz>
tlwoerner: and I assume you put either 0 or 1 in that variable, correct?
<tlwoerner>
yes, the meta-rockchip patch i sent a week or two ago
<tlwoerner>
oh... i've updated the patch to have another MACHINE_FEATURE to let the user say whether they're booting from SDcard or eMMC
<tlwoerner>
i haven't submitted it yet, because adding the above patch messes things up
<qschulz>
tlwoerner: i'm flabbergasted, i don't understand how this can not work
<tlwoerner>
if i'm reading the DT correctly, with the patch included the board boots from eMMC and the patch says "hey, i just booted from the sdcard, let me try to store the environment there"
<qschulz>
because it finds the appropriate dev number based on the MMC driver device in U-Boot
<tlwoerner>
and visa-versa
<tlwoerner>
oh, let me double-check
mmu_man has quit [Ping timeout: 272 seconds]
<tlwoerner>
mmc@fe32 is the sdmmc (arch/arm/dts/rk3399.dtsi)
<qschulz>
mmmm so it reads from the wrong controller
<tlwoerner>
okay, i'll bump SRCREV to the latest master and see what happens
<qschulz>
patches 1 to 4 I assume (they were merged)
<qschulz>
lemme check with Puma, maybe I have the same issue (but since I always have eMMC, I don't see it)
<tlwoerner>
my main goal is to get rauc (or any general A/B mechanism) working regardless of whether the user is booting from emmc or sdcard
<tlwoerner>
getting the environment working was supposed to be a small bump along the way ;-)
<qschulz>
tlwoerner: yeah, that would be great. It'd be even better if the exact same image can be flashed on SD card or eMMC :)
<qschulz>
tlwoerner: oopsies :)
<tlwoerner>
i'm happy to see progress is being made in the direction of using the same image on both emmc and sdcard!
<tlwoerner>
i guess we're just in a period of flux for the time-being
<qschulz>
tlwoerner: same issue on my Puma
mmu_man has joined #u-boot
<qschulz>
reading eMMC when booting from SD card on v2024.01
<tlwoerner>
okay good (i'm not off-track)
<qschulz>
tlwoerner: mmmm seems to also be incorrect on v2024.01...
<qschulz>
04*
<tlwoerner>
for the record, i do have rauc working for everything supported by meta-rockchip (it's been working for a while) but getting everything upstream properly is the hiccup
<tlwoerner>
but i'm glad for the feedback to make sure it is done properly
<qschulz>
tlwoerner: that's some code area I don't like digging into, so that may take some time, it's not fun in there :D
<qschulz>
tlwoerner: sorry, I had a massive brainfart I think
<qschulz>
Puma v2024.01 works fine
<qschulz>
boots from SD card and detects /mmc@fe320000 as being the device it booted from
mmu_man has quit [Ping timeout: 255 seconds]
<qschulz>
tlwoerner: https://paste.ack.tf/9c2936 can you add this on top of v2024.01 and tell me what SPL prints?
<qschulz>
I think it's really because the rockpi defconfig is missing SPL_DM_SEQ_ALIAS
<qschulz>
this means that the aliases aren't used for mmc devices, so the first probed is going to have devnum 0
<tlwoerner>
updating with 'SRCREV = "master"' works for the SDcard, give me a minute to test the emmc
<tlwoerner>
maybe i just add that to the patch and go from there? ;-)
<qschulz>
and since the sd card controller is before the emmc controller in the DT, it has a higher chance to probe before the emmc controller
<qschulz>
making sd card mmc0 and emmc mmc1, instead of the opposite
slobodan_ has joined #u-boot
slobodan has quit [Ping timeout: 264 seconds]
slobodan_ has quit [Remote host closed the connection]
<tlwoerner>
i will try testing with SPL_DM_SEQ_ALIAS too
mckoan is now known as mckoan|away
<tlwoerner>
darn Upstream-Status ... :-|
<qschulz>
tlwoerner: surprising that it works in master, SPL_DM_SEQ_ALIAS is still missing
<qschulz>
tlwoerner: compile locally, you'll have a better time :)
<qschulz>
export BL31=/path/to/tf-a/bl31.elf
<qschulz>
make
<qschulz>
then flash idbloader.img to offset 64 (seek=64 in dd)
<qschulz>
tlwoerner: as expected, incorrect. Can you apply the same patch for v2024.04 ?
<tlwoerner>
okay
slobodan_ has joined #u-boot
slobodan has quit [Read error: Connection reset by peer]
<qschulz>
tlwoerner: in v2024.04 you still have Card did not respond to voltage select! : -110
<qschulz>
Unable to get mmc desc
<qschulz>
which is surprising
<tlwoerner>
yes, but unrelated to the environment
<tlwoerner>
it's trying to probe all mmc devices (for some reason)?
<tlwoerner>
oops, patch doesn't apply in master, i'll tweak it
<qschulz>
tlwoerner: the s/debug/printf/ in mmc_get_env_dev + dev_err(dev, "devnum: %d\n", desc->devnum); in arch/arm/mach-rockchip/spl-boot-order.c + s/debug/printf/ in arch/arm/mach-rockchip/spl.c ?
mmu_man has joined #u-boot
slobodan_ has quit [Ping timeout: 260 seconds]
<tlwoerner>
in 2024.01 i'm applying the mmc_get_env_dev myself, so in that case i've changed s/debug/printf
<tlwoerner>
but in master i'm just using as-is. i'll tweak it to make the same change
<qschulz>
this really does fix it for you without needing SPL_DM_SEQ_ALIAS
stefanro has joined #u-boot
<qschulz>
instead of mapping BOOT_DEVICE_MMC1 to a path in SPL, what we do is mapping BOOT_DEVICE_MMC1 to the path returned by the MMC device with that devnum in the blk subsystem
<qschulz>
meaning there aren't any synchronization issue between those two steps of the SPL
<tlwoerner>
it leaves meta-rockchip in limbo. there's no point doing a whole bunch of work-arounds that won't be needed very soon
<tlwoerner>
or i could just force the SRCREV in meta-rockchip to 2024.04 and go from there
<qschulz>
So I believe 2024.01 with the SPL_DM_SEQ_ALIAS should work with the mmc_get_env_dev patch from Ben Wolsieffer
<tlwoerner>
okay, let me give that a try
<qschulz>
tlwoerner: there aren't any work-arounds, only patches to backport :) (and patches that are merged already)
<tlwoerner>
are your eMMCs (on puma etc) removable?
<qschulz>
tlwoerner: no
mmu_man has quit [Ping timeout: 272 seconds]
<qschulz>
tlwoerner: and before you ask, I don't have a heatgun :)
<tlwoerner>
out of curiosity, how do you flash them?
<qschulz>
tlwoerner: rkdeveloptool through a USB OTG port
<tlwoerner>
yuck
<qschulz>
rockusb from collabora-rockchiprs also works
<tlwoerner>
wasn't aware of that one
<qschulz>
though this USB thing works well only if your board manufacturer added a mechanism to disable the eMMC
<qschulz>
otherwise... you can brick your device without being able to recover it
<qschulz>
(we have a slider that cuts the data lines)
<tlwoerner>
agreed! i like that the modules on some boards are removable
<qschulz>
another option is to boot from SD card, somehow load the images to flash in RAM, and then flash them on the eMMC
<tlwoerner>
but i need to find a module that my rock-3a and rock-5a will like
<qschulz>
tlwoerner: yeah, I don't know if it's really a good thing to have removable eMMCs
<tlwoerner>
that's the "beaglebone black" workflow
<qschulz>
signal integrity and all that kind of stuff
<tlwoerner>
the http://radxa.com/products/zeros/zero3e/ looks pretty nice! small, rockchip, PoE, camera interface, no eMMC... could be the perfect basis for cameras
enok has quit [Ping timeout: 268 seconds]
ldevulder has quit [Quit: Leaving]
prabhakarlad has quit [Quit: Client closed]
enok has joined #u-boot
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #u-boot
f_[xmpp] has quit [Quit: Gateway shutdown]
enok has quit [Ping timeout: 240 seconds]
<tlwoerner>
qschulz: u-boot 2024.01 + SPL_DM_SEQ_ALIAS + Ben Wolsieffer patch (with your extra debug output) works PERFECTLY on rock-pi-4b via both sdcard and emmc
f_[xmpp] has joined #u-boot
enok has joined #u-boot
<tlwoerner>
qschulz: however, it doesn't seem possible to assign a label to a "rawcopy" partition, even if its type is marked "ext4" (instead of "none")
GNUtoo_ is now known as GNUtoo
Clamor has quit [Ping timeout: 264 seconds]
enok has quit [Ping timeout: 252 seconds]
Clamor has joined #u-boot
KREYREN has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
<tlwoerner>
qschulz: YES! --part-label works → /dev/disk/by-partlabel/u-boot-env
<tlwoerner>
oops, --part-name (in wic)
Clamor has quit [Read error: Connection reset by peer]
prabhakalad has quit [Ping timeout: 268 seconds]
prabhakalad has joined #u-boot
prabhakalad has quit [Ping timeout: 252 seconds]
prabhakalad has joined #u-boot
gsz has quit [Ping timeout: 255 seconds]
gsz has joined #u-boot
mmu_man has joined #u-boot
naoki has joined #u-boot
prabhakalad has quit [Ping timeout: 268 seconds]
prabhakalad has joined #u-boot
rvalue has quit [Ping timeout: 255 seconds]
stefanro has quit [Ping timeout: 240 seconds]
jfsimon1981_c has joined #u-boot
jybz has quit [Remote host closed the connection]
jybz has joined #u-boot
stefanro has joined #u-boot
redbrain has quit [Read error: Connection reset by peer]
redbrain has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
wooosaiiii has quit [Remote host closed the connection]
wooosaiiii has joined #u-boot
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #u-boot
stefanro has quit [Ping timeout: 272 seconds]
slobodan has quit [Ping timeout: 256 seconds]
stefanro has joined #u-boot
KREYREN has quit [Remote host closed the connection]