* Okay to change default zImage link/load address? @ 2007-02-09 18:43 Mark A. Greer 2007-02-09 18:51 ` Olaf Hering 0 siblings, 1 reply; 13+ messages in thread From: Mark A. Greer @ 2007-02-09 18:43 UTC (permalink / raw) To: linuxppc-dev, Paul Mackerras The default link (and therefore load address if your fw talks ELF) is @ 4MB. This causes problems for at least 2 different platforms I have (Maple and f101/prpmc280). The problem is that a large enough zImage overwrites memory--or stops downloading if it would overwrite memory--used by the firmware and it ends up complaining about a corrupted ELF image or just doesn't run properly. The default in arch/ppc was configurable (CONFIG_BOOT_LOAD) with the default being 8MB. 8MB worked fine for most if not all 32-bit platforms. Does anyone know of a problem downloading to 8MB instead of 4MB in arch/powerpc? If not, would you object if it changed to 8MB? The patch below is the change I'm talking about. Thanks, Mark -- diff --git a/arch/powerpc/boot/zImage.lds.S b/arch/powerpc/boot/zImage.lds.S index 4be3c64..608de2f 100644 --- a/arch/powerpc/boot/zImage.lds.S +++ b/arch/powerpc/boot/zImage.lds.S @@ -2,7 +2,7 @@ OUTPUT_ARCH(powerpc:common) ENTRY(_zimage_start) SECTIONS { - . = (4*1024*1024); + . = (8*1024*1024); _start = .; .text : { ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 18:43 Okay to change default zImage link/load address? Mark A. Greer @ 2007-02-09 18:51 ` Olaf Hering 2007-02-09 18:55 ` Mark A. Greer 0 siblings, 1 reply; 13+ messages in thread From: Olaf Hering @ 2007-02-09 18:51 UTC (permalink / raw) To: Mark A. Greer; +Cc: linuxppc-dev, Paul Mackerras On Fri, Feb 09, Mark A. Greer wrote: > Does anyone know of a problem downloading to 8MB instead of 4MB in > arch/powerpc? If not, would you object if it changed to 8MB? IBM chrp 32 and 64bit has a free and usable memory range from 64k to 12M. Changing the link address from 4 to 8 MB will reduce the max zImage size to 3MB on these systems. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 18:51 ` Olaf Hering @ 2007-02-09 18:55 ` Mark A. Greer 2007-02-09 19:14 ` Josh Boyer 2007-02-09 19:34 ` Geoff Levand 0 siblings, 2 replies; 13+ messages in thread From: Mark A. Greer @ 2007-02-09 18:55 UTC (permalink / raw) To: Olaf Hering; +Cc: linuxppc-dev, Paul Mackerras On Fri, Feb 09, 2007 at 07:51:07PM +0100, Olaf Hering wrote: > On Fri, Feb 09, Mark A. Greer wrote: > > > Does anyone know of a problem downloading to 8MB instead of 4MB in > > arch/powerpc? If not, would you object if it changed to 8MB? > > IBM chrp 32 and 64bit has a free and usable memory range from 64k to > 12M. > Changing the link address from 4 to 8 MB will reduce the max zImage size > to 3MB on these systems. Hmm, not good. Paul, may we may this configurable (i.e., a CONFIG option)? Mark ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 18:55 ` Mark A. Greer @ 2007-02-09 19:14 ` Josh Boyer 2007-02-09 22:35 ` David Gibson 2007-02-09 19:34 ` Geoff Levand 1 sibling, 1 reply; 13+ messages in thread From: Josh Boyer @ 2007-02-09 19:14 UTC (permalink / raw) To: Mark A. Greer; +Cc: linuxppc-dev, Olaf Hering, Paul Mackerras On Fri, 2007-02-09 at 11:55 -0700, Mark A. Greer wrote: > On Fri, Feb 09, 2007 at 07:51:07PM +0100, Olaf Hering wrote: > > On Fri, Feb 09, Mark A. Greer wrote: > > > > > Does anyone know of a problem downloading to 8MB instead of 4MB in > > > arch/powerpc? If not, would you object if it changed to 8MB? > > > > IBM chrp 32 and 64bit has a free and usable memory range from 64k to > > 12M. > > Changing the link address from 4 to 8 MB will reduce the max zImage size > > to 3MB on these systems. > > Hmm, not good. > > Paul, may we may this configurable (i.e., a CONFIG option)? Something like that is going to be needed for 4xx anyway. josh ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 19:14 ` Josh Boyer @ 2007-02-09 22:35 ` David Gibson 2007-02-10 1:27 ` Josh Boyer 0 siblings, 1 reply; 13+ messages in thread From: David Gibson @ 2007-02-09 22:35 UTC (permalink / raw) To: Josh Boyer; +Cc: linuxppc-dev, Olaf Hering, Paul Mackerras On Fri, Feb 09, 2007 at 01:14:22PM -0600, Josh Boyer wrote: > On Fri, 2007-02-09 at 11:55 -0700, Mark A. Greer wrote: > > On Fri, Feb 09, 2007 at 07:51:07PM +0100, Olaf Hering wrote: > > > On Fri, Feb 09, Mark A. Greer wrote: > > > > > > > Does anyone know of a problem downloading to 8MB instead of 4MB in > > > > arch/powerpc? If not, would you object if it changed to 8MB? > > > > > > IBM chrp 32 and 64bit has a free and usable memory range from 64k to > > > 12M. > > > Changing the link address from 4 to 8 MB will reduce the max zImage size > > > to 3MB on these systems. > > > > Hmm, not good. > > > > Paul, may we may this configurable (i.e., a CONFIG option)? > > Something like that is going to be needed for 4xx anyway. Uh.. don't think so. I'm booting fine on 440, loading the zImage at 4MB. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 22:35 ` David Gibson @ 2007-02-10 1:27 ` Josh Boyer 0 siblings, 0 replies; 13+ messages in thread From: Josh Boyer @ 2007-02-10 1:27 UTC (permalink / raw) To: David Gibson; +Cc: linuxppc-dev, Olaf Hering, Paul Mackerras On Sat, 2007-02-10 at 09:35 +1100, David Gibson wrote: > On Fri, Feb 09, 2007 at 01:14:22PM -0600, Josh Boyer wrote: > > On Fri, 2007-02-09 at 11:55 -0700, Mark A. Greer wrote: > > > On Fri, Feb 09, 2007 at 07:51:07PM +0100, Olaf Hering wrote: > > > > On Fri, Feb 09, Mark A. Greer wrote: > > > > > > > > > Does anyone know of a problem downloading to 8MB instead of 4MB in > > > > > arch/powerpc? If not, would you object if it changed to 8MB? > > > > > > > > IBM chrp 32 and 64bit has a free and usable memory range from 64k to > > > > 12M. > > > > Changing the link address from 4 to 8 MB will reduce the max zImage size > > > > to 3MB on these systems. > > > > > > Hmm, not good. > > > > > > Paul, may we may this configurable (i.e., a CONFIG option)? > > > > Something like that is going to be needed for 4xx anyway. > > Uh.. don't think so. I'm booting fine on 440, loading the zImage at > 4MB. Yes, sorry. Was thinking of where vmlinux is uncompressed to by the bootwrapper, but you've solved that a different way as well. josh ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 18:55 ` Mark A. Greer 2007-02-09 19:14 ` Josh Boyer @ 2007-02-09 19:34 ` Geoff Levand 2007-02-09 22:40 ` David Gibson 1 sibling, 1 reply; 13+ messages in thread From: Geoff Levand @ 2007-02-09 19:34 UTC (permalink / raw) To: Mark A. Greer; +Cc: linuxppc-dev, Olaf Hering, Paul Mackerras Mark A. Greer wrote: > On Fri, Feb 09, 2007 at 07:51:07PM +0100, Olaf Hering wrote: >> On Fri, Feb 09, Mark A. Greer wrote: >> >> > Does anyone know of a problem downloading to 8MB instead of 4MB in >> > arch/powerpc? If not, would you object if it changed to 8MB? >> >> IBM chrp 32 and 64bit has a free and usable memory range from 64k to >> 12M. >> Changing the link address from 4 to 8 MB will reduce the max zImage size >> to 3MB on these systems. > > Hmm, not good. > > Paul, may we may this configurable (i.e., a CONFIG option)? To have zImage.lds.S use a config option you'll need to run it through the preprocessor, which in general seems like a good thing. Now we just have this: $(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S @cp $< $@ -Geoff ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 19:34 ` Geoff Levand @ 2007-02-09 22:40 ` David Gibson 2007-02-09 23:05 ` Geoff Levand 2007-02-09 23:21 ` Mark A. Greer 0 siblings, 2 replies; 13+ messages in thread From: David Gibson @ 2007-02-09 22:40 UTC (permalink / raw) To: Geoff Levand; +Cc: linuxppc-dev, Olaf Hering, Paul Mackerras On Fri, Feb 09, 2007 at 11:34:05AM -0800, Geoff Levand wrote: > Mark A. Greer wrote: > > On Fri, Feb 09, 2007 at 07:51:07PM +0100, Olaf Hering wrote: > >> On Fri, Feb 09, Mark A. Greer wrote: > >> > >> > Does anyone know of a problem downloading to 8MB instead of 4MB in > >> > arch/powerpc? If not, would you object if it changed to 8MB? > >> > >> IBM chrp 32 and 64bit has a free and usable memory range from 64k to > >> 12M. > >> Changing the link address from 4 to 8 MB will reduce the max zImage size > >> to 3MB on these systems. > > > > Hmm, not good. > > > > Paul, may we may this configurable (i.e., a CONFIG option)? > > To have zImage.lds.S use a config option you'll need to run it through > the preprocessor, which in general seems like a good thing. Now we just > have this: > > $(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S > @cp $< $@ No. Well, at that, running zImage.lds.S through the preprocessor might not be a bad idea, but we definitely want to avoid using the config anywhere in the bootwrapper, except in the Makefile for choosing the platform passed to the wrapper script. The idea is that it should always be possible to wrap a given vmlinux using the wrapper script and wrapper library, outside the context of the kernel source tree that built that vmlinux. Note that the zImage is already build -fPIC and capable of relocating itself if loaded at an address other than 4MB... -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 22:40 ` David Gibson @ 2007-02-09 23:05 ` Geoff Levand 2007-02-09 23:21 ` Mark A. Greer 1 sibling, 0 replies; 13+ messages in thread From: Geoff Levand @ 2007-02-09 23:05 UTC (permalink / raw) To: David Gibson; +Cc: linuxppc-dev, Olaf Hering, Paul Mackerras David Gibson wrote: > On Fri, Feb 09, 2007 at 11:34:05AM -0800, Geoff Levand wrote: >> Mark A. Greer wrote: >> > On Fri, Feb 09, 2007 at 07:51:07PM +0100, Olaf Hering wrote: >> >> On Fri, Feb 09, Mark A. Greer wrote: >> >> >> >> > Does anyone know of a problem downloading to 8MB instead of 4MB in >> >> > arch/powerpc? If not, would you object if it changed to 8MB? >> >> >> >> IBM chrp 32 and 64bit has a free and usable memory range from 64k to >> >> 12M. >> >> Changing the link address from 4 to 8 MB will reduce the max zImage size >> >> to 3MB on these systems. >> > >> > Hmm, not good. >> > >> > Paul, may we may this configurable (i.e., a CONFIG option)? >> >> To have zImage.lds.S use a config option you'll need to run it through >> the preprocessor, which in general seems like a good thing. Now we just >> have this: >> >> $(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S >> @cp $< $@ > > No. Well, at that, running zImage.lds.S through the preprocessor > might not be a bad idea, but we definitely want to avoid using the > config anywhere in the bootwrapper, except in the Makefile for > choosing the platform passed to the wrapper script. The idea is that > it should always be possible to wrap a given vmlinux using the wrapper > script and wrapper library, outside the context of the kernel source > tree that built that vmlinux. > > Note that the zImage is already build -fPIC and capable of relocating > itself if loaded at an address other than 4MB... > That line is from the makefile, not the wrapper, so the preprocessing, and the use of the config file would be prior to running the wrapper. It seems though that you are talking about something other than using a config option to change the hard coded output location in the linker script, which I thought was Mark's proposal. -Geoff ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 22:40 ` David Gibson 2007-02-09 23:05 ` Geoff Levand @ 2007-02-09 23:21 ` Mark A. Greer 2007-02-09 23:25 ` Mark A. Greer 1 sibling, 1 reply; 13+ messages in thread From: Mark A. Greer @ 2007-02-09 23:21 UTC (permalink / raw) To: Geoff Levand, Mark A. Greer, linuxppc-dev, Olaf Hering, Paul Mackerras On Sat, Feb 10, 2007 at 09:40:10AM +1100, David Gibson wrote: > Note that the zImage is already build -fPIC and capable of relocating > itself if loaded at an address other than 4MB... That doesn't address the issue. Many firmwares look at the address in the ELF header and that's where they download it, period. Right now, that address is 4MB, period. 4MB doesn't work on some platforms so I'm looking for an acceptable alternative. Mark ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 23:21 ` Mark A. Greer @ 2007-02-09 23:25 ` Mark A. Greer 2007-02-10 0:53 ` David Gibson 0 siblings, 1 reply; 13+ messages in thread From: Mark A. Greer @ 2007-02-09 23:25 UTC (permalink / raw) To: Mark A. Greer; +Cc: linuxppc-dev, Olaf Hering, Paul Mackerras On Fri, Feb 09, 2007 at 04:21:00PM -0700, Mark A. Greer wrote: > On Sat, Feb 10, 2007 at 09:40:10AM +1100, David Gibson wrote: > > > Note that the zImage is already build -fPIC and capable of relocating > > itself if loaded at an address other than 4MB... > > That doesn't address the issue. > > Many firmwares look at the address in the ELF header and that's where > they download it, period. Right now, that address is 4MB, period. > 4MB doesn't work on some platforms so I'm looking for an acceptable > alternative. David, if I sounded rude, I didn't mean to. It may sound better if you do this: :) s/, period/(can't be overridden)/ Mark ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-09 23:25 ` Mark A. Greer @ 2007-02-10 0:53 ` David Gibson 2007-02-12 19:18 ` Mark A. Greer 0 siblings, 1 reply; 13+ messages in thread From: David Gibson @ 2007-02-10 0:53 UTC (permalink / raw) To: Mark A. Greer; +Cc: linuxppc-dev, Olaf Hering, Paul Mackerras On Fri, Feb 09, 2007 at 04:25:33PM -0700, Mark A. Greer wrote: > On Fri, Feb 09, 2007 at 04:21:00PM -0700, Mark A. Greer wrote: > > On Sat, Feb 10, 2007 at 09:40:10AM +1100, David Gibson wrote: > > > > > Note that the zImage is already build -fPIC and capable of relocating > > > itself if loaded at an address other than 4MB... > > > > That doesn't address the issue. > > > > Many firmwares look at the address in the ELF header and that's where > > they download it, period. Right now, that address is 4MB, period. > > 4MB doesn't work on some platforms so I'm looking for an acceptable > > alternative. > > David, if I sounded rude, I didn't mean to. No no. I see your point. Hrm... I've already been thinking that we'll need to make the crt0.S replaceable by platform. The same is probably true for the linker script. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Okay to change default zImage link/load address? 2007-02-10 0:53 ` David Gibson @ 2007-02-12 19:18 ` Mark A. Greer 0 siblings, 0 replies; 13+ messages in thread From: Mark A. Greer @ 2007-02-12 19:18 UTC (permalink / raw) To: Mark A. Greer, linuxppc-dev, Olaf Hering, Paul Mackerras On Sat, Feb 10, 2007 at 11:53:31AM +1100, David Gibson wrote: > On Fri, Feb 09, 2007 at 04:25:33PM -0700, Mark A. Greer wrote: > > On Fri, Feb 09, 2007 at 04:21:00PM -0700, Mark A. Greer wrote: > > > On Sat, Feb 10, 2007 at 09:40:10AM +1100, David Gibson wrote: > > > > > > > Note that the zImage is already build -fPIC and capable of relocating > > > > itself if loaded at an address other than 4MB... > > > > > > That doesn't address the issue. > > > > > > Many firmwares look at the address in the ELF header and that's where > > > they download it, period. Right now, that address is 4MB, period. > > > 4MB doesn't work on some platforms so I'm looking for an acceptable > > > alternative. > > > > David, if I sounded rude, I didn't mean to. > > No no. I see your point. > > Hrm... I've already been thinking that we'll need to make the crt0.S > replaceable by platform. The same is probably true for the linker > script. Looks like objcopy can change the addr for us. So we could pass a CONFIG_ value from the Makefile to 'wrapper' and have wrapper run objcopy. Seems easier than having to make your own linker script just to change the addr. Mark ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-02-12 19:18 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-02-09 18:43 Okay to change default zImage link/load address? Mark A. Greer 2007-02-09 18:51 ` Olaf Hering 2007-02-09 18:55 ` Mark A. Greer 2007-02-09 19:14 ` Josh Boyer 2007-02-09 22:35 ` David Gibson 2007-02-10 1:27 ` Josh Boyer 2007-02-09 19:34 ` Geoff Levand 2007-02-09 22:40 ` David Gibson 2007-02-09 23:05 ` Geoff Levand 2007-02-09 23:21 ` Mark A. Greer 2007-02-09 23:25 ` Mark A. Greer 2007-02-10 0:53 ` David Gibson 2007-02-12 19:18 ` Mark A. Greer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).