summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Randhawa <robin.randhawa@arm.com>2011-12-20 15:54:33 +0000
committerRobin Randhawa <robin.randhawa@arm.com>2011-12-20 15:54:33 +0000
commit06193b40307e17cf6b675000abb5859838b0c841 (patch)
treebc792d2f9e8be28dd8ffc2913df4bc0cd6a2b5eb
parent0656dea51f48c51a57e77187de4d5f66a6ba1337 (diff)
Updated to release v2.1.
Intended to be the basis for the VSM development.
-rw-r--r--Release_Notes.txt136
-rw-r--r--acsr/c_helpers.c46
-rw-r--r--acsr/helpers.h46
-rw-r--r--acsr/helpers.s46
-rw-r--r--acsr/v7.s46
-rw-r--r--acsr/v7_c.c46
-rwxr-xr-xbig-little/Makefile116
-rw-r--r--big-little/bl-sec.scf.template42
-rw-r--r--big-little/bl.scf.template34
-rw-r--r--big-little/common/cci.c34
-rw-r--r--big-little/common/hyp_setup.c114
-rwxr-xr-xbig-little/common/hyp_vectors.s159
-rwxr-xr-xbig-little/common/pagetable_setup.c53
-rw-r--r--big-little/common/vgic_handle.c34
-rw-r--r--big-little/common/vgic_setup.c39
-rw-r--r--big-little/common/vgiclib.c99
-rw-r--r--big-little/include/arm.h34
-rw-r--r--big-little/include/bakery.h34
-rw-r--r--big-little/include/bl.h35
-rw-r--r--big-little/include/context.h34
-rw-r--r--big-little/include/events.h61
-rw-r--r--big-little/include/gic_registers.h36
-rw-r--r--big-little/include/handler.h34
-rw-r--r--big-little/include/hvc.h34
-rwxr-xr-xbig-little/include/hyp_types.h34
-rw-r--r--big-little/include/hyp_vmmap.h34
-rw-r--r--big-little/include/int_master.h34
-rw-r--r--big-little/include/misc.h74
-rwxr-xr-xbig-little/include/traps.h34
-rw-r--r--big-little/include/vgiclib.h34
-rw-r--r--big-little/include/virt_helpers.h36
-rw-r--r--big-little/lib/bakery.c34
-rwxr-xr-xbig-little/lib/tube.c34
-rw-r--r--big-little/lib/uart.c36
-rw-r--r--big-little/lib/virt_events.c40
-rw-r--r--big-little/lib/virt_helpers.s65
-rw-r--r--big-little/secure_world/events.c34
-rw-r--r--big-little/secure_world/flat_pagetable.s36
-rw-r--r--big-little/secure_world/monmode_vectors.s407
-rw-r--r--big-little/secure_world/secure_context.c45
-rw-r--r--big-little/secure_world/secure_resets.c100
-rw-r--r--big-little/secure_world/secure_world.h37
-rw-r--r--big-little/secure_world/ve_reset_handler.s62
-rw-r--r--big-little/switcher/context/gic.c75
-rw-r--r--big-little/switcher/context/ns_context.c73
-rw-r--r--big-little/switcher/context/sh_vgic.c37
-rw-r--r--big-little/switcher/trigger/async_switchover.c54
-rwxr-xr-xbig-little/switcher/trigger/handle_switchover.s34
-rw-r--r--big-little/switcher/trigger/sync_switchover.c34
-rw-r--r--big-little/virtualisor/cache_geom.c40
-rw-r--r--big-little/virtualisor/cpus/a15/a15.c34
-rw-r--r--big-little/virtualisor/cpus/a15/include/a15.h34
-rw-r--r--big-little/virtualisor/cpus/a7/a7.c34
-rw-r--r--big-little/virtualisor/cpus/a7/include/a7.h34
-rw-r--r--big-little/virtualisor/include/cache_geom.h34
-rw-r--r--big-little/virtualisor/include/mem_trap.h34
-rw-r--r--big-little/virtualisor/include/virtualisor.h34
-rw-r--r--big-little/virtualisor/mem_trap.c34
-rw-r--r--big-little/virtualisor/vgic_trap_handler.c34
-rw-r--r--big-little/virtualisor/virt_context.c38
-rw-r--r--big-little/virtualisor/virt_handle.c36
-rw-r--r--big-little/virtualisor/virt_setup.c39
-rwxr-xr-xbootwrapper/Makefile38
-rwxr-xr-xbootwrapper/big-little-mp1.mxscript2
-rwxr-xr-xbootwrapper/big-little-mp4.mxscript2
-rwxr-xr-xbootwrapper/bl-mp1-fm-eac.mxscript76
-rwxr-xr-xbootwrapper/bl-mp4-fm-eac.mxscript94
-rwxr-xr-xbootwrapper/boot.S34
-rwxr-xr-xbootwrapper/boot.map.template35
-rw-r--r--bootwrapper/bootargs.S34
-rw-r--r--bootwrapper/bootwrapper.h34
-rw-r--r--bootwrapper/c_start.c34
-rw-r--r--bootwrapper/emubuild.s34
-rw-r--r--bootwrapper/filesystem.S43
-rwxr-xr-xbootwrapper/helpers.S34
-rw-r--r--bootwrapper/helpers.h34
-rw-r--r--bootwrapper/kernel.S34
-rwxr-xr-xbootwrapper/makemap34
-rw-r--r--bootwrapper/uart.c36
-rw-r--r--bootwrapper/vectors.S37
-rw-r--r--bootwrapper/vgic.h34
-rw-r--r--docs/01-Usage.txt30
-rw-r--r--docs/02-Code-layout.txt41
-rw-r--r--docs/03-Linux-kernel-build.txt19
-rw-r--r--docs/04-Cache-hit-rate-howto.txt6
-rw-r--r--docs/06-Optional-rootfs-build.txt6
86 files changed, 2514 insertions, 1659 deletions
diff --git a/Release_Notes.txt b/Release_Notes.txt
index e32ae89..7af4553 100644
--- a/Release_Notes.txt
+++ b/Release_Notes.txt
@@ -8,37 +8,51 @@ Release notes
Copyright (c) 2011, ARM Limited
All rights reserved.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT 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.
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ 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.
b. License details
- 1. This software release is subject to the express, prior,
- acceptance of the 'ARM End User License Agreement for
- Virtualizer Software'.
-
- 2. Subject to this license agreement, ARM provides this software
- release purely as example software and absolves itself of any
- support burden. ARM is open to receiving any constructive
- feedback and at it's discretion, will endeavour to incorporate
- any feedback in subsequent releases of this example software.
+ Copyright (c) 2009-11, ARM Limited. All rights reserved.
+
+ Redistribution and use in source and binary forms, with
+ or without modification, are permitted provided that the
+ following conditions are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions 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 ARM nor the names of its
+ contributors may be used to endorse or promote products
+ derived from this software without specific prior written
+ permission.
c. Document confidentiality status
- Subject to the 'ARM End User License Agreement for Virtualizer Software'.
+ Redistribution of source and compiled code is subject to the
+ license terms above.
d. Product status
- v2.0
+ ARM Virtualizer for Cortex-A15/Cortex-A7 Task Migration v2.1
e. Web address
@@ -56,16 +70,16 @@ Release notes
a. Product release status
- v2.0
+ v2.1
- b. ARM Virtualizer software release v2.0
+ b. ARM Virtualizer software release v2.1
- This software release is a v2.0 snapshot of the ARM
+ This software release is a v2.1 snapshot of the ARM
Virtualizer software.
The ARM Virtualizer software is example code that demonstrates
cluster context switching capability on a coherent dual
- cluster system composed of a Kingfisher cluster and a
+ cluster system composed of a Cortex-A7 cluster and a
Cortex-A15 cluster.
The intent behind this delivery is to allow
@@ -82,7 +96,7 @@ Release notes
This release contains the following file:
- 1. arm-virtualizer-v2.0-ti-040911.tar.bz2
+ 1. arm-virtualizer-v2_1-171111.tar.bz2
- Contains source code for a basic boot wrapper.
@@ -101,49 +115,52 @@ Release notes
This release of the ARM Virtualizer software is capable of rapid
and robust cluster context switching on a coherent system
- between a cluster of up to four Kingfisher processors and a
+ between a cluster of up to four Cortex-A7 processors and a
cluster of up to four Cortex-A15 processors.
In addition, this release of the ARM Virtualizer software
permits payload software (bare-metal software or a Linux
operating system kernel) built for the Cortex-A15 processor
- cluster to run un-modified on a Kingfisher processor cluster.
+ cluster to run un-modified on a Cortex-A7 processor cluster.
This release does not support execution of software built for the
- Kingfisher cluster on the Cortex-A15 cluster.
+ Cortex-A7 cluster on the Cortex-A15 cluster.
e. New features
- 1. Support for cluster switching between MP4 clusters (as opposed to
- only MP1 clusters in the last release).
-
- 2. Support for snoop hit rate calculation using FastModel trace
- plugin infrastructure.
-
- 3. Insertion of trace checkpoints in the virtualizer switching sequence
- that allow the switchover process to be traced and analyzed.
-
- 4. Helper functions have been re-organized into:
+ 1. Code optimizations have been done to lower the number of cycles
+ taken to switch payload software execution between the two clusters.
+ An internal cycle accurate emulation platform was used to perform
+ the optimizations. It is not possible to undertake the same activity
+ on the ARM FastModels. The changes mostly center around:
- 1. Common functions used by the Virtualizer:
+ a. Replacement & rework of C code by assembler routines for
+ initialising the Secure Monitor and HYP mode environment after a
+ warm reset.
- 1. Cache maintenance
+ b. Context of the vGIC shared distributor interface is not saved any
+ longer. Since the interface maintains its state across a switch,
+ changes are made to it directly while restoring context on the
+ inbound cluster.
- 2. Stack manipulation
+ c. MMU is enabled as soon as possible after a warm reset to minimize
+ strongly ordered accesses.
- 3. Spinlocks
+ d. Barrier instructions are being used more optimally.
- 2. CP15 operations
+ e. The copy_words() routine which was used to save and restore the vGIC
+ context using word sized loads and stores has been replaced by the
+ memcpy() library routine. Depending upon the number of bytes that
+ need to be transferred, it chooses an optimal way of saving and
+ restoring context.
- 5. Virtualizer uses UART1 for all error and diagnostic messages
- generated during execution in HYP mode.
-
- 6. More comprehensive documentation.
+ 2. The variant field of the KFS_ID register is used to distinguish
+ between the FastModels and other platform types.
f. Known issues
1. This release does not support execution of software
- built for the Kingfisher cluster on the Cortex-A15
+ built for the Cortex-A7 cluster on the Cortex-A15
cluster.
2. This release is intended to be built in a Linux development
@@ -166,16 +183,10 @@ Release notes
1. Bug fixes
- 1. The inter-cluster synchronization mechanism used a wfe() before
- checking the associated event variable. This sequence has been
- reversed for correct operation.
-
- 2. The context save sequence for the vGIC HYP view interface was
- not clearing pending/active virtual interrupts in the list
- registers. This has been fixed.
-
- 3. Active SPIs which were migrated to the inbound cluster are now
- EOI'ed correctly.
+ 1. vGIC HYP view interface handling code in (common/vgiclib.c) now
+ detects the number of implemented list registers from the vgic
+ type register instead of assuming that the maximum (64) will be
+ present.
h. Test cases and results
@@ -234,5 +245,6 @@ Release notes
incorporate any feedback in subsequent releases of this example
software.
- Any feedback is to be routed through Doug Maass, Senior Partner
- Manager <doug.maass@arm.com>.
+ Any feedback can be routed through Steve Bannister, Software
+ Development Manager: steve.bannister@arm.com
+
diff --git a/acsr/c_helpers.c b/acsr/c_helpers.c
index 5137140..ac181d8 100644
--- a/acsr/c_helpers.c
+++ b/acsr/c_helpers.c
@@ -1,30 +1,24 @@
/*
- Copyright (c) 2009-11, ARM Limited. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions 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 ARM nor the names of its contributors may be used to
- endorse or promote products derived from this software without specific
- prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT 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.
-*/
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
/**
diff --git a/acsr/helpers.h b/acsr/helpers.h
index 0c7fd40..2d8b06f 100644
--- a/acsr/helpers.h
+++ b/acsr/helpers.h
@@ -1,30 +1,24 @@
/*
- Copyright (c) 2009-11, ARM Limited. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions 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 ARM nor the names of its contributors may be used to
- endorse or promote products derived from this software without specific
- prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT 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.
-*/
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
/*
* V7 functions
diff --git a/acsr/helpers.s b/acsr/helpers.s
index c19fa48..99bb2a6 100644
--- a/acsr/helpers.s
+++ b/acsr/helpers.s
@@ -1,28 +1,24 @@
-; Copyright (c) 2009-11, ARM Limited. All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions are met:
-;
-; * Redistributions of source code must retain the above copyright notice,
-; this list of conditions and the following disclaimer.
-; * Redistributions 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 ARM nor the names of its contributors may be used to
-; endorse or promote products derived from this software without specific
-; prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-; CONTRACT, STRICT 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.
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
EXPORT isb
EXPORT dsb
diff --git a/acsr/v7.s b/acsr/v7.s
index 180fc93..ffd1b06 100644
--- a/acsr/v7.s
+++ b/acsr/v7.s
@@ -1,28 +1,24 @@
-; Copyright (c) 2009-11, ARM Limited. All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions are met:
-;
-; * Redistributions of source code must retain the above copyright notice,
-; this list of conditions and the following disclaimer.
-; * Redistributions 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 ARM nor the names of its contributors may be used to
-; endorse or promote products derived from this software without specific
-; prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-; CONTRACT, STRICT 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.
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
EXPORT save_performance_monitors
EXPORT restore_performance_monitors
diff --git a/acsr/v7_c.c b/acsr/v7_c.c
index beed7df..9f8cc11 100644
--- a/acsr/v7_c.c
+++ b/acsr/v7_c.c
@@ -1,30 +1,24 @@
/*
- Copyright (c) 2009-11, ARM Limited. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions 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 ARM nor the names of its contributors may be used to
- endorse or promote products derived from this software without specific
- prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT 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.
-*/
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
/*
* The code to save and restore debug context uses the memory-mapped interface.
diff --git a/big-little/Makefile b/big-little/Makefile
index db3d0c6..7800148 100755
--- a/big-little/Makefile
+++ b/big-little/Makefile
@@ -1,16 +1,24 @@
- # $Copyright:
- # ----------------------------------------------------------------
- # This confidential and proprietary software may be used only as
- # authorised by a licensing agreement from ARM Limited
- # (C) COPYRIGHT 2008-2011 ARM Limited
- # ALL RIGHTS RESERVED
- # The entire notice above must be reproduced on all authorised
- # copies and copies may only be made to the extent permitted
- # by a licensing agreement from ARM Limited.
- # ----------------------------------------------------------------
- # File: Makefile
- # ----------------------------------------------------------------
- # $
+#
+# Copyright (c) 2011, ARM Limited. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with
+# or without modification, are permitted provided that the
+# following conditions are met:
+#
+# Redistributions of source code must retain the above
+# copyright notice, this list of conditions and the
+# following disclaimer.
+#
+# Redistributions 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 ARM nor the names of its
+# contributors may be used to endorse or promote products
+# derived from this software without specific prior written
+# permission.
+#
# Decrease the verbosity of the make script
# can be made verbose by passing V=1 at the make command line
@@ -34,18 +42,17 @@ DEBUG=TRUE
SVGIC_OBJS += sh_vgic.o
###############################################################################################################
# Switcher defines
-SWITCHER ?= TRUE
-ASYNC ?= TRUE
-HYP_TIMERS ?= TRUE
-RAND_ASYNC ?= FALSE
-HOST_CLUSTER ?= 1
-FLUSH_OB_L2 ?= TRUE
-FLUSH_L2_FIX ?= FALSE
-TUBE ?= FALSE
-SYSBENCH ?= FALSE
-
-#ifeq ($(SWITCHER), TRUE)
-
+SWITCHER ?= TRUE
+ASYNC ?= TRUE
+HYP_TIMERS ?= TRUE
+RAND_ASYNC ?= FALSE
+HOST_CLUSTER ?= 1
+FLUSH_OB_L2 ?= TRUE
+FLUSH_L2_FIX ?= FALSE
+TUBE ?= FALSE
+FM_BETA ?= TRUE
+
+ifeq ($(SWITCHER), TRUE)
ifeq ($(ASYNC), FALSE)
HYP_TIMERS = FALSE
endif
@@ -58,14 +65,18 @@ SWITCHER_OBJS = ns_context.o hyp_setup.o pagetable_setup.o virt_helpers.o sync_
virt_events.o bakery.o vgic_setup.o async_switchover.o hyp_vectors.o helpers.o
SECURE_ENTRY_POINT = monmode_vector_table
+
SECURE_OBJS += secure_context.o monmode_vectors.o flat_pagetable.o virt_helpers.o virt_events.o \
- secure_resets.o bakery.o ve_reset_handler.o tube.o helpers.o
-SECURE_ASFLAGS = --apcs /inter --cpu=Eagle --keep --fpu=none --pd "SYSBENCH SETL {$(SYSBENCH)}"
+ secure_resets.o bakery.o tube.o helpers.o
+
+SECURE_ASFLAGS = --apcs /inter --cpu=Eagle --keep --fpu=none --pd "FM_BETA SETL {$(FM_BETA)}"
+
SECURE_CFLAGS = -Iinclude -I. -Isecure_world -I../acsr --cpu=Eagle --fpu=none -O2 \
-DHOST_CLUSTER=$(HOST_CLUSTER) -DSWITCHER=$(SWITCHER) \
- -DFLUSH_OB_L2=$(FLUSH_OB_L2) -DSYSBENCH=$(SYSBENCH) -DTUBE=$(TUBE) -DFLUSH_L2_FIX=$(FLUSH_L2_FIX)
+ -DFLUSH_OB_L2=$(FLUSH_OB_L2) -DTUBE=$(TUBE) -DFLUSH_L2_FIX=$(FLUSH_L2_FIX) -DFM_BETA=$(FM_BETA)
+
SECURE_LDFLAGS = --verbose --map --fpu=none --symbols --noremove --datacompressor=off \
- --entry $(SECURE_ENTRY_POINT) --scatter $(SECURE_MAPFILE)
+ --entry $(SECURE_ENTRY_POINT) --scatter $(SECURE_MAPFILE) --predefine="-DFM_BETA=$(FM_BETA)"
SWITCHER_ASFLAGS += --pd "ASYNC_SWITCH SETL {$(ASYNC)}" \
--pd "RAND_ASYNC SETL {$(RAND_ASYNC)}" \
@@ -79,10 +90,9 @@ SWITCHER_CFLAGS += -DASYNC_SWITCH=$(ASYNC) \
-DUSE_HYP_TIMERS=$(HYP_TIMERS) \
-DFLUSH_OB_L2=$(FLUSH_OB_L2) \
-DTUBE=$(TUBE) \
- -DSYSBENCH=$(SYSBENCH) \
-DFLUSH_L2_FIX=$(FLUSH_L2_FIX) \
-DSWITCHER=$(SWITCHER)
-#endif
+endif
###############################################################################################################
# Virtualisor defines
@@ -100,11 +110,11 @@ VIRTUALISOR_OBJS += virt_handle.o virt_setup.o virt_context.o cache_geom.o mem_t
OBJS += cci.o
ASFLAGS = --apcs /inter --cpu=Eagle --keep --fpu=none \
- $(SWITCHER_ASFLAGS) \
- $(VIRTUALISOR_ASFLAGS)
+ $(SWITCHER_ASFLAGS) \
+ $(VIRTUALISOR_ASFLAGS)
CFLAGS = -Iinclude -I. -Ivirtualisor/include -Ivirtualisor/cpus/a7/include \
- -Ivirtualisor/cpus/a15/include -I../acsr \
+ -Ivirtualisor/cpus/a15/include -I../acsr \
--cpu=Eagle --fpu=none -O2 $(SWITCHER_CFLAGS) $(VIRTUALISOR_CFLAGS)
ifdef DEBUG
@@ -127,7 +137,12 @@ AS = armasm
AR = armar
LD = armlink
+
+ifeq ($(FM_BETA), FALSE)
+all: bl.axf bl_sec.axf wboot.bin
+else
all: bl.axf bl_sec.axf
+endif
clean:
@echo " CLEAN"
@@ -147,7 +162,7 @@ dump:
fromelf --text -c bl.axf > bl.dump
fromelf --text -c bl_sec.axf > bl_sec.dump
-%.o: %.s
+%.o: %.s
@echo " AS $<"
$(Q)$(AS) $(ASFLAGS) $< -o $@
@@ -161,12 +176,33 @@ bl.axf: $(OBJS)
@echo " LD $@"
$(Q)$(LD) $(LDFLAGS) --symdefs=bl_symdef.o $(OBJS) -o $@ > $(LISTFILE)
-bl.ar: $(OBJS)
+ifeq ($(FM_BETA), FALSE)
+wboot.axf: ve_reset_handler.o
+ @echo " LD $@"
+ $(Q)$(LD) --ro-base=0x0 $< -o $@ > $(LISTFILE)
+
+wboot.bin: wboot.axf
+ @echo " BIN $@"
+ $(Q)fromelf --bin $< --output $@
+else
+SECURE_OBJS += ve_reset_handler.o
+wboot.bin:
+endif
+
+bl.ar: $(OBJS)
@echo " AR $@"
$(Q)$(AR) -r $@ $(OBJS)
-%.bin: %.axf
- fromelf --bin $< --output $@
+%.bin: %.axf
+ fromelf --bin $< --output $@
+
+ve_reset_handler.o: ve_reset_handler.s
+ @echo " AS $<"
+ $(Q)$(AS) $(SECURE_ASFLAGS) $< -o $@
+
+secure_resets.o: secure_resets.c
+ @echo " CC $<"
+ $(Q)$(CC) $(SECURE_CFLAGS) -c $< -o $@
monmode_vectors.o: monmode_vectors.s
@echo " AS $<"
@@ -180,12 +216,12 @@ secure_context.o: secure_context.c
@echo " CC $<"
$(Q)$(CC) $(SECURE_CFLAGS) -c $< -o $@
-bl_sec.axf: $(SECURE_OBJS)
+bl_sec.axf: $(SECURE_OBJS)
$(Q)cat $(SECURE_MAPFILE).template > $(SECURE_MAPFILE)
$(Q)sed -i -e "s/HIBASE/${HIBASE}/g" $(SECURE_MAPFILE)
$(Q)$(LD) $(SECURE_LDFLAGS) --symdefs=bl_sec_symdef.o $(SECURE_OBJS) -o $@ > $(SECURE_LISTFILE)
-bl_sec.ar: $(SECURE_OBJS)
+bl_sec.ar: $(SECURE_OBJS)
$(Q)$(AR) -r $@ $(SECURE_OBJS)
diff --git a/big-little/bl-sec.scf.template b/big-little/bl-sec.scf.template
index 8340ebd..47aaec4 100644
--- a/big-little/bl-sec.scf.template
+++ b/big-little/bl-sec.scf.template
@@ -1,24 +1,38 @@
- ; $Copyright:
- ; ----------------------------------------------------------------
- ; This confidential and proprietary software may be used only as
- ; authorised by a licensing agreement from ARM Limited
- ; (C) COPYRIGHT 2008-2011 ARM Limited
- ; ALL RIGHTS RESERVED
- ; The entire notice above must be reproduced on all authorised
- ; copies and copies may only be made to the extent permitted
- ; by a licensing agreement from ARM Limited.
- ; ----------------------------------------------------------------
- ; File: bl-ve-sec.scf.template
- ; ----------------------------------------------------------------
- ; $
+#! armcc -E
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
+#define TRUE 1
+#define FALSE 0
+
+#if FM_BETA
JUMP_LOAD 0x0 0x100
{
JUMP_EXEC 0x0 0x100
{
- ve_reset_handler.o (+RO, +RW, +ZI)
+ ve_reset_handler.o (+RO, +RW, +ZI)
}
}
+#endif
LOAD_REGION1 HIBASE00000 NOCOMPRESS ALIGN 4096 65536
{
diff --git a/big-little/bl.scf.template b/big-little/bl.scf.template
index c3ea58d..c764526 100644
--- a/big-little/bl.scf.template
+++ b/big-little/bl.scf.template
@@ -1,16 +1,24 @@
- ; $Copyright:
- ; ----------------------------------------------------------------
- ; This confidential and proprietary software may be used only as
- ; authorised by a licensing agreement from ARM Limited
- ; (C) COPYRIGHT 2008-2011 ARM Limited
- ; ALL RIGHTS RESERVED
- ; The entire notice above must be reproduced on all authorised
- ; copies and copies may only be made to the extent permitted
- ; by a licensing agreement from ARM Limited.
- ; ----------------------------------------------------------------
- ; File: bl-ve.scf.template
- ; ----------------------------------------------------------------
- ; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
LOAD_REGION1 HIBASE0D000 NOCOMPRESS ALIGN 4096 65536
{
diff --git a/big-little/common/cci.c b/big-little/common/cci.c
index 7a5b7a5..8bf4b5f 100644
--- a/big-little/common/cci.c
+++ b/big-little/common/cci.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: cci.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "misc.h"
#include "virt_helpers.h"
diff --git a/big-little/common/hyp_setup.c b/big-little/common/hyp_setup.c
index 37c0e8a..d65aafc 100644
--- a/big-little/common/hyp_setup.c
+++ b/big-little/common/hyp_setup.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: hyp_setup.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "context.h"
#include "misc.h"
@@ -45,63 +51,57 @@ unsigned event[NUM_CPUS][MAX_EVENTS] __attribute__ ((section("BL_DV_PAGE")));
/*
* C function to perform the remaining initialisation
- * once the MMU has been enabled after a cold/warm reset
+ * once the MMU has been enabled after a cold reset
*/
void bl_rest_init(void)
{
- unsigned warm_boot = reset_type();
unsigned first_cpu = find_first_cpu();
unsigned cpu_id = read_cpuid();
unsigned cluster_id = read_clusterid();
+ unsigned warm_reset = 0;
/* HYP mode initialisation performed after every reset */
write_hvbar((unsigned)&vectors);
Enable2ndStagePageTables();
- if (!warm_boot) {
-
- /* Initialise a per cpu UART */
- config_uart();
-
- if (switcher) {
- /*
- * Ask the secure world to initialise its context.
- * Not required when "always on"
- */
- smc(SMC_SEC_INIT, 0);
-
- /*
- * Since we are using the shared vgic, we need to map
- * the cpuids to the cpu interfaces as there is no
- * longer a 1:1 mapping
- */
- map_cpuif();
-
- if (async_switchover && first_cpu == cpu_id)
- enable_trigger(read_cntfrq());
- } else {
-
- /*
- * Only one cpu should enable the CCI while the other
- * cpus wait.
- */
- if (first_cpu == cpu_id && cluster_id == host_cluster) {
- write32(A7_SL_IFACE_BASE + SNOOP_CTLR_REG, 0x3);
- write32(A15_SL_IFACE_BASE + SNOOP_CTLR_REG, 0x3);
- dsb();
- }
-
- /* Wait for the dust to settle down */
- while (read32(CCI_BASE + STATUS_REG) & 0x1) ;
- }
-
- /* Initialise the Virtual GIC */
- SetupVGIC(warm_boot);
+ /* Initialise a per cpu UART */
+ config_uart();
- SetupVirtualisor(first_cpu);
+ if (switcher) {
+ /*
+ * Ask the secure world to initialise its context.
+ * Not required when "always on"
+ */
+ smc(SMC_SEC_INIT, 0);
+
+ /*
+ * Since we are using the shared vgic, we need to map
+ * the cpuids to the cpu interfaces as there is no
+ * longer a 1:1 mapping
+ */
+ map_cpuif(cluster_id, cpu_id);
+
+ if (async_switchover && first_cpu == cpu_id)
+ enable_trigger(read_cntfrq());
} else {
- restore_context(first_cpu);
+
+ /*
+ * Only one cpu should enable the CCI while the other
+ * cpus wait.
+ */
+ if (first_cpu == cpu_id && cluster_id == host_cluster) {
+ write32(A7_SL_IFACE_BASE + SNOOP_CTLR_REG, 0x3);
+ write32(A15_SL_IFACE_BASE + SNOOP_CTLR_REG, 0x3);
+ dsb();
+ }
+
+ /* Wait for the dust to settle down */
+ while (read32(CCI_BASE + STATUS_REG) & 0x1) ;
}
+
+ /* Initialise the Virtual GIC and the Virtualizer */
+ SetupVGIC(warm_reset);
+ SetupVirtualisor(first_cpu);
return;
}
diff --git a/big-little/common/hyp_vectors.s b/big-little/common/hyp_vectors.s
index a111285..59d1b66 100755
--- a/big-little/common/hyp_vectors.s
+++ b/big-little/common/hyp_vectors.s
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: hyp_vectors.s
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
AREA HypVectors, CODE, READONLY, ALIGN=5
@@ -23,8 +31,9 @@
IMPORT get_sp
IMPORT output_string
IMPORT virt_dead
- IMPORT reset_type
IMPORT SetupVirtExtPageTables
+ IMPORT Enable2ndStagePageTables
+ IMPORT restore_context
IMPORT read_hsctlr
IMPORT write_hsctlr
IMPORT write_hmair0
@@ -44,7 +53,8 @@
EXPORT undef_entry
EXPORT svc_hyp_entry
EXPORT fiq_entry
- EXPORT bl_setup
+ EXPORT bl_setup
+ EXPORT hyp_warm_reset_handler
MACRO
@@ -156,23 +166,29 @@ vectors
bl_setup FUNCTION
; ----------------------------------------------------
- ; This function is called once after a cold and warm
- ; reset and needs a stack to do anything useful in each
- ; case. 'r0-r3' can be corrupted after a cold reset
- ; while all regs are available after a warm reset.
+ ; This function is called after a reset. 'r0-r3' can
+ ; be corrupted after a cold reset.
; Its also assumed that we are taking part in coherency
; already (entered in secure world)
; ----------------------------------------------------
- msr elr_hyp, lr
; ----------------------------------------------------
- ; Enable ICache
+ ; Enable Caches
; ----------------------------------------------------
- bl read_hsctlr
+ mrc p15, 4, r0, c1, c0, 0
orr r0, #ICACHE
- orr r0, #ALIGN
- bl write_hsctlr
-
+ orr r0, #ALIGN
+ orr r0, #DCACHE
+ mcr p15, 4, r0, c1, c0, 0
+ isb
+
+ msr elr_hyp, lr
+
+ ; ----------------------------------------------------
+ ; Give yourself a stack without enabling the MMU so
+ ; that the pagetables can be created in C code.
+ ; ----------------------------------------------------
+
; ----------------------------------------------------
; Allocate the HYP stack first up to do greater things
; ----------------------------------------------------
@@ -181,34 +197,28 @@ bl_setup FUNCTION
ldr r1, [r1]
bl get_sp
mov sp, r0
-
- ; ----------------------------------------------------
- ; Find what whether we are born or just woken up
- ; ----------------------------------------------------
- bl reset_type
- cmp r0, #0
-
+
; ----------------------------------------------------
- ; Create the 2nd stage and HYP mode page tables if this
- ; is a cold reset
+ ; Create the 2nd stage and HYP mode page tables
; ----------------------------------------------------
- bleq SetupVirtExtPageTables
+ bl SetupVirtExtPageTables
; ----------------------------------------------------
; Enable the HYP mode MMU before doing anything further
; ----------------------------------------------------
ldr r0, =hyp_l1_pagetable
MOV r1, #0
- bl write_httbr
- ldr r0, =(IDX2 :OR: IDX1 :OR: IDX0)
- bl write_hmair0
+ mcrr p15, 4, r0, r1, c2
+ ldr r0, =(IDX2 :OR: IDX1 :OR: IDX0)
+ mcr p15, 4, r0, c10, c2, 0
ldr r0, =(EAE :OR: SH0 :OR: ORGN0 :OR: IRGN0 :OR: T0SZ)
- bl write_htcr
- bl read_hsctlr
- ldr r1, =(DCACHE :OR: MMU)
- orr r0, r1
- bl write_hsctlr
-
+ mcr p15, 4, r0, c2, c0, 2
+ mrc p15, 4, r0, c1, c0, 0
+ orr r0, #MMU
+ mcr p15, 4, r0, c1, c0, 0
+ dsb
+ isb
+
; ----------------------------------------------------
; Initialise the remaining bits now that the MMU is on
; ----------------------------------------------------
@@ -324,5 +334,66 @@ next
out
hyp_exit sp
+hyp_warm_reset_handler FUNCTION
+ ; ----------------------------------------------------
+ ; Enable Caches
+ ; ----------------------------------------------------
+ mrc p15, 4, r0, c1, c0, 0
+ orr r0, #ICACHE
+ orr r0, #ALIGN
+ orr r0, #DCACHE
+ mcr p15, 4, r0, c1, c0, 0
+ isb
+
+ ; ----------------------------------------------------
+ ; Enable the HYP mode MMU before doing anything further
+ ; ----------------------------------------------------
+ ldr r0, =hyp_l1_pagetable
+ MOV r1, #0
+ mcrr p15, 4, r0, r1, c2
+ ldr r0, =(IDX2 :OR: IDX1 :OR: IDX0)
+ mcr p15, 4, r0, c10, c2, 0
+ ldr r0, =(EAE :OR: SH0 :OR: ORGN0 :OR: IRGN0 :OR: T0SZ)
+ mcr p15, 4, r0, c2, c0, 2
+ mrc p15, 4, r0, c1, c0, 0
+ orr r0, #MMU
+ mcr p15, 4, r0, c1, c0, 0
+ dsb
+ isb
+
+ ; ----------------------------------------------------
+ ; Initialise the remaining bits now that the MMU is on
+ ; ----------------------------------------------------
+
+ ; ----------------------------------------------------
+ ; Allocate the HYP stack first up to do greater things
+ ; ----------------------------------------------------
+ ldr r0, =guestos_state
+ ldr r1, =guestos_state_size
+ ldr r1, [r1]
+ bl get_sp
+ mov sp, r0
+
+ ; ----------------------------------------------------
+ ; Initialise the HVBAR
+ ; ----------------------------------------------------
+ adr r0, vectors
+ mcr p15, 4, r0, c12, c0, 0
+
+ ; ----------------------------------------------------
+ ; Initialise the 2nd stage translations for NS PL0/1
+ ; ----------------------------------------------------
+ bl Enable2ndStagePageTables
+
+ ; ----------------------------------------------------
+ ; Restore the context now. CPU0 is the first cpu
+ ; ----------------------------------------------------
+ hyp_entry sp
+ mov r0, #0
+ bl restore_context
+ hyp_exit sp
+
+ ENDFUNC
+
END
diff --git a/big-little/common/pagetable_setup.c b/big-little/common/pagetable_setup.c
index 727e913..132ad73 100755
--- a/big-little/common/pagetable_setup.c
+++ b/big-little/common/pagetable_setup.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: pagetable_setup.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
/* ----------------------------------------------------------------------------
* i n c l u d e s
@@ -197,8 +203,9 @@ static void Add4KMapping(four_kb_pt_desc * l3_mapping, unsigned level,
void CreateHypModePageTables(void)
{
- unsigned num_l1_descs = 0, num_l2_descs = 0, l2_attrs =
- 0, l1_index, l2_index;
+ unsigned num_l1_descs = 0, num_l2_descs = 0;
+ unsigned l1_index, l2_index;
+ unsigned long long l2_attrs = 0;
four_kb_pt_desc l3_desc;
/* Create the pagetables */
@@ -213,24 +220,28 @@ void CreateHypModePageTables(void)
for (l2_index = 0; l2_index < num_l2_descs / num_l1_descs;
l2_index++) {
- if ((l2_index + (l1_index << 9)) < 32)
+ if ((l2_index + (l1_index << 9)) < 32) {
/* 0-64M(Secure ROM/NOR Flash):Block mapping with RO access, Inner shareable, Inner/Outer WBWA */
l2_attrs =
BLOCK_MAPPING | HMAIR0_NORMAL_MEM_ATTR_IDX |
NS_BIT | SHAREABILITY(0x3) | ACCESS_FLAG |
AP(KERN_RO);
+ ((unsigned *) &l2_attrs)[1] |= XN;
+ }
else if ((l2_index + (l1_index << 9)) < 64)
/* 64-128M(Secure RAM) : Block mapping with RW access, Inner shareable, Inner/Outer WBWA */
l2_attrs =
BLOCK_MAPPING | HMAIR0_NORMAL_MEM_ATTR_IDX |
NS_BIT | SHAREABILITY(0x3) | ACCESS_FLAG |
AP(KERN_RW);
- else if ((l2_index + (l1_index << 9)) < 1024)
+ else if ((l2_index + (l1_index << 9)) < 1024) {
/* 128-2048M (Peripherals) : Block mapping of Device memory */
l2_attrs =
BLOCK_MAPPING | HMAIR0_DEVICE_MEM_ATTR_IDX |
NS_BIT | SHAREABILITY(0x3) | ACCESS_FLAG |
AP(KERN_RW);
+ ((unsigned *) &l2_attrs)[1] |= XN;
+ }
else
/* 2-4GB (RAM) : Block mapping with RW access, Inner shareable, Inner/Outer WBWA */
l2_attrs =
@@ -370,8 +381,12 @@ void Enable2ndStagePageTables(void)
write_vttbr((unsigned long long)stage2_l2_pagetable);
write_hcr(read_hcr() | HCR_VM);
- isb();
+ /*
+ * TODO: We do not need a synchronization barrier here as we
+ * are not yet executing out of NS PL0 & PL1 and there will be
+ * a barrier at some point before that.
+ */
return;
}
diff --git a/big-little/common/vgic_handle.c b/big-little/common/vgic_handle.c
index e3574e6..4a7ded1 100644
--- a/big-little/common/vgic_handle.c
+++ b/big-little/common/vgic_handle.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: vgic_handle.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "int_master.h"
#include "gic_registers.h"
diff --git a/big-little/common/vgic_setup.c b/big-little/common/vgic_setup.c
index e9c7873..b72359e 100644
--- a/big-little/common/vgic_setup.c
+++ b/big-little/common/vgic_setup.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: vgic_setup.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "int_master.h"
#include "gic_registers.h"
@@ -67,5 +73,10 @@ void SetupVGIC(unsigned warm_reset)
*/
write_hcr(read_hcr() | HCR_AMO | HCR_IMO | HCR_FMO);
+ /*
+ * TODO: Barriers not needed here as there will surely
+ * be others further down the line before virtual
+ * exceptions are used.
+ */
return;
}
diff --git a/big-little/common/vgiclib.c b/big-little/common/vgiclib.c
index 5ee82ae..838fc06 100644
--- a/big-little/common/vgiclib.c
+++ b/big-little/common/vgiclib.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: vgiclib.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "vgiclib.h"
#include "misc.h"
@@ -28,6 +34,7 @@
static struct overflowint *freeoverflows[NUM_CPUS];
static struct overflowint theoverflowints[NUM_CPUS][MAXOVERFLOWINTS];
static struct gic_cpuif cpuifs[NUM_CPUS];
+static unsigned hv_lr_count[NUM_CPUS] = {0};
void dump_vgic_state()
{
@@ -73,6 +80,14 @@ void vgic_init(void)
free_overflowint(&(theoverflowints[cpuid][i]), cpuid);
}
+ /*
+ * Find the number of List registers
+ * TODO: Will not work if individual cpus can have different number
+ * of list registers across clusters. Needs to be detected for each
+ * access then.
+ */
+ hv_lr_count[cpuid] = (read32(VGIC_HV_PHY_BASE + GICH_VTR) & 0x3f) + 1;
+
/* Enable virtual interrupts & if required, maintenance interrupts */
write32(VGIC_HV_PHY_BASE + GICH_CTL, VGICH_HCR_EN);
@@ -137,19 +152,58 @@ static void set_vgic_queue_entry(struct gic_cpuif *cpuif, unsigned int descr)
*oflowh = oflowp;
}
+/*
+ * The vGIC spec implements 64 list registers across two 32-bit status
+ * registers. Since all of the list registers may not be implemented,
+ * this function returns the maximum index we need to bother about.
+ */
+static inline unsigned elrsr_max_index(unsigned cpuid)
+{
+ return (hv_lr_count[cpuid] - 1) >> 5;
+}
+
+/*
+ * In a HYP view list register status register both active and unimplemented
+ * interrupts are represented by a 0 bit. This function returns a 32-bit value
+ * where each set bit represents an active list register. Its basically the
+ * inverse of what the elrsr returns while taking into account unimplemented
+ * interrupts.
+ */
+static unsigned get_elrsr_active_bits(unsigned index, unsigned cpuid, unsigned max_index)
+{
+ unsigned elrsr = ~(read32(VGIC_HV_PHY_BASE + GICH_ELRSR0 + (index << 2)));
+
+ if (index == max_index) {
+ /*
+ * Get the remainder, shift 1 times remainder and subtract 1
+ * from it to form the mask.
+ */
+ elrsr &= (1 << (hv_lr_count[cpuid] - (32 * max_index))) - 1;
+ } else if (index > max_index) {
+ /*
+ * There can never be active virqs when the list registers
+ * do not exist.
+ */
+ elrsr = 0;
+ }
+
+ return elrsr;
+}
+
void vgic_savestate(unsigned int cpu)
{
struct gic_cpuif *cpuif = &(cpuifs[cpu]);
unsigned int i, ctr = 0, cur_elrsr = 0;
+ unsigned max_index = elrsr_max_index(cpu);
- for(ctr = 0; ctr < 2; ctr++) {
+ for(ctr = 0; ctr <= max_index; ctr++) {
/* Negate read value so that set bit corresponds to a !inactive register */
- cur_elrsr = ~(read32(VGIC_HV_PHY_BASE + GICH_ELRSR0 + (ctr << 2)));
+ cur_elrsr = get_elrsr_active_bits(ctr, cpu, max_index);
cpuif->elrsr[ctr] = cur_elrsr;
for(i = bitindex(cur_elrsr); ((int) i) >= 0; i = bitindex(cur_elrsr)) {
unsigned list_reg =
- read32(VGIC_HV_PHY_BASE + GICH_LR_BASE + (i << 2));
+ read32(VGIC_HV_PHY_BASE + GICH_LR_BASE + ((1 << 7) * ctr) + (i << 2));
unsigned int_id = (list_reg >> 10) & 0x3ff;
/* Clear the saved bit index */
@@ -159,7 +213,7 @@ void vgic_savestate(unsigned int cpu)
* Invalidate the pending/active virtual interrupt. Since its a shared vGIC
* this irq will persist till the next switch and hence create a duplicate.
*/
- write32(VGIC_HV_PHY_BASE + GICH_LR_BASE + (i << 2), list_reg & ~(0x3 << 28));
+ write32(VGIC_HV_PHY_BASE + GICH_LR_BASE + ((1 << 7) * ctr) + (i << 2), list_reg & ~(0x3 << 28));
/*
* While saving queued IPI context, ensure that the requesting cpu
@@ -199,12 +253,13 @@ void vgic_loadstate(unsigned int cpu)
{
struct gic_cpuif *cpuif = &(cpuifs[cpu]);
unsigned int i, ctr = 0, cur_elrsr = 0;
+ unsigned max_index = elrsr_max_index(cpu);
- for(ctr = 0; ctr < 2; ctr++) {
+ for(ctr = 0; ctr <= max_index; ctr++) {
cur_elrsr = cpuif->elrsr[ctr];
for(i = bitindex(cur_elrsr); ((int) i) >= 0; i = bitindex(cur_elrsr)) {
- write32(VGIC_HV_PHY_BASE + GICH_LR_BASE + (i << 2), cpuif->ints[i]);
+ write32(VGIC_HV_PHY_BASE + GICH_LR_BASE + ((1 << 7) * ctr) + (i << 2), cpuif->ints[i]);
/* Clear the restored bit index */
cur_elrsr &= ~(1 << i);
@@ -321,7 +376,7 @@ void vgic_refresh(unsigned int cpu)
/*
* Now populate any spare slots with entries from the list (if any). Also fix up the free slot bitmap
*/
- for (i = 0; i < VGIC_LISTENTRIES; i++) {
+ for (i = 0; i < hv_lr_count[cpu]; i++) {
value = get_vgic_entry(i);
if (value & 0x30000000) {
@@ -419,7 +474,7 @@ void enqueue_interrupt(unsigned int descr, unsigned int cpu)
/*
* Otherwise find the lowest priority entry..
*/
- for (i = 0; i < VGIC_LISTENTRIES; i++) {
+ for (i = 0; i < hv_lr_count[cpu]; i++) {
j = (get_vgic_entry(i) >> 20) & 0xFF; /* Get the priority for the current thing in this slot */
if (i == 0 || (j > minpri)) {
minpri = j;
diff --git a/big-little/include/arm.h b/big-little/include/arm.h
index e4c3175..7db58ce 100644
--- a/big-little/include/arm.h
+++ b/big-little/include/arm.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: arm.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef ARM_H
#define ARM_H
diff --git a/big-little/include/bakery.h b/big-little/include/bakery.h
index 8c20467..e8b9ecc 100644
--- a/big-little/include/bakery.h
+++ b/big-little/include/bakery.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: bakery.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef _BAKERY_H_
#define _BAKERY_H_
diff --git a/big-little/include/bl.h b/big-little/include/bl.h
index a08d2fe..700afa2 100644
--- a/big-little/include/bl.h
+++ b/big-little/include/bl.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: bl.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __BL_H__
#define __BL_H__
@@ -37,4 +43,5 @@ typedef struct vm_s {
extern vm_state guestos_state[MAX_CPUIFS];
extern void bl_setup(void);
+extern void hyp_warm_reset_handler(void);
#endif /* __BL_H__ */
diff --git a/big-little/include/context.h b/big-little/include/context.h
index acdb88b..17656a8 100644
--- a/big-little/include/context.h
+++ b/big-little/include/context.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: context.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __CONTEXT_H__
#define __CONTEXT_H__
diff --git a/big-little/include/events.h b/big-little/include/events.h
index 248a5b3..d6523e3 100644
--- a/big-little/include/events.h
+++ b/big-little/include/events.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: events.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __EVENTS_H__
#define __EVENTS_H__
@@ -24,37 +30,36 @@
/*
* Events for inter/intra-cluster sync
*/
-#define MAX_EVENTS 13
+#define MAX_EVENTS 12
/* Inter cluster events */
-#define IB_HS_DONE 0
-#define IB_CONTEXT_DONE 1
-#define OB_CONTEXT_DONE 2
+#define IB_CONTEXT_DONE 0
+#define OB_CONTEXT_DONE 1
/* Intra cluster events */
-#define L2_READY 3
-#define L1_DONE 4
-#define CCI_READY 5
-#define GIC_READY 6
+#define L2_READY 2
+#define L1_DONE 3
+#define CCI_READY 4
+#define GIC_READY 5
/* Cores have finished performing inbound headstart specific initialisation */
-#define HS_DONE 7
+#define HS_DONE 6
/*
* Holding pen to ensure that all other context is restored only after all
* cpus have finished initialised local and global HYP mode context.
*/
-#define HYP_CONTEXT_DONE 8
+#define HYP_CONTEXT_DONE 7
/*
* Holding pen to ensure that all cores have setup the local and global
* virtualisor context before any one of them uses it
*/
-#define VIRT_SETUP_DONE 9
+#define VIRT_SETUP_DONE 8
/*
* Event to synchronise creation of HYP mode pagetables
*/
-#define VIRT_PGT_DONE 10
+#define VIRT_PGT_DONE 9
-#define CACHE_GEOM_DONE 11
-#define VID_REGS_DONE 12
+#define CACHE_GEOM_DONE 10
+#define VID_REGS_DONE 11
/* Defines for Secure events */
#define MAX_SEC_EVENTS 4
diff --git a/big-little/include/gic_registers.h b/big-little/include/gic_registers.h
index 3e83356..92ff5c0 100644
--- a/big-little/include/gic_registers.h
+++ b/big-little/include/gic_registers.h
@@ -1,18 +1,24 @@
-/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: gic_registers.h
- * ----------------------------------------------------------------
- * $
- */
+/*
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __GIC_REGISTERS_H__
#define __GIC_REGISTERS_H__
diff --git a/big-little/include/handler.h b/big-little/include/handler.h
index 1e8d8f6..747b31c 100644
--- a/big-little/include/handler.h
+++ b/big-little/include/handler.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: handler.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __HANDLER_H__
#define __HANDLER_H__
diff --git a/big-little/include/hvc.h b/big-little/include/hvc.h
index 32c4d90..1f71271 100644
--- a/big-little/include/hvc.h
+++ b/big-little/include/hvc.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: hvc.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __HVC_H__
#define __HVC_H__
diff --git a/big-little/include/hyp_types.h b/big-little/include/hyp_types.h
index ee19466..123242c 100755
--- a/big-little/include/hyp_types.h
+++ b/big-little/include/hyp_types.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: hyp_types.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __HYP_TYPES_H__
#define __HYP_TYPES_H__
diff --git a/big-little/include/hyp_vmmap.h b/big-little/include/hyp_vmmap.h
index 4815410..ef3eeb6 100644
--- a/big-little/include/hyp_vmmap.h
+++ b/big-little/include/hyp_vmmap.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: hyp_vmmap.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __HYP_VMMAP_H__
#define __HYP_VMMAP_H__
diff --git a/big-little/include/int_master.h b/big-little/include/int_master.h
index 4390acc..ec3b1b7 100644
--- a/big-little/include/int_master.h
+++ b/big-little/include/int_master.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: int_master.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
/*
* Master interrupt controller driver - talks to real IC and dispatches
diff --git a/big-little/include/misc.h b/big-little/include/misc.h
index 8a735f1..c154ced 100644
--- a/big-little/include/misc.h
+++ b/big-little/include/misc.h
@@ -1,30 +1,40 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: misc.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef MISC_H
#define MISC_H
#include <stdio.h>
+#include <string.h>
#define NUM_CPUS 8
#define inline __inline
-#define A7 0X410fC070
-#define A15 0X410fC0F0
+#define A7 0xC07
+#define A15 0xC0F
+#define PART_NO(x) ((x >> 4) & 0xfff)
+#define REVISION(x) (x & 0xf)
+#define VARIANT(x) ((x >> 20) & 0xf)
#define MAX_CLUSTERS 2
#define MAX_CORES 8
@@ -135,6 +145,10 @@
#define ACCESS_PERM(x) ((x & 0x3) << 6)
#define MEM_ATTR(x) ((x & 0xf) << 2)
+/* Upper block attributes[63:52]. Defined as the upper word */
+#define XN (1 << 22)
+#define PXN (1 << 21)
+
/*
* Cache levels.
*/
@@ -194,11 +208,7 @@
* TODO:
* Move platform specific definitions to the right places
*/
-#if SYSBENCH
-#define KFSCB_BASE 0x1c080000
-#else
#define KFSCB_BASE 0x60000000
-#endif
#define RST_HOLD0 0x0
#define RST_HOLD1 0x4
@@ -210,6 +220,14 @@
#define KFC_CFG_R 0x28
#define KFC_CFG_W 0x2c
#define KFS_CFG_R 0x30
+#define RST_HANDLER0 0x40
+#define RST_HANDLER1 0x48
+#define RST_HANDLER2 0x50
+#define RST_HANDLER3 0x58
+#define RST_HANDLER4 0x60
+#define RST_HANDLER5 0x68
+#define RST_HANDLER6 0x70
+#define RST_HANDLER7 0x78
#define KFS_ID 0xffc
/*
@@ -238,7 +256,7 @@
#define CLUSTER_CPU_COUNT(x) (((read32(KFSCB_BASE + KFS_CFG_R) >> 16) >> (x << 2)) & 0xf)
#define DC_SYSTYPE ((read32(KFSCB_BASE + KFS_ID) >> 16) & 0xf)
#define asym_clusters() (((read32(KFSCB_BASE + KFS_CFG_R) >> 16) & 0xf) == \
- ((read32(KFSCB_BASE + KFS_CFG_R) >> 20) & 0xf))
+ ((read32(KFSCB_BASE + KFS_CFG_R) >> 20) & 0xf))
/*
* "Always on" uses cpuids that span across clusters e.g.
@@ -259,7 +277,8 @@
#define EXIT_RESET 0x2
#define CASCADE_RESET 0x4
-#define A15_A15 0x1
+#define A15_A15 0x0
+#define A7_A15 0x1
#define A15_A7 0x2
#define EAGLE 0x0
@@ -267,6 +286,7 @@
/* Control register bits */
#define CR_M (1<<0) /* MMU enabled */
+#define CR_A (1<<1) /* Align fault enable */
#define CR_C (1<<2) /* Data cache */
#define CR_W (1<<3) /* Write buffer */
#define CR_Z (1<<11) /* Branch prediction */
@@ -322,9 +342,10 @@
#define SMC_SEC_SHUTDOWN 0x2
#define MAX_CACHE_LEVELS 0x8
-#define CRN_C0 0x0
-#define CRN_C7 0x7
-#define CRN_C9 0x9
+#define CRN_C0 0x0
+#define CRN_C7 0x7
+#define CRN_C9 0x9
+#define CRN_C15 0xf
/*
* Opcode2 definitions in the corresponding cp15 instruction
@@ -366,8 +387,7 @@ extern void spin_unlock(unsigned int *);
extern void panic(void);
extern unsigned get_inbound(void);
extern unsigned reset_status(unsigned, unsigned, unsigned);
-extern unsigned reset_type(void);
-extern unsigned map_cpuif(void);
+extern unsigned map_cpuif(unsigned, unsigned);
extern unsigned get_cpuif(unsigned, unsigned);
extern unsigned remap_cpuif(unsigned *);
extern unsigned get_cpuif_mask(unsigned);
diff --git a/big-little/include/traps.h b/big-little/include/traps.h
index 3011acc..323ba42 100755
--- a/big-little/include/traps.h
+++ b/big-little/include/traps.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: traps.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __TRAPS_H__
#define __TRAPS_H__
diff --git a/big-little/include/vgiclib.h b/big-little/include/vgiclib.h
index f0fccde..869a8df 100644
--- a/big-little/include/vgiclib.h
+++ b/big-little/include/vgiclib.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: vgiclib.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef VGICLIB_H
#define VGICLIB_H
diff --git a/big-little/include/virt_helpers.h b/big-little/include/virt_helpers.h
index d2672b8..34e4d1c 100644
--- a/big-little/include/virt_helpers.h
+++ b/big-little/include/virt_helpers.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: virt_helpers.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef _VIRT_HELPERS_H_
#define _VIRT_HELPERS_H_
@@ -84,7 +90,7 @@ extern void hyp_save(unsigned, unsigned);
*/
#if TUBE
extern void write_trace(bakery_t *, unsigned, char *, unsigned long long,
- unsigned long long, unsigned long long);
+ unsigned long long, unsigned long long);
#else
#define write_trace(...)
#endif
diff --git a/big-little/lib/bakery.c b/big-little/lib/bakery.c
index ce114f4..bd2547f 100644
--- a/big-little/lib/bakery.c
+++ b/big-little/lib/bakery.c
@@ -1,18 +1,26 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: bakery.c
- * ----------------------------------------------------------------
- * $
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
*
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
+
+/*
* bakery.c: Lamport's Bakery algorithm for spinlock handling
*
* Note that the algorithm requires the stack and the bakery struct
diff --git a/big-little/lib/tube.c b/big-little/lib/tube.c
index d2fa972..2fd6486 100755
--- a/big-little/lib/tube.c
+++ b/big-little/lib/tube.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: tube.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "misc.h"
#include "virt_helpers.h"
diff --git a/big-little/lib/uart.c b/big-little/lib/uart.c
index a2e0353..2d4486a 100644
--- a/big-little/lib/uart.c
+++ b/big-little/lib/uart.c
@@ -1,18 +1,26 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: uart.c
- * ----------------------------------------------------------------
- * $
- *
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
+
+/*
* uart.c - boot code to output characters on a PL011 uart
* Not SMP-safe, so make sure you only call these functions
* from one CPU at a time.
diff --git a/big-little/lib/virt_events.c b/big-little/lib/virt_events.c
index 2765278..b842324 100644
--- a/big-little/lib/virt_events.c
+++ b/big-little/lib/virt_events.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: virt_events.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "events.h"
#include "misc.h"
@@ -34,7 +40,6 @@ extern unsigned event[][MAX_EVENTS];
*/
void set_event(unsigned event_id, unsigned cpu_id)
{
- dsb();
event[cpu_id][event_id] = TRUE;
dsb();
sev();
@@ -48,19 +53,14 @@ inline unsigned get_event(unsigned event_id, unsigned cpu_id)
void reset_event(unsigned event_id, unsigned cpu_id)
{
- dsb();
event[cpu_id][event_id] = FALSE;
- dsb();
return;
}
void wait_for_event(unsigned event_id, unsigned cpu_id)
{
- dsb();
while (FALSE == get_event(event_id, cpu_id)) {
wfe();
- isb();
- dsb();
}
return;
diff --git a/big-little/lib/virt_helpers.s b/big-little/lib/virt_helpers.s
index ec94be1..0306e06 100644
--- a/big-little/lib/virt_helpers.s
+++ b/big-little/lib/virt_helpers.s
@@ -1,16 +1,24 @@
- ; $Copyright:
- ; ----------------------------------------------------------------
- ; This confidential and proprietary software may be used only as
- ; authorised by a licensing agreement from ARM Limited
- ; (C) COPYRIGHT 2008-2011 ARM Limited
- ; ALL RIGHTS RESERVED
- ; The entire notice above must be reproduced on all authorised
- ; copies and copies may only be made to the extent permitted
- ; by a licensing agreement from ARM Limited.
- ; ----------------------------------------------------------------
- ; File: virt_helpers.s
- ; ----------------------------------------------------------------
- ; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
IMPORT read_actlr
@@ -20,22 +28,19 @@
EXPORT dcisw
EXPORT dccsw
EXPORT dccisw
-
- EXPORT read_lr
- EXPORT read_sp
-
- EXPORT write_sp
- EXPORT write_lr
-
+ EXPORT read_lr
+ EXPORT read_sp
+ EXPORT write_sp
+ EXPORT write_lr
EXPORT panic
EXPORT spin_lock
EXPORT spin_trylock
EXPORT spin_unlock
- EXPORT virt_memset
- EXPORT hyp_save
- EXPORT num_secondaries
- EXPORT virt_dead
- EXPORT get_sp
+ EXPORT virt_memset
+ EXPORT hyp_save
+ EXPORT num_secondaries
+ EXPORT virt_dead
+ EXPORT get_sp
EXPORT disable_coherency
EXPORT enable_coherency
EXPORT inv_tlb_all
@@ -231,9 +236,9 @@ panic FUNCTION
; It returns the pointer to the stack offset for the asked cpu
;--------------------------------------------------------------
get_sp FUNCTION
- ldr r2, =0x2c001800
- ldr r2, [r2]
- and r2, r2, #0xff
+ ldr r2, =0x2c001800
+ ldr r2, [r2]
+ and r2, r2, #0xff
clz r2, r2
mov r3, #32
sub r2, r3, r2
@@ -247,6 +252,8 @@ disable_coherency FUNCTION
bl read_actlr
bic r0, r0, #0x40
bl write_actlr
+ dsb
+ isb
pop {lr}
bx lr
ENDFUNC
@@ -256,6 +263,8 @@ enable_coherency FUNCTION
bl read_actlr
orr r0, r0, #0x40
bl write_actlr
+ dsb
+ isb
pop {lr}
bx lr
ENDFUNC
diff --git a/big-little/secure_world/events.c b/big-little/secure_world/events.c
index e128165..d5c5e54 100644
--- a/big-little/secure_world/events.c
+++ b/big-little/secure_world/events.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: events.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "events.h"
diff --git a/big-little/secure_world/flat_pagetable.s b/big-little/secure_world/flat_pagetable.s
index 8a4317c..38762e9 100644
--- a/big-little/secure_world/flat_pagetable.s
+++ b/big-little/secure_world/flat_pagetable.s
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: flat_pagetable.s
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
PRESERVE8
AREA PageTable, DATA, READONLY, ALIGN=14
@@ -67,7 +75,7 @@ ramstart SETA 0
; NOT FOR RELEASE
WHILE count16 < ramstart+0x40
; 0-64MB Secure ROM/NOR Flash
- DCD (count16<<20) :OR: SHARED_S_RO_MEMORY
+ DCD (count16<<20) :OR: SHARED_DEVICE
count16 SETA count16 + 1
WEND
diff --git a/big-little/secure_world/monmode_vectors.s b/big-little/secure_world/monmode_vectors.s
index 15e54bc..14a416f 100644
--- a/big-little/secure_world/monmode_vectors.s
+++ b/big-little/secure_world/monmode_vectors.s
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: monmode_vectors.s
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
AREA |monmode_vectors|, CODE, ALIGN=5
@@ -18,51 +26,52 @@
SMC_SEC_INIT EQU 0x0
SMC_SEC_SAVE EQU 0x1
-SMC_SEC_SHUTDOWN EQU 0x2
-
-L1 EQU 0x0
-L2 EQU 0x1
-
-INV EQU 0x0
-CLN EQU 0x1
-CLN_INV EQU 0x2
-
-CR_M EQU (1<<0)
-CR_C EQU (1<<2)
-CR_I EQU (1<<12)
-CR_Z EQU (1<<11)
-CR_U EQU (1<<22)
-CR_TRE EQU (1<<28)
-SCR_NS EQU 0x01
+SMC_SEC_SHUTDOWN EQU 0x2
+L1 EQU 0x0
+L2 EQU 0x1
+INV EQU 0x0
+CLN EQU 0x1
+CLN_INV EQU 0x2
+CR_M EQU (1<<0)
+CR_C EQU (1<<2)
+CR_I EQU (1<<12)
+CR_Z EQU (1<<11)
+CR_U EQU (1<<22)
+CR_TRE EQU (1<<28)
+SCR_NS EQU 0x01
+PT_IRGN EQU (1<<0)
+PT_RGN EQU (1<<3)
+PT_SH EQU (1<<1)
+PT_NOS EQU (1<<5)
+TTBR0_PROP EQU (PT_NOS :OR: PT_SH :OR: PT_RGN :OR: PT_IRGN)
+SO_MEM EQU 0x0
+DV_MEM EQU 0x1
+NM_MEM EQU 0x2
+I_SH EQU 0x1
+SH EQU 0x1
+PRRR_TR0 EQU (SO_MEM<<0)
+PRRR_TR1 EQU (DV_MEM<<2)
+PRRR_TR4 EQU (NM_MEM<<8)
+PRRR_TR7 EQU (NM_MEM<<14)
+PRRR_DS1 EQU (SH<<17)
+PRRR_NS1 EQU (SH<<19)
+PRRR_NOS1 EQU (I_SH<<25)
+PRRR_NOS4 EQU (I_SH<<28)
+PRRR_NOS7 EQU (I_SH<<31)
+NC EQU 0x0
+WBWA EQU 0x1
+NMRR_OR4 EQU (NC<<24)
+NMRR_OR7 EQU (WBWA<<30)
+NMRR_IR4 EQU (NC<<8)
+NMRR_IR7 EQU (WBWA<<14)
-PT_IRGN EQU (1<<0)
-PT_RGN EQU (1<<3)
-PT_SH EQU (1<<1)
-PT_NOS EQU (1<<5)
-TTBR0_PROP EQU (PT_NOS :OR: PT_SH :OR: PT_RGN :OR: PT_IRGN)
-
-SO_MEM EQU 0x0
-DV_MEM EQU 0x1
-NM_MEM EQU 0x2
-I_SH EQU 0x1
-SH EQU 0x1
-PRRR_TR0 EQU (SO_MEM<<0)
-PRRR_TR1 EQU (DV_MEM<<2)
-PRRR_TR4 EQU (NM_MEM<<8)
-PRRR_TR7 EQU (NM_MEM<<14)
-PRRR_DS1 EQU (SH<<17)
-PRRR_NS1 EQU (SH<<19)
-PRRR_NOS1 EQU (I_SH<<25)
-PRRR_NOS4 EQU (I_SH<<28)
-PRRR_NOS7 EQU (I_SH<<31)
-
-NC EQU 0x0
-WBWA EQU 0x1
-NMRR_OR4 EQU (NC<<24)
-NMRR_OR7 EQU (WBWA<<30)
-NMRR_IR4 EQU (NC<<8)
-NMRR_IR7 EQU (WBWA<<14)
-
+; ==============================================================================
+; These should be the same the defines in misc.h
+; ==============================================================================
+MAX_CLUSTERS EQU 2
+MAX_CPUS EQU 8
+STACK_SIZE EQU (96 << 2)
+
; ==============================================================================
; Simple vector table
; ==============================================================================
@@ -71,8 +80,6 @@ NMRR_IR7 EQU (WBWA<<14)
IMPORT enable_caches
IMPORT inv_icache_all
IMPORT flat_pagetables
- IMPORT secure_stacks
- IMPORT secure_stack_size
IMPORT read_sctlr
IMPORT write_sctlr
IMPORT read_ttbr0
@@ -89,48 +96,60 @@ NMRR_IR7 EQU (WBWA<<14)
IMPORT wfi
IMPORT read_cpuid
IMPORT add_dv_page
- [ SYSBENCH
- IMPORT setup_reset_handler
- ]
EXPORT monmode_vector_table
EXPORT warm_reset
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
; Macro to initialise MMU. Corrupts 'r0'
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
MACRO
- setup_mmu $r1, $r2
+ setup_mmu $r1, $r2
+ MOV $r1, #0x5555
+ MOVT $r1, #0x5555
; Enable our page tables if not
LDR r0, =flat_pagetables
ORR r0, #TTBR0_PROP
- BL write_ttbr0
- BL inv_tlb_all
- BL inv_bpred_all
- LDR r0, =0x55555555
- BL write_dacr
+ ; Write TTBR0
+ MCR p15, 0, r0, c2, c0, 0
+ ; Write DACR
+ MCR p15, 0, $r1, c3, c0, 0
; Enable the remap registers to treat OSH memory as ISH memory
- LDR r0, =(PRRR_TR0 :OR: PRRR_TR1 :OR: PRRR_TR4 :OR: PRRR_TR7 :OR: PRRR_NOS1 :OR: PRRR_NOS4 :OR: PRRR_NOS7 :OR: PRRR_NS1 :OR: PRRR_DS1)
- BL write_prrr
- LDR r0, =(NMRR_IR4 :OR: NMRR_IR7 :OR: NMRR_OR4 :OR: NMRR_OR7)
- BL write_nmrr
+ MOV $r1, #PRRR_TR0
+ ORR $r1, #PRRR_TR1
+ ORR $r1, #PRRR_TR4
+ ORR $r1, #PRRR_TR7
+ ORR $r1, #PRRR_NOS1
+ ORR $r1, #PRRR_NOS4
+ ORR $r1, #PRRR_NOS7
+ ORR $r1, #PRRR_NS1
+ ORR $r1, #PRRR_DS1
+
+ MOV $r2, #NMRR_IR4
+ ORR $r2, #NMRR_IR7
+ ORR $r2, #NMRR_OR4
+ ORR $r2, #NMRR_OR7
- ; Enable Dcache and MMU
- BL read_sctlr
+ MCR p15, 0, $r1, c10, c2, 0
+ MCR p15, 0, $r2, c10, c2, 1
+
+ ; Enable Dcache, TEX Remap & MMU
+ MRC p15, 0, r0, c1, c0, 0
ORR r0, #CR_M
- ORR r0, #CR_C
- ORR r0, #CR_TRE
- BL write_sctlr
+ ORR r0, #CR_C
+ ORR r0, #CR_TRE
+ MCR p15, 0, r0, c1, c0, 0
+ DSB
+ ISB
MEND
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
; Macro to setup secure stacks, Corrupts 'r0-r3'
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
MACRO
setup_stack
LDR r0, =secure_stacks
- LDR r1, =secure_stack_size
- LDR r1, [r1]
+ MOV r1, #STACK_SIZE
BL get_sp
MOV sp, r0
MEND
@@ -166,7 +185,6 @@ do_smc FUNCTION
BIC r2, #SCR_NS
MCR p15, 0, r2, c1, c1, 0
ISB
- DSB
; Check if we are being called to setup the world
CMP r0, #SMC_SEC_INIT
@@ -184,7 +202,6 @@ smc_done
ORR r0, #SCR_NS
MCR p15, 0, r0, c1, c1, 0
ISB
- DSB
ERET
ENDFUNC
@@ -209,117 +226,144 @@ setup_secure
MOV r4, lr
; Turn on the I cache, branch predictor and alingment
- BL read_sctlr
- ORR r0, #CR_I
- ORR r0, #CR_U
- ORR r0, #CR_Z
- BL write_sctlr
-
+ BL read_sctlr
+ ORR r0, #CR_I
+ ORR r0, #CR_U
+ ORR r0, #CR_Z
+ BL write_sctlr
+ dsb
+ isb
+
setup_stack
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
; Safely turn on caches
; TODO: Expensive usage of stacks as we are executing
; out of SO memory. Done only once so can live with it
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
BL enable_caches
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
; Add a page backed by device memory for locks & stacks
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
LDR r0, =flat_pagetables
BL add_dv_page
- setup_mmu r1, r2
+ setup_mmu r1, r2
- [ SYSBENCH
- ; ----------------------------------------------------
- ; When on systembench, write our warm reset handler at
- ; 0x0 instead of sysboot.axf
- ; ----------------------------------------------------
- LDR r0, =warm_reset_handler
- BL setup_reset_handler
- ]
-
; Restore LR
MOV lr, r4
B smc_done
warm_reset FUNCTION
- ; ----------------------------------------------------
- ; Enable Icache asap to prevent SO accesses
- ; ----------------------------------------------------
- MRC p15, 0, r0, c1, c0, 0
- ORR r0, r0, #CR_I
- ORR r0, #CR_U
- MCR p15, 0, r0, c1, c0, 0
+ ; ----------------------------------------------------
+ ; Start the SO load of the pagetables asap
+ ; ----------------------------------------------------
+ LDR r4, =flat_pagetables
+
+ ; ----------------------------------------------------
+ ; Enable I, C, Z, U bits in the SCTLR and SMP bit in
+ ; the ACTLR right after reset
+ ; ----------------------------------------------------
+ MRC p15, 0, r0, c1, c0, 0
+ ORR r0, r0, #CR_I
+ ORR r0, r0, #CR_U
+ ORR r0, r0, #CR_Z
+ ORR r0, r0, #CR_C
+ MCR p15, 0, r0, c1, c0, 0
+ MRC p15, 0, r1, c1, c0, 1
+ ORR r1, r1, #0x40
+ MCR p15, 0, r1, c1, c0, 1
ISB
- DSB
- ; ----------------------------------------------------
- ; Switch to Monitor mode straight away as we do not want to worry
- ; about setting up Secure SVC stacks. All Secure world save/restore
- ; takes place in the monitor mode.
- ; ----------------------------------------------------
- MRS r5, cpsr ; Get current mode (SVC) in r0
- BIC r1, r5, #0x1f ; Clear all mode bits
- ORR r1, r1, #0x16 ; Set bits for Monitor mode
- MSR cpsr_cxsf, r1 ; We are now in Monitor Mode
- BIC r1, r5, #0x1f ; Clear all mode bits
- ORR r1, r1, #0x1a ; Set bits for a return to the HYP mode
- MSR spsr_cxsf, r1
-
- ; ----------------------------------------------------
- ; Safely turn on coherency and caches
- ; ----------------------------------------------------
- MRC p15, 0, r1, c0, c0, 5
- ANDS r1, r1, #0xf
- MRC p15, 0, r2, c0, c0, 5
- LSR r2, r2, #0x8
- ANDS r2, r2, #0xf
- MRC p15, 0, r4, c1, c0, 1
- ORR r4, r4, #0x40
- MCR p15, 0, r4, c1, c0, 1
- ORR r0, r0, #0x1800
- ORR r0, r0, #4
- MOV r0, r0
+ ; ----------------------------------------------------
+ ; Enable the MMU even though CCI snoops have not been
+ ; enabled. Should not be a problem as we will not
+ ; access any inter-cluster data till we do so
+ ; ----------------------------------------------------
+ MOV r2, #0x5555
+ MOVT r2, #0x5555
+ ; Enable our page tables if not
+ ORR r4, #TTBR0_PROP
+ ; Write TTBR0
+ MCR p15, 0, r4, c2, c0, 0
+ ; Write DACR
+ MCR p15, 0, r2, c3, c0, 0
+
+ ; Enable the remap registers to treat OSH memory as ISH memory
+ MOV r2, #PRRR_TR0
+ ORR r2, #PRRR_TR1
+ ORR r2, #PRRR_TR4
+ ORR r2, #PRRR_TR7
+ ORR r2, #PRRR_NOS1
+ ORR r2, #PRRR_NOS4
+ ORR r2, #PRRR_NOS7
+ ORR r2, #PRRR_NS1
+ ORR r2, #PRRR_DS1
+ MOV r3, #NMRR_IR4
+ ORR r3, #NMRR_IR7
+ ORR r3, #NMRR_OR4
+ ORR r3, #NMRR_OR7
+ MCR p15, 0, r2, c10, c2, 0
+ MCR p15, 0, r3, c10, c2, 1
+
+ ; Enable Dcache, TEX Remap & MMU
+ MRC p15, 0, r0, c1, c0, 0
+ ORR r0, #CR_M
+ ORR r0, #CR_C
+ ORR r0, #CR_TRE
MCR p15, 0, r0, c1, c0, 0
- ISB
- DSB
+ ISB
- ; ----------------------------------------------------
+ ; ----------------------------------------------------
+ ; Try Preloading the literal pools before they are
+ ; accessed.
+ ; ----------------------------------------------------
+ ADR r4, warm_reset_ltrls
+ PLD [r4]
+ PLD warm_reset_ltrls
+ LDR r6, =secure_stacks
+
+ ; ----------------------------------------------------
; Safely turn on CCI snoops
- ; ----------------------------------------------------
- CMP r1, #0
- BNE cci_snoop_status
- MOV r0, #3
- CMP r2, #0
- BEQ a15_snoops
- LDR r1, =0x2c095000
- STR r0, [r1,#0]
- dsb
- B cci_snoop_status
+ ; ----------------------------------------------------
+ MOV r4, #0x0
+ MOVT r4, #0x2c09
+ MRC p15, 0, r0, c0, c0, 5
+ UBFX r1, r0, #0, #8
+ UBFX r2, r0, #8, #8
+ CMP r1, #0
+ BNE cci_snoop_status
+ MOV r3, #3
+ CMP r2, #0
+ BEQ a15_snoops
+ MOV r5, #0x5000
+ STR r3, [r4, r5]
+ B cci_snoop_status
a15_snoops
- LDR r1, =0x2c094000
- STR r0, [r1,#0]
- dsb
+ MOV r5, #0x4000
+ STR r3, [r4, r5]
cci_snoop_status
- NOP
- LDR r0, =0x2c090000
- LDR r0, [r0,#0xc]
- TST r0, #1
- BNE cci_snoop_status
+ LDR r0, [r4, #0xc]
+ TST r0, #1
+ BNE cci_snoop_status
- setup_stack
+ ; ----------------------------------------------------
+ ; Switch to Monitor mode straight away as we do not want to worry
+ ; about setting up Secure SVC stacks. All Secure world save/restore
+ ; takes place in the monitor mode.
+ ; ----------------------------------------------------
+ MRS r5, cpsr ; Get current mode (SVC) in r0
+ BIC r1, r5, #0x1f ; Clear all mode bits
+ ORR r1, r1, #0x16 ; Set bits for Monitor mode
+ MSR cpsr_cxsf, r1 ; We are now in Monitor Mode
+ BIC r1, r5, #0x1f ; Clear all mode bits
+ ORR r1, r1, #0x1a ; Set bits for a return to the HYP mode
+ MSR spsr_cxsf, r1
- ; ----------------------------------------------------
- ; MMU is enabled after caches are. This is to ensure that
- ; we are taking part in CCI based coherency before we start
- ; using our own caches. Doing it the other way round would
- ; result in a scenario when the cores are taking part in
- ; in internal coherency but not in the CCI based one which
- ; does not seem right.
- ; ----------------------------------------------------
- setup_mmu r1, r2
+ MOV r0, r6
+ MOV r1, #STACK_SIZE
+ BL get_sp
+ MOV sp, r0
; Restore secure world context & enable MMU
BL secure_context_restore
@@ -332,19 +376,16 @@ cci_snoop_status
ISB
; Setup the NS link register
- MRC p15, 0, r0, c0, c0, 5
- ANDS r0, r0, #0xf
- LDR r1, =ns_entry_ptr
- ADD r1, r1, r0, lsl #2
- LDR lr, [r1]
+ MRC p15, 0, r0, c0, c0, 5
+ ANDS r0, r0, #0xf
+ LDR r1, =ns_entry_ptr
+ ADD r1, r1, r0, lsl #2
+ LDR lr, [r1]
; Switch to Non-secure world
ERET
-
- ENDFUNC
+warm_reset_ltrls
+ ENDFUNC
- [ SYSBENCH
-warm_reset_handler
- LDR PC, =warm_reset
- ]
-
+ AREA stacks, DATA, ALIGN=6
+secure_stacks SPACE MAX_CLUSTERS*MAX_CPUS*STACK_SIZE
END
diff --git a/big-little/secure_world/secure_context.c b/big-little/secure_world/secure_context.c
index bf20cb1..ff864f1 100644
--- a/big-little/secure_world/secure_context.c
+++ b/big-little/secure_world/secure_context.c
@@ -1,31 +1,30 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: secure_context.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "secure_world.h"
extern powerup_ib_core(unsigned, unsigned);
-/*
- * Monitor/Secure SVC stack to save/restore secure context
- * Used by monitor mode while saving secure context & by
- * the secure svc mode while restoring the secure context
- */
-sec_stack secure_stacks[MAX_CLUSTERS][MAX_CORES];
sec_context secure_context[MAX_CORES] __attribute__ ((aligned(CACHE_LINE_SZ)));
-unsigned secure_stack_size = sizeof(sec_stack);
unsigned ns_entry_ptr[MAX_CORES];
unsigned small_pagetable[1024] __attribute__ ((aligned(4096)));
unsigned host_cluster = HOST_CLUSTER;
@@ -47,6 +46,8 @@ void enable_caches(void)
/* Enable caches */
write_sctlr(read_sctlr() | CR_I | CR_Z | CR_C);
+ dsb();
+ isb();
/*
* Only one cpu should enable the CCI while the other
@@ -94,8 +95,8 @@ void secure_context_restore(void)
write_actlr(sec_ctx->actlr);
write_scr(sec_ctx->scr);
write_sctlr(read_sctlr() | sec_ctx->sctlr);
- isb();
dsb();
+ isb();
write_trace(&lock_tube1, SEC_TUBE1, "Secure Context Restore End", read_cntpct(), 0x0, 0x0);
return;
diff --git a/big-little/secure_world/secure_resets.c b/big-little/secure_world/secure_resets.c
index c63d98d..cb732ba 100644
--- a/big-little/secure_world/secure_resets.c
+++ b/big-little/secure_world/secure_resets.c
@@ -1,23 +1,31 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: secure_resets.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "secure_world.h"
#include "events.h"
#include "bakery.h"
+extern unsigned warm_reset;
+
/* Bakery lock to serialize access to the tube. */
bakery_t lock_tube0 __attribute__ ((section("BL_SEC_DV_PAGE"))) = { 0 };
@@ -29,11 +37,13 @@ bakery_t lock_tube0 __attribute__ ((section("BL_SEC_DV_PAGE"))) = { 0 };
*/
static unsigned flush_ob_l2 = FLUSH_OB_L2;
+#if FM_BETA
/*
- * Variable in secure world to indicate the
+ * Variable in secure world to indicate the
* reset type i.e. cold (0) or warm reset (!0).
*/
unsigned ve_reset_type[NUM_CPUS];
+#endif
/*
* Allocate secure events in our device page
@@ -61,29 +71,31 @@ static bakery_t lock_ob_kfscb __attribute__ ((section("BL_SEC_DV_PAGE"))) = { 0
static unsigned long long powerdown_stacks[NUM_CPUS][32]
__attribute__ ((section("BL_SEC_DV_PAGE")));
-#if SYSBENCH
-void setup_reset_handler(unsigned handler)
+/*
+ * The way a warm reset is detected has changed in the post beta FastModels.
+ * The following workarounds make the earlier approach coexist with the
+ * new one. Instead of dealing with a function pointer, they manipulate a
+ * variable.
+ */
+static void set_reset_handler(unsigned cluster_id, unsigned cpu_id, void (*handler)(void))
{
- unsigned *warm_reset_vector = 0x0;
- unsigned first_cpu = find_first_cpu();
- unsigned cpu_id = read_cpuid();
-
- /*
- * First cpu waits for all others to finish execution
- * in SMC memory before editing the reset vector.
- */
- if (first_cpu == cpu_id) {
- wait_for_events(SETUP_RST);
- *warm_reset_vector = handler;
- dsb();
- cln_dcache_mva_poc(warm_reset_vector);
- } else {
- set_event(SETUP_RST, cpu_id);
- }
-
- return;
+#if FM_BETA
+ ve_reset_type[cpu_id]++;
+ cln_dcache_mva_poc(&ve_reset_type[cpu_id]);
+#else
+ write32(KFSCB_BASE + RST_HANDLER0 + ((cpu_id + (cluster_id << 2)) << 3), (unsigned) handler);
+ dsb();
+#endif
}
+
+static void (*get_reset_handler(unsigned cluster_id, unsigned cpu_id))(void)
+{
+#if FM_BETA
+ return (void (*)(void)) ve_reset_type[cpu_id];
+#else
+ return (void (*)(void)) read32(KFSCB_BASE + RST_HANDLER0 + ((cpu_id + (cluster_id << 2)) << 3));
#endif
+}
unsigned long long *get_powerdown_stack(unsigned cpu_id)
{
@@ -102,15 +114,18 @@ void powerup_ib_core(unsigned cluster_id, unsigned cpu_id)
{
unsigned rst_stat_reg = 0x0;
unsigned cpu_mask = 0x0;
+ void (*cold_reset_handler)(void) = 0x0;
+ void (*warm_reset_handler)(void) = (void (*)(void)) &warm_reset;
- if (ve_reset_type[cpu_id]) {
-
+ if (cold_reset_handler == get_reset_handler(cluster_id, cpu_id)) {
+ set_reset_handler(cluster_id, cpu_id, warm_reset_handler);
+ } else {
if (flush_ob_l2) {
#if FLUSH_L2_FIX
set_event(FLUSH_L2, cpu_id);
#endif
}
-
+
/*
* The outbound cluster's last cpu send an event
* indicating that its finished the last switchover.
@@ -119,12 +134,7 @@ void powerup_ib_core(unsigned cluster_id, unsigned cpu_id)
*/
wait_for_event(OB_SHUTDOWN, cpu_id);
reset_event(OB_SHUTDOWN, cpu_id);
- } else {
- /* Bump the warm reset count */
- ve_reset_type[cpu_id]++;
- cln_dcache_mva_poc(&ve_reset_type[cpu_id]);
- }
-
+ }
write_trace(&lock_tube0, SEC_TUBE0, "Powerup Inbound", read_cntpct(), 0x0, 0x0);
@@ -216,6 +226,8 @@ void powerdown_cluster(void)
*/
write_trace(&lock_tube0, SEC_TUBE0, "L1 Flush Begin", read_cntpct(), 0x0, 0x0);
write_sctlr(read_sctlr() & ~CR_C & ~CR_M);
+ dsb();
+ isb();
inv_icache_all();
cache_maint_op(L1, CLN_INV);
disable_coherency();
diff --git a/big-little/secure_world/secure_world.h b/big-little/secure_world/secure_world.h
index b01766f..9d6db42 100644
--- a/big-little/secure_world/secure_world.h
+++ b/big-little/secure_world/secure_world.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: secure_world.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __SECURE_WORLD_H__
#define __SECURE_WORLD_H__
@@ -77,8 +83,5 @@ typedef struct sec_context {
extern void enable_caches(void);
extern void secure_context_restore(void);
extern void secure_context_save(unsigned);
-#if SYSBENCH
-extern void setup_reset_handler(unsigned);
-#endif
#endif /* __SECURE_WORLD_H__ */
diff --git a/big-little/secure_world/ve_reset_handler.s b/big-little/secure_world/ve_reset_handler.s
index 73c5a28..1a5b6a1 100644
--- a/big-little/secure_world/ve_reset_handler.s
+++ b/big-little/secure_world/ve_reset_handler.s
@@ -1,32 +1,58 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: ve_reset_handler.s
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
AREA test, CODE
ENTRY
- IMPORT warm_reset
- IMPORT ve_reset_type
- MRC p15, 0, r0, c0, c0, 5
- ANDS r0, r0, #0xf
+ [ FM_BETA
+ IMPORT warm_reset
+ IMPORT ve_reset_type
+
+ MRC p15, 0, r0, c0, c0, 5
+ ANDS r0, r0, #0xf
LDR r2, =ve_reset_type
ADD r2, r2, r0, lsl #2
LDR r1, [r2]
CMP r1, #0
MOVEQ r1, #1
STREQ r1, [r2]
- LDREQ PC, =0x80000000
+ LDREQ PC, =0x80000000
LDRNE PC, =warm_reset
+
+ |
+
+ MRC p15, 0, r0, c0, c0, 5
+ UBFX r1, r0, #0, #8
+ UBFX r2, r0, #8, #8
+ ADD r3, r1, r2, lsl #2
+ LSL r3, #3
+ LDR r4, =0x60000040
+ LDR r4, [r4, r3]
+ CMP r4, #0
+ BXNE r4
+ LDR pc, =0x80000000
+
+ ]
END
+
diff --git a/big-little/switcher/context/gic.c b/big-little/switcher/context/gic.c
index c5da757..4195346 100644
--- a/big-little/switcher/context/gic.c
+++ b/big-little/switcher/context/gic.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: gic.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virt_helpers.h"
#include "misc.h"
@@ -81,8 +87,10 @@ int save_gic_distributor_private(unsigned int *pointer,
*pointer = id->enable.set[0];
++pointer;
- pointer = copy_words(pointer, id->priority, 8);
- pointer = copy_words(pointer, id->target, 8);
+ memcpy((void *) pointer, (const void *) id->priority, 8 << 2);
+ pointer += 8;
+ memcpy((void *) pointer, (const void *) id->target, 8 << 2);
+ pointer += 8;
/* Save just the PPI configurations (SGIs are not configurable) */
*pointer = id->configuration[1];
@@ -106,13 +114,14 @@ int save_gic_distributor_private(unsigned int *pointer,
* and restoring the set/clear pending registers
*/
ptr = pointer;
- pointer = copy_words(pointer, id->sgi_set_pending, 4);
+ memcpy((void *) pointer, (const void *) id->sgi_set_pending, 4 << 2);
+ pointer += 8;
/*
* Clear the pending SGIs on this cpuif so that they don't
* interfere with the wfi later on.
*/
- copy_words(id->sgi_clr_pending, ptr, 4);
+ memcpy((void *) id->sgi_clr_pending, (const void *) ptr, 4 << 2);
if (*pointer) {
return -1;
@@ -138,8 +147,10 @@ int save_gic_distributor_shared(unsigned int *pointer,
num_spis = 32 * (id->controller_type & 0x1f);
/* Save rest of GIC configuration */
- if (num_spis)
- pointer = copy_words(pointer, id->target + 8, num_spis / 4);
+ if (num_spis) {
+ memcpy((void *) pointer, (const void *) (id->target + 8), (num_spis / 4) << 2);
+ pointer += num_spis / 4;
+ }
/* Save control register */
*pointer = id->control;
@@ -170,9 +181,9 @@ void restore_gic_distributor_private(unsigned int *pointer,
id->enable.set[0] = *pointer;
++pointer;
- copy_words(id->priority, pointer, 8);
+ memcpy((void *) id->priority, (const void *) pointer, 8 << 2);
pointer += 8;
- copy_words(id->target, pointer, 8);
+ memcpy((void *) id->target, (const void *) pointer, 8 << 2);
pointer += 8;
/* Restore just the PPI configurations (SGIs are not configurable) */
@@ -202,13 +213,21 @@ void restore_gic_distributor_private(unsigned int *pointer,
}
}
- copy_words(id->sgi_set_pending, pointer, 4);
+ memcpy((void *) id->sgi_set_pending, (const void *) pointer, 4 << 2);
+ pointer += 4;
id->pending.set[0] = *pointer;
return;
}
+/*
+ * Optimized routine to restore the shared vgic distributor interface.
+ * Saving on outbound and restoring on inbound is redundant as the
+ * context is non-volatile across a switch. Hence, simply R-M-W on
+ * the inbound and remove the 'save' function from the outbound
+ * critical path.
+ */
void restore_gic_distributor_shared(unsigned int *pointer,
unsigned gic_distributor_address)
{
@@ -222,6 +241,9 @@ void restore_gic_distributor_shared(unsigned int *pointer,
/* Restore rest of GIC configuration */
if (num_spis) {
+
+ memcpy((void *) pointer, (const void *) (id->target + 8), (num_spis / 4) << 2);
+
for (ctr = 0; ctr < num_spis / 4; ctr++) {
if(!pointer[ctr])
continue;
@@ -235,13 +257,8 @@ void restore_gic_distributor_shared(unsigned int *pointer,
}
}
- copy_words(id->target + 8, pointer, num_spis / 4);
- pointer += num_spis / 4;
+ memcpy((void *) (id->target + 8), (const void *) pointer, (num_spis / 4) << 2);
}
- /* We assume the I and F bits are set in the CPSR so that we will not respond to interrupts! */
- /* Restore control register */
- id->control = *pointer;
-
return;
}
diff --git a/big-little/switcher/context/ns_context.c b/big-little/switcher/context/ns_context.c
index b0e1220..891f5bb 100644
--- a/big-little/switcher/context/ns_context.c
+++ b/big-little/switcher/context/ns_context.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: ns_context.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virt_helpers.h"
#include "vgiclib.h"
@@ -38,12 +44,7 @@ static bakery_t lock_tube1 __attribute__ ((section("BL_DV_PAGE"))) = { 0 };
* Top level structure which encapsulates the context of the entire
* Kingfisher system
*/
-system_context switcher_context;
-
-unsigned reset_type(void)
-{
- return switcher_context.warm_reset;
-}
+system_context switcher_context = {0};
void stop_generic_timer(generic_timer_context *ctr_ctx)
{
@@ -74,7 +75,6 @@ void stop_generic_timer(generic_timer_context *ctr_ctx)
void save_context(unsigned first_cpu)
{
unsigned cpu_id = read_cpuid();
- unsigned nsacr = read_nsacr();
unsigned cluster_id = read_clusterid();
cpu_context *ns_cpu_ctx =
&switcher_context.cluster.core[cpu_id].ns_cpu_ctx;
@@ -83,27 +83,17 @@ void save_context(unsigned first_cpu)
unsigned *vfp_context = ns_cpu_ctx->vfp_regs;
banked_cp15_context *cp15_context = &ns_cpu_ctx->banked_cp15_regs;
gic_cpu_context *gic_pvt_context = &ns_cpu_ctx->gic_cpu_ctx;
- global_context *gbl_context = &switcher_context.cluster.ns_cluster_ctx;
generic_timer_context *cp15_timer_ctx = &ns_cpu_ctx->cp15_timer_ctx;
cp15_fault_regs *fault_ctx = &cp15_context->ns_cp15_fault_regs;
write_trace(&lock_tube0, NS_TUBE0, "Context Save Start", read_cntpct(), 0x0, 0x0);
/*
- * Increment the warm reset counter. This will not only indicate that
- * a cluster has been warm reset but also the number of times the
- * the switchover has taken place. Update main memory so that the
- * inbound cluster can see this flag even with its MMU off
- */
- switcher_context.warm_reset++;
- cln_dcache_mva_poc(&switcher_context.warm_reset);
-
- /*
* Good place to bring the inbound cluster out of reset, but first
* we need to save the secure world context.
*/
write_trace(&lock_tube0, NS_TUBE0, "Secure Context Save Start", read_cntpct(), 0x0, 0x0);
- smc(SMC_SEC_SAVE, (unsigned)bl_setup);
+ smc(SMC_SEC_SAVE, (unsigned) hyp_warm_reset_handler);
write_trace(&lock_tube0, NS_TUBE0, "Secure Context Save End", read_cntpct(), 0x0, 0x0);
/*
@@ -128,9 +118,16 @@ void save_context(unsigned first_cpu)
* Check if non-secure world has access to the vfp/neon registers
* and save them if so.
*/
- if (nsacr & (0x3 << 10))
+ if (read_nsacr() & (0x3 << 10))
save_vfp(vfp_context);
+
+ /*
+ * Disable the GIC CPU interface tp prevent interrupts from waking
+ * the core from wfi() subsequently.
+ */
+ write32(GIC_IC_PHY_BASE + GICC_CTL, 0x0);
+
/* Save vGIC virtual cpu interface (cpu view) context */
save_gic_interface(gic_pvt_context->gic_cpu_if_regs, VGIC_VM_PHY_BASE);
@@ -151,9 +148,6 @@ void save_context(unsigned first_cpu)
*/
save_gic_distributor_private(gic_pvt_context->gic_dist_if_pvt_regs,
GIC_ID_PHY_BASE);
- if (cpu_id == first_cpu)
- save_gic_distributor_shared(gbl_context->gic_dist_if_regs,
- GIC_ID_PHY_BASE);
/* Safe place to save the Virtualisor context */
SaveVirtualisor(first_cpu);
@@ -181,8 +175,7 @@ void restore_context(unsigned first_cpu)
{
unsigned cpu_id = read_cpuid();
unsigned cluster_id = read_clusterid();
- unsigned nsacr = read_nsacr();
- unsigned warm_reset = reset_type();
+ unsigned warm_reset = 1;
cpu_context *ns_cpu_ctx =
&switcher_context.cluster.core[cpu_id].ns_cpu_ctx;
global_context *gbl_context = &switcher_context.cluster.ns_cluster_ctx;
@@ -203,7 +196,7 @@ void restore_context(unsigned first_cpu)
* specific context can be correctly restored on the external
* vGIC.
*/
- map_cpuif();
+ map_cpuif(cluster_id, cpu_id);
SetupVGIC(warm_reset);
/*
@@ -237,7 +230,7 @@ void restore_context(unsigned first_cpu)
* Check if non-secure world has access to the vfp/neon registers
* and save them if so.
*/
- if (nsacr & (0x3 << 10))
+ if (read_nsacr() & (0x3 << 10))
restore_vfp(vfp_context);
/*
diff --git a/big-little/switcher/context/sh_vgic.c b/big-little/switcher/context/sh_vgic.c
index 691387d..a13f862 100644
--- a/big-little/switcher/context/sh_vgic.c
+++ b/big-little/switcher/context/sh_vgic.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: sh_vgic.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virt_helpers.h"
#include "gic_registers.h"
@@ -79,10 +85,9 @@ static unsigned int cpuinfo_map[MAX_CPUIFS];
* Assuming no IPIs will be received at this point of time. So
* no changes will be made to the priority mask registers.
*/
-unsigned map_cpuif(void)
+unsigned map_cpuif(unsigned cluster_id, unsigned cpu_id)
{
unsigned cpuif_id = 0;
- unsigned cpu_id = read_cpuid(), cluster_id = read_clusterid();
cpuif_id = bitindex(read32(GIC_ID_PHY_BASE + GICD_CPUS) & 0xff);
cpuif_map[cluster_id][cpu_id] = cpuif_id;
diff --git a/big-little/switcher/trigger/async_switchover.c b/big-little/switcher/trigger/async_switchover.c
index 2823163..056c8a1 100644
--- a/big-little/switcher/trigger/async_switchover.c
+++ b/big-little/switcher/trigger/async_switchover.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: async_switchover.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virt_helpers.h"
#include "misc.h"
@@ -148,6 +154,7 @@ unsigned check_switchover_ipi(unsigned cpu_if, unsigned ipi_no)
unsigned check_trigger(unsigned int_id, unsigned int_ack)
{
unsigned cpuid = read_cpuid();
+ unsigned platform = (read32(KFSCB_BASE + KFS_ID) >> 20) & 0xf;
/*
* If we are not using HYP mode timers for triggering a switchover
@@ -177,6 +184,10 @@ unsigned check_trigger(unsigned int_id, unsigned int_ack)
* to the other cluster
*/
+ /* Indicator on emulation that switches are actually taking place */
+ if (platform != 0x1)
+ printf("%d", read_clusterid());
+
/*
* Send an IPI to all the cores in this cluster to start
* a switchover.
@@ -224,6 +235,8 @@ void keep_trigger_alive(void)
void enable_trigger(unsigned tval)
{
unsigned ctl = TIMER_ENABLE;
+ unsigned platform = read32((KFSCB_BASE + KFS_ID) >> 20) & 0xf;
+
/*
* No need to lock this as its accessed by only one cpu
* per cluster and that too one at a time.
@@ -259,9 +272,16 @@ void enable_trigger(unsigned tval)
write_cnthp_tval(interval);
- } else
- /* Program the timer to fire every 10 ms */
- write_cnthp_tval(tval);
+ } else {
+ /*
+ * Program the timer to fire every 12000000 instructions
+ * on the FastModel while 1500000 cycles on the Emulator
+ */
+ if (platform == 0x1)
+ write_cnthp_tval(tval);
+ else
+ write_cnthp_tval(tval >> 3);
+ }
gic_enable_int(HYP_TIMER_IRQ);
}
diff --git a/big-little/switcher/trigger/handle_switchover.s b/big-little/switcher/trigger/handle_switchover.s
index 9190cd4..d18ba21 100755
--- a/big-little/switcher/trigger/handle_switchover.s
+++ b/big-little/switcher/trigger/handle_switchover.s
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: handle_switchover.s
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
AREA SwitchoverCode, CODE, READONLY, ALIGN=5
diff --git a/big-little/switcher/trigger/sync_switchover.c b/big-little/switcher/trigger/sync_switchover.c
index f52d386..ad257bc 100644
--- a/big-little/switcher/trigger/sync_switchover.c
+++ b/big-little/switcher/trigger/sync_switchover.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: sync_switchover.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "misc.h"
#include "virt_helpers.h"
diff --git a/big-little/virtualisor/cache_geom.c b/big-little/virtualisor/cache_geom.c
index 4c0307c..4138eeb 100644
--- a/big-little/virtualisor/cache_geom.c
+++ b/big-little/virtualisor/cache_geom.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: cache_geom.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virtualisor.h"
#include "virt_helpers.h"
@@ -159,7 +165,7 @@ void find_cache_diff(cache_geometry *hcg_ptr, cache_geometry *tcg_ptr, cache_dif
unsigned map_cache_geometries(cache_geometry *hcg_ptr, cache_geometry *tcg_ptr, cache_diff *cd_ptr)
{
- unsigned rc = 0, cpu_no = read_midr(), cpu_id = read_cpuid();
+ unsigned rc = 0, cpu_id = read_cpuid();
unsigned hcr = 0, cluster_id = read_clusterid(), sibling_cpuid = 0;
unsigned abs_cpuid = 0;
@@ -208,7 +214,9 @@ unsigned map_cache_geometries(cache_geometry *hcg_ptr, cache_geometry *tcg_ptr,
hcr = read_hcr();
hcr |= HCR_TSW | HCR_TID2;
write_hcr(hcr);
-
+ dsb();
+ isb();
+
} else {
/* Find the cache geometry on the target cpu */
diff --git a/big-little/virtualisor/cpus/a15/a15.c b/big-little/virtualisor/cpus/a15/a15.c
index 50f626b..92bebac 100644
--- a/big-little/virtualisor/cpus/a15/a15.c
+++ b/big-little/virtualisor/cpus/a15/a15.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: a15.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "bl.h"
#include "virtualisor.h"
diff --git a/big-little/virtualisor/cpus/a15/include/a15.h b/big-little/virtualisor/cpus/a15/include/a15.h
index 7f4e8a9..554e401 100644
--- a/big-little/virtualisor/cpus/a15/include/a15.h
+++ b/big-little/virtualisor/cpus/a15/include/a15.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: a15.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __A15_H__
#define __A15_H__
diff --git a/big-little/virtualisor/cpus/a7/a7.c b/big-little/virtualisor/cpus/a7/a7.c
index c3742bf..9c3cef5 100644
--- a/big-little/virtualisor/cpus/a7/a7.c
+++ b/big-little/virtualisor/cpus/a7/a7.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: a7.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "bl.h"
#include "virtualisor.h"
diff --git a/big-little/virtualisor/cpus/a7/include/a7.h b/big-little/virtualisor/cpus/a7/include/a7.h
index b7841b9..5e2b62f 100644
--- a/big-little/virtualisor/cpus/a7/include/a7.h
+++ b/big-little/virtualisor/cpus/a7/include/a7.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: a7.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __A7_H__
#define __A7_H__
diff --git a/big-little/virtualisor/include/cache_geom.h b/big-little/virtualisor/include/cache_geom.h
index 72935f5..642e0e9 100644
--- a/big-little/virtualisor/include/cache_geom.h
+++ b/big-little/virtualisor/include/cache_geom.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: kingfisher.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __CACHE_GEOM_H__
#define __CACHE_GEOM_H__
diff --git a/big-little/virtualisor/include/mem_trap.h b/big-little/virtualisor/include/mem_trap.h
index 72afda8..4c4a200 100644
--- a/big-little/virtualisor/include/mem_trap.h
+++ b/big-little/virtualisor/include/mem_trap.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: mem_trap.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __MEM_TRAP_H__
#define __MEM_TRAP_H__
diff --git a/big-little/virtualisor/include/virtualisor.h b/big-little/virtualisor/include/virtualisor.h
index fac42e7..c3bf2c1 100644
--- a/big-little/virtualisor/include/virtualisor.h
+++ b/big-little/virtualisor/include/virtualisor.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: virtualisor.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __VIRTUALISOR_H__
#define __VIRTUALISOR_H__
diff --git a/big-little/virtualisor/mem_trap.c b/big-little/virtualisor/mem_trap.c
index bd99b52..a3a2de8 100644
--- a/big-little/virtualisor/mem_trap.c
+++ b/big-little/virtualisor/mem_trap.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: mem_trap.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virtualisor.h"
#include "misc.h"
diff --git a/big-little/virtualisor/vgic_trap_handler.c b/big-little/virtualisor/vgic_trap_handler.c
index 5b726a2..77ac14c 100644
--- a/big-little/virtualisor/vgic_trap_handler.c
+++ b/big-little/virtualisor/vgic_trap_handler.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: vgic_trap_handler.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virtualisor.h"
#include "gic_registers.h"
diff --git a/big-little/virtualisor/virt_context.c b/big-little/virtualisor/virt_context.c
index 941f3dc..80a79b2 100644
--- a/big-little/virtualisor/virt_context.c
+++ b/big-little/virtualisor/virt_context.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: virt_context.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virtualisor.h"
#include "misc.h"
@@ -32,7 +38,7 @@ extern cache_stats cm_op_stats[NUM_CPUS][MAX_CACHE_LEVELS];
*/
void SaveVirtualisor(unsigned first_cpu)
{
- unsigned len = 0, ctr = 0, cpu_id = read_cpuid(), cpu_no = read_midr();
+ unsigned len = 0, ctr = 0, cpu_id = read_cpuid(), cpu_no = PART_NO(read_midr());
unsigned cluster_id = read_clusterid(), index = 0, vd_len = 0, rc = 0;
mem_trap_data *s2_td = &s2_trap_section$$Base;
unsigned long long *cd_ptr = 0x0;
@@ -135,7 +141,7 @@ void SaveVirtualisor(unsigned first_cpu)
*/
void RestoreVirtualisor(unsigned first_cpu)
{
- unsigned len = 0, ctr = 0, cpu_id = read_cpuid(), cpu_no = read_midr();
+ unsigned len = 0, ctr = 0, cpu_id = read_cpuid(), cpu_no = PART_NO(read_midr());
unsigned cluster_id = read_clusterid(), index = 0, vd_len = 0, rc = 0;
mem_trap_data *s2_td = &s2_trap_section$$Base;
unsigned long long *cd_ptr = 0x0;
diff --git a/big-little/virtualisor/virt_handle.c b/big-little/virtualisor/virt_handle.c
index 6b4c1b5..2cfb2cc 100644
--- a/big-little/virtualisor/virt_handle.c
+++ b/big-little/virtualisor/virt_handle.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: virt_handle.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virtualisor.h"
#include "virt_helpers.h"
@@ -515,7 +521,7 @@ void trap_dabort_handle(unsigned hsr, gp_regs * regs)
void HandleVirtualisor(gp_regs * regs)
{
- unsigned cpu_id = read_cpuid(), cpu_no = read_midr(), rc = 0;
+ unsigned cpu_id = read_cpuid(), cpu_no = PART_NO(read_midr()), rc = 0;
unsigned hsr = read_hsr(), elr = 0, vd_len = 0, index = 0;
virt_descriptor *vd_array = &virt_desc_section$$Base;
unsigned (*handler) (gp_regs *, unsigned, unsigned) = 0x0, sibling;
diff --git a/big-little/virtualisor/virt_setup.c b/big-little/virtualisor/virt_setup.c
index cc90936..c2dd75e 100644
--- a/big-little/virtualisor/virt_setup.c
+++ b/big-little/virtualisor/virt_setup.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: virt_setup.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include "virt_helpers.h"
#include "virtualisor.h"
@@ -49,13 +55,14 @@ static unsigned virt_init[NUM_CPUS];
*/
unsigned find_sibling_cpu()
{
- unsigned cpu_no = read_midr();
+ unsigned cpu_no = PART_NO(read_midr());
switch (DC_SYSTYPE) {
case A15_A15:
if(cpu_no == A15)
return cpu_no;
break;
+ case A7_A15:
case A15_A7:
if(cpu_no == A15)
return A7;
@@ -73,7 +80,7 @@ unsigned find_sibling_cpu()
void SetupVirtualisor(unsigned first_cpu)
{
- unsigned rc = 0, cpu_id = read_cpuid(), cpu_no = read_midr();
+ unsigned rc = 0, cpu_id = read_cpuid(), cpu_no = PART_NO(read_midr());
unsigned vd_len = 0, index = 0, cluster_id = read_clusterid();
virt_descriptor *vd_array = &virt_desc_section$$Base;
unsigned (*handler) (unsigned, unsigned) = 0x0, sibling;
diff --git a/bootwrapper/Makefile b/bootwrapper/Makefile
index c2ec64f..addcdae 100755
--- a/bootwrapper/Makefile
+++ b/bootwrapper/Makefile
@@ -1,16 +1,24 @@
-# $Copyright:
-# ----------------------------------------------------------------
-# This confidential and proprietary software may be used only as
-# authorised by a licensing agreement from ARM Limited
-# (C) COPYRIGHT 2008-2011 ARM Limited
-# ALL RIGHTS RESERVED
-# The entire notice above must be reproduced on all authorised
-# copies and copies may only be made to the extent permitted
-# by a licensing agreement from ARM Limited.
-# ----------------------------------------------------------------
-# File: Makefile
-# ----------------------------------------------------------------
-# $
+#
+# Copyright (c) 2011, ARM Limited. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with
+# or without modification, are permitted provided that the
+# following conditions are met:
+#
+# Redistributions of source code must retain the above
+# copyright notice, this list of conditions and the
+# following disclaimer.
+#
+# Redistributions 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 ARM nor the names of its
+# contributors may be used to endorse or promote products
+# derived from this software without specific prior written
+# permission.
+#
# Decrease the verbosity of the make script
# can be made verbose by passing V=1 at the make command line
@@ -75,7 +83,7 @@ bl:
.PHONY: bl_sec
bl_sec:
- make -C big-little bl_sec.axf
+ make -C big-little bl_sec.axf wboot.bin
.PHONY: clean
@@ -106,7 +114,7 @@ bl.o: bl.S
$(Q)armasm $(V7_ASFLAGS) -o $@ $<
bl_sec.S:
- make -C big-little bl_sec.axf
+ make -C big-little bl_sec.axf wboot.bin
@echo " MAP"
$(Q)./makemap big-little/bl_sec.axf bl_sec
diff --git a/bootwrapper/big-little-mp1.mxscript b/bootwrapper/big-little-mp1.mxscript
index 99d90c2..b007e3d 100755
--- a/bootwrapper/big-little-mp1.mxscript
+++ b/bootwrapper/big-little-mp1.mxscript
@@ -40,7 +40,7 @@ int ctr = 0;
// below (on line 47) and uncomment the following lines taking care to update
// the paths accordingly.
// string mmcimage = "<path to mmc.img>";
-// system(model + " -C motherboard.mmc.p_mmc_file=" + mmcimage + trace_plugin + trace_sources + trace_file + trace_misc + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
+// system(model + " -C motherboard.mmc.p_mmc_file=" + mmcimage + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
// Invoke the model. It then listens for connection requests from the model debugger
// Vanilla invocation of the model.
diff --git a/bootwrapper/big-little-mp4.mxscript b/bootwrapper/big-little-mp4.mxscript
index fb817a9..96bc6bf 100755
--- a/bootwrapper/big-little-mp4.mxscript
+++ b/bootwrapper/big-little-mp4.mxscript
@@ -40,7 +40,7 @@ int ctr = 0;
// below (on line 47) and uncomment the following lines taking care to update
// the paths accordingly.
// string mmcimage = "<path to mmc.img>";
-// system(model + " -C motherboard.mmc.p_mmc_file=" + mmcimage + trace_plugin + trace_sources + trace_file + trace_misc + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
+// system(model + " -C motherboard.mmc.p_mmc_file=" + mmcimage + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
// Invoke the model. It then listens for connection requests from the model debugger
// Vanilla invocation of the model.
diff --git a/bootwrapper/bl-mp1-fm-eac.mxscript b/bootwrapper/bl-mp1-fm-eac.mxscript
new file mode 100755
index 0000000..7a7912e
--- /dev/null
+++ b/bootwrapper/bl-mp1-fm-eac.mxscript
@@ -0,0 +1,76 @@
+// Replace the string with the absolute path of the Kingfisher model executable
+// e.g. string model = "/home/working_dir/RTSM_VE_Cortex-A15x1-A7x1";
+string model = "<path to the model>";
+
+// Replace the string with the absolute path of the Virutalizer+Payload software image
+// e.g. string app = "/home/working_dir/bootwrapper/img.axf"
+string app = "<path to the software image>";
+
+// Replace the string with the absolute path of the wboot.bin image created in the
+// bootwrapper/big-little directory. This image is load in flash at 0x0 and distinguishes
+// between a warm and a cold reset
+string wboot = "<path to warm reset handler image>";
+
+int ctr = 0;
+
+// NOTE
+//
+// Uncomment the next 4 'string' variables and update them _only_ if the run is required
+// to generate trace output as described in docs/04-Cache-hit-rate-howto.txt. Also,
+// comment out the system() invocation on line 47 and uncomment the system() command on line 34.
+// Each 'trace' parameter is described below.
+
+// Add the path to the trace plugin
+// string trace_plugin = " --trace-plugin <path to>/GenericTrace.so";
+
+// Parameters for selecting the trace sources to monitor outbound cache hits
+// string trace_sources = " --parameter TRACE.GenericTrace.trace-sources=\*sw_trace_event\*,\*read_for_3_came_from_snoop\*,\*read_for_4_came_from_snoop\* ";
+
+// Add the path to the trace file where all the output will be collected
+// string trace_file = " --parameter TRACE.GenericTrace.trace-file=<path to trace file> ";
+
+// Miscellaneous parameters. The frequency at which the performance metrics of the
+// model appear in the trace source can be changed here (default is 0x100).
+// string trace_misc = " -C TRACE.GenericTrace.perf-period=0x100 -C TRACE.GenericTrace.flush=1 ";
+
+// The commented 'system' command below will launch the model and register the trace
+// sources selected in 'trace_sources' with the Generic Trace plugin selected using
+// 'trace_plugin'. Other parameters are specified in 'trace_file' & 'trace_misc'.
+// system(model + trace_plugin + trace_sources + trace_file + trace_misc + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
+
+// NOTE
+//
+// _Only_ if a run is needed using an optional rootfs MMC image built using the instructions in
+// docs/06-Optional-rootfs-build.txt, then comment out the system() invocation
+// below (on line 47) and uncomment the following lines taking care to update
+// the paths accordingly.
+// string mmcimage = "<path to mmc.img>";
+// system(model + " -C motherboard.mmc.p_mmc_file=" + mmcimage + trace_plugin + trace_sources + trace_file + trace_misc + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
+
+// Invoke the model. It then listens for connection requests from the model debugger
+// Vanilla invocation of the model.
+system(model + " -C motherboard.flashloader0.fname=" + wboot + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
+
+// Wait for the model to load before connecting to it. There will be times when we
+// try connecting before the model has loded resulting in a "Connection refused"
+// error. Increasing 'ctr' or retrying should solve the problem.
+while(ctr < 400000000)
+{
+ ctr++;
+}
+
+// Model listens at port 7000
+connectToModel("7000");
+
+// The following lines can be uncommented to set any breakpoints on each cluster
+selectTarget("coretile.cluster0.cpu0");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+selectTarget("coretile.cluster1.cpu0");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+
+// Select the primary cpu on the primary cluster and set the ball rolling
+selectTarget("coretile.cluster0.cpu0");
+run();
+
diff --git a/bootwrapper/bl-mp4-fm-eac.mxscript b/bootwrapper/bl-mp4-fm-eac.mxscript
new file mode 100755
index 0000000..6099351
--- /dev/null
+++ b/bootwrapper/bl-mp4-fm-eac.mxscript
@@ -0,0 +1,94 @@
+// Replace the string with the absolute path of the Kingfisher model executable
+// e.g. string model = "/home/working_dir/models/RTSM_VE_Cortex-A15x4-A7x4"
+string model = "<path to the model>";
+
+// Replace the string with the absolute path of the Virutalizer+Payload software image
+// e.g. string app = "/home/working_dir/bootwrapper/img.axf"
+string app = "<path to the software image>";
+
+// Replace the string with the absolute path of the wboot.bin image created in the
+// bootwrapper/big-little directory. This image is load in flash at 0x0 and distinguishes
+// between a warm and a cold reset
+string wboot = "<path to warm reset handler image>";
+
+int ctr = 0;
+
+// NOTE
+//
+// Uncomment the next 4 'string' variables and update them _only_ if the run is required
+// to generate trace output as described in docs/04-Cache-hit-rate-howto.txt. Also,
+// comment out the system() invocation on line 47 and uncomment the system() command on line 34.
+// Each 'trace' parameter is described below.
+
+// Add the path to the trace plugin
+// string trace_plugin = " --trace-plugin <path to>/GenericTrace.so";
+
+// Parameters for selecting the trace sources to monitor outbound cache hits
+// string trace_sources = " --parameter TRACE.GenericTrace.trace-sources=\*sw_trace_event\*,\*read_for_3_came_from_snoop\*,\*read_for_4_came_from_snoop\* ";
+
+// Add the path to the trace file where all the output will be collected
+// string trace_file = " --parameter TRACE.GenericTrace.trace-file=<path to trace file> ";
+
+// Miscellaneous parameters. The frequency at which the performance metrics of the
+// model appear in the trace source can be changed here (default is 0x100).
+// string trace_misc = " -C TRACE.GenericTrace.perf-period=0x100 -C TRACE.GenericTrace.flush=1 ";
+
+// The commented 'system' command below will launch the model and register the trace
+// sources selected in 'trace_sources' with the Generic Trace plugin selected using
+// 'trace_plugin'. Other parameters are specified in 'trace_file' & 'trace_misc'.
+// system(model + trace_plugin + trace_sources + trace_file + trace_misc + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
+
+// NOTE
+//
+// _Only_ if a run is needed using an optional rootfs MMC image built using the instructions in
+// doc/06-Optional-rootfs-build.txt, then comment out the system() invocation
+// below (on line 47) and uncomment the following lines taking care to update
+// the paths accordingly.
+// string mmcimage = "<path to mmc.img>";
+// system(model + " -C motherboard.mmc.p_mmc_file=" + mmcimage + trace_plugin + trace_sources + trace_file + trace_misc + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
+
+// Invoke the model. It then listens for connection requests from the model debugger
+// Vanilla invocation of the model.
+system(model + " -C motherboard.flashloader0.fname=" + wboot + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + " --verbose -S &");
+
+// Wait for the model to load before connecting to it. There will be times when we
+// try connecting before the model has loded resulting in a "Connection refused"
+// error. Increasing 'ctr' or retrying should solve the problem.
+while(ctr < 400000000)
+{
+ ctr++;
+}
+
+// Model listens at port 7000
+connectToModel("7000");
+
+// The following lines can be uncommented to set any breakpoints on each cluster
+selectTarget("coretile.cluster0.cpu0");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+selectTarget("coretile.cluster0.cpu1");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+selectTarget("coretile.cluster0.cpu2");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+selectTarget("coretile.cluster0.cpu3");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+selectTarget("coretile.cluster1.cpu0");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+selectTarget("coretile.cluster1.cpu1");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+selectTarget("coretile.cluster1.cpu2");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+selectTarget("coretile.cluster1.cpu3");
+//bpAdd(<address>, "Normal");
+//bpAdd(<address>, "Secure");
+
+// Select the primary cpu on the primary cluster and set the ball rolling
+selectTarget("coretile.cluster0.cpu0");
+run();
+
diff --git a/bootwrapper/boot.S b/bootwrapper/boot.S
index 5842ebe..6afbf34 100755
--- a/bootwrapper/boot.S
+++ b/bootwrapper/boot.S
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: boot.S
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
AREA |boot|, CODE, ALIGN=2
PRESERVE8
diff --git a/bootwrapper/boot.map.template b/bootwrapper/boot.map.template
index c5c05b3..7267c4b 100755
--- a/bootwrapper/boot.map.template
+++ b/bootwrapper/boot.map.template
@@ -1,16 +1,25 @@
- ; $Copyright:
- ; ----------------------------------------------------------------
- ; This confidential and proprietary software may be used only as
- ; authorised by a licensing agreement from ARM Limited
- ; (C) COPYRIGHT 2008-2011 ARM Limited
- ; ALL RIGHTS RESERVED
- ; The entire notice above must be reproduced on all authorised
- ; copies and copies may only be made to the extent permitted
- ; by a licensing agreement from ARM Limited.
- ; ----------------------------------------------------------------
- ; File: boot.map.template
- ; ----------------------------------------------------------------
- ; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
+
VECTORS VECTBASE00000 0x100
{
diff --git a/bootwrapper/bootargs.S b/bootwrapper/bootargs.S
index 4edc17a..3c57492 100644
--- a/bootwrapper/bootargs.S
+++ b/bootwrapper/bootargs.S
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: bootargs.S
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
AREA | bootargs|, CODE, ALIGN=8
PRESERVE8
diff --git a/bootwrapper/bootwrapper.h b/bootwrapper/bootwrapper.h
index 7aa6605..7d44493 100644
--- a/bootwrapper/bootwrapper.h
+++ b/bootwrapper/bootwrapper.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: bootwrapper.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __BOOTWRAPPER_H__
#define __BOOTWRAPPER_H__
diff --git a/bootwrapper/c_start.c b/bootwrapper/c_start.c
index 61b184e..12442ff 100644
--- a/bootwrapper/c_start.c
+++ b/bootwrapper/c_start.c
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: c_start.c
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#include <stdio.h>
#include <string.h>
diff --git a/bootwrapper/emubuild.s b/bootwrapper/emubuild.s
index abf2103..b487015 100644
--- a/bootwrapper/emubuild.s
+++ b/bootwrapper/emubuild.s
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: emubuild.s
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
;; CPSR Mode bits definitions
USR_MODE EQU 16
diff --git a/bootwrapper/filesystem.S b/bootwrapper/filesystem.S
index 80068ea..4b8cb31 100644
--- a/bootwrapper/filesystem.S
+++ b/bootwrapper/filesystem.S
@@ -1,20 +1,29 @@
- AREA |filesystem|, CODE, ALIGN=2 ; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: filesystem.S
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
+ AREA |filesystem|, CODE, ALIGN=2
- EXPORT fs_start
- EXPORT fs_end
+ EXPORT fs_start
+ EXPORT fs_end
fs_start
- INCBIN payload/fsimg
+ INCBIN payload/fsimg
fs_end
- END
+ END
diff --git a/bootwrapper/helpers.S b/bootwrapper/helpers.S
index 49e70e2..811b263 100755
--- a/bootwrapper/helpers.S
+++ b/bootwrapper/helpers.S
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: helpers.S
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
EXPORT wfi
EXPORT wfe
diff --git a/bootwrapper/helpers.h b/bootwrapper/helpers.h
index 187df86..1142627 100644
--- a/bootwrapper/helpers.h
+++ b/bootwrapper/helpers.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: helpers.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef _VIRT_HELPERS_H_
#define _VIRT_HELPERS_H_
diff --git a/bootwrapper/kernel.S b/bootwrapper/kernel.S
index cdd6c9f..1586abb 100644
--- a/bootwrapper/kernel.S
+++ b/bootwrapper/kernel.S
@@ -1,16 +1,24 @@
- ;; $Copyright:
- ;; ----------------------------------------------------------------
- ;; This confidential and proprietary software may be used only as
- ;; authorised by a licensing agreement from ARM Limited
- ;; (C) COPYRIGHT 2008-2011 ARM Limited
- ;; ALL RIGHTS RESERVED
- ;; The entire notice above must be reproduced on all authorised
- ;; copies and copies may only be made to the extent permitted
- ;; by a licensing agreement from ARM Limited.
- ;; ----------------------------------------------------------------
- ;; File: kernel.S
- ;; ----------------------------------------------------------------
- ;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
AREA |kernel|, CODE, ALIGN=2
EXPORT kernel_start
diff --git a/bootwrapper/makemap b/bootwrapper/makemap
index 2e9f6c4..47213c9 100755
--- a/bootwrapper/makemap
+++ b/bootwrapper/makemap
@@ -1,17 +1,25 @@
#! /bin/env perl
-# $Copyright:
-# ----------------------------------------------------------------
-# This confidential and proprietary software may be used only as
-# authorised by a licensing agreement from ARM Limited
-# (C) COPYRIGHT 2008-2011 ARM Limited
-# ALL RIGHTS RESERVED
-# The entire notice above must be reproduced on all authorised
-# copies and copies may only be made to the extent permitted
-# by a licensing agreement from ARM Limited.
-# ----------------------------------------------------------------
-# File: virt_helpers.s
-# ----------------------------------------------------------------
-# $
+#
+# Copyright (c) 2011, ARM Limited. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with
+# or without modification, are permitted provided that the
+# following conditions are met:
+#
+# Redistributions of source code must retain the above
+# copyright notice, this list of conditions and the
+# following disclaimer.
+#
+# Redistributions 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 ARM nor the names of its
+# contributors may be used to endorse or promote products
+# derived from this software without specific prior written
+# permission.
+#
use strict;
diff --git a/bootwrapper/uart.c b/bootwrapper/uart.c
index 93334ec..138b0d5 100644
--- a/bootwrapper/uart.c
+++ b/bootwrapper/uart.c
@@ -1,18 +1,26 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: uart.c
- * ----------------------------------------------------------------
- * $
- *
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
+
+/*
* uart.c - boot code to output characters on a PL011 uart
* Not SMP-safe, so make sure you only call these functions
* from one CPU at a time.
diff --git a/bootwrapper/vectors.S b/bootwrapper/vectors.S
index 096d1b6..1474ff1 100644
--- a/bootwrapper/vectors.S
+++ b/bootwrapper/vectors.S
@@ -1,19 +1,26 @@
-;;-----------------------------------------------------------------------------
-;; $Copyright:
-;; ----------------------------------------------------------------
-;; This confidential and proprietary software may be used only as
-;; authorised by a licensing agreement from ARM Limited
-;; (C) COPYRIGHT 2008-2011 ARM Limited
-;; ALL RIGHTS RESERVED
-;; The entire notice above must be reproduced on all authorised
-;; copies and copies may only be made to the extent permitted
-;; by a licensing agreement from ARM Limited.
-;; ----------------------------------------------------------------
-;; File: vectors.S
-;; ----------------------------------------------------------------
-;; $
+ ;
+ ; Copyright (c) 2011, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions 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 ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
- AREA | vectors|, CODE, ALIGN=8
+ AREA vectors, CODE, ALIGN=8
PRESERVE8
; ==============================================================================
diff --git a/bootwrapper/vgic.h b/bootwrapper/vgic.h
index fb76d2f..56b5389 100644
--- a/bootwrapper/vgic.h
+++ b/bootwrapper/vgic.h
@@ -1,18 +1,24 @@
/*
- * $Copyright:
- * ----------------------------------------------------------------
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2011 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- * ----------------------------------------------------------------
- * File: vgic.h
- * ----------------------------------------------------------------
- * $
- */
+ * Copyright (c) 2011, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions 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 ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
#ifndef __VGIC_H__
#define __VGIC_H__
diff --git a/docs/01-Usage.txt b/docs/01-Usage.txt
index 3ed01f8..3eeb764 100644
--- a/docs/01-Usage.txt
+++ b/docs/01-Usage.txt
@@ -24,10 +24,21 @@ Usage
2. Build instructions
+ Note that this release relies on the 'env' utility, which is
+ a part of the coreutils suite. The 'env' utility is expected
+ to be located at '/bin/env'. If it is at a different
+ location then this must be reflected in the first line of
+ the following file:
+
+ arm-virtualizer-v2_1-171111/bootwrapper/makemap
+
+ Failure to make this modification will result in a build
+ failure.
+
To build the software:
- $ tar -jxf arm-virtualizer-v2.0-ti-040911.tar.bz2
- $ cd arm-virtualizer-v2.0-ti-040911/bootwrapper
+ $ tar -jxf arm-virtualizer-v2_1-171111.tar.bz2
+ $ cd arm-virtualizer-v2_1-171111/bootwrapper
$ make clean && make
The resulting file is 'img.axf'.
@@ -37,12 +48,12 @@ Usage
Note that the pre-built stub kernel image is located at:
- arm-virtualizer-v2.0-ti-040911/bootwrapper/payload/kernel
+ arm-virtualizer-v2_1-171111/bootwrapper/payload/kernel
.. and the placeholder dummy root filesystem image is located
at:
- arm-virtualizer-v2.0-ti-040911/bootwrapper/payload/fsimg
+ arm-virtualizer-v2_1-171111/bootwrapper/payload/fsimg
These may be replaced with custom built images such as a
suitably configured linux kernel image and a root filesystem
@@ -54,17 +65,6 @@ Usage
Look at docs/06-Optional-rootfs-build.txt for optionally
building a complete root filesystem.
- Note that this release relies on the 'env' utility, which is
- a part of the coreutils suite. The 'env' utility is expected
- to be located at '/bin/env'. If it is at a different
- location then this must be reflected in the first line of
- the following file:
-
- arm-virtualizer-v2.0-ti-040911/bootwrapper/makemap
-
- Failure to make this modification will result in a build
- failure.
-
3. Usage
If the Kingfisher Real-Time System Model (RTSM VE Cortex-A15 KF
diff --git a/docs/02-Code-layout.txt b/docs/02-Code-layout.txt
index 79af0a3..d033b39 100644
--- a/docs/02-Code-layout.txt
+++ b/docs/02-Code-layout.txt
@@ -6,7 +6,7 @@ A Introduction
The software contained in the 'bootwrapper' directory allows
the execution of a software payload e.g. a Linux stack to
alternate between two multi-core clusters of ARM Cortex-A15
- & Kingfisher processors connected by a coherent
+ & Cortex-A7 processors connected by a coherent
interconnect. To achieve this aim it provides the ability
to:
@@ -15,12 +15,12 @@ A Introduction
cluster (henceforth called the inbound cluster).
2. Hide any software visible microarchitectural differences
- between the Cortex-A15 & Kingfisher processors.
+ between the Cortex-A15 & Cortex-A7 processors.
3. Use the ARM Virtualization Extensions to perform 1. & 2.
in an payload software agnostic manner.
- This software is intended to be executed on the Kingfisher
+ This software is intended to be executed on the Cortex-A7
Real-Time System Model (RTSM VE Cortex-A15 KF CCI version
6.2 Beta).
@@ -31,7 +31,7 @@ A Introduction
This is called the MP configuration. In it's current state,
it mainly involves making the payload software believe that
- the A15 cluster includes the cpus present on Kingfisher cluster
+ the A15 cluster includes the cpus present on Cortex-A7 cluster
i.e.there is one cluster with more cpus that there
physically are. [Note that MP support is highly experimental
and unstable. It is NOT the focus of this release and is
@@ -180,10 +180,7 @@ B Code layout overview
2. hyp_setup.c
1. Extends the initialization of the Virtualizer
- software into C code. Most importantly it
- distinguishes between cold (power-on) & warm
- (inbound cluster) resets. Software is
- initialised differently in each case.
+ software into C code after a cold reset.
2. If switching is being done asynchronously then
the HYP timer interrupt is setup to periodically
@@ -295,7 +292,7 @@ B Code layout overview
is no longer a 1 to 1 mapping between cpu
ids and cpu interface ids e.g. on an
MPx1+MPx1 cluster configuration,
- cpu0 of the Kingfisher cluster would
+ cpu0 of the Cortex-A7 cluster would
correspond to cpuinterface1 on the shared
vGIC. This in turn affects routing of
peripheral and software generated
@@ -313,10 +310,14 @@ B Code layout overview
2. sync_switchover.c
- 1. Contains code to handle an HVC instruction
- executed by the payload software as a
- trigger to initiate a
- synchronous switchover.
+ 1. Contains code to handle an HVC instructions
+ executed by the payload software:
+
+ a. to initiate a synchronous switchover.
+ ("HVC #1")
+
+ b. to find the id of the cluster on which its
+ currently executing. ("HVC #2")
3. handle_switchover.s
@@ -332,13 +333,13 @@ B Code layout overview
Virtualization extensions:
1. Hides any microarchitectural differences between the
- Cortex-A15 & Kingfisher processors visible to the
+ Cortex-A15 & Cortex-A7 processors visible to the
payload software.
2. Provides a different view of the underlying hardware
than what really exists e.g. in the switching mode
it traps accesses made by the host cluster
- (Kingfisher cluster currently) to the shared vGIC
+ (Cortex-A7 cluster currently) to the shared vGIC
physical distributor interface, so that routing of
interrupts can take place correctly. In the MP mode,
the L2 control and MPIDR registers are virtualized
@@ -367,7 +368,7 @@ B Code layout overview
recognized by the HSR. Also, to deal with
microarchitectural differences the concept of a HOST
cluster is introduced. It is possible for each
- cpu to find out the system topology using the Kingfisher
+ cpu to find out the system topology using the Kingfisher
System Control Block. Once it knows the host cluster id
& whether the software is expected to switch execution
or run in the MP mode (provided at compile time), the
@@ -378,7 +379,7 @@ B Code layout overview
been built to run on [assumed to be Cortex-A15 for this
release] is termed as the TARGET while the cluster on
which the differences are expected to crop up is called
- the HOST (assumed to be Kingfisher for this release).
+ the HOST (assumed to be Cortex-A7 for this release).
The HOST environment variable is used to specify
the host cluster. The target cluster is assumed to be
the logical complement of the host i.e. cluster ids can
@@ -402,7 +403,7 @@ B Code layout overview
and target clusters if the trap handler needs
to obtain some information about the target
cluster to be able to work correctly e.g the
- Kingfisher processor cluster needs to find out
+ Cortex-A7 processor cluster needs to find out
the cache geometry of the Cortex-A15
processor cluster to be able to handle cache
maintenance operations by set/way correctly.This
@@ -448,13 +449,13 @@ B Code layout overview
8. cpus/
- Placeholders for any traps that the Kingfisher or A15 processor
+ Placeholders for any traps that the Cortex-A7 or A15 processor
cluster might want to setup. No traps need to be setup
at the moment.
9. big-little/secure_world
- Since both Kingfisher & Cortex-A15 processors support ARM
+ Since both Cortex-A7 & Cortex-A15 processors support ARM
TrustZone Security Extensions, there is certain context
that needs to be setup, saved & restored in the Secure
world.
diff --git a/docs/03-Linux-kernel-build.txt b/docs/03-Linux-kernel-build.txt
index 972725a..b5d79b2 100644
--- a/docs/03-Linux-kernel-build.txt
+++ b/docs/03-Linux-kernel-build.txt
@@ -2,14 +2,15 @@ Building and installing a Linux kernel
======================================
A suitable Linux kernel image for use with the virtualizer
-can be built as follows:
+can be built as follows (GCC toolchain used for these steps is:
+CodeSourcery Sourcery G++ Lite 2010.09 v4.5.1)
-$ tar -jxf arm-virtualizer-v2.0-ti-040911.tar.bz2
-$ cd arm-virtualizer-v2.0-ti-040911/bootwrapper
+$ tar -jxf arm-virtualizer-v2_1-171111.tar.bz2
+$ cd arm-virtualizer-v2_1-171111/bootwrapper
$ make clean
$ pushd /tmp
-$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/maz/ael-kernel.git ael-kernel.git
-$ cd ael-kernel.git
+$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git arm-platforms.git
+$ cd arm-platforms.git
$ git checkout -b ael-11.06 origin/ael-11.06
$ yes | make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- vexpress-new_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4
@@ -23,10 +24,10 @@ $ make clean && make
.. in the top bootwrapper directory.
This will result in a file called img.axf located at
-arm-virtualizer-v2.0-ti-040911/bootwrapper/img.axf.
+arm-virtualizer-v2_1-171111/bootwrapper/img.axf.
To launch the ARM FastModel with the virtualizer, first modify
-arm-virtualizer-v2.0-ti-040911/bootwrapper/big-little-MP<x>.mxscript
+arm-virtualizer-v2_1-171111/bootwrapper/big-little-MP<x>.mxscript
as usual to fill in paths to the model binary and the img.axf files. The
mxscript file is adequately commented to assist with this.
@@ -43,11 +44,11 @@ string model = "/home/working_dir/models/RTSM_VE_Cortex-A15x4-A7x4";
The path to the img.axf file is specified using the app directive as
follows:
-string app = "arm-virtualizer-v2.0-ti-040911/bootwrapper/img.axf";
+string app = "arm-virtualizer-v2_1-171111/bootwrapper/img.axf";
The model can then be launched using:
-modeldebugger -s arm-virtualizer-v2.0-ti-040911/bootwrapper/big-little-MP<x>.mxscript
+modeldebugger -s arm-virtualizer-v2_1-171111/bootwrapper/big-little-MP<x>.mxscript
Where 'x' is the 1 or 4 respectively in the case of an MP1 model run or an
MP4 model run.
diff --git a/docs/04-Cache-hit-rate-howto.txt b/docs/04-Cache-hit-rate-howto.txt
index fec4899..60d37a5 100644
--- a/docs/04-Cache-hit-rate-howto.txt
+++ b/docs/04-Cache-hit-rate-howto.txt
@@ -49,7 +49,7 @@ C Plugin Trace sources
The GenericTrace plugin provides events which allow each cluster
to trace snoop requests originating from a different cluster that
- hit in its caches. For snoops originating from the Kingfisher cluster
+ hit in its caches. For snoops originating from the Cortex-A7 cluster
that hit in the A15 cluster, the event is 'read_for_4_came_from_snoop'
& for the opposite case the event is 'read_for_3_came_from_snoop'.
The numbers '3' & '4' in the name of the trace sources are the ids
@@ -148,7 +148,7 @@ D Putting it all together
// Lines beginning with "read_for_<x>_came_from_snoop" are a result of
// enabling the event sources for monitoring the cache hits resulting
// from snoops originating from master interface <x> on the CCI.
- // The following line indicates that a snoop from the Kingfisher cluster
+ // The following line indicates that a snoop from the Cortex-A7 cluster
// hit in the caches of the A15 cluster. It also prints the cache line
// address and whether the access was Secure or Non-secure.
read_for_4_came_from_snoop: Bus address=0x000000008ff02440 Is non secure=N
@@ -195,7 +195,7 @@ D Putting it all together
E Status of "TUBE" support
The current version of ARM FastModels (RTSM VE Cortex-A15 KF
- CCI version 6.2 Beta) implements only one 'tube'
+ CCI version MODEL_VERSION) implements only one 'tube'
interface i.e. TUBE0.
Subsequent releases will support upto four 'tube' interfaces i.e TUBE0-3.
diff --git a/docs/06-Optional-rootfs-build.txt b/docs/06-Optional-rootfs-build.txt
index eb11c60..6e372ea 100644
--- a/docs/06-Optional-rootfs-build.txt
+++ b/docs/06-Optional-rootfs-build.txt
@@ -11,7 +11,7 @@ A Introduction
The default virtualizer release contains an empty filesystem
stub located at:
- arm-virtualizer-v2.0-ti-040911./bootwrapper/payload/fsimg
+ arm-virtualizer-v2_1-171111/bootwrapper/payload/fsimg
A build using this stub doesn't contain a functional
filesytem that the Linux kernel image can use. fsimg can be
@@ -49,8 +49,8 @@ B Building and installing a Linux kernel
A suitable Linux kernel image for use with the virtualizer
can be built as follows:
- $ tar -jxf arm-virtualizer-v2.0-ti-040911.tar.bz2
- $ cd arm-virtualizer-v2.0-ti-040911/bootwrapper
+ $ tar -jxf arm-virtualizer-v2_1-171111.tar.bz2
+ $ cd arm-virtualizer-v2_1-171111/bootwrapper
$ make clean
$ pushd /tmp
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/maz/ael-kernel.git ael-kernel.git