aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--Makefile.inc11
-rw-r--r--share/mk/bsd.cpu.mk2
-rw-r--r--share/mk/bsd.endian.mk1
-rw-r--r--share/mk/local.meta.sys.mk2
-rw-r--r--share/mk/src.opts.mk6
-rw-r--r--share/mk/sys.mk2
-rw-r--r--stand/defs.mk8
-rw-r--r--sys/conf/files.powerpc44
-rw-r--r--sys/conf/kern.mk3
-rw-r--r--sys/conf/ldscript.powerpc64le180
-rw-r--r--sys/conf/options.powerpc1
-rw-r--r--sys/modules/Makefile2
-rw-r--r--sys/powerpc/include/param.h4
14 files changed, 223 insertions, 35 deletions
diff --git a/Makefile b/Makefile
index ea4827a0bb26..e7b8b01088d3 100644
--- a/Makefile
+++ b/Makefile
@@ -500,7 +500,7 @@ worlds: .PHONY
EXTRA_ARCHES_mips= mipsel mipshf mipselhf mips64el mips64hf mips64elhf
EXTRA_ARCHES_mips+= mipsn32
# powerpcspe excluded from main list until clang fixed
-EXTRA_ARCHES_powerpc= powerpcspe
+EXTRA_ARCHES_powerpc= powerpcspe powerpc64le
.endif
TARGETS?=amd64 arm arm64 i386 mips powerpc riscv
_UNIVERSE_TARGETS= ${TARGETS}
diff --git a/Makefile.inc1 b/Makefile.inc1
index de4970efeef6..7aa996cc9973 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -152,6 +152,7 @@ KNOWN_ARCHES?= aarch64/arm64 \
mips64hf/mips \
powerpc \
powerpc64/powerpc \
+ powerpc64le/powerpc \
powerpcspe/powerpc \
riscv64/riscv \
riscv64sf/riscv
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index 923dcf49bdda..cc907d79d03e 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -128,7 +128,7 @@ _CPUCFLAGS = -Wa,-me500 -msoft-float
. else
_CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64
. endif
-. elif ${MACHINE_ARCH} == "powerpc64"
+. elif ${MACHINE_ARCH:Mpowerpc64*} != ""
_CPUCFLAGS = -mcpu=${CPUTYPE}
. elif ${MACHINE_CPUARCH} == "mips"
# mips[1234], mips32, mips64, and all later releases need to have mips
diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk
index 03c997e1e59b..667ee174c184 100644
--- a/share/mk/bsd.endian.mk
+++ b/share/mk/bsd.endian.mk
@@ -4,6 +4,7 @@
${MACHINE_ARCH} == "amd64" || \
${MACHINE_ARCH} == "i386" || \
(${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} == "") || \
+ ${MACHINE_ARCH} == "powerpc64le" || \
${MACHINE_CPUARCH} == "riscv" || \
${MACHINE_ARCH:Mmips*el*} != ""
TARGET_ENDIANNESS= 1234
diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk
index 0212d00ee1d9..aaf6ecc5fe58 100644
--- a/share/mk/local.meta.sys.mk
+++ b/share/mk/local.meta.sys.mk
@@ -17,7 +17,7 @@ MK_INSTALL_AS_USER= yes
TARGET_ARCHES_arm?= arm armv6 armv7
TARGET_ARCHES_arm64?= aarch64
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipsn32el
-TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe
+TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpc64le powerpcspe
TARGET_ARCHES_riscv?= riscv64 riscv64sf
# some corner cases
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index b0efef7d4564..d71b05d3ec99 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -354,14 +354,14 @@ BROKEN_OPTIONS+=MLX5TOOL
BROKEN_OPTIONS+=HYPERV
.endif
-# NVME is only aarch64, x86 and powerpc64
+# NVME is only aarch64, x86 and powerpc64*
.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
- ${__T} != "powerpc64"
+ ${__T:Mpowerpc64*} == ""
BROKEN_OPTIONS+=NVME
.endif
.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \
- ${__T} == "powerpc64"
+ ${__T:Mpowerpc64*} != ""
__DEFAULT_YES_OPTIONS+=OPENMP
.else
__DEFAULT_NO_OPTIONS+=OPENMP
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index f064c7eda41d..b3843bb779b7 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX.
# and/or endian. This is called MACHINE_CPU in NetBSD, but that's used
# for something different in FreeBSD.
#
-__TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?(eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv/
+__TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?(eb)?/arm/:C/powerpc(64|64le|spe)/powerpc/:C/riscv64(sf)?/riscv/
MACHINE_CPUARCH=${MACHINE_ARCH:${__TO_CPUARCH}}
.endif
diff --git a/stand/defs.mk b/stand/defs.mk
index 06f582d568f6..54b7a7250c48 100644
--- a/stand/defs.mk
+++ b/stand/defs.mk
@@ -105,10 +105,10 @@ CFLAGS+= -DLOADER_DISK_SUPPORT
# Machine specific flags for all builds here
-# All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc
-# or powerpc64.
-.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+= -m32 -mcpu=powerpc
+# Ensure PowerPC64 and PowerPC64LE boot loaders are compiled as 32 bit
+# and in big endian.
+.if ${MACHINE_ARCH:Mpowerpc64*} != ""
+CFLAGS+= -m32 -mcpu=powerpc -mbig-endian
.endif
# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index 4106c2fe30cd..cb02f60991d8 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -93,7 +93,7 @@ dev/ofw/ofw_standard.c optional aim powerpc
dev/ofw/ofw_subr.c standard
dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac
dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx
-dev/random/darn.c optional powerpc64 !random_loadable
+dev/random/darn.c optional powerpc64 !random_loadable | powerpc64le !random_loadable
dev/scc/scc_bfe_macio.c optional scc powermac
dev/sdhci/fsl_sdhci.c optional mpc85xx sdhci
dev/sec/sec.c optional sec mpc85xx
@@ -136,10 +136,10 @@ powerpc/aim/locore.S optional aim no-obj
powerpc/aim/aim_machdep.c optional aim
powerpc/aim/mmu_oea.c optional aim powerpc
powerpc/aim/mmu_oea64.c optional aim
-powerpc/aim/mmu_radix.c optional aim powerpc64
+powerpc/aim/mmu_radix.c optional aim powerpc64 | aim powerpc64le
powerpc/aim/moea64_native.c optional aim
powerpc/aim/mp_cpudep.c optional aim
-powerpc/aim/slb.c optional aim powerpc64
+powerpc/aim/slb.c optional aim powerpc64 | aim powerpc64le
powerpc/amigaone/platform_amigaone.c optional amigaone
powerpc/amigaone/cpld_a1222.c optional powerpc amigaone | powerpcspe amigaone
powerpc/amigaone/cpld_x5000.c optional powerpc amigaone | powerpc64 amigaone
@@ -153,7 +153,7 @@ powerpc/booke/spe.c optional powerpcspe
powerpc/cpufreq/dfs.c optional cpufreq
powerpc/cpufreq/mpc85xx_jog.c optional cpufreq mpc85xx
powerpc/cpufreq/pcr.c optional cpufreq aim
-powerpc/cpufreq/pmcr.c optional cpufreq aim powerpc64
+powerpc/cpufreq/pmcr.c optional cpufreq aim powerpc64 | cpufreq aim powerpc64le
powerpc/cpufreq/pmufreq.c optional cpufreq aim pmu
powerpc/fpu/fpu_add.c optional fpu_emu | powerpcspe
powerpc/fpu/fpu_compare.c optional fpu_emu | powerpcspe
@@ -192,10 +192,10 @@ powerpc/ofw/ofw_pcib_pci.c optional pci
powerpc/ofw/ofw_real.c optional aim
powerpc/ofw/ofw_syscons.c optional sc aim
powerpc/ofw/ofwcall32.S optional aim powerpc
-powerpc/ofw/ofwcall64.S optional aim powerpc64
+powerpc/ofw/ofwcall64.S optional aim powerpc64 | aim powerpc64le
powerpc/ofw/openpic_ofw.c standard
powerpc/ofw/rtas.c optional aim
-powerpc/ofw/ofw_initrd.c optional md_root_mem powerpc64
+powerpc/ofw/ofw_initrd.c optional md_root_mem powerpc64 | md_root_mem powerpc64le
powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio
powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio
powerpc/powermac/ata_dbdma.c optional powermac ata | powermac atamacio
@@ -236,21 +236,21 @@ powerpc/powernv/platform_powernv.c optional powernv
powerpc/powernv/powernv_centaur.c optional powernv
powerpc/powernv/powernv_xscom.c optional powernv
powerpc/powernv/xive.c optional powernv
-powerpc/powerpc/altivec.c optional powerpc | powerpc64
+powerpc/powerpc/altivec.c optional !powerpcspe
powerpc/powerpc/autoconf.c standard
powerpc/powerpc/bus_machdep.c standard
powerpc/powerpc/busdma_machdep.c standard
powerpc/powerpc/clock.c standard
powerpc/powerpc/copyinout.c optional aim
powerpc/powerpc/cpu.c standard
-powerpc/powerpc/cpu_subr64.S optional powerpc64
+powerpc/powerpc/cpu_subr64.S optional powerpc64 | powerpc64le
powerpc/powerpc/db_disasm.c optional ddb
powerpc/powerpc/db_hwwatch.c optional ddb
powerpc/powerpc/db_interface.c optional ddb
powerpc/powerpc/db_trace.c optional ddb
powerpc/powerpc/dump_machdep.c standard
powerpc/powerpc/elf32_machdep.c optional powerpc | powerpcspe | compat_freebsd32
-powerpc/powerpc/elf64_machdep.c optional powerpc64
+powerpc/powerpc/elf64_machdep.c optional powerpc64 | powerpc64le
powerpc/powerpc/exec_machdep.c standard
powerpc/powerpc/fpu.c standard
powerpc/powerpc/gdb_machdep.c optional gdb
@@ -260,7 +260,7 @@ powerpc/powerpc/intr_machdep.c standard
powerpc/powerpc/iommu_if.m standard
powerpc/powerpc/machdep.c standard
powerpc/powerpc/mem.c optional mem
-powerpc/powerpc/minidump_machdep.c optional powerpc64
+powerpc/powerpc/minidump_machdep.c optional powerpc64 | powerpc64le
powerpc/powerpc/mp_machdep.c optional smp
powerpc/powerpc/nexus.c standard
powerpc/powerpc/openpic.c standard
@@ -272,11 +272,11 @@ powerpc/powerpc/ptrace_machdep.c standard
powerpc/powerpc/sc_machdep.c optional sc
powerpc/powerpc/setjmp.S standard
powerpc/powerpc/sigcode32.S optional powerpc | powerpcspe | compat_freebsd32
-powerpc/powerpc/sigcode64.S optional powerpc64
+powerpc/powerpc/sigcode64.S optional powerpc64 | powerpc64le
powerpc/powerpc/swtch32.S optional powerpc | powerpcspe
-powerpc/powerpc/swtch64.S optional powerpc64
+powerpc/powerpc/swtch64.S optional powerpc64 | powerpc64le
powerpc/powerpc/stack_machdep.c optional ddb | stack
-powerpc/powerpc/support.S optional powerpc64 | booke
+powerpc/powerpc/support.S optional powerpc64 | powerpc64le | booke
powerpc/powerpc/syncicache.c standard
powerpc/powerpc/sys_machdep.c standard
powerpc/powerpc/trap.c standard
@@ -294,19 +294,19 @@ powerpc/ps3/ps3disk.c optional ps3
powerpc/ps3/ps3pic.c optional ps3
powerpc/ps3/ps3_syscons.c optional ps3 vt
powerpc/ps3/ps3-hvcall.S optional ps3
-powerpc/pseries/phyp-hvcall.S optional pseries powerpc64
-powerpc/pseries/mmu_phyp.c optional pseries powerpc64
-powerpc/pseries/phyp_console.c optional pseries powerpc64 uart
-powerpc/pseries/phyp_dbg.c optional pseries powerpc64 gdb
+powerpc/pseries/phyp-hvcall.S optional pseries powerpc64 | pseries powerpc64le
+powerpc/pseries/mmu_phyp.c optional pseries powerpc64 | pseries powerpc64le
+powerpc/pseries/phyp_console.c optional pseries powerpc64 uart | pseries powerpc64le uart
+powerpc/pseries/phyp_dbg.c optional pseries powerpc64 gdb | pseries powerpc64le gdb
powerpc/pseries/phyp_llan.c optional llan
-powerpc/pseries/phyp_vscsi.c optional pseries powerpc64 scbus
+powerpc/pseries/phyp_vscsi.c optional pseries powerpc64 scbus | pseries powerpc64le scbus
powerpc/pseries/platform_chrp.c optional pseries
-powerpc/pseries/plpar_iommu.c optional pseries powerpc64
-powerpc/pseries/plpar_pcibus.c optional pseries powerpc64 pci
+powerpc/pseries/plpar_iommu.c optional pseries powerpc64 | pseries powerpc64le
+powerpc/pseries/plpar_pcibus.c optional pseries powerpc64 pci | pseries powerpc64le pci
powerpc/pseries/rtas_dev.c optional pseries
powerpc/pseries/rtas_pci.c optional pseries pci
-powerpc/pseries/vdevice.c optional pseries powerpc64
-powerpc/pseries/xics.c optional pseries powerpc64
+powerpc/pseries/vdevice.c optional pseries powerpc64 | pseries powerpc64le
+powerpc/pseries/xics.c optional pseries powerpc64 | pseries powerpc64le
powerpc/psim/iobus.c optional psim
powerpc/psim/ata_iobus.c optional ata psim
powerpc/psim/openpic_iobus.c optional psim
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index de5286688e13..89907c6ac148 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -185,7 +185,7 @@ CFLAGS.gcc+= -mno-spe
# Use dot symbols (or, better, the V2 ELF ABI) on powerpc64 to make
# DDB happy. ELFv2, if available, has some other efficiency benefits.
#
-.if ${MACHINE_ARCH} == "powerpc64"
+.if ${MACHINE_ARCH:Mpowerpc64*} != ""
CFLAGS+= -mabi=elfv2
.endif
@@ -307,6 +307,7 @@ LD_EMULATION_mipsn32el= elf32btsmipn32_fbsd # I don't think this is a thing th
LD_EMULATION_powerpc= elf32ppc_fbsd
LD_EMULATION_powerpcspe= elf32ppc_fbsd
LD_EMULATION_powerpc64= elf64ppc_fbsd
+LD_EMULATION_powerpc64le= elf64lppc_fbsd
LD_EMULATION_riscv64= elf64lriscv
LD_EMULATION_riscv64sf= elf64lriscv
LD_EMULATION=${LD_EMULATION_${MACHINE_ARCH}}
diff --git a/sys/conf/ldscript.powerpc64le b/sys/conf/ldscript.powerpc64le
new file mode 100644
index 000000000000..72f993cb9fb9
--- /dev/null
+++ b/sys/conf/ldscript.powerpc64le
@@ -0,0 +1,180 @@
+/* $FreeBSD$ */
+
+OUTPUT_FORMAT("elf64-powerpcle-freebsd", "elf64-powerpcle-freebsd",
+ "elf64-powerpcle-freebsd")
+OUTPUT_ARCH(powerpc:common64)
+ENTRY(__start)
+SEARCH_DIR(/usr/lib);
+PROVIDE (__stack = 0);
+PHDRS
+{
+ text PT_LOAD ;
+ dynamic PT_DYNAMIC ;
+}
+SECTIONS
+{
+
+ /* Low-address wrapper for bootloaders (kexec/kboot) that can't parse ELF */
+ . = kernbase - 0x100;
+ .kboot : { *(.text.kboot) } :text
+
+ /* Read-only sections, merged into text segment: */
+ . = kernbase;
+ PROVIDE (begin = .);
+
+ .text :
+ {
+ *(.glink)
+ *(.text)
+ *(.stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+ } =0
+ _etext = .;
+ PROVIDE (etext = .);
+
+ /* Do not emit PT_INTERP section, which confuses some loaders (kexec-lite) */
+ /DISCARD/ : { *(.interp) }
+
+ /* Also delete notes */
+ /DISCARD/ : { *(.note.*) }
+
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .note.gnu.build-id : {
+ PROVIDE (__build_id_start = .);
+ *(.note.gnu.build-id)
+ PROVIDE (__build_id_end = .);
+ }
+ .rela.text :
+ { *(.rela.text) *(.rela.gnu.linkonce.t*) }
+ .rela.data :
+ { *(.rela.data) *(.rela.gnu.linkonce.d*) }
+ .rela.rodata :
+ { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+ .rela.got : { *(.rela.got) }
+ .rela.got1 : { *(.rela.got1) }
+ .rela.got2 : { *(.rela.got2) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rela.init : { *(.rela.init) }
+ .rela.fini : { *(.rela.fini) }
+ .rela.bss : { *(.rela.bss) }
+ .rela.plt : { *(.rela.plt) }
+ .rela.sdata : { *(.rela.sdata) }
+ .rela.sbss : { *(.rela.sbss) }
+ .rela.sdata2 : { *(.rela.sdata2) }
+ .rela.sbss2 : { *(.rela.sbss2) }
+
+ .init : { *(.init) } =0
+ .fini : { *(.fini) } =0
+ .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 : { *(.sdata2) }
+ .sbss2 : { *(.sbss2) }
+ /* Adjust the address for the data segment to the next page up. */
+ . = ALIGN(4096);
+ .data.read_frequently :
+ {
+ *(SORT_BY_ALIGNMENT(.data.read_frequently))
+ }
+ .data.read_mostly :
+ {
+ *(.data.read_mostly)
+ }
+ . = ALIGN(128);
+ .data.exclusive_cache_line :
+ {
+ *(.data.exclusive_cache_line)
+ }
+ . = ALIGN(128);
+ .data :
+ {
+ *(.data)
+ *(.gnu.linkonce.d*)
+ }
+ .data1 : { *(.data1) }
+ .toc1 : ALIGN(8) { *(.toc1) }
+ .opd : ALIGN(8) { KEEP (*(.opd)) }
+ .branch_lt : ALIGN(8) { *(.branch_lt) }
+ . = ALIGN(4096);
+ .got : ALIGN(8) { __tocbase = .; *(.got) }
+ .toc : ALIGN(8) { *(.toc) }
+
+ .dynamic : { *(.dynamic) } :text :dynamic
+ /* Put .ctors and .dtors next to the .got2 section, so that the pointers
+ get relocated with -mrelocatable. Also put in the .fixup pointers.
+ The current compiler no longer needs this, but keep it around for 2.7.2 */
+ PROVIDE (_GOT2_START_ = .);
+ .got2 : { *(.got2) }
+ PROVIDE (__CTOR_LIST__ = .);
+ .ctors : { *(.ctors) }
+ PROVIDE (__CTOR_END__ = .);
+ PROVIDE (__DTOR_LIST__ = .);
+ .dtors : { *(.dtors) }
+ PROVIDE (__DTOR_END__ = .);
+ PROVIDE (_FIXUP_START_ = .);
+ .fixup : { *(.fixup) }
+ PROVIDE (_FIXUP_END_ = .);
+ PROVIDE (_GOT2_END_ = .);
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata : { *(.sdata) }
+ _edata = .;
+ PROVIDE (edata = .);
+ .sbss :
+ {
+ PROVIDE (__sbss_start = .);
+ *(.sbss)
+ *(.scommon)
+ *(.dynsbss)
+ PROVIDE (__sbss_end = .);
+ }
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .bss :
+ {
+ PROVIDE (__bss_start = .);
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ _end = . ;
+ PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* These must appear regardless of . */
+}
+
diff --git a/sys/conf/options.powerpc b/sys/conf/options.powerpc
index 83656f5540a0..6e9eb81ecaf0 100644
--- a/sys/conf/options.powerpc
+++ b/sys/conf/options.powerpc
@@ -8,6 +8,7 @@ CELL
POWERPC
POWERPC64
+POWERPC64LE
POWERPCSPE
FPU_EMU
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 44b89a5d0259..305eec0dfdbc 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -779,7 +779,7 @@ _wi= wi
_virtio= virtio
.endif
-.if ${MACHINE_ARCH} == "powerpc64"
+.if ${MACHINE_ARCH:Mpowerpc64*} != ""
_ipmi= ipmi
_ixl= ixl
_nvram= opal_nvram
diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h
index 44fbd2089f30..600d0d310191 100644
--- a/sys/powerpc/include/param.h
+++ b/sys/powerpc/include/param.h
@@ -57,7 +57,11 @@
#endif
#ifndef MACHINE_ARCH
#ifdef __powerpc64__
+#if defined(__LITTLE_ENDIAN__)
+#define MACHINE_ARCH "powerpc64le"
+#else
#define MACHINE_ARCH "powerpc64"
+#endif
#else
#ifdef __SPE__
#define MACHINE_ARCH "powerpcspe"