\ ========== Copyright Header Begin ==========================================
\ Hypervisor Software File: reset.fth
\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
\ - Do no alter or remove copyright notices
\ - Redistribution and use of this software in source and binary forms, with
\ or without modification, are permitted provided that the following
\ - Redistribution of source code must retain the above copyright notice,
\ this list of conditions and the following disclaimer.
\ - Redistribution in binary form must reproduce the above copyright notice,
\ this list of conditions and the following disclaimer in the
\ documentation and/or other materials provided with the distribution.
\ Neither the name of Sun Microsystems, Inc. or the names of contributors
\ may be used to endorse or promote products derived from this software
\ without specific prior written permission.
\ This software is provided "AS IS," without a warranty of any kind.
\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
\ You acknowledge that this software is not designed, licensed or
\ intended for use in the design, construction, operation or maintenance of
\ ========== Copyright Header End ============================================
id: @(#)reset.fth 1.3 07/06/22
copyright: Copyright 2007 Sun Microsystems, Inc. All rights reserved.
copyright: Use is subject to license terms.
\ [define] verify-dropin-copy?
\ [define] dropin-checksum?
h# 4f.42.4d.44 constant dropin-magic
h# 70 constant soft-state-set
1 constant core-api-group
1 constant core-major-version
0 constant core-minor-version
3 constant guest-state-api-group
1 constant guest-state-major-version
0 constant guest-state-minor-version
2 constant sis-transitional
fload ${BP}/arch/sun4s/reset/common.fth
fload ${BP}/arch/sun/auto-field.fth
obj-base obj-size ofd @ fputs
0 F: always brif annul nop
1 F: always brif annul nop
2 F: always brif annul nop
3 F: always brif annul nop
4 F: always brif annul nop
5 F: always brif annul nop
label sccs-string sccs-id cscount ", align end-code
label boot-name$ " bootprom" bounds do i c@ c, loop 0 c, end-code
label obp-name$ " OBP" bounds do i c@ c, loop 0 c, end-code
\ these two labels need to be kept one after the other for proper
label guest-state-align-buffer& h# 20 .align end-code
label guest-state-init-string$
" Openboot initializing" tuck bounds do i c@ c, loop 0 c,
fload ${BP}/cpu/sparc/ultra4v/tlbasm.fth
fload ${BP}/arch/sun4v/niagara/tlbsetup.fth
fload ${BP}/arch/sun4v/savestate.fth
fload ${BP}/arch/sun4v/error-reset.fth
fload ${BP}/arch/sun4v/diagprint.fth
fload ${BP}/pkg/dropins/sparc/find-dropin.fth
fload ${BP}/arch/sun/reset-dropin.fth
%g1 %i0 move \ restore %i's
\ At start up, all hypervisor API calls are disabled. Any calls
\ we need must be enabled with appropriate calls to
core-api-group %o0 set \ core API group
core-major-version %o1 set \ current major version
core-minor-version %o2 set \ current minor version
%g0 0 %o5 add \ api_set_version function
\ Negotiate the guest-state API, and set the initial state.
\ If the guest-staet API is not supported, hypervisor will
\ return an error, but we are not checking the return code
guest-state-api-group %o0 set \ guest state API group
guest-state-major-version %o1 set \ current major version
guest-state-minor-version %o2 set \ current minor version
%g0 0 %o5 add \ api_set_version function
sis-transitional %o0 set \ transitional state
guest-state-init-string$ obj-base - \
%o2 %o1 setx \ location of string
%i0 %o1 %o1 add \ physical address
soft-state-set %o5 set \ soft-state-set function
\ DTLB: 0 -> membase + 8M
\ ITLB: 0 -> membase + 8M
%g0 h# 27 %o5 add \ MMU_ENABLE
\ bclear the first 512KB of memory (@0)
%g0 h# 31 %o5 add \ mem_scrub
%g0 %g0 %g0 subcc \ BAIL!
%l3 %o1 %l3 add \ dump RA
%g0 h# 31 %o5 add \ (mem scrub) delay
here obj-base - h# 20 + scr set
0 L: \ Power On Reset 0x20
power-on-reset always brif annul nop
1 L: \ Watchdog Reset 0x40
save-reset-state call nop
%g0 2 %o1 add \ error code
%o1 %o0 offset-of last-trap# %asi stxa \ last-trap = error-reset-trap
%o1 %o0 offset-of error-reset-trap %asi stxa
error-reset-recovery call nop
save-reset-state call nop
%g0 3 %o1 add \ error code
%o1 %o0 offset-of last-trap# %asi stxa \ last-trap = error-reset-trap
%o1 %o0 offset-of error-reset-trap %asi stxa
error-reset-recovery call nop
save-reset-state call nop
%g0 4 %o1 add \ error code
%o1 %o0 offset-of last-trap# %asi stxa \ last-trap = error-reset-trap
%o1 %o0 offset-of error-reset-trap %asi stxa
error-reset-recovery call nop
save-reset-state call nop
%g0 5 %o1 add \ error code
%o1 %o0 offset-of last-trap# %asi stxa \ last-trap = error-reset-trap
%o1 %o0 offset-of error-reset-trap %asi stxa
error-reset-recovery call nop
" reset-vector" " reset" $export-procedure
fload ${BP}/arch/sun/reset-cleanup.fth