head	1.7;
access;
symbols
	netbsd-11-0-RC6:1.6
	netbsd-11-0-RC5:1.6
	netbsd-11-0-RC4:1.6
	netbsd-11-0-RC3:1.6
	netbsd-11-0-RC2:1.6
	netbsd-11-0-RC1:1.6
	perseant-exfatfs-base-20250801:1.6
	netbsd-11:1.6.0.12
	netbsd-11-base:1.6
	netbsd-10-1-RELEASE:1.6
	perseant-exfatfs-base-20240630:1.6
	perseant-exfatfs:1.6.0.10
	perseant-exfatfs-base:1.6
	netbsd-8-3-RELEASE:1.3.4.3
	netbsd-9-4-RELEASE:1.3
	netbsd-10-0-RELEASE:1.6
	netbsd-10-0-RC6:1.6
	netbsd-10-0-RC5:1.6
	netbsd-10-0-RC4:1.6
	netbsd-10-0-RC3:1.6
	netbsd-10-0-RC2:1.6
	thorpej-ifq:1.6.0.8
	thorpej-ifq-base:1.6
	thorpej-altq-separation:1.6.0.6
	thorpej-altq-separation-base:1.6
	netbsd-10-0-RC1:1.6
	netbsd-10:1.6.0.4
	netbsd-10-base:1.6
	bouyer-sunxi-drm:1.6.0.2
	bouyer-sunxi-drm-base:1.6
	netbsd-9-3-RELEASE:1.3
	thorpej-i2c-spi-conf2:1.5.0.14
	thorpej-i2c-spi-conf2-base:1.5
	thorpej-futex2:1.5.0.12
	thorpej-futex2-base:1.5
	thorpej-cfargs2:1.5.0.10
	thorpej-cfargs2-base:1.5
	cjep_sun2x-base1:1.5
	cjep_sun2x:1.5.0.8
	cjep_sun2x-base:1.5
	cjep_staticlib_x-base1:1.5
	netbsd-9-2-RELEASE:1.3
	cjep_staticlib_x:1.5.0.6
	cjep_staticlib_x-base:1.5
	thorpej-i2c-spi-conf:1.5.0.4
	thorpej-i2c-spi-conf-base:1.5
	thorpej-cfargs:1.5.0.2
	thorpej-cfargs-base:1.5
	thorpej-futex:1.3.0.22
	thorpej-futex-base:1.5
	netbsd-9-1-RELEASE:1.3
	bouyer-xenpvh-base2:1.3
	phil-wifi-20200421:1.3
	bouyer-xenpvh-base1:1.3
	phil-wifi-20200411:1.3
	bouyer-xenpvh:1.3.0.20
	bouyer-xenpvh-base:1.3
	is-mlppp:1.3.0.18
	is-mlppp-base:1.3
	phil-wifi-20200406:1.3
	netbsd-8-2-RELEASE:1.3.4.3
	ad-namecache-base3:1.3
	netbsd-9-0-RELEASE:1.3
	netbsd-9-0-RC2:1.3
	ad-namecache-base2:1.3
	ad-namecache-base1:1.3
	ad-namecache:1.3.0.16
	ad-namecache-base:1.3
	netbsd-9-0-RC1:1.3
	phil-wifi-20191119:1.3
	netbsd-9:1.3.0.14
	netbsd-9-base:1.3
	phil-wifi-20190609:1.3
	netbsd-8-1-RELEASE:1.3.4.3
	netbsd-8-1-RC1:1.3.4.3
	isaki-audio2:1.3.0.12
	isaki-audio2-base:1.3
	pgoyette-compat-merge-20190127:1.3
	pgoyette-compat-20190127:1.3
	pgoyette-compat-20190118:1.3
	pgoyette-compat-1226:1.3
	pgoyette-compat-1126:1.3
	pgoyette-compat-1020:1.3
	pgoyette-compat-0930:1.3
	pgoyette-compat-0906:1.3
	pgoyette-compat-0728:1.3
	netbsd-8-0-RELEASE:1.3.4.3
	phil-wifi:1.3.0.10
	phil-wifi-base:1.3
	pgoyette-compat-0625:1.3
	netbsd-8-0-RC2:1.3.4.3
	pgoyette-compat-0521:1.3
	pgoyette-compat-0502:1.3
	pgoyette-compat-0422:1.3
	netbsd-8-0-RC1:1.3.4.3
	pgoyette-compat-0415:1.3
	pgoyette-compat-0407:1.3
	pgoyette-compat-0330:1.3
	pgoyette-compat-0322:1.3
	pgoyette-compat-0315:1.3
	pgoyette-compat:1.3.0.8
	pgoyette-compat-base:1.3
	tls-maxphys:1.3.0.6
	tls-maxphys-base-20171202:1.3
	matt-nb8-mediatek:1.3.4.3.0.2
	matt-nb8-mediatek-base:1.3.4.3
	netbsd-8:1.3.0.4
	nick-nhusb:1.3.0.2
	nick-nhusb-base-20170825:1.3
	NetBSD-2017-07-22:1.1.1.1
	NetBSD:1.1.1;
