aboutsummaryrefslogtreecommitdiff
path: root/stand/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'stand/powerpc')
-rw-r--r--stand/powerpc/Makefile2
-rw-r--r--stand/powerpc/Makefile.inc2
-rw-r--r--stand/powerpc/boot1.chrp/Makefile4
-rw-r--r--stand/powerpc/boot1.chrp/Makefile.hfs1
-rw-r--r--stand/powerpc/boot1.chrp/boot1.c9
-rwxr-xr-xstand/powerpc/boot1.chrp/generate-hfs.sh6
-rw-r--r--stand/powerpc/boot1.chrp/hfs.tmpl.bz2.uu1
-rw-r--r--stand/powerpc/ofw/Makefile17
-rw-r--r--stand/powerpc/ofw/Makefile.depend12
-rw-r--r--stand/powerpc/ofw/cas.c13
-rw-r--r--stand/powerpc/ofw/conf.c5
-rw-r--r--stand/powerpc/ofw/elf_freebsd.c6
-rw-r--r--stand/powerpc/ofw/ldscript.powerpcle142
-rw-r--r--stand/powerpc/ofw/main.c39
-rw-r--r--stand/powerpc/ofw/ofwfdt.c3
-rw-r--r--stand/powerpc/ofw/powerpc.ldscript3
-rw-r--r--stand/powerpc/ofw/powerpc64.ldscript3
-rw-r--r--stand/powerpc/ofw/powerpc64le.ldscript3
-rw-r--r--stand/powerpc/ofw/powerpcspe.ldscript3
-rw-r--r--stand/powerpc/ofw/ppc-common.ldscript (renamed from stand/powerpc/ofw/ldscript.powerpc)5
-rw-r--r--stand/powerpc/ofw/ppc64_elf_freebsd.c6
-rw-r--r--stand/powerpc/ofw/start.c3
-rw-r--r--stand/powerpc/ofw/trampolineLE.S4
-rw-r--r--stand/powerpc/ofw/version6
24 files changed, 69 insertions, 229 deletions
diff --git a/stand/powerpc/Makefile b/stand/powerpc/Makefile
index d0c5830e4042..c6403f324ba7 100644
--- a/stand/powerpc/Makefile
+++ b/stand/powerpc/Makefile
@@ -1,5 +1,3 @@
-# $FreeBSD$
-
NO_OBJ=t
.include <bsd.init.mk>
diff --git a/stand/powerpc/Makefile.inc b/stand/powerpc/Makefile.inc
index 265f86d1ed55..01b5f23410c8 100644
--- a/stand/powerpc/Makefile.inc
+++ b/stand/powerpc/Makefile.inc
@@ -1,3 +1 @@
-# $FreeBSD$
-
.include "../Makefile.inc"
diff --git a/stand/powerpc/boot1.chrp/Makefile b/stand/powerpc/boot1.chrp/Makefile
index 928f30e7eabb..e67414584bc8 100644
--- a/stand/powerpc/boot1.chrp/Makefile
+++ b/stand/powerpc/boot1.chrp/Makefile
@@ -1,5 +1,3 @@
-# $FreeBSD$
-
.include <bsd.init.mk>
PROG= boot1.elf
@@ -7,7 +5,7 @@ NEWVERSWHAT= "Open Firmware boot block" ${MACHINE_ARCH}
INSTALLFLAGS= -b
FILES= boot1.hfs
-SRCS= boot1.c ashldi3.c syncicache.c
+SRCS= boot1.c ashldi3.c syncicache.c memset.c
CFLAGS+=-I${LDRSRC}
# Load boot1.elf below kernel.
diff --git a/stand/powerpc/boot1.chrp/Makefile.hfs b/stand/powerpc/boot1.chrp/Makefile.hfs
index c6c2d866f6bf..cd526de8ec7a 100644
--- a/stand/powerpc/boot1.chrp/Makefile.hfs
+++ b/stand/powerpc/boot1.chrp/Makefile.hfs
@@ -1,4 +1,3 @@
# This file autogenerated by generate-hfs.sh - DO NOT EDIT
-# $FreeBSD$
BOOTINFO_OFFSET=0x9c
BOOT1_OFFSET=0x1c
diff --git a/stand/powerpc/boot1.chrp/boot1.c b/stand/powerpc/boot1.chrp/boot1.c
index ed7c55d11d6f..1a546f3473e2 100644
--- a/stand/powerpc/boot1.chrp/boot1.c
+++ b/stand/powerpc/boot1.chrp/boot1.c
@@ -15,15 +15,14 @@
* purpose.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/dirent.h>
#include <sys/endian.h>
+#include <sys/stdarg.h>
+
#include <machine/elf.h>
-#include <machine/stdarg.h>
#include <machine/md_var.h>
+
#include <ufs/ffs/fs.h>
#include "paths.h"
@@ -58,7 +57,7 @@ static void exit(int) __dead2;
static void load(const char *);
static int dskread(void *, uint64_t, int);
-static void usage(void);
+static void usage(void) __dead2;
static void bcopy(const void *src, void *dst, size_t len);
static void bzero(void *b, size_t len);
diff --git a/stand/powerpc/boot1.chrp/generate-hfs.sh b/stand/powerpc/boot1.chrp/generate-hfs.sh
index ef368d1566b4..dc2b12d8f826 100755
--- a/stand/powerpc/boot1.chrp/generate-hfs.sh
+++ b/stand/powerpc/boot1.chrp/generate-hfs.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# This script generates the dummy HFS filesystem used for the PowerPC boot
-# blocks. It uses hfsutils (emulators/hfsutils) to generate a template
+# blocks. It uses hfsutils (filesystems/hfsutils) to generate a template
# filesystem with the relevant interesting files. These are then found by
# grep, and the offsets written to a Makefile snippet.
#
@@ -10,8 +10,6 @@
# template (e.g. because the boot block or the CHRP script have grown),
# you must install it from ports.
-# $FreeBSD$
-
HFS_SIZE=1600 #Size in 512-byte blocks of the produced image
CHRPBOOT_SIZE=2k
@@ -50,14 +48,12 @@ BOOTINFO_OFFSET=$(echo 0x$BOOTINFO_OFFSET | awk '{printf("%x\n",$1/512);}')
BOOT1_OFFSET=$(echo 0x$BOOT1_OFFSET | awk '{printf("%x\n",$1/512);}')
echo '# This file autogenerated by generate-hfs.sh - DO NOT EDIT' > Makefile.hfs
-echo '# $FreeBSD$' >> Makefile.hfs
echo "BOOTINFO_OFFSET=0x$BOOTINFO_OFFSET" >> Makefile.hfs
echo "BOOT1_OFFSET=0x$BOOT1_OFFSET" >> Makefile.hfs
bzip2 $OUTPUT_FILE
echo 'HFS template boot filesystem created by generate-hfs.sh' > $OUTPUT_FILE.bz2.uu
echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu
-echo '$FreeBSD$' >> $OUTPUT_FILE.bz2.uu
uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu
rm $OUTPUT_FILE.bz2
diff --git a/stand/powerpc/boot1.chrp/hfs.tmpl.bz2.uu b/stand/powerpc/boot1.chrp/hfs.tmpl.bz2.uu
index 20b7695e6db4..4adb468de6a8 100644
--- a/stand/powerpc/boot1.chrp/hfs.tmpl.bz2.uu
+++ b/stand/powerpc/boot1.chrp/hfs.tmpl.bz2.uu
@@ -1,6 +1,5 @@
HFS template boot filesystem created by generate-hfs.sh
DO NOT EDIT
-$FreeBSD$
begin 644 hfs.tmpl.bz2
M0EIH.3%!629365^MV6L``"]__O___M)20>!0O2$>0#MUW$!$``%%$``@``!`
M!`!R2<`![@H2"2A2-Z)-HC]4`:`-``T:&@&@#0/TTH<`PC":8A@$`R`&$:9,
diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile
index 28eb8ee91fad..552e828b7614 100644
--- a/stand/powerpc/ofw/Makefile
+++ b/stand/powerpc/ofw/Makefile
@@ -1,5 +1,3 @@
-# $FreeBSD$
-
LOADER_CD9660_SUPPORT?= yes
LOADER_EXT2FS_SUPPORT?= no
LOADER_MSDOS_SUPPORT?= no
@@ -18,9 +16,7 @@ INSTALLFLAGS= -b
# Architecture-specific loader code
SRCS= conf.c vers.c main.c elf_freebsd.c ppc64_elf_freebsd.c start.c
-SRCS+= ucmpdi2.c gfx_fb_stub.c
-
-CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken
+SRCS+= ucmpdi2.c
.include "${BOOTSRC}/fdt.mk"
.if ${MK_FDT} == "yes"
@@ -37,6 +33,7 @@ SRCS+= trampolineLE.S
.endif
HELP_FILES= ${FDTSRC}/help.fdt
+HELP_FILENAME= loader.help.ofw
# Always add MI sources
.include "${BOOTSRC}/loader.mk"
@@ -49,18 +46,14 @@ CFLAGS+= -DRELOC=${RELOC} -g
LDFLAGS= -nostdlib -static
-.if ${MACHINE_ARCH} == "powerpc64le"
-LDFLAGS+= -T ${.CURDIR}/ldscript.powerpcle
-.else
-LDFLAGS+= -T ${.CURDIR}/ldscript.powerpc
-.endif
+LDFLAGS+= -L ${.CURDIR} -T ${.CURDIR}/${MACHINE_ARCH}.ldscript
# Open Firmware standalone support library
LIBOFW= ${BOOTOBJ}/libofw/libofw.a
CFLAGS+= -I${BOOTSRC}/libofw
-DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
-LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
+DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA}
+LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA}
MK_PIE= no
diff --git a/stand/powerpc/ofw/Makefile.depend b/stand/powerpc/ofw/Makefile.depend
new file mode 100644
index 000000000000..15a1f9c07f7c
--- /dev/null
+++ b/stand/powerpc/ofw/Makefile.depend
@@ -0,0 +1,12 @@
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/stand/powerpc/ofw/cas.c b/stand/powerpc/ofw/cas.c
index e95af42762a5..45fd4d8d567f 100644
--- a/stand/powerpc/ofw/cas.c
+++ b/stand/powerpc/ofw/cas.c
@@ -23,9 +23,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <openfirm.h>
#include <stand.h>
@@ -43,10 +40,13 @@ __FBSDID("$FreeBSD$");
#define PVR_CPU_P8NVL 0x004c0000
#define PVR_CPU_P8 0x004d0000
#define PVR_CPU_P9 0x004e0000
+#define PVR_CPU_P10 0x00800000
+#define PVR_CPU_P11 0x00820000
#define PVR_CPU_MASK 0xffff0000
#define PVR_ISA_207 0x0f000004
#define PVR_ISA_300 0x0f000005
+#define PVR_ISA_31 0x0f000006
#define PVR_ISA_MASK 0xffffffff
/* loader version of kernel's CPU_MAXSIZE */
@@ -125,7 +125,7 @@ struct opt_vec5 {
} __packed;
static struct ibm_arch_vec {
- struct pvr pvr_list[7];
+ struct pvr pvr_list[10];
uint8_t num_opts;
struct opt_vec_ignore vec1;
struct opt_vec_ignore vec2;
@@ -138,8 +138,11 @@ static struct ibm_arch_vec {
{ htobe32(PVR_CPU_MASK), htobe32(PVR_CPU_P8E) },
{ htobe32(PVR_CPU_MASK), htobe32(PVR_CPU_P8NVL) },
{ htobe32(PVR_CPU_MASK), htobe32(PVR_CPU_P9) },
+ { htobe32(PVR_CPU_MASK), htobe32(PVR_CPU_P10) },
+ { htobe32(PVR_CPU_MASK), htobe32(PVR_CPU_P11) },
{ htobe32(PVR_ISA_MASK), htobe32(PVR_ISA_207) },
{ htobe32(PVR_ISA_MASK), htobe32(PVR_ISA_300) },
+ { htobe32(PVR_ISA_MASK), htobe32(PVR_ISA_31) },
{ 0, 0xffffffffu } /* terminator */
},
4, /* num_opts (4 actually means 5 option vectors) */
@@ -188,7 +191,7 @@ ppc64_cas(void)
{
phandle_t pkg;
ihandle_t inst;
- cell_t err;
+ cell_t err = 0;
uint8_t buf[16], idx, val;
int i, len, rc, radix_mmu;
const char *var;
diff --git a/stand/powerpc/ofw/conf.c b/stand/powerpc/ofw/conf.c
index a472faeed97b..c96048b5a09c 100644
--- a/stand/powerpc/ofw/conf.c
+++ b/stand/powerpc/ofw/conf.c
@@ -24,9 +24,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <stand.h>
#include "bootstrap.h"
#include "libofw.h"
@@ -54,7 +51,7 @@ struct devsw *devsw[] = {
&ofwdisk,
#endif
#if defined(LOADER_NET_SUPPORT)
- &netdev,
+ &ofw_netdev,
#endif
NULL
};
diff --git a/stand/powerpc/ofw/elf_freebsd.c b/stand/powerpc/ofw/elf_freebsd.c
index 89811e965d6e..4d34fa18c5dd 100644
--- a/stand/powerpc/ofw/elf_freebsd.c
+++ b/stand/powerpc/ofw/elf_freebsd.c
@@ -24,9 +24,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/linker.h>
@@ -41,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include "bootstrap.h"
#include "libofw.h"
#include "openfirm.h"
+#include "modinfo.h"
extern char end[];
extern vm_offset_t reloc; /* From <arch>/conf.c */
@@ -60,7 +58,7 @@ __elfN(ofw_loadfile)(char *filename, uint64_t dest,
* No need to sync the icache for modules: this will
* be done by the kernel after relocation.
*/
- if (!strcmp((*result)->f_type, "elf kernel"))
+ if (!strcmp((*result)->f_type, md_kerntype))
__syncicache((void *) (*result)->f_addr, (*result)->f_size);
#endif
return (0);
diff --git a/stand/powerpc/ofw/ldscript.powerpcle b/stand/powerpc/ofw/ldscript.powerpcle
deleted file mode 100644
index 813459b8c242..000000000000
--- a/stand/powerpc/ofw/ldscript.powerpcle
+++ /dev/null
@@ -1,142 +0,0 @@
-/* $FreeBSD$ */
-
-OUTPUT_FORMAT("elf32-powerpcle-freebsd", "elf32-powerpcle-freebsd",
- "elf32-powerpcle-freebsd")
-OUTPUT_ARCH(powerpcle:common)
-ENTRY(_start)
-SEARCH_DIR(/usr/lib);
-PROVIDE (__stack = 0);
-PHDRS
-{
- text PT_LOAD;
-}
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- . = 0x02c00000 + SIZEOF_HEADERS;
- .interp : { *(.interp) } :text
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .gnu.version : { *(.gnu.version) }
- .gnu.version_d : { *(.gnu.version_d) }
- .gnu.version_r : { *(.gnu.version_r) }
- .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) }
- .text :
- {
- *(.text)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.gnu.linkonce.t*)
- } =0
- _etext = .;
- PROVIDE (etext = .);
- .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. */
- . = ((. + 0x1000) & ~(0x1000 - 1));
- .data :
- {
- *(.data)
- *(.gnu.linkonce.d*)
- CONSTRUCTORS
- }
- .data1 : { *(.data1) }
- .got1 : { *(.got1) }
- .dynamic : { *(.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_ = .);
- PROVIDE (_GOT_START_ = .);
- .got : { *(.got) }
- .got.plt : { *(.got.plt) }
- PROVIDE (_GOT_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) }
- .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/stand/powerpc/ofw/main.c b/stand/powerpc/ofw/main.c
index 81195d3f2444..093dda27ae04 100644
--- a/stand/powerpc/ofw/main.c
+++ b/stand/powerpc/ofw/main.c
@@ -25,9 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/endian.h>
#include <stand.h>
@@ -38,9 +35,21 @@ __FBSDID("$FreeBSD$");
#include <machine/asm.h>
#include <machine/psl.h>
-struct arch_switch archsw; /* MI/MD interface boundary */
+#ifdef CAS
+static int ppc64_autoload(void);
+#endif
-extern char end[];
+struct arch_switch archsw = { /* MI/MD interface boundary */
+ .arch_getdev = ofw_getdev,
+ .arch_copyin = ofw_copyin,
+ .arch_copyout = ofw_copyout,
+ .arch_readin = ofw_readin,
+#ifdef CAS
+ .arch_autoload = ppc64_autoload,
+#else
+ .arch_autoload = ofw_autoload,
+#endif
+};
uint32_t acells, scells;
@@ -168,26 +177,14 @@ main(int (*openfirm)(void *))
*/
cons_probe();
- archsw.arch_getdev = ofw_getdev;
- archsw.arch_copyin = ofw_copyin;
- archsw.arch_copyout = ofw_copyout;
- archsw.arch_readin = ofw_readin;
#ifdef CAS
setenv("cas", "1", 0);
- archsw.arch_autoload = ppc64_autoload;
-#else
- archsw.arch_autoload = ofw_autoload;
#endif
/* Set up currdev variable to have hooks in place. */
- env_setenv("currdev", EV_VOLATILE, "", ofw_setcurrdev, env_nounset);
+ env_setenv("currdev", EV_VOLATILE, "", gen_setcurrdev, env_nounset);
- /*
- * March through the device switch probing for things.
- */
- for (i = 0; devsw[i] != NULL; i++)
- if (devsw[i]->dv_init != NULL)
- (devsw[i]->dv_init)();
+ devinit();
printf("\n%s", bootprog_info);
printf("Memory: %lldKB\n", memsize() / 1024);
@@ -207,11 +204,11 @@ main(int (*openfirm)(void *))
bargc = 0;
parse(&bargc, &bargv, bootargs);
if (bargc == 1)
- env_setenv("currdev", EV_VOLATILE, bargv[0], ofw_setcurrdev,
+ env_setenv("currdev", EV_VOLATILE, bargv[0], gen_setcurrdev,
env_nounset);
else
env_setenv("currdev", EV_VOLATILE, bootpath,
- ofw_setcurrdev, env_nounset);
+ gen_setcurrdev, env_nounset);
env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset,
env_nounset);
setenv("LINES", "24", 1); /* optional */
diff --git a/stand/powerpc/ofw/ofwfdt.c b/stand/powerpc/ofw/ofwfdt.c
index ff1458ed2edf..eeb5f132a3f2 100644
--- a/stand/powerpc/ofw/ofwfdt.c
+++ b/stand/powerpc/ofw/ofwfdt.c
@@ -23,9 +23,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <stand.h>
#include <sys/param.h>
#include <fdt_platform.h>
diff --git a/stand/powerpc/ofw/powerpc.ldscript b/stand/powerpc/ofw/powerpc.ldscript
new file mode 100644
index 000000000000..aa48f257af1a
--- /dev/null
+++ b/stand/powerpc/ofw/powerpc.ldscript
@@ -0,0 +1,3 @@
+OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd",
+ "elf32-powerpc-freebsd")
+INCLUDE "ppc-common.ldscript"
diff --git a/stand/powerpc/ofw/powerpc64.ldscript b/stand/powerpc/ofw/powerpc64.ldscript
new file mode 100644
index 000000000000..aa48f257af1a
--- /dev/null
+++ b/stand/powerpc/ofw/powerpc64.ldscript
@@ -0,0 +1,3 @@
+OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd",
+ "elf32-powerpc-freebsd")
+INCLUDE "ppc-common.ldscript"
diff --git a/stand/powerpc/ofw/powerpc64le.ldscript b/stand/powerpc/ofw/powerpc64le.ldscript
new file mode 100644
index 000000000000..269d8121db6b
--- /dev/null
+++ b/stand/powerpc/ofw/powerpc64le.ldscript
@@ -0,0 +1,3 @@
+OUTPUT_FORMAT("elf32-powerpcle-freebsd", "elf32-powerpcle-freebsd",
+ "elf32-powerpcle-freebsd")
+INCLUDE "ppc-common.ldscript"
diff --git a/stand/powerpc/ofw/powerpcspe.ldscript b/stand/powerpc/ofw/powerpcspe.ldscript
new file mode 100644
index 000000000000..aa48f257af1a
--- /dev/null
+++ b/stand/powerpc/ofw/powerpcspe.ldscript
@@ -0,0 +1,3 @@
+OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd",
+ "elf32-powerpc-freebsd")
+INCLUDE "ppc-common.ldscript"
diff --git a/stand/powerpc/ofw/ldscript.powerpc b/stand/powerpc/ofw/ppc-common.ldscript
index 5fa27eaf6a13..e12dee74824a 100644
--- a/stand/powerpc/ofw/ldscript.powerpc
+++ b/stand/powerpc/ofw/ppc-common.ldscript
@@ -1,7 +1,3 @@
-/* $FreeBSD$ */
-
-OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd",
- "elf32-powerpc-freebsd")
OUTPUT_ARCH(powerpc:common)
ENTRY(_start)
SEARCH_DIR(/usr/lib);
@@ -57,6 +53,7 @@ SECTIONS
.sbss2 : { *(.sbss2) }
/* Adjust the address for the data segment to the next page up. */
. = ((. + 0x1000) & ~(0x1000 - 1));
+ .data.rel.ro : { *(.data.rel.ro*) }
.data :
{
*(.data)
diff --git a/stand/powerpc/ofw/ppc64_elf_freebsd.c b/stand/powerpc/ofw/ppc64_elf_freebsd.c
index 38c664228c12..bc68d129f353 100644
--- a/stand/powerpc/ofw/ppc64_elf_freebsd.c
+++ b/stand/powerpc/ofw/ppc64_elf_freebsd.c
@@ -24,9 +24,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#define __ELF_WORD_SIZE 64
#include <sys/param.h>
@@ -41,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include "bootstrap.h"
#include "libofw.h"
#include "openfirm.h"
+#include "modinfo.h"
extern char end[];
extern vm_offset_t reloc; /* From <arch>/conf.c */
@@ -59,7 +57,7 @@ ppc64_ofw_elf_loadfile(char *filename, uint64_t dest,
* No need to sync the icache for modules: this will
* be done by the kernel after relocation.
*/
- if (!strcmp((*result)->f_type, "elf kernel"))
+ if (!strcmp((*result)->f_type, md_kerntype))
__syncicache((void *) (*result)->f_addr, (*result)->f_size);
return (0);
}
diff --git a/stand/powerpc/ofw/start.c b/stand/powerpc/ofw/start.c
index 5e0744be45a3..227fc3bc7fc7 100644
--- a/stand/powerpc/ofw/start.c
+++ b/stand/powerpc/ofw/start.c
@@ -30,9 +30,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <stand.h>
#include "libofw.h"
diff --git a/stand/powerpc/ofw/trampolineLE.S b/stand/powerpc/ofw/trampolineLE.S
index cd940fb3dfee..39f4e9108519 100644
--- a/stand/powerpc/ofw/trampolineLE.S
+++ b/stand/powerpc/ofw/trampolineLE.S
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 Brandon Bergren <bdragon@FreeBSD.org>
*
@@ -23,8 +23,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#include <machine/asm.h>
diff --git a/stand/powerpc/ofw/version b/stand/powerpc/ofw/version
index cb0f6938f966..fd8b01228f46 100644
--- a/stand/powerpc/ofw/version
+++ b/stand/powerpc/ofw/version
@@ -1,6 +1,2 @@
-$FreeBSD$
-
-NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
-file is important. Make sure the current version number is on line 6.
-
+3.0: Lua scripts API stability
0.1: Initial OFW/PowerPC version.