Boot alarm from u-boot on XE303C12.

This forum is for supported devices using an ARMv7 Samsung SoC.

Boot alarm from u-boot on XE303C12.

Postby ericgreenwood123 » Sun Jun 02, 2019 7:50 pm

Hi,

I've wiped my SPI (don't ask how or why :) ), and then put solder bridges on and installed nv_image-snow.bin on an sd card, as per these instructions:
https://archlinuxarm.org/forum/viewtopic.php?f=60&t=11812
now when I turn it on I get into a U-boot prompt.

There is no OS on my eMMC.

Is there any way to flash the SPI from U-boot, or otherwise how can i tell U-boot to boot from a usb stick with the ALARM tarball on it to then reflash a working U-Boot to my SPI?

Or any other ways to get it to boot ;) ?

Thanks in advance,
Eric.
ericgreenwood123
 
Posts: 4
Joined: Fri May 17, 2019 7:57 pm

Re: Boot alarm from u-boot on XE303C12.

Postby summers » Mon Jun 03, 2019 9:42 am

Depends on what your uboot has been set up with. Whats easiest (if set up) is to enable the ethernet in uboot, then tftp the root image into memory, then write the memory to the flash.

Think you can find the instructions on the uboot somewhere.

If you can't do ethernet, then you can modem the root image across the serial port - this will be very slow, so far better if you can get the ethernet up ....

Another approach, how hard is it to pop the flash/hdd? If you can get it out of the case easilly, can you mount it on another machine and write the root image to it?
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Boot alarm from u-boot on XE303C12.

Postby summers » Mon Jun 03, 2019 10:07 am

Bit more investigation. You don't have an ethernet port, so thats a non starter. But you do have access to the sd card.

What you'll need to do is to write a kernel image to a known position on the sd card, and the root filesystem to a second partition.

Then in uboot, you can load the kernel from the sd card into memory, and boot it pointing at the root fs. That should boot.

Check if uboot has "bootz" or "bootm" etc - e.g. can you boot zimages, do they have to be uimages, etc - and you'll need to package the kernel in the right way ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Boot alarm from u-boot on XE303C12.

Postby ericgreenwood123 » Mon Jun 03, 2019 9:39 pm

Thank you for your reply,

Sorry for my ignorance, I'm a newbie.

'bootz' is not available, 'bootm' is. Guess that means it has to be a uImage?

I am already running U-boot off the sd card, but i'm guessing it'll be in the first part (the command i did to write the sd card was $this->bbcode_second_pass_code('', 'dd if=nv_image-snow.bin of=/dev/mmcblk1 bs=512 seek=1') as instructed in the forum i linked previously.), so if i put the other partitions about 10MB in then it shouldn't be overwritten.

I also have a USB to Ethernet dongle, but I'm guessing it would need drivers so wouldn't work in U-boot??

I wouldn't be able to access the flash memory externally.

I have got a tarball designed for this device from the ALARM website, with a *.kpart which could be booted by the verified U-boot in the factory setup, could that be booted by non-verified U-boot?

And if so, this is the tutorial i followed to write the original SD card setup: https://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook
you use $this->bbcode_second_pass_code('', 'cgpt add -i 1 -t kernel -b 8192 -s 32768 -l Kernel -S 1 -T 5 -P 10 /dev/mmcblk1') and $this->bbcode_second_pass_code('', 'cgpt add -i 2 -t data -b 40960 -s `expr xxxxx - 40960` -l Root /dev/mmcblk1') to add the two partitions, what numbers would i have to change to put them 10 mb forward?

and then how would i load the kernel in U-boot?

Thank you,
Eric.
ericgreenwood123
 
Posts: 4
Joined: Fri May 17, 2019 7:57 pm

Re: Boot alarm from u-boot on XE303C12.

Postby summers » Tue Jun 04, 2019 9:28 am

Lets see if I can remember uboot commands $this->bbcode_second_pass_code('', 'bootm') IIRC boots a uImage from memory. $this->bbcode_second_pass_code('', 'boot') IIRC boots a zImage/Image from memory.

So what you need to do is load the kernel from the sd card to memory, then run the relevant bootm/boot command.

Now to load from sd card, if you have a modern uboot then something like $this->bbcode_second_pass_code('', 'ext4load mmc 1:1 ${kernel_addr_r} /boot/uImage') to load from first partition on mmc 1, so first mmc. You can probably see what devices you have with a command like $this->bbcode_second_pass_code('', 'mmc') which IIRC lists the mmc devices, can do similar things with usb. think $this->bbcode_second_pass_code('', 'load') loads straight from a location on the relevent device - but forget. You can check with $this->bbcode_second_pass_code('', 'help load').