locks; strict;
comment	@# @;


1.7
date	2026.06.01.20.34.18;	author andvar;	state Exp;
branches;
next	1.6;
commitid	jlnv00UiF0OAv8IG;

1.6
date	2022.05.28.22.16.43;	author andvar;	state Exp;
branches;
next	1.5;
commitid	hAfSsjsL42hM9SFD;

1.5
date	2021.03.15.18.13.54;	author christos;	state Exp;
branches;
next	1.4;
commitid	6LFiWJNM7cnSVqLC;

1.4
date	2021.03.14.22.58.10;	author christos;	state Exp;
branches;
next	1.3;
commitid	FBZR85IpcxvpxkLC;

1.3
date	2017.08.21.16.36.00;	author christos;	state Exp;
branches
	1.3.2.1
	1.3.4.1
	1.3.6.1
	1.3.22.1;
next	1.2;
commitid	dtPsvwCA0Fr9f64A;

1.2
date	2017.07.24.10.34.54;	author mrg;	state Exp;
branches;
next	1.1;
commitid	reCifQS71lC79t0A;

1.1
date	2017.07.24.08.56.29;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;
commitid	VHIp5TVByCUzAs0A;

1.3.2.1
date	2017.08.21.16.36.00;	author skrll;	state dead;
branches;
next	1.3.2.2;
commitid	UQQpnjvcNkUZn05A;

1.3.2.2
date	2017.08.28.17.51.36;	author skrll;	state Exp;
branches;
next	;
commitid	UQQpnjvcNkUZn05A;

1.3.4.1
date	2017.08.21.16.36.00;	author martin;	state dead;
branches;
next	1.3.4.2;
commitid	4fKy1uPyqUNNFf5A;

1.3.4.2
date	2017.08.30.15.45.04;	author martin;	state Exp;
branches;
next	1.3.4.3;
commitid	4fKy1uPyqUNNFf5A;

1.3.4.3
date	2017.08.31.08.18.08;	author martin;	state Exp;
branches;
next	;
commitid	StHZa1ko0EMkal5A;

1.3.6.1
date	2017.08.21.16.36.00;	author jdolecek;	state dead;
branches;
next	1.3.6.2;
commitid	XcIYRZTAh1LmerhA;

1.3.6.2
date	2017.12.03.11.36.10;	author jdolecek;	state Exp;
branches;
next	;
commitid	XcIYRZTAh1LmerhA;

1.3.22.1
date	2021.04.03.22.28.23;	author thorpej;	state Exp;
branches;
next	;
commitid	1gqS07EfPjskJTNC;

1.1.1.1
date	2017.07.24.08.56.29;	author mrg;	state Exp;
branches;
next	;
commitid	VHIp5TVByCUzAs0A;


desc
@@


1.7
log
@fix various typos in comments.
@
text
@# $NetBSD: Makefile.bootprogs,v 1.6 2022/05/28 22:16:43 andvar Exp $

NOSSP=yes
NOPIE=yes

.include <bsd.own.mk>
.include <bsd.klinks.mk>

S=	${.CURDIR}/../../../../..
COMMON=	${.CURDIR}/../common

.PATH:	${COMMON}

.if ${MACHINE_ARCH:M*64*}
.	if ${MACHINE_ARCH:M*eb}
LDABI=	-melf32btsmipn32
.	else
LDABI=	-melf32ltsmipn32
.	endif
CPUFLAGS+=	-mabi=n32
.endif

STRIPFLAG=
BINMODE= 444

# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBCRTI=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=

STRIP?=	strip

CHECKSIZE_CMD=	SIZE=${SIZE} ${HOST_SH} ${COMMON}/checksize.sh

AFLAGS+=	-DASSEMBLER -D_LOCORE -mno-abicalls -mips64 -msoft-float
# -I${.CURDIR}/../.. done by Makefile.inc
CPPFLAGS+=	-nostdinc -I${.OBJDIR} -D_STANDALONE -I${S}
CFLAGS=		-Os -g -ffreestanding -mno-abicalls -msoft-float -G 0
CFLAGS+=	-mips64
CFLAGS+=	-Werror ${CWARNFLAGS}

NETBSD_VERS!=${HOST_SH} ${S}/conf/osrelease.sh
CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'

CWARNFLAGS+=	-Wno-main 
CWARNFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
CWARNFLAGS+=	-Wno-pointer-sign

VERSIONFLAGS+=-n
.include "${S}/conf/newvers_stand.mk"

# 
# Refer to CFE documentation for a description of these regions.
# 

REGION1_START=		0x20000000		# "Region 1 start"
REGION1_SIZE!=		expr 256 \* 1024	# 256k

LDSCRIPT=		${COMMON}/boot.ldscript

# our memory layout:

#	'unified' boot loaders (e.g. netboot) can consume all of region
#	1 for their text+data, or text+data+bss.

