Uboot gcc arm development


Eddie

Member
Joined
Mar 24, 2007
Messages
168
Age
32
Ive been gone while, busy losing job, ect. Anyways still studying my ass off linux. I have ran into a few things that blow my mind. I know you openpandora guys know whats going on.

I requesting information about how one would go about programming the uboot for the pandora with no knowlege of the hardware or the information given to them. I have my reasons.

Edit* This uboot code makes me want to hang myself, it's like this big blob of bs that no one seems to be - example only supports the hardware were the hardware makers release support for it. Otherwize it appears that they just unencrypt the android blob and use it to get linux running. Or translate the blob into linux gcc.

If this is really whats going on it seems like a waste of effort and an unwinable war aginst the corporations and organizations that run this bull. How can one trully learn the interworkings if it revolves around hardware that one can never really know the interworkings of... you CANT. Not only that but it is just like the car industry were once they stop producing a model you can no longer get parts, ect.

I am interested in running my own arm assembly code and debuging on a rockchip processor (MK808) that I soldered a usb to serial to but because the uboot code is not set up. Indirect displacement.. I am interested in doing this on the pandora that I own that is debugging and running some had crafted arm assembly, does this require uboot to be set up or will the processor run it without? What do I need to do to set this up.

I was reading that with the assebly I can do some pretty interesting things
 
Last edited by a moderator:
First I would like to know if the boot processes is required for the assembly to be run on the processor. Hardware initalization and such.

I am not interested in running assembly on an os.  I understand that of couse assembly can run because it is what is used to start the bios/post like startup.
 
Last edited by a moderator:
First I would like to know if the boot processes is required for the assembly to be run on the processor. Hardware initalization and such.

I am not interested in running assembly on an os.  I understand that of couse assembly can run because it is what is used to start the bios/post like startup.
You can load a file from flash in uboot (cp command) and you can start running it (go command). You can make uboot's default script do this. Now you have a very simple bootloader that you can easily run your code with. Doing this straight from the processor's boot instead of using uboot where available is possible but will require much more hardware specific coding and could require hardware specific methods of loading your code. By sticking with uboot it's easy to go back and forth between your code and a proper OS. I can't see a good reason why you'd prefer to boot code directly (then again, you probably don't have a good reason to want to run OS-less...)

uboot does do some initialization, for instance setting clock speeds, enabling caches, setting SDRAM.. how much you need it depends on what you're doing. Without knowing what your goals are we can't really answer anything. Once your code is out of uboot you'll have to interface all hardware directly. So you'll have to know the low level register interface for the hardware. What you need to know again depends on what you'll need to do, but it's impossible to do anything at all without at least interfacing with some I/O like a UART. I hope you have the RK3066 technical reference manual handy.
 
I have been reading about the features of uboot and all that it can do, but that requires the board and processor to have support. I have found what appears to be the RK3066 technical reference manual and I have the Arm cortex technical reference manual. Also I found were someone has wrote scripts that pull the hard setting for the andriod uboot. It appears that after you run his scripts and get the code, you then have to read the code and translate it to the gcc arm compiler. While I have all the files and understand the concepts behind this I don't even know were to start as some of the code I'm going to have to spend days studying just to read... All I want is to learn this so that I can carry the knowlege to other devices. I get tired of waiting on others to set this stuff up and then I don't know anything and cant even help. I want to learn and change that.

When it comes to documentation about uboot it all surrounds the processor being supported, and maby even the board... But that means I have to buy there expensive dev boards and then I have the code handed to me, what is there to learn with that method?
 
Last edited by a moderator:
Sorry, but I'm having a difficult time understanding what you're saying..

From a little bit of searching it looks like uboot on MK808 is configured so it can be interrupted. So if you've wired serial input to it you just have to press some key and you'll be dropped into the uboot command prompt. From there you should be able to load a program from the SD card into memory then run the program. Of course you will need to know how to make that program. When making a flat binary program I will usually compile it with GCC with the -nostartfiles option, and use a custom link script to define where the sections should be. For a simple assembly program that's loaded into and executed from memory you can probably avoid doing that. You can use objcopy to link to a pure binary file.

I'd give you an example program and how to compile it but it's useless unless you're prepared to interface with the hardware in some way. Like sending a character through the serial port.
 
I performed this http://www.omegamoon.com/blog/static.php?page=mk808_serial_console and set up a consol. It show me the processor info when I plug into the usb power and it boots. I do not know if the processor can be interupted with key presses. I have erased the nand flash. As according to the documentation the processor should look to the sd or usb for a fat partion to boot off of. So I have eyes, I have tried a couple of bin files loaded onto the fat partions but nothing changes when it loads. In other words I don't know what I'm doing and I'm stuck, Thanks for taking the time.

Also I found an underground chinese video using some google syntax were they had uboot booting off this device and they had configured it to have a splash screen. But find training for this I have not been able. Also training I can take to any device not just this on device.

I have been tempted by the promise that the dev devices offer but I know they will just leave me brainless and take my money... I have a pandora so if there is a dev device I will learn off of, it will be the one. Otherwize leaning what is going on with this mk808 and how to make it happens seems a logical approach.
 
Last edited by a moderator:
I'm not 100% sure but indeed the nand is blank. It comes with android so if android uses uboot then yes it is erased. I have the tools to put all the data back so it is not lost. I have also gotten the picuntu to work and had issues with it as my model is mk808B. I ran a minecraft sever off it but the processor maxed out when to local comupters connected to it and the game was very laggy. Nonetheless it would make an ok server or desktop on the low end side.  That is if I can get uboot working on it, and booting from nand. But I'm not going to be able to boot to nand if I cant boot to sd.

Google this file RK3066_datasheet_brief.pdf

page 5 shows boot from following devices when I compaire this to the boot information from arm information from the begal bone black I belive this to be possible.
 
Last edited by a moderator:
I still think you shouldn't try to boot something directly from the device instead of uboot unless you have a really good reason. uboot will make it easier to manually boot something and will provide a lot of other useful tools. Once your thing program is running you still get full control again.

If uboot isn't configured with a countdown that lets you interrupt the boot process then it's at least possible to change it from within a Linux installation, see here: http://www.denx.de/wiki/DULG/HowCanIAccessUBootEnvironmentVariablesInLinux

You'd want to change the bootdelay variable to something that isn't 0.
 
That would proably work if the device was using uboot, but in this case they are using androids boot processes to load the linux kernal as an adroid recovery. So unless the is a ton of information about he android boot process code that I know nothing about This device does not have support in uboot yet. That is why I'm asking about the processor and how one would go about making the support for the device and other devices. I am interested in getting uboot on devices because from there everything eles can happen.

The only doc's I can find on uboot seem to be like. Uboot is great and here is what it works on. But in the case that it dosnt work on something that I want it to... what do I need to do?

Also were you saying there are tools withen linux so that when running picuntu I could use them to "probe" the hardware in order to make the files I need...? I know I still have much to learn.

Also I would like to point out that QEMU alows you to run the assembly and uboot but it sets up all the varibles with the hardware for you...
 
Last edited by a moderator:
To summarize..

You're wanting to write bare-metal code, on a processor you can't get documentation for?

Is the MK808 a processor or a box? I've seen the MK808 tv-box around, which in turn runs some other rockchip processor. (hmm, google would suggest RK3066.)

Looks like the RK3066 tech datasheet and some devkits and such are availabnle; first google hit fed me:

http://www.cnx-software.com/2012/11/04/rockchip-rk3066-rk30xx-processor-documentation-source-code-and-tools/

Now, I can certainly see the attraction in writing your own bootloader (crazy yet fun if thats your game.)  But you'll definately want good datasheets before you get started, otherwise you're just wasting your time. If you can't get datasheets, get another chip to work on that you can. Then again, if you're out of work etc, and have the chip... sure, I see it. But expect a fight if no datasheets!

But if its the RK3066, then it looks like you can get the datasheets, so you should be okay, you should not be in the dark. Go read :)

jeff

datasheet looks like: https://www.dropbox.com/s/80ubbvgou4g3bmk/Rockchip%20RK30xx%20TRM%20V2.0.pdf
 
Last edited by a moderator:
Architecture

An architecture defines behavior that is common to many processor designs.

Processor

A processor is an implementation of an architecture, and can be integrated into several different designs.

Device

A device contains a processor and additional components.


Developers who are new to this model can find it difficult to find information about system-level behavior. This is because the information can be divided between several documents:


  • the architecture reference manual
  • the processor technical reference manual
  • the device documentation.

This article identifies the borders between these levels of specification, and where to look for information.

Someone tell me there is an easy way to approach and develop this stuff...  I got 100's of pages of documentation and a makeshift dev board but don't know were to start putting it all together.

Should I start with http://crosstool-ng.org/? I see it has arm-cortexa9_neon-linux-gnueabihf

Will code compiled from that work or is this only refering to architecture?

MK808 is a cheap tv box, RK3066 is it's processor. I'm trying to learn on it. I did'nt pass the first linux+ cert today... I feel like I don't know anything about linux, and it feels great! :-D
 
Last edited by a moderator:
That might well do it; it sounds like the right ABI and all that.

The page I linked to references some linux kernel sources, and noted their build steps.. take a look.

There is no easy way; dive in, get your feet wet, see if you can get anything to happen. Enjoy :)

If you are lucky, you can find a forum of other like-minded hackers to bounce ideas off of, or who've already done these early steps. Writing your own OS is fun, but it also means you won't have any features ..

jeff
 
Back
Top