All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ram Pai <linuxram@us.ibm.com>
To: grub-devel@gnu.org
Cc: tonyb@au1.ibm.com, anton@au1.ibm.com, linuxram@us.ibm.com,
	tlfalcon@linux.vnet.ibm.com, tbberry@us.ibm.com
Subject: [RFC PATCH 01/23] Add a new architecture to the build process
Date: Wed, 26 Feb 2014 10:31:00 -0800	[thread overview]
Message-ID: <1393439482-20341-2-git-send-email-linuxram@us.ibm.com> (raw)
In-Reply-To: <1393439482-20341-1-git-send-email-linuxram@us.ibm.com>

Add a new architecture to the build process

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Tomohiro B Berry <tbberry@us.ibm.com>
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
---
 Makefile.am                 |  4 ++++
 config.h.in                 |  4 ++++
 configure.ac                | 10 +++++++---
 gentpl.py                   |  7 ++++---
 grub-core/Makefile.am       |  7 +++++++
 grub-core/Makefile.core.def | 18 ++++++++++++++++++
 include/grub/powerpc64le    |  1 +
 7 files changed, 45 insertions(+), 6 deletions(-)
 create mode 120000 include/grub/powerpc64le

diff --git a/Makefile.am b/Makefile.am
index f02ae0a..8aad803 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -383,6 +383,10 @@ if COND_powerpc_ieee1275
 BOOTCHECKS = bootcheck-linux-ppc
 endif
 
+if COND_powerpc64le_ieee1275
+BOOTCHECKS = bootcheck-linux-ppc
+endif
+
 EXTRA_DIST += grub-core/tests/boot/kbsd.init-i386.S grub-core/tests/boot/kbsd.init-x86_64.S grub-core/tests/boot/kbsd.spec.txt grub-core/tests/boot/kernel-8086.S grub-core/tests/boot/kernel-i386.S grub-core/tests/boot/kfreebsd-aout.cfg grub-core/tests/boot/kfreebsd.cfg grub-core/tests/boot/kfreebsd.init-i386.S grub-core/tests/boot/kfreebsd.init-x86_64.S grub-core/tests/boot/knetbsd.cfg grub-core/tests/boot/kopenbsd.cfg grub-core/tests/boot/kopenbsdlabel.txt grub-core/tests/boot/linux16.cfg grub-core/tests/boot/linux.cfg grub-core/tests/boot/linux.init-i386.S grub-core/tests/boot/linux.init-mips.S grub-core/tests/boot/linux.init-ppc.S grub-core/tests/boot/linux.init-x86_64.S grub-core/tests/boot/linux-ppc.cfg grub-core/tests/boot/multiboot2.cfg grub-core/tests/boot/multiboot.cfg grub-core/tests/boot/ntldr.cfg grub-core/tests/boot/pc-chainloader.cfg grub-core/tests/boot/qemu-shutdown-x86.S
 
 .PHONY: bootcheck-linux-i386 bootcheck-linux-x86_64 \
diff --git a/config.h.in b/config.h.in
index 4b63014..1d71e35 100644
--- a/config.h.in
+++ b/config.h.in
@@ -6,6 +6,10 @@
 #define __powerpc__ 1
 #endif
 
+#if defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
+#define __powerpc64le__ 1
+#endif
+
 #define GCRYPT_NO_DEPRECATED 1
 
 /* Define to 1 to enable disk cache statistics.  */
diff --git a/configure.ac b/configure.ac
index 8888c2f..09e9dfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,7 @@ if test "x$with_platform" = x; then
     x86_64-*) platform=pc ;;
     powerpc-*) platform=ieee1275 ;;
     powerpc64-*) platform=ieee1275 ;;
+    powerpc64le-*) platform=ieee1275 ;;
     sparc64-*) platform=ieee1275 ;;
     mipsel-*) platform=loongson ;;
     mips-*) platform=arc ;;
@@ -137,6 +138,7 @@ case "$target_cpu"-"$platform" in
   x86_64-xen) ;;
   x86_64-*) target_cpu=i386 ;;
   powerpc64-ieee1275) target_cpu=powerpc ;;