UNIFIED_LOAD_ADDRESS=	${REGION1_START}
UNIFIED_MAX_LOAD!=	expr ${REGION1_SIZE}
UNIFIED_MAX_TOTAL!=	expr ${REGION1_SIZE}

#UNIFIED_HEAP_START=	right after secondary bss
UNIFIED_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#	two-stage boot loaders must share region 1.  The first stage
#	loads into the lowest portion, and uses the highest portion
#	for its heap.  The second stage loads in between the primary image
#	and the heap, and can reuse the memory after it (i.e. the primary's
#	heap) for its own heap.

PRIMARY_LOAD_ADDRESS=	${REGION1_START}
#PRIMARY_MAX_LOAD=	booter dependent, no more than ${PRIMARY_MAX_TOTAL}
PRIMARY_MAX_TOTAL!=	expr 16 \* 1024

# XXX SECONDARY_LOAD_ADDRESS should be
# XXX (${PRIMARY_LOAD_ADDRESS} + ${PRIMARY_MAX_TOTAL}) bt there's no easy
# XXX way to do that calculation and 'ld' wants a single number.
SECONDARY_LOAD_ADDRESS=	0x20004000	# XXX
SECONDARY_MAX_LOAD!=	expr 112 \* 1024
SECONDARY_MAX_TOTAL!=	expr ${REGION1_SIZE} - ${PRIMARY_MAX_TOTAL}

PRIMARY_HEAP_START=	(${SECONDARY_LOAD_ADDRESS} + ${SECONDARY_MAX_LOAD})
PRIMARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#SECONDARY_HEAP_START=	right after secondary bss
SECONDARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#	standalone programs are like kernels.  They load at
#	0xfffffc0000300000 and can use the rest of memory.

STANDPROG_LOAD_ADDRESS=	0xfffffc0000300000


FILE_FORMAT_CPPFLAGS=	-DBOOT_ELF

UNIFIED_CPPFLAGS=	-DUNIFIED_BOOTBLOCK \
			-DHEAP_LIMIT="${UNIFIED_HEAP_LIMIT}" \
			${FILE_FORMAT_CPPFLAGS}

PRIMARY_CPPFLAGS=	-DPRIMARY_BOOTBLOCK \
			-DSECONDARY_LOAD_ADDRESS="${SECONDARY_LOAD_ADDRESS}" \
			-DSECONDARY_MAX_LOAD="${SECONDARY_MAX_LOAD}" \
			-DHEAP_LIMIT="${PRIMARY_HEAP_LIMIT}" \
			-DHEAP_START="${PRIMARY_HEAP_START}"

SECONDARY_CPPFLAGS=	-DSECONDARY_BOOTBLOCK \
			-DHEAP_LIMIT="${SECONDARY_HEAP_LIMIT}" \
			${FILE_FORMAT_CPPFLAGS}

STANDPROG_CPPFLAGS=	-DSTANDALONE_PROGRAM

.include <bsd.prog.mk>

### find out what to use for libkern
KERN_AS=	library
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN=	${KERNLIB}

### find out what to use for libz
Z_AS=		library
.include "${S}/lib/libz/Makefile.inc"
LIBZ=		${ZLIB}

### find out what to use for libsa
SA_AS=		library
SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
.include "${S}/lib/libsa/Makefile.inc"
LIBSA=		${SALIB}

/usr/lib/crt0.o:
	true

/usr/lib/crtbegin.o:
	true

/usr/lib/crtend.o:
	true

cleandir: .WAIT cleandirlocal
cleandirlocal:
	-rm -rf lib
@


1.6
log
@fix various typos in comments.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.bootprogs,v 1.5 2021/03/15 18:13:54 christos Exp $
d63 1
a63 1
# our memory lauout:
@


1.5
log
@- 32 bit mips uses oabi, don't force it to n32.
- compile assembly code with soft-float to kill linker warnings
@
text
@d1 1
a1 1
# $NetBSD: Makefile.bootprogs,v 1.4 2021/03/14 22:58:10 christos Exp $
d76 1
a76 1
#	loads into the lowest portion, and uses the higest portion
@


1.4
log
@Specify the emulation explicitly (n32) so this builds when the default
emulation changes.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.bootprogs,v 1.3 2017/08/21 16:36:00 christos Exp $
d20 1
d37 1
a37 1
AFLAGS+=	-DASSEMBLER -D_LOCORE -mno-abicalls -mips64
a42 1
CPUFLAGS+=	-mabi=n32
@


1.3
log
@no ssp and pie
@
text
@d1 1
a1 1
# $NetBSD: Makefile.bootprogs,v 1.2 2017/07/24 10:34:54 mrg Exp $
d14 8
d42 1
@


1.3.22.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.bootprogs,v 1.5 2021/03/15 18:13:54 christos Exp $
a13 9
.if ${MACHINE_ARCH:M*64*}
.	if ${MACHINE_ARCH:M*eb}
LDABI=	-melf32btsmipn32
.	else
LDABI=	-melf32ltsmipn32
.	endif
CPUFLAGS+=	-mabi=n32
.endif

