public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] booting linux from u-boot - help!
       [not found] ` <sdff7591.074@au.thalesgroup.com>
@ 2002-12-17  9:05   ` Murray Jensen
  0 siblings, 0 replies; 3+ messages in thread
From: Murray Jensen @ 2002-12-17  9:05 UTC (permalink / raw)
  To: u-boot

On Tue, 17 Dec 2002 19:04:41 +1100, My-Hong Vuong <My-Hong.Vuong@au.thalesgroup.com> writes:
>with the cache, i've disabled MSR_DR in head_8xx.S

You mustn't do this - virtual memory will not work if you do this.

>which then seems to
>get to start_here fine.

This is giving you false hope - you must leave the virtual memory on.

>but inserting the same code just before
>early_init doesn't seem to work...

One problem that you need to look out for is that you only have 0x100 bytes
available to you at that point. This is executing the reset exception handler
at 0x...100 and the next exception handler must start at 0x...200. Don't insert
too much code (you should get an error from the assembler - saying that you
are trying to set the location backwards or something like that).

>the assembly I'm using is :
>lis     r25, 0xaaaa
>ori     r25, r25, 0xaaaa
>lis     r26, 0x8100
>ori     r26,r26,0x0000
>stw     r25, 0(r26)
>
>where r25 is the pattern I want to write into address 0x81000000.  I've
>used r25 and r26 because I can't see them being used anywhere in the
>code...

r25 and r26 (and others) are used to save the arguments passed to kernel from
the boot loader (in r3, r4, ..., r7) - it's like the first few instructions
ever executed by Linux - you mustn't clobber these registers.

Besides this, if you leave virtual memory on, this will not do what you
think it will - you must first set up a temporary translation in the TLB before
you can access that physical location, as is done for the Internal Memory
Mapped Registers (IMMR) area.

Of course, the appropriate BRx/ORx for the LEDs must have been set up by the
boot loader so that the physical address 0x81000000 really does access the
LED hardware (I assume this is the case - since you say this code works
elsewhere).

>I'm not sure how do do it otherwise (i.e. restoring the original
>register values)

Use some other registers (if you're careful) - e.g. r3, r4, r5 - these will be
restored later when required (see call to identify_machine - or some name like
that).

>any other ideas would be muchly appreciated,

I just got my BDI2000 - it's great. Other than that - pull out all code you
have inserted and go back to the original Linux code - after carefully
examining all the config options. If your hardware is correct and your
linux config matches it properly, it should "just work" :-) Good luck.
Cheers!
								Murray...
-- 
Murray Jensen, CSIRO Manufacturing & Infra. Tech.      Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662 7853
Internet: Murray.Jensen at csiro.au

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/

To the extent permitted by law, CSIRO does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained or
that the communication is free of errors, virus, interception or interference.

The information contained in this e-mail may be confidential or privileged.
Any unauthorised use or disclosure is prohibited. If you have received this
e-mail in error, please delete it immediately and notify Murray Jensen on
+61 3 9662 7763. Thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] [PPCBoot-users] Using gcc-3.4 to compile u-boo t on powerpc
@ 2003-06-24  0:08 ` Vuong My-Hong
  2003-06-26  2:03   ` Murray Jensen
  0 siblings, 1 reply; 3+ messages in thread
From: Vuong My-Hong @ 2003-06-24  0:08 UTC (permalink / raw)
  To: u-boot

Hi Murray,

Is there a similar fix for gcc 3.0.4? 

Thanks, My Hong

------------------------------------------------------------------
Acoustic Mine Imaging
Thales Underwater Systems
274 Victoria Road
Rydalmere NSW 2116
+61 2 9848 3872
+61404 483 823
My-Hong.Vuong at au.thalesgroup.com
------------------------------------------------------------------

