WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: A10 boot files  (Read 41615 times)

Offline athouston

  • Full Member
  • ***
  • Posts: 143
A10 boot files
« on: July 19, 2013, 02:17:14 AM »
I have a working MK802 1GB stick using the boot from sd card method. I am investigating how to load it on the internal nand but I am confused about some of the file relationships. I also want to try and implement TCL on other devices so I am trying to get "really techo".

My mmcblk0p1 partition contains the following files:

boot.scr
script.bin
uCore
uEnv.txt
uImage

The files I "dd'd" to the card were:

A10Core.img
sunxi-spl.bin
u-boot.bin
script.bin

What file became what (ie. what translation occurred) and what are the files for.

Thanks in advance..


Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #1 on: July 19, 2013, 02:17:34 PM »
sunxi-spl.bin
u-boot.bin
boot.scr
script.bin
uCore
uEnv.txt
uImage
All of the above are in A10Core.img. The current A10Core.img is for the Marsboard A10.

sunxi-spl.bin
u-boot.bin
These two files are the board specific boot loader files, used to initially boot from sdcard.
They are typically static and are located at specific sector and offset locations.
Code: [Select]
dd if=sunxi-spl.bin of=/dev/sdX bs=1024 seek=8
dd if=u-boot.bin of=/dev/sdX bs=1024 seek32

boot.scr
script.bin
uCore
uEnv.txt
uImage
The aove are the release files, They are visible in the first partition.
boot.scr is used by u-boot to boot the kernel and initrd.
script.bin is also typically board specific describiing features that the board supports..
uImage is the kernel, uCore is the rootfs as an initrd compressed cpio.
uEnv.txt is for additional boot parameters (extraargs), i.e, to declare the location of tce directory tce=, the timezone specs, tz= ...
10+ Years Contributing to Linux Open Source Projects.

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: A10 boot files
« Reply #2 on: July 19, 2013, 09:44:48 PM »
OK. So we put the A10core image on the target and replace the Marsboard u-boot and sunxi files with the board specific versions.

Q1. Are the u-boot and sunxi files the standard files that come on the target device or do we modify them for TCL.
Q2. What happens to sunxi-spl.bin. I cannot see it on either of the TCL partitions or on any of the MK802 nand partitions.

The only other question is regarding the actual boot process.

When we power on the device the chip firmware must have a command to load a program at a specific location in order to start the boot process. On a device with onboard nand this location is obviously somewhere there. When we boot from the external sd card how do we tell the chip to use this boot location.



Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #3 on: July 20, 2013, 12:56:12 AM »
Re: Q1
The hardware section see http://tinycorelinux.net/5.x/armv7/hardware/  was made by compiling u-boot for Allwinner. It contains a list of supported hardware.
https://github/com/hno/uboot-allwinner

Re: Q2
Not seen as it is written to specific sector see prior dd command.

boot.scr is a set of commands for u-boot. It determines what and how to boot. This allwinner version looks at the first fat partition from external sdcard for script.bin and also the kernel. It is "compiled" and "decompiled" with mkimage command.

script.bin is a configuration file of hardware specifics "compiled" with fex2bin and "decompiled" bin2fex

Typically you can use the script.bin from your specific board.

uEnv.txt can override some boot paramters specified in boot.scr and is where Core specific boot parameters are located.
« Last Edit: July 20, 2013, 12:58:54 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Would you please describe for me, how can I change or define the Marsboard pins setting for gpio or SPI functions?

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #5 on: July 29, 2013, 05:55:57 PM »
Perhaps perusing Marsboard specific sites would be helpful as Arduino, electronic prototyping, is beyond the scope or intent of Core.
10+ Years Contributing to Linux Open Source Projects.

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: A10 boot files
« Reply #6 on: August 04, 2013, 03:25:15 AM »
OK. I think I now have the boot process down pat, thank you. I have followed forums on a number of other sites as well to cover off my knowledge.

I see your comments regarding mkimage and fex2bin, etc. I found mkimage in the u-boot tools tcz but I cannot find any package that provides bin2fex / fex2bin.