d28 1
a28 1
AFLAGS+=	-DASSEMBLER -D_LOCORE -mno-abicalls -mips64 -msoft-float
@


1.3.6.1
log
@file Makefile.bootprogs was added on branch tls-maxphys on 2017-12-03 11:36:10 +0000
@
text
@d1 142
@


1.3.6.2
log
@update from HEAD
@
text
@a0 142
# $NetBSD$

NOSSP=yes
NOPIE=yes

.include <bsd.own.mk>
.include <bsd.klinks.mk>

S=	${.CURDIR}/../../../../..
COMMON=	${.CURDIR}/../common

.PATH:	${COMMON}

STRIPFLAG=
BINMODE= 444

# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBCRTI=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=

STRIP?=	strip

CHECKSIZE_CMD=	SIZE=${SIZE} ${HOST_SH} ${COMMON}/checksize.sh

AFLAGS+=	-DASSEMBLER -D_LOCORE -mno-abicalls -mips64
# -I${.CURDIR}/../.. done by Makefile.inc
CPPFLAGS+=	-nostdinc -I${.OBJDIR} -D_STANDALONE -I${S}
CFLAGS=		-Os -g -ffreestanding -mno-abicalls -msoft-float -G 0
CFLAGS+=	-mips64
CFLAGS+=	-Werror ${CWARNFLAGS}

NETBSD_VERS!=${HOST_SH} ${S}/conf/osrelease.sh
CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'

CWARNFLAGS+=	-Wno-main 
CWARNFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
CWARNFLAGS+=	-Wno-pointer-sign

VERSIONFLAGS+=-n
.include "${S}/conf/newvers_stand.mk"

# 
# Refer to CFE documentation for a description of these regions.
# 

REGION1_START=		0x20000000		# "Region 1 start"
REGION1_SIZE!=		expr 256 \* 1024	# 256k

LDSCRIPT=		${COMMON}/boot.ldscript

# our memory lauout:

#	'unified' boot loaders (e.g. netboot) can consume all of region
#	1 for their text+data, or text+data+bss.

UNIFIED_LOAD_ADDRESS=	${REGION1_START}
UNIFIED_MAX_LOAD!=	expr ${REGION1_SIZE}
UNIFIED_MAX_TOTAL!=	expr ${REGION1_SIZE}

#UNIFIED_HEAP_START=	right after secondary bss
UNIFIED_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#	two-stage boot loaders must share region 1.  The first stage
#	loads into the lowest portion, and uses the higest portion
#	for its heap.  The second stage loads in between the primary image
#	and the heap, and can reuse the memory after it (i.e. the primary's
#	heap) for its own heap.

PRIMARY_LOAD_ADDRESS=	${REGION1_START}
#PRIMARY_MAX_LOAD=	booter dependent, no more than ${PRIMARY_MAX_TOTAL}
PRIMARY_MAX_TOTAL!=	expr 16 \* 1024

# XXX SECONDARY_LOAD_ADDRESS should be
# XXX (${PRIMARY_LOAD_ADDRESS} + ${PRIMARY_MAX_TOTAL}) bt there's no easy
# XXX way to do that calculation and 'ld' wants a single number.
SECONDARY_LOAD_ADDRESS=	0x20004000	# XXX
SECONDARY_MAX_LOAD!=	expr 112 \* 1024
SECONDARY_MAX_TOTAL!=	expr ${REGION1_SIZE} - ${PRIMARY_MAX_TOTAL}

PRIMARY_HEAP_START=	(${SECONDARY_LOAD_ADDRESS} + ${SECONDARY_MAX_LOAD})
PRIMARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#SECONDARY_HEAP_START=	right after secondary bss
SECONDARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#	standalone programs are like kernels.  They load at
#	0xfffffc0000300000 and can use the rest of memory.

STANDPROG_LOAD_ADDRESS=	0xfffffc0000300000


FILE_FORMAT_CPPFLAGS=	-DBOOT_ELF

UNIFIED_CPPFLAGS=	-DUNIFIED_BOOTBLOCK \
			-DHEAP_LIMIT="${UNIFIED_HEAP_LIMIT}" \
			${FILE_FORMAT_CPPFLAGS}

PRIMARY_CPPFLAGS=	-DPRIMARY_BOOTBLOCK \
			-DSECONDARY_LOAD_ADDRESS="${SECONDARY_LOAD_ADDRESS}" \
			-DSECONDARY_MAX_LOAD="${SECONDARY_MAX_LOAD}" \
			-DHEAP_LIMIT="${PRIMARY_HEAP_LIMIT}" \
			-DHEAP_START="${PRIMARY_HEAP_START}"

SECONDARY_CPPFLAGS=	-DSECONDARY_BOOTBLOCK \
			-DHEAP_LIMIT="${SECONDARY_HEAP_LIMIT}" \
			${FILE_FORMAT_CPPFLAGS}

STANDPROG_CPPFLAGS=	-DSTANDALONE_PROGRAM

.include <bsd.prog.mk>

### find out what to use for libkern
KERN_AS=	library
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN=	${KERNLIB}

### find out what to use for libz
Z_AS=		library
.include "${S}/lib/libz/Makefile.inc"
LIBZ=		${ZLIB}

### find out what to use for libsa
SA_AS=		library
SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
.include "${S}/lib/libsa/Makefile.inc"
LIBSA=		${SALIB}

/usr/lib/crt0.o:
	true

/usr/lib/crtbegin.o:
	true

/usr/lib/crtend.o:
	true

cleandir: .WAIT cleandirlocal
cleandirlocal:
	-rm -rf lib
@


1.3.4.1
log
@file Makefile.bootprogs was added on branch netbsd-8 on 2017-08-30 15:45:04 +0000
@
text
@d1 142
@


1.3.4.2
log
@Pull up following revision(s) (requested by mrg in ticket #231):
	distrib/sets/lists/base/md.evbmips		1.3
	doc/CHANGES					1.2303-1.2304
	etc/etc.evbmips/MAKEDEV.conf			1.8
	etc/etc.evbmips/Makefile.inc			1.22
	etc/mtree/Makefile				1.37
	etc/mtree/NetBSD.dist.evbmips			1.1
	sys/arch/evbmips/Makefile			1.9
	sys/arch/evbmips/conf/SBMIPS			upto 1.2
	sys/arch/evbmips/conf/SBMIPS.MP			upto 1.2
	sys/arch/evbmips/conf/SBMIPS64			upto 1.2
	sys/arch/evbmips/conf/SBMIPS64.MP		upto 1.2
	sys/arch/evbmips/conf/files.sbmips		upto 1.2
	sys/arch/evbmips/conf/std.sbmips		upto 1.2
	sys/arch/evbmips/include/disklabel.h		1.6
	sys/arch/evbmips/include/loadfile_machdep.h
	sys/arch/evbmips/include/param.h		1.10
	sys/arch/evbmips/include/pci_machdep.h		1.3
	sys/arch/evbmips/sbmips/TODO
	sys/arch/evbmips/sbmips/autoconf.c
	sys/arch/evbmips/sbmips/autoconf.h
	sys/arch/evbmips/sbmips/console.c
	sys/arch/evbmips/sbmips/cpu.c			upto 1.3
	sys/arch/evbmips/sbmips/cpuvar.h
	sys/arch/evbmips/sbmips/disksubr.c
	sys/arch/evbmips/sbmips/leds.h
	sys/arch/evbmips/sbmips/locore_machdep.S
	sys/arch/evbmips/sbmips/machdep.c		upto 1.2
	sys/arch/evbmips/sbmips/rtc.c			upto 1.2
	sys/arch/evbmips/sbmips/sb1250_icu.c		upto 1.2
	sys/arch/evbmips/sbmips/swarm.h
	sys/arch/evbmips/sbmips/systemsw.c		upto 1.2
	sys/arch/evbmips/sbmips/systemsw.h
	sys/arch/evbmips/sbmips/zbbus.c			upto 1.2
	sys/arch/evbmips/stand/Makefile			1.1
	sys/arch/evbmips/stand/sbmips/Makefile
	sys/arch/evbmips/stand/sbmips/Makefile.bootprogs upto 1.2
	sys/arch/evbmips/stand/sbmips/Makefile.bootprogs 1.3
	sys/arch/evbmips/stand/sbmips/Makefile.bootxx
	sys/arch/evbmips/stand/sbmips/Makefile.inc	upto 1.3
	sys/arch/evbmips/stand/sbmips/boot/Makefile
	sys/arch/evbmips/stand/sbmips/boot/filesystem.c
	sys/arch/evbmips/stand/sbmips/boot/version
	sys/arch/evbmips/stand/sbmips/bootxx_cd9660/Makefile
	sys/arch/evbmips/stand/sbmips/bootxx_ffs/Makefile
	sys/arch/evbmips/stand/sbmips/bootxx_lfs/Makefile
	sys/arch/evbmips/stand/sbmips/common/bbinfo.h
	sys/arch/evbmips/stand/sbmips/common/blkdev.c	upto 1.2
	sys/arch/evbmips/stand/sbmips/common/blkdev.h
	sys/arch/evbmips/stand/sbmips/common/boot.c	upto 1.2
	sys/arch/evbmips/stand/sbmips/common/boot.ldscript
	sys/arch/evbmips/stand/sbmips/common/booted_dev.c upto 1.2
	sys/arch/evbmips/stand/sbmips/common/bootxx.c
	sys/arch/evbmips/stand/sbmips/common/cfe.c
	sys/arch/evbmips/stand/sbmips/common/cfe_api.c
	sys/arch/evbmips/stand/sbmips/common/cfe_api.h
	sys/arch/evbmips/stand/sbmips/common/cfe_api_int.h
	sys/arch/evbmips/stand/sbmips/common/cfe_error.h
	sys/arch/evbmips/stand/sbmips/common/cfe_ioctl.h
	sys/arch/evbmips/stand/sbmips/common/checksize.sh
	sys/arch/evbmips/stand/sbmips/common/common.h
	sys/arch/evbmips/stand/sbmips/common/panic_putstr.c
	sys/arch/evbmips/stand/sbmips/common/putstr.c
	sys/arch/evbmips/stand/sbmips/common/start.S
	sys/arch/evbmips/stand/sbmips/netboot/Makefile
	sys/arch/evbmips/stand/sbmips/netboot/conf.c
	sys/arch/evbmips/stand/sbmips/netboot/dev_net.c
	sys/arch/evbmips/stand/sbmips/netboot/devopen.c
	sys/arch/evbmips/stand/sbmips/netboot/getsecs.c	upto 1.2
	sys/arch/evbmips/stand/sbmips/netboot/if_cfe.c	upto 1.2
	sys/arch/evbmips/stand/sbmips/netboot/version
	sys/arch/mips/conf/files.sibyte			1.8
	sys/arch/mips/include/pmap.h			1.70
	sys/arch/mips/sibyte/dev/sbbuswatch.c		1.4
	sys/arch/mips/sibyte/dev/sbmac.c		1.49
	sys/arch/mips/sibyte/dev/sbscn.c		1.43
	sys/arch/mips/sibyte/dev/sbsmbus.c		1.17
	sys/arch/mips/sibyte/dev/sbtimer.c		1.21
	sys/arch/mips/sibyte/dev/sbwdog.c		1.15
	sys/arch/mips/sibyte/pci/sbbrz_pci.c		1.8
	usr.sbin/installboot/installboot.8		1.94

Move sys/arch/sbmips/* into sys/arch/evbmips/*/sbmips.
@
text
@a0 138
# $NetBSD: Makefile.bootprogs,v 1.1.1.1 2017/07/24 08:56:29 mrg Exp $

.include <bsd.own.mk>
.include <bsd.klinks.mk>

S=	${.CURDIR}/../../../..

.PATH:	${.CURDIR}/../common

STRIPFLAG=
BINMODE= 444

# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBCRTI=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=

STRIP?=	strip

CHECKSIZE_CMD=	SIZE=${SIZE} ${HOST_SH} ${.CURDIR}/../common/checksize.sh

AFLAGS+=	-DASSEMBLER -D_LOCORE -mno-abicalls -mips64
# -I${.CURDIR}/../.. done by Makefile.inc
CPPFLAGS+=	-nostdinc -I${.OBJDIR} -D_STANDALONE -I${S}
CFLAGS=		-Os -g -ffreestanding -mno-abicalls -msoft-float -G 0
CFLAGS+=	-mips64
CFLAGS+=	-Werror ${CWARNFLAGS}

NETBSD_VERS!=${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'

CWARNFLAGS+=	-Wno-main 
CWARNFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
CWARNFLAGS+=	-Wno-pointer-sign

VERSIONFLAGS+=-n
.include "${S}/conf/newvers_stand.mk"

# 
# Refer to CFE documentation for a description of these regions.
# 

REGION1_START=		0x20000000		# "Region 1 start"
REGION1_SIZE!=		expr 256 \* 1024	# 256k

LDSCRIPT=		${.CURDIR}/../common/boot.ldscript

# our memory lauout:

#	'unified' boot loaders (e.g. netboot) can consume all of region
#	1 for their text+data, or text+data+bss.

UNIFIED_LOAD_ADDRESS=	${REGION1_START}
UNIFIED_MAX_LOAD!=	expr ${REGION1_SIZE}
UNIFIED_MAX_TOTAL!=	expr ${REGION1_SIZE}

#UNIFIED_HEAP_START=	right after secondary bss
UNIFIED_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#	two-stage boot loaders must share region 1.  The first stage
#	loads into the lowest portion, and uses the higest portion
#	for its heap.  The second stage loads in between the primary image
#	and the heap, and can reuse the memory after it (i.e. the primary's
#	heap) for its own heap.

PRIMARY_LOAD_ADDRESS=	${REGION1_START}
#PRIMARY_MAX_LOAD=	booter dependent, no more than ${PRIMARY_MAX_TOTAL}
PRIMARY_MAX_TOTAL!=	expr 16 \* 1024

# XXX SECONDARY_LOAD_ADDRESS should be
# XXX (${PRIMARY_LOAD_ADDRESS} + ${PRIMARY_MAX_TOTAL}) bt there's no easy
# XXX way to do that calculation and 'ld' wants a single number.
SECONDARY_LOAD_ADDRESS=	0x20004000	# XXX
SECONDARY_MAX_LOAD!=	expr 112 \* 1024
SECONDARY_MAX_TOTAL!=	expr ${REGION1_SIZE} - ${PRIMARY_MAX_TOTAL}

PRIMARY_HEAP_START=	(${SECONDARY_LOAD_ADDRESS} + ${SECONDARY_MAX_LOAD})
PRIMARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#SECONDARY_HEAP_START=	right after secondary bss
SECONDARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#	standalone programs are like kernels.  They load at
#	0xfffffc0000300000 and can use the rest of memory.

STANDPROG_LOAD_ADDRESS=	0xfffffc0000300000


FILE_FORMAT_CPPFLAGS=	-DBOOT_ELF

UNIFIED_CPPFLAGS=	-DUNIFIED_BOOTBLOCK \
			-DHEAP_LIMIT="${UNIFIED_HEAP_LIMIT}" \
			${FILE_FORMAT_CPPFLAGS}

PRIMARY_CPPFLAGS=	-DPRIMARY_BOOTBLOCK \
			-DSECONDARY_LOAD_ADDRESS="${SECONDARY_LOAD_ADDRESS}" \
			-DSECONDARY_MAX_LOAD="${SECONDARY_MAX_LOAD}" \
			-DHEAP_LIMIT="${PRIMARY_HEAP_LIMIT}" \
			-DHEAP_START="${PRIMARY_HEAP_START}"

SECONDARY_CPPFLAGS=	-DSECONDARY_BOOTBLOCK \
			-DHEAP_LIMIT="${SECONDARY_HEAP_LIMIT}" \
			${FILE_FORMAT_CPPFLAGS}

STANDPROG_CPPFLAGS=	-DSTANDALONE_PROGRAM

.include <bsd.prog.mk>

### find out what to use for libkern
KERN_AS=	library
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN=	${KERNLIB}

### find out what to use for libz
Z_AS=		library
.include "${S}/lib/libz/Makefile.inc"
LIBZ=		${ZLIB}

### find out what to use for libsa
SA_AS=		library
SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
.include "${S}/lib/libsa/Makefile.inc"
LIBSA=		${SALIB}

/usr/lib/crt0.o:
	true

/usr/lib/crtbegin.o:
	true

/usr/lib/crtend.o:
	true

cleandir: .WAIT cleandirlocal
cleandirlocal:
	-rm -rf lib
@


1.3.4.3
log
@Adjust reality of the branch to what the previous commit message and
the CHANGES-8.0 entry for Ticket #231 claim.
@
text
@d1 1
a1 4
# $NetBSD: Makefile.bootprogs,v 1.3 2017/08/21 16:36:00 christos Exp $

NOSSP=yes
NOPIE=yes
d6 1
a6 2
S=	${.CURDIR}/../../../../..
COMMON=	${.CURDIR}/../common
d8 1
a8 1
.PATH:	${COMMON}
d22 1
a22 1
CHECKSIZE_CMD=	SIZE=${SIZE} ${HOST_SH} ${COMMON}/checksize.sh
d31 1
a31 1
NETBSD_VERS!=${HOST_SH} ${S}/conf/osrelease.sh
d48 1
a48 1
LDSCRIPT=		${COMMON}/boot.ldscript
@


1.3.2.1
log
@file Makefile.bootprogs was added on branch nick-nhusb on 2017-08-28 17:51:36 +0000
@
text
@d1 142
@


1.3.2.2
log
@Sync with HEAD
@
text
@a0 142
# $NetBSD: Makefile.bootprogs,v 1.3 2017/08/21 16:36:00 christos Exp $

NOSSP=yes
NOPIE=yes

.include <bsd.own.mk>
.include <bsd.klinks.mk>

S=	${.CURDIR}/../../../../..
COMMON=	${.CURDIR}/../common

.PATH:	${COMMON}

STRIPFLAG=
BINMODE= 444

# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBCRTI=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=

STRIP?=	strip

CHECKSIZE_CMD=	SIZE=${SIZE} ${HOST_SH} ${COMMON}/checksize.sh

AFLAGS+=	-DASSEMBLER -D_LOCORE -mno-abicalls -mips64
# -I${.CURDIR}/../.. done by Makefile.inc
CPPFLAGS+=	-nostdinc -I${.OBJDIR} -D_STANDALONE -I${S}
CFLAGS=		-Os -g -ffreestanding -mno-abicalls -msoft-float -G 0
CFLAGS+=	-mips64
CFLAGS+=	-Werror ${CWARNFLAGS}

NETBSD_VERS!=${HOST_SH} ${S}/conf/osrelease.sh
CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'

CWARNFLAGS+=	-Wno-main 
CWARNFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
CWARNFLAGS+=	-Wno-pointer-sign

VERSIONFLAGS+=-n
.include "${S}/conf/newvers_stand.mk"

# 
# Refer to CFE documentation for a description of these regions.
# 

REGION1_START=		0x20000000		# "Region 1 start"
REGION1_SIZE!=		expr 256 \* 1024	# 256k

LDSCRIPT=		${COMMON}/boot.ldscript

# our memory lauout:

#	'unified' boot loaders (e.g. netboot) can consume all of region
#	1 for their text+data, or text+data+bss.

UNIFIED_LOAD_ADDRESS=	${REGION1_START}
UNIFIED_MAX_LOAD!=	expr ${REGION1_SIZE}
UNIFIED_MAX_TOTAL!=	expr ${REGION1_SIZE}

#UNIFIED_HEAP_START=	right after secondary bss
UNIFIED_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#	two-stage boot loaders must share region 1.  The first stage
#	loads into the lowest portion, and uses the higest portion
#	for its heap.  The second stage loads in between the primary image
#	and the heap, and can reuse the memory after it (i.e. the primary's
#	heap) for its own heap.

PRIMARY_LOAD_ADDRESS=	${REGION1_START}
#PRIMARY_MAX_LOAD=	booter dependent, no more than ${PRIMARY_MAX_TOTAL}
PRIMARY_MAX_TOTAL!=	expr 16 \* 1024

# XXX SECONDARY_LOAD_ADDRESS should be
# XXX (${PRIMARY_LOAD_ADDRESS} + ${PRIMARY_MAX_TOTAL}) bt there's no easy
# XXX way to do that calculation and 'ld' wants a single number.
SECONDARY_LOAD_ADDRESS=	0x20004000	# XXX
SECONDARY_MAX_LOAD!=	expr 112 \* 1024
SECONDARY_MAX_TOTAL!=	expr ${REGION1_SIZE} - ${PRIMARY_MAX_TOTAL}

PRIMARY_HEAP_START=	(${SECONDARY_LOAD_ADDRESS} + ${SECONDARY_MAX_LOAD})
PRIMARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#SECONDARY_HEAP_START=	right after secondary bss
SECONDARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})

#	standalone programs are like kernels.  They load at
#	0xfffffc0000300000 and can use the rest of memory.

STANDPROG_LOAD_ADDRESS=	0xfffffc0000300000


FILE_FORMAT_CPPFLAGS=	-DBOOT_ELF

UNIFIED_CPPFLAGS=	-DUNIFIED_BOOTBLOCK \
			-DHEAP_LIMIT="${UNIFIED_HEAP_LIMIT}" \
			${FILE_FORMAT_CPPFLAGS}

PRIMARY_CPPFLAGS=	-DPRIMARY_BOOTBLOCK \
			-DSECONDARY_LOAD_ADDRESS="${SECONDARY_LOAD_ADDRESS}" \
			-DSECONDARY_MAX_LOAD="${SECONDARY_MAX_LOAD}" \
			-DHEAP_LIMIT="${PRIMARY_HEAP_LIMIT}" \
			-DHEAP_START="${PRIMARY_HEAP_START}"

SECONDARY_CPPFLAGS=	-DSECONDARY_BOOTBLOCK \
			-DHEAP_LIMIT="${SECONDARY_HEAP_LIMIT}" \
			${FILE_FORMAT_CPPFLAGS}

STANDPROG_CPPFLAGS=	-DSTANDALONE_PROGRAM

