2009-12-06 02:57:05 +01:00
|
|
|
/** @file
|
|
|
|
|
2010-04-29 14:15:47 +02:00
|
|
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
2013-01-25 13:05:17 +01:00
|
|
|
Copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR>
|
2009-12-06 02:57:05 +01:00
|
|
|
|
2010-04-29 14:15:47 +02:00
|
|
|
This program and the accompanying materials
|
2009-12-06 02:57:05 +01:00
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
2010-02-18 02:57:13 +01:00
|
|
|
#ifndef __ARM_V7_H__
|
|
|
|
#define __ARM_V7_H__
|
2009-12-06 02:57:05 +01:00
|
|
|
|
2011-09-23 00:53:54 +02:00
|
|
|
#include <Chipset/ArmV7Mmu.h>
|
2011-09-27 18:35:16 +02:00
|
|
|
#include <Chipset/ArmV7ArchTimer.h>
|
2011-09-23 00:53:54 +02:00
|
|
|
|
2009-12-06 02:57:05 +01:00
|
|
|
// Domain Access Control Register
|
|
|
|
#define DOMAIN_ACCESS_CONTROL_MASK(a) (3UL << (2 * (a)))
|
|
|
|
#define DOMAIN_ACCESS_CONTROL_NONE(a) (0UL << (2 * (a)))
|
|
|
|
#define DOMAIN_ACCESS_CONTROL_CLIENT(a) (1UL << (2 * (a)))
|
|
|
|
#define DOMAIN_ACCESS_CONTROL_RESERVED(a) (2UL << (2 * (a)))
|
|
|
|
#define DOMAIN_ACCESS_CONTROL_MANAGER(a) (3UL << (2 * (a)))
|
|
|
|
|
2013-01-25 13:05:17 +01:00
|
|
|
// CPSR - Coprocessor Status Register definitions
|
|
|
|
#define CPSR_MODE_USER 0x10
|
|
|
|
#define CPSR_MODE_FIQ 0x11
|
|
|
|
#define CPSR_MODE_IRQ 0x12
|
|
|
|
#define CPSR_MODE_SVC 0x13
|
|
|
|
#define CPSR_MODE_ABORT 0x17
|
|
|
|
#define CPSR_MODE_HYP 0x1A
|
|
|
|
#define CPSR_MODE_UNDEFINED 0x1B
|
|
|
|
#define CPSR_MODE_SYSTEM 0x1F
|
|
|
|
#define CPSR_MODE_MASK 0x1F
|
|
|
|
#define CPSR_ASYNC_ABORT (1 << 8)
|
|
|
|
#define CPSR_IRQ (1 << 7)
|
|
|
|
#define CPSR_FIQ (1 << 6)
|
|
|
|
|
|
|
|
|
2011-09-23 00:53:54 +02:00
|
|
|
// CPACR - Coprocessor Access Control Register definitions
|
2011-02-02 23:35:30 +01:00
|
|
|
#define CPACR_CP_DENIED(cp) 0x00
|
|
|
|
#define CPACR_CP_PRIV(cp) ((0x1 << ((cp) << 1)) & 0x0FFFFFFF)
|
|
|
|
#define CPACR_CP_FULL(cp) ((0x3 << ((cp) << 1)) & 0x0FFFFFFF)
|
|
|
|
#define CPACR_ASEDIS (1 << 31)
|
|
|
|
#define CPACR_D32DIS (1 << 30)
|
|
|
|
#define CPACR_CP_FULL_ACCESS 0x0FFFFFFF
|
|
|
|
|
2011-09-23 00:53:54 +02:00
|
|
|
// NSACR - Non-Secure Access Control Register definitions
|
2011-02-02 23:35:30 +01:00
|
|
|
#define NSACR_CP(cp) ((1 << (cp)) & 0x3FFF)
|
|
|
|
#define NSACR_NSD32DIS (1 << 14)
|
|
|
|
#define NSACR_NSASEDIS (1 << 15)
|
|
|
|
#define NSACR_PLE (1 << 16)
|
|
|
|
#define NSACR_TL (1 << 17)
|
|
|
|
#define NSACR_NS_SMP (1 << 18)
|
|
|
|
#define NSACR_RFR (1 << 19)
|
|
|
|
|
2011-09-23 00:53:54 +02:00
|
|
|
// SCR - Secure Configuration Register definitions
|
2011-02-02 23:35:30 +01:00
|
|
|
#define SCR_NS (1 << 0)
|
|
|
|
#define SCR_IRQ (1 << 1)
|
|
|
|
#define SCR_FIQ (1 << 2)
|
|
|
|
#define SCR_EA (1 << 3)
|
|
|
|
#define SCR_FW (1 << 4)
|
|
|
|
#define SCR_AW (1 << 5)
|
|
|
|
|
2011-09-27 18:31:20 +02:00
|
|
|
// MIDR - Main ID Register definitions
|
|
|
|
#define ARM_CPU_TYPE_MASK 0xFFF
|
|
|
|
#define ARM_CPU_TYPE_A15 0xC0F
|
|
|
|
#define ARM_CPU_TYPE_A9 0xC09
|
|
|
|
#define ARM_CPU_TYPE_A5 0xC05
|
2011-02-02 23:35:30 +01:00
|
|
|
|
2012-09-26 22:19:53 +02:00
|
|
|
#define ARM_VECTOR_TABLE_ALIGNMENT ((1 << 5)-1)
|
|
|
|
|
2011-02-02 23:35:30 +01:00
|
|
|
VOID
|
|
|
|
EFIAPI
|
2011-09-27 18:31:20 +02:00
|
|
|
ArmEnableSWPInstruction (
|
2011-02-02 23:35:30 +01:00
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
UINTN
|
|
|
|
EFIAPI
|
2011-06-11 13:15:55 +02:00
|
|
|
ArmReadCbar (
|
|
|
|
VOID
|
|
|
|
);
|
2011-02-02 23:35:30 +01:00
|
|
|
|
2011-06-03 11:43:12 +02:00
|
|
|
UINTN
|
|
|
|
EFIAPI
|
2011-06-11 13:15:55 +02:00
|
|
|
ArmReadTpidrurw (
|
|
|
|
VOID
|
|
|
|
);
|
2011-06-03 11:43:12 +02:00
|
|
|
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
2011-06-11 13:15:55 +02:00
|
|
|
ArmWriteTpidrurw (
|
|
|
|
UINTN Value
|
|
|
|
);
|
2011-06-03 11:43:12 +02:00
|
|
|
|
2011-09-27 18:35:16 +02:00
|
|
|
UINTN
|
|
|
|
EFIAPI
|
|
|
|
ArmIsArchTimerImplemented (
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2011-09-27 18:31:20 +02:00
|
|
|
UINTN
|
|
|
|
EFIAPI
|
|
|
|
ArmReadIdPfr1 (
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2010-02-18 02:57:13 +01:00
|
|
|
#endif // __ARM_V7_H__
|