>>> Murray Jensen 06/23/03 12:06pm >>>
Hi All, a small but important thing... I am using the latest gcc from cvs
(3.4 20030608 (experimental)) and if you build the cross compiler for a
powerpc/linux target, it leaves out the "fixup" stuff for the
"-mrelocatable"
command line option. If you then want to use that cross compiler to build
"u-boot", it stuffs up with messages from the Assembler that looks something
like this (on certain C files):

... Error: Relocation cannot be done when using -mrelocatable

Since "-mrelocatable" is usually not used for Linux programs, I can't see
why
they did this. Rather than have two different cross compilers, one for linux
and one for "other", which you use to compile u-boot, I chose a simple fix -
patch the file "gcc/config/rs6000/linux.h" as follows:

--- linux.h     2003/06/13 16:41:53     1.3
+++ linux.h     2003/06/20 01:28:53
@@ -84,7 +84,8 @@
 #define TARGET_64BIT 0
   
 /* We don't need to generate entries in .fixup.  */
-#undef RELOCATABLE_NEEDS_FIXUP
+/* well I do need them! */
+#define RELOCATABLE_NEEDS_FIXUP
  
 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack

Hope this helps someone. Cheers!
        Murray...
--
Murray Jensen, CSIRO Manufacturing & Infra. Tech.      Phone: +61 3 9662
7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662
7853
Internet: Murray.Jensen at csiro.au 

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/ 

To the extent permitted by law, CSIRO does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained or
that the communication is free of errors, virus, interception or
interference.

The information contained in this e-mail may be confidential or privileged.
Any unauthorised use or disclosure is prohibited. If you have received this
e-mail in error, please delete it immediately and notify Murray Jensen on
+61 3 9662 7763. Thank you.


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php 
_______________________________________________
PPCBoot-users mailing list
PPCBoot-users at lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/ppcboot-users 



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php 
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/u-boot-users

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] [PPCBoot-users] Using gcc-3.4 to compile u-boo t on powerpc
  2003-06-24  0:08 ` [U-Boot-Users] [PPCBoot-users] Using gcc-3.4 to compile u-boo t on powerpc Vuong My-Hong
@ 2003-06-26  2:03   ` Murray Jensen
  0 siblings, 0 replies; 3+ messages in thread
From: Murray Jensen @ 2003-06-26  2:03 UTC (permalink / raw)
  To: u-boot

On Tue, 24 Jun 2003 10:08:00 +1000, Vuong My-Hong <My-Hong.Vuong@au.thalesgroup.com> writes:
>Hi Murray,
>
>Is there a similar fix for gcc 3.0.4? 
>
>Thanks, My Hong

Sorry, I wouldn't know. Here is a posting where this define was proposed
(14 Dec 2001) ...

	http://gcc.gnu.org/ml/gcc-patches/2001-12/msg01678.html

and here is a post where it was proposed that the define be turned off
in "linux.h" (29 Jan 2003) ...

	http://gcc.gnu.org/ml/gcc-patches/2003-01/msg02345.html

If the second is before gcc 3.0.4, then this fix will apply, otherwise
you have some other problem. 3.0.4 sounds like a long time ago, so my
guess would be "no (you could check in the gcc cvs). Cheers!
								Murray...
-- 
Murray Jensen, CSIRO Manufacturing & Infra. Tech.      Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662 7853
Internet: Murray.Jensen at csiro.au

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/

To the extent permitted by law, CSIRO does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained or
that the communication is free of errors, virus, interception or interference.

The information contained in this e-mail may be confidential or privileged.
Any unauthorised use or disclosure is prohibited. If you have received this
e-mail in error, please delete it immediately and notify Murray Jensen on
+61 3 9662 7763. Thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-06-26  2:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <My-Hong.Vuong@au.thalesgroup.com>
     [not found] ` <sdff7591.074@au.thalesgroup.com>
2002-12-17  9:05   ` [U-Boot-Users] booting linux from u-boot - help! Murray Jensen
2003-06-24  0:08 ` [U-Boot-Users] [PPCBoot-users] Using gcc-3.4 to compile u-boo t on powerpc Vuong My-Hong
2003-06-26  2:03   ` Murray Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox