Go to advanced search

by Cycl0ne
Sat Jul 14, 2012 4:40 pm
Forum: Bare metal, Assembly language
Topic: Floating point in bare metal code
Replies: 11
Views: 7031

Re: Floating point in bare metal code

Question:

FPU uses new registers? When going into a "task switch" do i need to take care about?

What about division 0 ? Are new Traps enabled? ..
by Cycl0ne
Fri Jul 13, 2012 6:58 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

Dexos, do you have a fast memcpy/memset for me?
by Cycl0ne
Fri Jul 13, 2012 8:15 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH I found my bug !! :) it was my MEMSET written in Assembler ;-), I changed it to a C version, and now it works :D The Assembler was perhaps too optimized ;) Here the output: Root Hub The RASPI Hub (3 Ports) Ethernet connected [DEMO] Started USB: Core Releas...
by Cycl0ne
Thu Jul 12, 2012 8:24 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

i will give it a try. but guess what: my usb on raspi is naked. nothing connected. normaly it should present it to me like this: Root Hub Hub Ethernet Cause i got nothing connected to the hub. the interessting factor here is: the code is unmodified from the u-boot raspi port ... and there it works a...
by Cycl0ne
Thu Jul 12, 2012 6:23 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

Hmm, as far as i know RPI boots up with all disabled (cache,...) do you think i really need the memorybarrier? The usb code runs little modified in the u-boot. Gonzo also does no memorybarrier. Here is the "C" Code of your assembler part ;) void memorybarrier (void) { asm ("mcr p15, 0, %0, c7, c5, 0...
by Cycl0ne
Thu Jul 12, 2012 5:32 pm
Forum: Bare metal, Assembly language
Topic: [Guide] Beginning Bare Metal on Raspi
Replies: 38
Views: 34616

Re: [Guide] Beginning Bare Metal on Raspi

i can update my post :) if you like, you can take the contents here and put it on the wiki. To be honest, i wrote the two guide to get the head clear of this USB thing :-P
by Cycl0ne
Thu Jul 12, 2012 5:18 pm
Forum: Bare metal, Assembly language
Topic: [Guide] Beginning Bare Metal on Raspi
Replies: 38
Views: 34616

Re: [Guide] Beginning Bare Metal on Raspi

Maybe sometime. First I would like to collect everything here in the forum. Otherwise you end up with infos on wiki, infos in the forum, infos in the github, infos in some blog.. and then it gets annoying and hard time to keep all updated.
by Cycl0ne
Thu Jul 12, 2012 4:18 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

you just got a pm. for the code (for the others) there is good news.. one part is synopsys, two BSD one GPL. and if someone like they can rewrite the GPL code. at the moment im completely stuck. i cant write to the second hub, it seems im missing something. i alligned my pointers, i tried here and t...
by Cycl0ne
Wed Jul 11, 2012 8:41 am
Forum: Bare metal, Assembly language
Topic: [Guide] ATAG Scanner
Replies: 4
Views: 3935

[Guide] ATAG Scanner

Here some Code for an ATAG Scanner, you have to use the ATAGS to find out: - Memory - Commandline (dont know why the FB ATAG/Board REV ATAG / is not used ;-) Memory is needed, to know which split firmware is used. The command line you need, if you want to use the ethernet device, there is the MAC ad...
by Cycl0ne
Wed Jul 11, 2012 7:03 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] Timer on Raspi
Replies: 10
Views: 18145

Re: [BareMetal] Timer on Raspi

Hi Dwelch, here is the code for the timer, they have 4 timers free running on 4 channels. 2 channels are reserved for the VideoCore. Here the IRQ Code to reinitialise the timer: __attribute__((no_instrument_function)) UINT32 IRQ_Tick(unsigned int exc_no, istate *istate, APTR Data, SysBase *SysBase) ...
by Cycl0ne
Wed Jul 11, 2012 12:47 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

I hate it.... it took me the whole day. i refactored and recoded my code for usb about 4 times.. i looked and looked and couldnt believe why it didnt work..... Then it was this Power Management: volatile UINT32 *mbox0_read = (volatile UINT32 *)BCM2835_ARM_MBOX0_BASE; volatile UINT32 *mbox0_write = (...
by Cycl0ne
Tue Jul 10, 2012 8:14 pm
Forum: Bare metal, Assembly language
Topic: [Guide] Beginning Bare Metal on Raspi
Replies: 38
Views: 34616

[Guide] Beginning Bare Metal on Raspi

Hi, I just wanted to start a thread about some links and guides to start bare metal programming on raspberry pi to give you a head start. First of all some links which helped me alot to get a "feeling" for arm cpus. ! ----------------------- https://github.com/dwelch67/raspberrypi/ From here you sho...
by Cycl0ne
Tue Jul 10, 2012 7:34 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

Hi, depends, the code has 4 parts, 2 parts come from synopsys and are those : dwc_otg files. Those are the low level usb driver. the third part from me is taken from u-boot, who have taken it from linux. its published under gpl. and the fourth part is mine, with no license at the moment ;-) at the m...
by Cycl0ne
Tue Jul 10, 2012 10:29 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