.include <bsd.prog.mk>

### find out what to use for libkern
KERN_AS=	library
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN=	${KERNLIB}

### find out what to use for libz
Z_AS=		library
.include "${S}/lib/libz/Makefile.inc"
LIBZ=		${ZLIB}

### find out what to use for libsa
SA_AS=		library
SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
.include "${S}/lib/libsa/Makefile.inc"
LIBSA=		${SALIB}

/usr/lib/crt0.o:
	true

/usr/lib/crtbegin.o:
	true

/usr/lib/crtend.o:
	true

cleandir: .WAIT cleandirlocal
cleandirlocal:
	-rm -rf lib
@


1.2
log
@port this to build under evbmips.
@
text
@d1 4
a4 1
# $NetBSD: Makefile.bootprogs,v 1.1.1.1 2017/07/24 08:56:29 mrg Exp $
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
# $NetBSD: Makefile.bootprogs,v 1.14 2017/04/08 19:53:22 christos Exp $
d6 2
a7 1
S=	${.CURDIR}/../../../..
d9 1
a9 1
.PATH:	${.CURDIR}/../common
d23 1
a23 1
CHECKSIZE_CMD=	SIZE=${SIZE} ${HOST_SH} ${.CURDIR}/../common/checksize.sh
d32 1
a32 1
NETBSD_VERS!=${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
d49 1
a49 1
LDSCRIPT=		${.CURDIR}/../common/boot.ldscript
@


1.1.1.1
log
@import most of the sbmips port into evbmips.  the renames are:
- TODO -> evbmips/sbmips/TODO
- sbmips -> evbmips/sbmips
- stand -> evbmips/stand
- conf/files* -> evbmips/conf/files*
- conf/GENERIC* -> evbmips/conf/SBMIPS*

this is not yet ported and will need to be updated, but it's a first step,
and it doesn't handle any include/* issues that need to be dealt with.
@
text
@@