Q1. Is there a tool chain tcz that contains the files I need (that I just haven't found) or do I have to get it from somewhere else?

Q2. Is there a good "user guide" to these programs?

I am determined to work through this so I can "roll my own" system rather than bothering someone else all the time.

Cheers.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #7 on: August 04, 2013, 11:42:59 AM »
fexc aka bin2fex fex2bin can be found here.
https://github.com/linux-sunxi/sunxi-tools/

There is no user guide that I am aware of.
I have created my own script to create bootable sdcard images via a selection of the supported board types that I have compiled u-boot.
10+ Years Contributing to Linux Open Source Projects.

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: A10 boot files
« Reply #8 on: August 04, 2013, 05:55:26 PM »
Thanks, I'll play later today.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #9 on: August 05, 2013, 03:10:39 PM »
Hi,
I need a Masrsbord [a10Core.img.gz] image with GPIO & SPI enabled.


I used [linux-sunxi-g2d.zip] as <linux-sunxi> directory at <Sunxi-Bsp> (downloaded from github) root and compiled all of them with [make] after setting Ugly GPIO & SPI with [make linux-config] application.

But after making [a10_mid_hwpack.tar.xz] at <output> I can not transfer [a10Core-20130712.img.gz] and [a10_mid_hwpack.tar.xz]
with the following command:

$sudo sh ./scripts/sunxi-media-create.sh  /dev/sda  ./output/a10_mid_1gb_hwpack.tar.xz  ../a10Core-20130712.img.gz

 to SD card for the following reasons:

1- The current core does not support [tar v1.22] for *.tar.xz !

2- The  [sunxi-media-create.sh] script file does not support *.img.gz for image transferring of current core!

3- After importing [dosfstools] for [mkfs.vfat] , this command makes "/dev/sda: path not found " error when run from script file but its correct when run from command promt!

How can I enable GPIO and SPI for current core image? please help me about these problems.

Thank you.
« Last Edit: August 05, 2013, 03:45:19 PM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #10 on: August 05, 2013, 04:41:43 PM »
Looks like you are trying to use some Linaro Ubuntu scripts?
If you used the kernel config from git hub then it will not work with Core.
If you have compiled your kernel with a10Core-kernel.config and added your specific requirements then if all you have is a new kernel uImage then copy to your sdcard and test.
If you have made new modules then unpack uCore is a gzipped cpio and add the modules and repack then copy to sdcard and test.

10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #11 on: August 05, 2013, 11:00:56 PM »
Dear robert,

Would you please tell me how to enable  GPIO and SPI functions and make an image for Marsboard (a10_mid_1gb)  with image [a10Core-20130712.img.gz] ? 

I don't know how to config [a10Core-kernel.config] file and compile it with source of TCL (linux-sunxi-g2d.zip) for image (a10Core-20130712.img.gz) to enable GPIO and SPI functions.

Would you please describe how to modify  [a10Core-kernel-3.0.42.config] file and compile it with source of TCL in step by step ?

Thak you.
« Last Edit: August 05, 2013, 11:19:34 PM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #12 on: August 06, 2013, 10:53:02 AM »
Please see: http://forum.tinycorelinux.net/index.php/topic,13827.msg78685.html#msg78685
Use this as your starting .config http://tinycorelinux.net/5.x/armv7/a10Core-kernel.config
then using make menuconfig to set your specific requirements, GPIO & SPI

« Last Edit: August 06, 2013, 11:03:33 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #13 on: August 06, 2013, 02:00:22 PM »
persian,

If you would rather just have the modules you need, then please specify then in the a10Core-kernel.config and I will compile those modules and create an after boot loadable extension.

If successful, then in kind, I would ask you to post here in our forums how you use GPIO and SPI.
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #14 on: August 06, 2013, 03:10:37 PM »
Dear Roberts,

Thank you for your replies to my questions.

I wish to use Ugly GPIO driver functions and also SPI functions, but I am beginner in linux and I decided to learn how to write programs for device drivers in linux with the help of [The linux programming interface] book and [ Writing device drivers in Linux_ A brief tutorial ] paper.

I want to write driver for my designed hardware devices.

Would you please enable for me GPIO and SPI functions for the [a10Core-20130712.img.gz] TCL image?

My arm training device is Marsboard [a10_mid_1gb].

I wish to learn the steps of modifying kernel and make TC linux image too.

I done your guided steps but I get the following error:


tc@box:/mnt/mmcblk0p2/tce$ ./arm-2010.09-50-arm-none-linux-gnueabi.bin
Checking for required programs: awk grep sed bzip2 gunzip
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
strings: '/lib/libc.so.6': No such file

Launching installer...

/mnt/mmcblk0p2/tce/install.dir.13202/Linux/resource/jre/bin/java: line 1: syntax error: unexpected "("


Thank you

« Last Edit: August 06, 2013, 03:19:19 PM by persian »