+  powerpc64le-ieee1275) target_cpu=powerpc64le ;;
 esac
 
 # Check if the platform is supported, make final adjustments.
@@ -152,6 +154,7 @@ case "$target_cpu"-"$platform" in
   i386-ieee1275) ;;
   i386-qemu) ;;
   powerpc-ieee1275) ;;
+  powerpc64le-ieee1275) ;;
   sparc64-ieee1275) ;;
   ia64-efi) ;;
   mips-qemu_mips) ;;
@@ -173,7 +176,7 @@ esac
 if test x$platform != xemu ; then
    case "$target_cpu" in
 	i386 | powerpc) target_m32=1 ;;
-	x86_64 | sparc64) target_m64=1 ;;
+	x86_64 | sparc64 | powerpc64le) target_m64=1 ;;
    esac
 fi
 
@@ -557,7 +560,7 @@ if test "x$grub_cv_cc_target_clang" = xyes && ( test "x$target_cpu" = xi386 \
    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
 fi
 
-if test "x$grub_cv_cc_target_clang" = xyes && test "x$target_cpu" = xpowerpc; then
+if test "x$grub_cv_cc_target_clang" = xyes && (test "x$target_cpu" = xpowerpc || test "x$target_cpu" = xpowerpc64le ); then
 AC_CACHE_CHECK([if clang can handle ame instruction], [grub_cv_cc_target_clang_ame]
 [
 CFLAGS="$TARGET_CFLAGS"
@@ -1428,7 +1431,7 @@ if test x"$enable_build_grub_mkfont" = xno ; then
   FONT_SOURCE=
 fi
 
-if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then
+if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$target_cpu"-"$platform" = xpowerpc64le-ieee1275 || test "x$platform" = xcoreboot ); then
   if test x"$grub_build_mkfont_excuse" = x ; then
     AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont])
   else
@@ -1671,6 +1674,7 @@ AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu =
 AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
 AM_CONDITIONAL([COND_sparc64_emu], [test x$target_cpu = xsparc64 -a x$platform = xemu])
 AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
+AM_CONDITIONAL([COND_powerpc64le_ieee1275], [test x$target_cpu = xpowerpc64le -a x$platform = xieee1275])
 AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
 AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
 AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
diff --git a/gentpl.py b/gentpl.py
index bdcae1a..744bed0 100644
--- a/gentpl.py
+++ b/gentpl.py
@@ -30,7 +30,7 @@ GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
                    "i386_multiboot", "i386_ieee1275", "x86_64_efi",
                    "i386_xen", "x86_64_xen",
                    "mips_loongson", "sparc64_ieee1275",
-                   "powerpc_ieee1275", "mips_arc", "ia64_efi",
+                   "powerpc_ieee1275", "powerpc64le_ieee1275", "mips_arc", "ia64_efi",
                    "mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi" ]
 
 GROUPS = {}
@@ -44,12 +44,13 @@ GROUPS["x86"]      = GROUPS["i386"] + GROUPS["x86_64"]
 GROUPS["mips"]     = [ "mips_loongson", "mips_qemu_mips", "mips_arc" ]
 GROUPS["sparc64"]  = [ "sparc64_ieee1275" ]
 GROUPS["powerpc"]  = [ "powerpc_ieee1275" ]
+GROUPS["powerpc64le"]  = [ "powerpc64le_ieee1275" ]
 GROUPS["arm"]      = [ "arm_uboot", "arm_efi" ]
 GROUPS["arm64"]    = [ "arm64_efi" ]
 
 # Groups based on firmware
 GROUPS["efi"]  = [ "i386_efi", "x86_64_efi", "ia64_efi", "arm_efi", "arm64_efi" ]
-GROUPS["ieee1275"]   = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ]
+GROUPS["ieee1275"]   = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275", "powerpc64le_ieee1275" ]
 GROUPS["uboot"] = [ "arm_uboot" ]
 GROUPS["xen"]  = [ "i386_xen", "x86_64_xen" ]
 