These days most uboot use the distro set up, this means that uboot by default looks for files on the main filesystem, and uses these to configure the system and boot. This makes it simple for OS to set up.

What would probably help is in uboot look carefully at $this->bbcode_second_pass_code('', 'printenv') and $this->bbcode_second_pass_code('', 'help') - these wil show what you have configured, so what you can use ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Boot alarm from u-boot on XE303C12.

Postby ericgreenwood123 » Tue Jun 04, 2019 3:20 pm

Thanks,

I have a 2011 U-boot, with ext2load, but no ext4load.
also the command 'load' isn't there.

I have managed to get U-boot onto my SPI, by using a built-in script sd_to_spi.

when i type both 'help', and 'printenv' it loads a list which goes off the top of the screen. any way to scroll up?

I am going to re-write the ALARM SD card and see what happens, will update when finished.

Eric.
ericgreenwood123
 
Posts: 4
Joined: Fri May 17, 2019 7:57 pm

Re: Boot alarm from u-boot on XE303C12.

Postby summers » Tue Jun 04, 2019 4:57 pm

$this->bbcode_second_pass_code('', 'ext2load') means it can load from an ext2 partition / so you'll need a /boot like that. my NSA325 is set up like that - I'll check it set up when I get home and give the commands and file structure that you need.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Boot alarm from u-boot on XE303C12.

Postby ericgreenwood123 » Wed Jun 05, 2019 9:14 pm

I tried booting the SD card, but i couldn't load it, if you can tell me how to set it up with ext2 that would be very useful.

Thank you,
Eric.
ericgreenwood123
 
Posts: 4
Joined: Fri May 17, 2019 7:57 pm

Re: Boot alarm from u-boot on XE303C12.

Postby summers » Thu Jun 06, 2019 3:00 pm

OOps yes - never gave final reply. My arm machines at home, all but one use the distro set up - and thats easiest. So probably when you get things working would be an idea to compile a modern uboot with distro support.

Anyway my NSA325 is still predistro, but does have ext4 support. So I'm doing a whole lot of this on memory.

On your sd card, you want to set up two partitions, that don't collide with uboot - so take note of where you put that on the sd card.

Make the first partition the /boot partition, it can be quite small few MB IIRC. Format that as ext2

Make the rest of the sd the second partition and that is the root partition /; format it as ext4 and install the arch root fs on that partition. Then copy the whole contents of /boot into the first ext2 partition.

Examine /boot and see what you'll need probably /boot/zImage, and a device tree blob - find the right one in /boot/dtbs

Now when you boot into uboot - hopefully you'll have some variables like:

$this->bbcode_second_pass_code('', 'fdtaddr=0x800000
loadaddr=0x810000')

Hopefully you can access the sd card, you'll need a command like $this->bbcode_second_pass_code('', 'mmc reset'), then can access with something like $this->bbcode_second_pass_code('', 'ext2ls mmc 0 1')
So you'll have to specify device from mmc,usb,ide etc - which number device that is, so first (and only) mmc card. Finally which partition to access, the first - the one than is ext2 formatted.

Having found out where your boot files are, load the image and device tree blob
$this->bbcode_second_pass_code('', 'ext2load mmc 0 1 ${loadaddr} zImage
ext2load mmc 0 1 ${fdtaddr} dtbs/dtb.dtb')
Where you'll need to give the right device tree - so at this stage kernel and device tree will be in memory.

Check that bootargs is set correctly, so do something like:
$this->bbcode_second_pass_code('', 'setenv bootargs console=${console} ${mtdparts} root=${root} rw rootwait ${optargs} ${ncargs}')

So console points to your screen and keyboard, root points to your second partition, and any other options you need to pass to the kernel on boot.

Then
$this->bbcode_second_pass_code('', 'bootz ${loadaddr} - ${fdtaddr}')

And with any luck it will boot. But if any stage doesn't work, look at what didn't work, and why - and figure out how to fix.

Sorry this isn't an exact answer - its just a rough sketch of the journey to take, but enough if you look out for signs on the way, notice where the sun rises, the direction of the big dipper at night, like the slaves in the south, you'll find the north and escape ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm


Return to Samsung

Who is online

Users browsing this forum: No registered users and 7 guests