Message ID | 1285916771-18033-2-git-send-email-imunsie@au1.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Oct 1, 2010, at 2:05 AM, Ian Munsie wrote: > > diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype > index d361f81..074ff12 100644 > --- a/arch/powerpc/platforms/Kconfig.cputype > +++ b/arch/powerpc/platforms/Kconfig.cputype > @@ -329,3 +329,19 @@ config CHECK_CACHE_COHERENCY > bool > > endmenu > + > +config ARCH_SUPPORTS_LITTLE_ENDIAN > + bool > + > +config CPU_LITTLE_ENDIAN > + bool "Build little endian kernel" > + depends on ARCH_SUPPORTS_LITTLE_ENDIAN && EXPERIMENTAL > + default n > + help > + This option selects whether a big endian or little endian kernel will > + be built. > + > + Note that if building a little endian kernel, CROSS_COMPILE must > + point to a toolchain capable of targetting little endian powerpc, > + while the toolchain specified by CROSS32_COMPILE must be capable of > + targetting *BIG* endian PowerPC. > -- > 1.7.1 Shouldn't we have something that limits to the sub-arch'es that actually support it? I doubt I'm ever going to make FSL-Book-e support LE. - k
On Fri, Oct 1, 2010 at 5:18 AM, Kumar Gala <galak@kernel.crashing.org> wrote: > > On Oct 1, 2010, at 2:05 AM, Ian Munsie wrote: > >> >> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype >> index d361f81..074ff12 100644 >> --- a/arch/powerpc/platforms/Kconfig.cputype >> +++ b/arch/powerpc/platforms/Kconfig.cputype >> @@ -329,3 +329,19 @@ config CHECK_CACHE_COHERENCY >> bool >> >> endmenu >> + >> +config ARCH_SUPPORTS_LITTLE_ENDIAN >> + bool >> + >> +config CPU_LITTLE_ENDIAN >> + bool "Build little endian kernel" >> + depends on ARCH_SUPPORTS_LITTLE_ENDIAN && EXPERIMENTAL >> + default n >> + help >> + This option selects whether a big endian or little endian kernel will >> + be built. >> + >> + Note that if building a little endian kernel, CROSS_COMPILE must >> + point to a toolchain capable of targetting little endian powerpc, >> + while the toolchain specified by CROSS32_COMPILE must be capable of >> + targetting *BIG* endian PowerPC. >> -- >> 1.7.1 > > Shouldn't we have something that limits to the sub-arch'es that actually support it? I doubt I'm ever going to make FSL-Book-e support LE. Yes, it should. josh
On Fri, Oct 1, 2010 at 3:05 AM, Ian Munsie <imunsie@au1.ibm.com> wrote: > diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype > index d361f81..074ff12 100644 > --- a/arch/powerpc/platforms/Kconfig.cputype > +++ b/arch/powerpc/platforms/Kconfig.cputype > @@ -329,3 +329,19 @@ config CHECK_CACHE_COHERENCY > bool > > endmenu > + > +config ARCH_SUPPORTS_LITTLE_ENDIAN > + bool > + > +config CPU_LITTLE_ENDIAN > + bool "Build little endian kernel" > + depends on ARCH_SUPPORTS_LITTLE_ENDIAN && EXPERIMENTAL > + default n > + help > + This option selects whether a big endian or little endian kernel will > + be built. > + > + Note that if building a little endian kernel, CROSS_COMPILE must > + point to a toolchain capable of targetting little endian powerpc, > + while the toolchain specified by CROSS32_COMPILE must be capable of > + targetting *BIG* endian PowerPC. Have you tested this support with a userspace containing floating point instructions? I wonder if CONFIG_MATH_EMULATION is going to need work at all, and if the boards with an actual FPU (440EP, 440EPx, 460EX, etc) would have issues. josh
On Fri, 2010-10-01 at 07:28 -0400, Josh Boyer wrote: > > Shouldn't we have something that limits to the sub-arch'es that > actually support it? I doubt I'm ever going to make FSL-Book-e > support LE. > > Yes, it should. Sure, that's only WIP patches :-) Tho FSL BookE would be relatively easy... Cheers, Ben.
On Fri, 2010-10-01 at 07:40 -0400, Josh Boyer wrote: > Have you tested this support with a userspace containing floating > point instructions? I wonder if CONFIG_MATH_EMULATION is going to > need work at all, and if the boards with an actual FPU (440EP, 440EPx, > 460EX, etc) would have issues. That's one of the things on the TODO list. We've tested that on a 44x with no FPU so far and made sure we built without math emu. Cheers, Ben.
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index b7212b6..3eed685 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -56,11 +56,27 @@ endif UTS_MACHINE := $(OLDARCH) +ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) +override CC += -mlittle-endian +override AS += -mlittle-endian +override LD += -EL +LDEMULATION := lppc +GNUTARGET := powerpcle +MULTIPLEWORD := -mno-multiple +else +override CC += -mbig-endian +override AS += -mbig-endian +override LD += -EB +LDEMULATION := ppc +GNUTARGET := powerpc +MULTIPLEWORD := -mmultiple +endif + ifeq ($(HAS_BIARCH),y) override AS += -a$(CONFIG_WORD_SIZE) -override LD += -m elf$(CONFIG_WORD_SIZE)ppc +override LD += -m elf$(CONFIG_WORD_SIZE)$(LDEMULATION) override CC += -m$(CONFIG_WORD_SIZE) -override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR) +override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-$(GNUTARGET) $(AR) endif LDFLAGS_vmlinux-yy := -Bstatic @@ -68,7 +84,7 @@ LDFLAGS_vmlinux-$(CONFIG_PPC64)$(CONFIG_RELOCATABLE) := -pie LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-yy) CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc -CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple +CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD) KBUILD_CPPFLAGS += -Iarch/$(ARCH) KBUILD_AFLAGS += -Iarch/$(ARCH) KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index fae8192..39f10a4 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -22,7 +22,8 @@ all: $(obj)/zImage BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -Os -msoft-float -pipe \ -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ - -isystem $(shell $(CROSS32CC) -print-file-name=include) + -isystem $(shell $(CROSS32CC) -print-file-name=include) \ + -mbig-endian BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc ifdef CONFIG_DEBUG_INFO diff --git a/arch/powerpc/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S index 0546bcd..f4c6676 100644 --- a/arch/powerpc/kernel/vdso32/vdso32.lds.S +++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S @@ -4,7 +4,11 @@ */ #include <asm/vdso.h> +#ifdef __LITTLE_ENDIAN__ +OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle") +#else OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") +#endif OUTPUT_ARCH(powerpc:common) ENTRY(_start) diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index d361f81..074ff12 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype @@ -329,3 +329,19 @@ config CHECK_CACHE_COHERENCY bool endmenu + +config ARCH_SUPPORTS_LITTLE_ENDIAN + bool + +config CPU_LITTLE_ENDIAN + bool "Build little endian kernel" + depends on ARCH_SUPPORTS_LITTLE_ENDIAN && EXPERIMENTAL + default n + help + This option selects whether a big endian or little endian kernel will + be built. + + Note that if building a little endian kernel, CROSS_COMPILE must + point to a toolchain capable of targetting little endian powerpc, + while the toolchain specified by CROSS32_COMPILE must be capable of + targetting *BIG* endian PowerPC.