@@ -58,7 +59,7 @@ GROUPS["noemu"]   = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
 
 # Groups based on hardware features
 GROUPS["cmos"] = GROUPS["x86"][:] + ["mips_loongson", "mips_qemu_mips",
-                                     "sparc64_ieee1275", "powerpc_ieee1275"]
+                                     "sparc64_ieee1275", "powerpc_ieee1275", "powerpc64le_ieee1275" ]
 GROUPS["cmos"].remove("i386_efi"); GROUPS["cmos"].remove("x86_64_efi");
 GROUPS["pci"]      = GROUPS["x86"] + ["mips_loongson"]
 GROUPS["usb"]      = GROUPS["pci"]
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
index 5c087c8..d9034c1 100644
--- a/grub-core/Makefile.am
+++ b/grub-core/Makefile.am
@@ -210,6 +210,13 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
 endif
 
+if COND_powerpc64le_ieee1275
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
+endif
+
 if COND_sparc64_ieee1275
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sparc64/ieee1275/ieee1275.h
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 42443bc..c6e70bb 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -35,6 +35,7 @@ script = {
   name = grub.chrp;
   common = boot/powerpc/grub.chrp.in;
   enable = powerpc_ieee1275;
+  enable = powerpc64le_ieee1275;
 };
 
 script = {
@@ -42,6 +43,7 @@ script = {
   name = bootinfo.txt;
   common = boot/powerpc/bootinfo.txt.in;
   enable = powerpc_ieee1275;
+  enable = powerpc64le_ieee1275;
 };
 
 kernel = {
@@ -87,6 +89,7 @@ kernel = {
 
   mips_loongson_ldflags    = '-Wl,-Ttext,0x80200000';
   powerpc_ieee1275_ldflags = '-Wl,-Ttext,0x200000';
+  powerpc64le_ieee1275_ldflags = '-Wl,-Ttext,0x200000';
   sparc64_ieee1275_ldflags = '-Wl,-Ttext,0x4400';
   mips_arc_ldflags    = '-Wl,-Ttext,$(TARGET_LINK_ADDR)';
   mips_qemu_mips_ldflags    = '-Wl,-Ttext,0x80200000';
@@ -110,6 +113,7 @@ kernel = {
   mips_startup = kern/mips/startup.S;
   sparc64_ieee1275_startup = kern/sparc64/ieee1275/crt0.S;
   powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
+  powerpc64le_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
   arm_uboot_startup = kern/arm/uboot/startup.S;
   arm_efi_startup = kern/arm/efi/startup.S;
   arm64_efi_startup = kern/arm64/efi/startup.S;
@@ -253,6 +257,9 @@ kernel = {
   powerpc_ieee1275 = kern/powerpc/cache.S;
   powerpc_ieee1275 = kern/powerpc/dl.c;
 
+  powerpc64le_ieee1275 = kern/powerpc/cache.S;
+  powerpc64le_ieee1275 = kern/powerpc/dl.c;
+
   sparc64_ieee1275 = kern/sparc64/cache.S;
   sparc64_ieee1275 = kern/sparc64/dl.c;
   sparc64_ieee1275 = kern/sparc64/ieee1275/ieee1275.c;
@@ -754,6 +761,7 @@ module = {
   enable = emu;
   enable = sparc64_ieee1275;
   enable = powerpc_ieee1275;
+  enable = powerpc64le_ieee1275;
   enable = mips_arc;
   enable = ia64_efi;
   enable = arm_efi;
@@ -855,6 +863,7 @@ module = {
   arm_efi = lib/efi/reboot.c;
   arm64_efi = lib/efi/reboot.c;
   powerpc_ieee1275 = lib/ieee1275/reboot.c;
+  powerpc64le_ieee1275 = lib/ieee1275/reboot.c;
   sparc64_ieee1275 = lib/ieee1275/reboot.c;
   mips_arc = lib/mips/arc/reboot.c;
   mips_loongson = lib/mips/loongson/reboot.c;
@@ -1027,12 +1036,14 @@ module = {
   ieee1275 = commands/ieee1275/suspend.c;
   enable = i386_ieee1275;
   enable = powerpc_ieee1275;
+  enable = powerpc64le_ieee1275;
 };
 
 module = {
   name = escc;
   ieee1275 = term/ieee1275/escc.c;
   enable = powerpc_ieee1275;
+  enable = powerpc64le_ieee1275;
 };
 
 module = {
@@ -1537,6 +1548,8 @@ module = {
   mips = lib/mips/relocator.c;
   powerpc = lib/powerpc/relocator_asm.S;
   powerpc = lib/powerpc/relocator.c;
+  powerpc64le = lib/powerpc/relocator_asm.S;
+  powerpc64le = lib/powerpc/relocator.c;
   xen = lib/xen/relocator.c;
   i386_xen = lib/i386/xen/relocator.S;
   x86_64_xen = lib/x86_64/xen/relocator.S;
@@ -1548,6 +1561,7 @@ module = {
 
   enable = mips;
   enable = powerpc;
+  enable = powerpc64le;
   enable = x86;
   enable = xen;
 };
@@ -1559,8 +1573,10 @@ module = {
   uboot = lib/uboot/datetime.c;
   sparc64_ieee1275 = lib/ieee1275/datetime.c;
   powerpc_ieee1275 = lib/ieee1275/datetime.c;
+  powerpc64le_ieee1275 = lib/ieee1275/datetime.c;
   sparc64_ieee1275 = lib/ieee1275/cmos.c;
   powerpc_ieee1275 = lib/ieee1275/cmos.c;
+  powerpc64le_ieee1275 = lib/ieee1275/cmos.c;
   xen = lib/xen/datetime.c;
   xen_cppflags = '$(CPPFLAGS_XEN)';
 
@@ -1669,6 +1685,7 @@ module = {
   i386_pc = lib/i386/pc/vesa_modes_table.c;
   mips = loader/mips/linux.c;
   powerpc_ieee1275 = loader/powerpc/ieee1275/linux.c;
+  powerpc64le_ieee1275 = loader/powerpc/ieee1275/linux.c;
   sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
   ia64_efi = loader/ia64/efi/linux.c;
   arm = loader/arm/linux.c;
@@ -2057,6 +2074,7 @@ module = {
   name = ieee1275_fb;
   ieee1275 = video/ieee1275.c;
   enable = powerpc_ieee1275;
+  enable = powerpc64le_ieee1275;
 };
 
 module = {
diff --git a/include/grub/powerpc64le b/include/grub/powerpc64le
new file mode 120000
index 0000000..9a47ca9
--- /dev/null
+++ b/include/grub/powerpc64le
@@ -0,0 +1 @@
+powerpc
\ No newline at end of file
-- 
1.8.5.3



  reply	other threads:[~2014-02-26 18:32 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 18:30 [RFC PATCH 00/23] grub 64bit little-endian on power Ram Pai
2014-02-26 18:31 ` Ram Pai [this message]
2014-02-26 18:31 ` [RFC PATCH 02/23] Build LE grub as O1 Ram Pai
2014-02-26 18:31 ` [RFC PATCH 03/23] ignore .TOC. symbol Ram Pai
2014-04-01 16:52   ` Andrey Borzenkov
2014-02-26 18:31 ` [RFC PATCH 04/23] grub-install can now recognize and install a LE grub boot loader Ram Pai
2014-02-26 18:31 ` [RFC PATCH 05/23] set ABI version in e_flag of the PPC64LE ELF image Ram Pai
2014-02-26 18:31 ` [RFC PATCH 06/23] Add IEEE1275_ADDR helper Ram Pai
2014-04-01 17:11   ` Andrey Borzenkov
2014-02-26 18:31 ` [RFC PATCH 07/23] Fix some more warnings when casting Ram Pai
2014-02-26 18:31 ` [RFC PATCH 08/23] Add powerpc64 types Ram Pai
2014-04-01 17:15   ` Andrey Borzenkov
2014-04-02 17:02     ` Ram Pai
2014-02-26 18:31 ` [RFC PATCH 09/23] Fix warnings when building powerpc linux loader 64bit Ram Pai
2014-04-01 17:21   ` Andrey Borzenkov
2014-04-02 17:03     ` Ram Pai
2014-02-26 18:31 ` [RFC PATCH 10/23] GRUB_ELF_R_PPC_* processing is applicable only for 32 bit bootloader Ram Pai
2014-02-26 18:31 ` [RFC PATCH 11/23] Fix powerpc setjmp/longjmp 64bit issues Ram Pai
2014-04-01 17:27   ` Andrey Borzenkov
2014-04-02 17:06     ` Ram Pai
2014-04-02 17:19       ` Andrey Borzenkov
2014-04-02 17:48         ` Ram Pai
2014-04-02 17:56           ` Andrey Borzenkov
2014-04-02 18:55             ` Ram Pai
2014-02-26 18:31 ` [RFC PATCH 12/23] Add powerpc64 ieee1275 trampoline Ram Pai
2014-02-26 18:31 ` [RFC PATCH 13/23] Add 64bit support to powerpc startup code Ram Pai
2014-02-26 18:31 ` [RFC PATCH 14/23] Add grub_dl_find_section_addr Ram Pai
2014-02-26 18:31 ` [RFC PATCH 15/23] Add ppc64 relocations Ram Pai
2014-02-26 18:31 ` [RFC PATCH 16/23] ppc64 doesn't need libgcc routines Ram Pai
2014-02-26 18:31 ` [RFC PATCH 17/23] Use FUNC_START/FUNC_END for powerpc function definitions Ram Pai
2014-02-26 18:31 ` [RFC PATCH 18/23] .TOC. symbol is special in ppc64le Ram Pai
2014-02-26 18:31 ` [RFC PATCH 19/23] align .toc section on 4byte boundary Ram Pai
2014-02-26 18:31 ` [RFC PATCH 20/23] fix parameter to firmware calls Ram Pai
2014-04-01 17:45   ` Andrey Borzenkov
2014-04-02 17:08     ` Ram Pai
2014-04-02 17:16       ` Andrey Borzenkov
2014-02-26 18:31 ` [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :) Ram Pai
2014-04-01 17:49   ` Andrey Borzenkov
2014-04-01 20:22     ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-04-03 17:33       ` Ram Pai
2014-04-03 17:53         ` Andrey Borzenkov
2014-04-03 18:37           ` Ram Pai
2014-04-03 19:03             ` Andrey Borzenkov
2014-04-03 19:26               ` Ram Pai
2014-04-03 19:42                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-04-03 20:23                   ` Ram Pai
2014-04-03 19:54                 ` Andrey Borzenkov
2014-04-03 20:32                   ` Ram Pai
2014-04-03 21:41                     ` Vladimir 'phcoder' Serbinenko
2014-04-04  2:28                     ` Andrey Borzenkov
2014-04-04 17:47                       ` Ram Pai
2014-04-04 18:17                         ` Andrey Borzenkov
2014-04-04 18:24                           ` Dinar Valeev
2014-04-04 19:12                             ` Andrey Borzenkov
2014-04-04 20:29                               ` Dinar Valeev
2014-04-04 22:19                                 ` Ram Pai
     [not found]                                   ` <CAEaD8JN9SkqU9+BkU2MYub=aC3Wb143nMPgRWjVbFvgit90yBQ@mail.gmail.com>
2014-04-05  0:04                                     ` Fwd: " Vladimir 'phcoder' Serbinenko
2014-09-27  5:42                             ` Andrei Borzenkov
2014-09-28  6:33                               ` Andrei Borzenkov
2014-04-04  6:37                   ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-04-04 17:08                     ` Andrey Borzenkov
2014-04-05 15:45                       ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-04-05 16:49                         ` Andrey Borzenkov
2014-04-05 18:29                           ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-04-05 18:48                             ` Andrey Borzenkov
2014-04-02 17:09     ` Ram Pai
2014-02-26 18:31 ` [RFC PATCH 22/23] fix segfaults if initrd Ram Pai
2014-02-26 18:31 ` [RFC PATCH 23/23] Optional: Power7 VSX instructions workaround Ram Pai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393439482-20341-2-git-send-email-linuxram@us.ibm.com \
    --to=linuxram@us.ibm.com \
    --cc=anton@au1.ibm.com \
    --cc=grub-devel@gnu.org \
    --cc=tbberry@us.ibm.com \
    --cc=tlfalcon@linux.vnet.ibm.com \
    --cc=tonyb@au1.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.