Hi, thanks for all your help, my USB Stack is now working :) [INIT] Adding Memory [INIT] SysBase Preperation [INIT] Create Idle Task [INIT] RTF_SINGLETASK [INIT] RTF_COLDSTART (COLDSTART)InitResident timer.device (1d350) (COLDSTART)InitResident usb.library (1d408) USB: [èñäñ:45320] ø(0x000154a8) [èñ...
by Cycl0ne
Sat Jul 07, 2012 9:54 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

Hi,

thanks so much infos, i will dig through it. one question.. im sitll abit fuzzled about otg thing. is oth something special or is it EHCI, or am i getting this completely wrong?
by Cycl0ne
Sat Jul 07, 2012 7:12 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

Here Dexos, thats cool. I dont need to get stuck with an own USB Stack ;-) How am i going to get this thing on the RASPI? Btw: USB is not soooooooooo fuzzy.. if you have the right docs.. look at this book here: http://www.amazon.de/USB-The-Universal-Serial-Bus/dp/1468151983/ref=sr_1_1?ie=UTF8&qid=13...
by Cycl0ne
Sat Jul 07, 2012 8:03 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

Re: [BareMetal] USB

Hmm, Raspi Linux Source on Git : #define DWC_DRIVER_VERSION "2.90b 6-MAY-2010" #define DWC_DRIVER_DESC "HS OTG USB Controller driver" Driver Version on Synopsys Page: Description USB 2.0 Hi-Speed OTG Linux Software Name dwc_usb_2_0_hs_otg_linux_software Version 2.94a Perhaps this solves some problem...
by Cycl0ne
Sat Jul 07, 2012 5:45 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] USB
Replies: 31
Views: 12845

[BareMetal] USB

Hi, Im thinking of writing an own USB Stack for my little bare metal project. What makes me a bit dizzy: What kind of controller sits on the Raspberry PI (not meaning the manufacturer). I know there is EHCI, OHCI, UHCI Standard. But when I have a look at the synopsys site, I only read: USB2.0 and pe...
by Cycl0ne
Sat Jul 07, 2012 4:55 am
Forum: Bare metal, Assembly language
Topic: Programming the RPi on the bare metal
Replies: 57
Views: 30210

Re: Programming the RPi on the bare metal

I did a lot in C and only a really small part in ASM (setting up the Stacks for all the Interrupts and a small "handler" which calls the C code on exceptions). Here is my C Code i use for the branch table: /** LDR instruction's code */ #define LDR_OPCODE 0xe59ff000 /** Number of exception vectors. *...
by Cycl0ne
Fri Jul 06, 2012 12:08 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] Timer on Raspi
Replies: 10
Views: 18145

Re: [BareMetal] Timer on Raspi

Hi Don, last Question on this Subject, everything works now really cool. What i am not sure about: UINT32 IRQBits = READ32(ARM_IRQ_PEND3); if (CHECK_BIT(IRQBits, 8)) { IRQBits = READ32(ARM_IRQ_PEND1); UINT32 number = MultiplyDeBruijnBitPosition2[(UINT32)(IRQBits * 0x077CB531U) >> 27]; ForeachNode(&S...
by Cycl0ne
Sun Jul 01, 2012 2:45 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] Timer on Raspi
Replies: 10
Views: 18145

Re: [BareMetal] Timer on Raspi

Ahh ok microsecond and not Mhz ;-) i thought of something like: 1/700 sec per one increase. when i read the comment.

Thanks again ;)
by Cycl0ne
Sun Jul 01, 2012 2:29 pm
Forum: Bare metal, Assembly language
Topic: [BareMetal] Timer on Raspi
Replies: 10
Views: 18145

Re: [BareMetal] Timer on Raspi

Thanks again, pops up the next question:
/* STC: a free running counter that increments at the rate of 1MHz */

1Mhz of what counter? core = 250? arm = 700?
by Cycl0ne
Sun Jul 01, 2012 10:14 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] Timer on Raspi
Replies: 10
Views: 18145

Re: [BareMetal] Timer on Raspi

Hi Dom, thanks, and where is this SystemTimer the BCM documents talks about in chapter 12, at what INT he comes from? At the moment I did this: WRITE32(ARMTIMER_CONTROL, 0x00000000); WRITE32(ARMTIMER_PREDIV, 0x000000f9); WRITE32(ARMTIMER_RELOAD,0x 4C4B40); //50 times a Sec by 250Mhz WRITE32(ARMTIMER...
by Cycl0ne
Sun Jul 01, 2012 8:55 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] Timer on Raspi
Replies: 10
Views: 18145

Re: [BareMetal] Timer on Raspi

Oh and if ound the following thing:

platform.h

Code: Select all

#define MAX_TIMER                       2
#define MAX_PERIOD                      699050
#define TICKS_PER_uSEC                  1
Really strange
by Cycl0ne
Sun Jul 01, 2012 8:49 am
Forum: Bare metal, Assembly language
Topic: [BareMetal] Timer on Raspi
Replies: 10
Views: 18145

[BareMetal] Timer on Raspi

Hi, i have a question on understanding the architecture. In the BCM document it says that the SP804 has only one timer. On the other hand i find the system timer and the arm timer. So are there 3 timers? Or more? In the linux source i find the following (irqs.h): #define IRQ_TIMER0 (IRQ_ARMCTRL_STAR...

Go to advanced search