<NonaSuomy>
Or some part of memory that the processor has inside the package?
<marex>
6.5 Boot Devices (Internal Boot)
<marex>
6.5.3 Expansion Device Support
<marex>
seems like eMMC normal boot
<marex>
so it likely loads U-Boot from raw eMMC offset 2 sectors from the start (?)
hthiery has joined #u-boot
<NonaSuomy>
Ok so I remember someone saying that there is a raw partition at the start of the eMMC so when I deleted the partitions one by one I probably just never hit that raw section
<NonaSuomy>
There was 10 partitions and deleted them backwards 10,9,8,etc
<marex>
this is not a partition
<marex>
there is raw u-boot.imx written at some offset
<marex>
on imx5 it was I think 2 sectors (offset 1kiB from start of storage)
samueldr has joined #u-boot
<NonaSuomy>
I'm meaning unpartitioned space at the start of the eMMC
JBB[m] has joined #u-boot
<marex>
try ... uh ... dd if=/dev/mmcblkX bs=512 skip=2 count=1 | hexdump -vC , I think there should be the imx header there
<marex>
6.6.1 Image Vector Table and Boot Data see here
<NonaSuomy>
I currently only have access to uboot on the device
<marex>
help mmc , is there mmc read ?
<NonaSuomy>
yes
<marex>
use it to read sector 2 to DRAM and then md the address
<marex>
you should see the U-Boot there
<marex>
err, the imx header there, the U-Boot is a bit further past that
mrnuke has quit [Read error: Connection reset by peer]
mrnuke has joined #u-boot
akaWolf has quit [Ping timeout: 260 seconds]
akaWolf has joined #u-boot
guillaume_g has joined #u-boot
<hanetzer>
hrm. for some reason I'm getting an error redefinition of clk_get_by_name_nodev and clk_release_all, but none of the code I've written even makes reference to that.
<hanetzer>
in clk-uclass.c
prabhakarlad has joined #u-boot
mlaga97 has joined #u-boot
<hthiery>
does anyone know if the HAB API on imx8 will work when using the upstream TF-A firmware. We see e.g. hab_auth_img command fails . The same works without issues when using downstream TF-A from NXP.
<hanetzer>
ah, the problem arises when SPL_CLK is selected, hrm.
<crb>
where does the ioAlign efi parameter get set?
camus has quit [Remote host closed the connection]
monstr has joined #u-boot
camus has joined #u-boot
<hanetzer>
anyone know offhand where in the rockchip (rk3288 or rk3399) boot path tthe cru/clock hw is instantiated? having trouble finding it
mmu_man has joined #u-boot
<hanetzer>
ohhh. from the looks of it, its indirectly called from the ram init?
<NonaSuomy>
without modifying the original uboot that is normally pointed at a linux kernel?
<hanetzer>
I mean, you can load it to ram and go addr
sszy has joined #u-boot
ilunev has joined #u-boot
torez has joined #u-boot
prabhakarlad has quit [Quit: Client closed]
NonaSuomy has quit [Ping timeout: 246 seconds]
NonaSuomy has joined #u-boot
<rfs613>
NonaSuomy: does the existing u-boot also reset after 30 seconds?
<NonaSuomy>
yes
<NonaSuomy>
was going to try to compile this flag into uboot #define CONFIG_I2C_MULTI_BUS 1
<NonaSuomy>
then quickly boot that then paste the i2c watchdog debug command we spoke about
<NonaSuomy>
Not sure I will have enough time but eh something to try.
<rfs613>
yup, understand the idea... however you might have some challenges to "restart" uboot from the beginning. For example it normally starts to initialize DDR and then copy itself there (relocation).
<hanetzer>
yeah. theres a lotta fuckery involved.
<rfs613>
that's a good way to put it ;-)
<NonaSuomy>
What would you suggest?
<hanetzer>
I'm neck deep in fuckery myself tbh :P
<hanetzer>
trying to get enough of clockshit done enough to get uart output on this device :P
<hanetzer>
plls are fun.
<NonaSuomy>
How do I compile select the config I modified make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j8 mx50_arm2
<NonaSuomy>
?
<NonaSuomy>
make: *** No rule to make target 'mx50_arm2'. Stop.
<rfs613>
NonaSuomy: first you configure, then you build.
<rfs613>
do you have configs/mx50_arm2_defconfig in your tree?
<NonaSuomy>
mx50_arm2.h
<rfs613>
thats include/configs/mx50_arm2.h, which is not the same as the defconfig
<rfs613>
(but both contain various settings)
<NonaSuomy>
where is this second configs folder?
<rfs613>
at the top level, "configs", it contains a whole bunch of *_defconfig files
<hanetzer>
rfs613: think thye're using old vendorboot, not mainline.
<rfs613>
what, it just compiled on 1st try? Take the rest of the day off! :P
<NonaSuomy>
haha
<NonaSuomy>
so if I toss this on the root of the sdcard what would I need to tell the original uboot to swap to it?
<rfs613>
well just like loading a kernel or anything else, you can get the existing u-boot read it into memory, and then jump to it.
<rfs613>
but this will almost certainly not work, because of the previuosly mentioned complications, the new u-boot will attempt to reconfigure DDR (where it is located)
<rfs613>
along with numerous other things, such as enabling caches
<rfs613>
can you pastebin a full boot (u-boot and kernel, as far as it gets)?
<rfs613>
that looks like it may be replaying an earlier boot log that it stored in RAM
<rfs613>
but let's back up a moment.
<rfs613>
the earlier log, you loaded the stock kernel (I think) but no ramdisk
<rfs613>
there was no output after 'starting kernel' which is odd, but, this kernel will for sure hang/crash becase it has no rootfs. So it will just sit there and watchdog would reset the board.
<rfs613>
now when you booted SD card, we can see some stuff including "MXC WatchDog Driver 2.0"
<NonaSuomy>
So if I had a rootfs for my custom kernel I probably wouldn't be in this fight with the watchdog.
<NonaSuomy>
?
<rfs613>
sort of... the existing kernel evidently has driver support for the watchdog, and the rootfs seems to start up some program to keep the watchdog happy.
<NonaSuomy>
The first log is when I tried to boot my custom kernel the second is a stock boot and the third is a stock boot but from the sdcard where the console is always 4 instead of 2 so you get more information.
<NonaSuomy>
and yes that was what I was trying to show you with the watchdog message that takes over.
<rfs613>
and your idea of disabling watchdog in u-boot is good, but difficult because u-boot only talks one I2C bus, and its' the wrong one.
<NonaSuomy>
correct
<rfs613>
so does your custom kernel include a driver for the watchdog chip?
<NonaSuomy>
my custom kernel is the stock kernel + busybox compiled into it as I was just trying to get a cli prompt
<rfs613>
ok, fwiw, I would just try booting with init=/bin/sh as a first step, that might get you a cli using stock rootfs
<rfs613>
(and it would probably reset after 30sec because there is nothing feeding the watchdog)
<NonaSuomy>
I had to pare it down to 2.1M as it was 3.5M or around there after busybox was compiled in.
<NonaSuomy>
I was doing this dd if=uImage of=/dev/mmcblk0 bs=512 seek=2048
<NonaSuomy>
and then telling env to boot from there.
<rfs613>
my concern is with you custom kenrel, there seems to be no output at all, so we dont' know what it is doing
<rfs613>
wheras the stock one is at least printing lots of boot messages
<NonaSuomy>
Agreed so after that I tried to compile in earlyprintk into the kernel but that code is broken in 2.6.35.3
<NonaSuomy>
I'm sure it needs rootfs to process properly
<NonaSuomy>
as you said.
<rfs613>
you should have kernel boot messages regardless of rootfs
<NonaSuomy>
ok one moment
<rfs613>
but for the watchdog, normally there is a userspace program ("watchdogd") that runs and periodically makes a call to the kernel's watchdog driver, which then kicks the actual hardware so it won't reset the CPU.
<NonaSuomy>
so this was what I was getting before when I still had a rootfs in place.
vagrantc has joined #u-boot
<NonaSuomy>
and all the eMMC partitions
<NonaSuomy>
it would then watchdog after Initialize a static memory for mix_logger.
<rfs613>
so this shows the early boot
<NonaSuomy>
What does that mean?
<rfs613>
but it seems that after switching bootconsole to ttymxc2, you are not seeing normal kernel messages anymore.
<rfs613>
there are a few more prints (not sure where those are coming from), but typically there are many more kernel drivers that probe, and eventually, you will see it preparing to switch to userspace (VFS mounted root)
<rfs613>
compare it with the SD boot log you posted earlier.
<NonaSuomy>
I think we tried to change this to console=ttymxc4 like what happened with the ext sd boot above but I can't remember if it just got stuck at the same message
sszy has quit [Ping timeout: 260 seconds]
<rfs613>
you should see a lot more output (like the SD boot)
<NonaSuomy>
Do you think it will be possible to boot from the SDCard again with no internel eMMC partitions?
<rfs613>
can't say for sure, but the SD boot log looks encouraging.
<rfs613>
the SD boot looks fairly complete, the only think missing is a login prompt. (Maybe it is on ttymxc2 instead of mxc4)
<rfs613>
you could try init=/bin/sh trick to bypass that, this would give you a limited shell directly on the boot console
<NonaSuomy>
Let me reflash this sdcard I just keep seeing 2.1M instead of the stock 2.2M kernel.
<NonaSuomy>
There is a 25MB unalocated disk space at the start of the drive is this a common practice?
sobkas has joined #u-boot
<marex>
why dont you just boot Linux and let it ping the WDT ?
<marex>
(you can always try and poke the I2C controller registers using 'mw' command and trigger transfer to the WDT that way too)
<NonaSuomy>
So the only way to get a proper console on this device was to load a custom sd recover image that required you to hold home + menu on the device. Since I broke the eMMC partitions I can no longer get it to see this recovery card as I think it needed the eMMC recover partition to tell it how to handle this sd recovery.
<marex>
which is probably something handled in $bootcmd, no ?
<NonaSuomy>
I'm willing to try anything with thought the first step may be to see I Can get this stock image booting again from the SDCard. The external watchdog will basically reset the device after 30 seconds so whatever your thoughts are would have to be completed in that time frame unless we know how to pet it.
<rfs613>
NonaSuomy: let me know if init=/bin/sh works... you may not get much time, but let's see if you get a shell prompt appearing.
<rfs613>
marex: question for you about adding RZ/N1 clock driver... I plan to add it to drivers/clk/reneasas, with a new CONFIG_CLK_R9A06G032 symbol obviously.
<rfs613>
There's a small problem, in order for makefile to recurse into drivers/clk/reneasas, I have to define CONFIG_CLK_RENESEAS, which cause renesas-cpg-mssr.c to be compiled
<rfs613>
I don't really need that file, but the real issue is the renesas_clk_remove() function in there, has base address TMU_BASE which is platform specific I think
<NonaSuomy>
This board has an 8bit reneasas microprocessor on it.
<NonaSuomy>
I'm not sure what it does it's beside the SDCard slot
<NonaSuomy>
I hope that is not the watchdog.
<NonaSuomy>
do you think init=/bin/sh will work with no kernel booting?
<NonaSuomy>
3 more mins for the stock sd image flash
<NonaSuomy>
## Booting kernel from Legacy Image at 70800000 ... Image Name: Recovery Kernel
<marex>
rfs613: the u-boot clock are modeled after the linux clock, so whatever linux does for rzn1, do it in u-boot the same (or similar_ way
<NonaSuomy>
endless kernel panic repeat at the end there.
<rfs613>
NonaSuomy: the kernel command line was changed to root=/dev/mmcblk2p1 rootfstype=ext4 rw rootwait init=/linuxrc console=ttymxc4,115200 bootdev=2 rawtable=0xF40000
guillaume_g has quit [Quit: Konversation terminated!]
<NonaSuomy>
Not sure how to prevent init= from changing that while it switches to the recovery kernel from holding those buttons.
<NonaSuomy>
Maybe while holding I can still trigger the hit any key to stop autoboot: 0
<NonaSuomy>
then add it back then it boots the recovery kernel
<rfs613>
NonaSuomy: i wonder if it is doing somethign else besides changing the commandline. Because all of the root-related parameters only come into play later in the boot (eg. you should get some kernel messages regardless), the only one that matters at the beginning is console=
<rfs613>
marex: in linux drivers/clk/renesas is recursed unconditionally, and the renesas-cpg-mssr.c file depends on its own config symbol (CONFIG_CLK_RENESAS_CPG_MSSR)
<NonaSuomy>
seems to ignore the serial terminal input while I'm holding the home + menu key on the device so it just goes past that hit any key prompt.
<NonaSuomy>
This is the guy that I got the SDCard boot process from
<marex>
rfs613: see ;-)
<NonaSuomy>
If it sheds any light
<NonaSuomy>
In his python script you can see him setting the env
<NonaSuomy>
I wonder if the recovery kernel is disabling the watchdog some how.
<NonaSuomy>
as it just sits there panicing forever after that point
<rfs613>
NonaSuomy: this is the classic "VFS cant find root filesytem" problem
<rfs613>
booted with root=/dev/mmcblk2p1 on kernel commandline
<rfs613>
but there is no such device found when kernel finishes its boot
<rfs613>
it only found a bunch of mmcblk0 partitions (likely the eMMC)
<rfs613>
it also detected mmcblk2 but there are no partitions on there
<NonaSuomy>
Yes mmcblk0 is the eMMC and mmcblk2 is the sdcard slot
<rfs613>
mmcblk2: mmc2:0001 SEM02G 1.82 GiB
<rfs613>
mmcblk2:
<rfs613>
so there's a device, without any recognized partitions, and this asking to boot mmcblk2p1 cannot work
<rfs613>
earlier, you were booting from SD and getting further (to userspace)
<NonaSuomy>
before I corrupted the eMMC I was able to get this SDCard stock image to boot yes after that no go.
<NonaSuomy>
I just flashed it fresh to the sdcard again now as It was looking like I modified it as it was showing the kernel as 2.1M which was the one I built before the stock kernel is 2.2M which it is reporting now.
<NonaSuomy>
If I look at the SDCard I see all the proper partitions
<NonaSuomy>
I think recovery mode (Home+Menu) doesn't know where to point proper to the SDCard partitions now.
<rfs613>
that would be rather odd and unusual. The partition information is typically stored on the first block of the device (the SD card itself).
vagrantc has quit [Quit: leaving]
___nick___ has joined #u-boot
<NonaSuomy>
The only step I can't complete now is where he copies u-boot from the sd image over top of the eMMC u-boot partition.
ilunev has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rfs613>
353kB of html+javascript, says "The file you requested has been deleted" (I miss the old 404 not found...)
<rfs613>
anyhow, the env files are basically just null-terminated strings. You can use "strings" command to extract those, then compare using your favourite tool (meld, kdiff, vim, etc)
<NonaSuomy>
So maybe I'm backward 0 is the SD and 2 is the eMMC
<NonaSuomy>
That would make sense why it couldn't find partitions on blk2 and recommended blk0
<NonaSuomy>
So can we load all of that into the setenv?
<rfs613>
you could, but the only real difference is in bootcmd, when it uses "mmc read" to get kernel and ramdisk. Old loads from device 2 and new loads from device 0.
<rfs613>
(and the size of ramdisk is slightly bigger in the new one)