first and last commit

This commit is contained in:
Chris Nutter committed 2023-07-08 13:03:17 -07:00
commit 1bf4efd552
2612 files changed
+636500

No files matched your search

+145
View File
@@ -0,0 +1,145 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#if WITH_TARGET_AMC_PARAMS
#include <target/amcconfig.h>
#else
static const struct amc_param amc_params = {
.flags = FLAG_AMC_PARAM_BUSTAT23 | FLAG_AMC_PARAM_ENABLE_AIU | FLAG_AMC_PARAM_LEGACY | FLAG_AMC_PARAM_ZQCL,
.freqsel = 3,
.tREFi = 0x5d,
.longsrcnt = 0x2008,
.srextrarefcnt = (0x2 << 16),
.rdlat = 4,
.wrlat = 2,
.phyrdlat = 8,
.phywrlat = 1,
.pdn = 0x22000303,
.read = 0x00000102,
.bustat = 0x00222209,
.bustat2 = 0x00222209,
.derate = 0x1c620d46,
.mcphyupdate = 0x05030000,
.mcphyupdate1 = 0x00000004,
.autoref_params = 0x1a1a1a1a,
.chnldec = 0x00050001,
.qbrparam = 0x00510000,
.odts = 0x190,
.aref_freq0 = 0x00000110,
.pwrmngtparam_small = 0x00011000,
.pwrmngtparam_guided = 0x01803000,
.schen_default = 0x00000110,
.pwrmngten_default = 0x00100100,
.addrcfg = 0x00020201,
.bankhash0 = 0x00006db6,
.bankhash1 = 0x00005b6d,
.bankhash2 = 0x000036db,
.bootclkdivsr = 1,
.mr1 = 0xc4,
.mr3 = 0x2,
.mr2 = 0x6,
.mr63 = 0xfc,
.readleveling = 0x00000300,
.freq = {
{ // 533MHz
.cas = 0x00000206,
.pch = 0x0002040c,
.act = 0x0c040706,
.autoref = 0x11240000,
.selfref = 0x00026040,
.modereg = 0x20190762,
.arefparam = 0x0c022131,
.mifcassch = 0x00000110,
.trefbwbasecyc = 0x0000002d,
},
{ // 266MHz
.cas = 0x00000004,
.pch = 0x00000007,
.act = 0x06020404,
.autoref = 0x09120000,
.selfref = 0x00014000,
.modereg = 0x000d0000,
.arefparam = 0x00000101,
.mifcassch = 0x00000000,
.trefbwbasecyc = 0x00000017,
},
{ // 133MHz
.cas = 0x00000002,
.pch = 0x00000004,
.act = 0x04010302,
.autoref = 0x050a0000,
.selfref = 0x0000a000,
.modereg = 0x00070000,
.arefparam = 0x00000101,
.mifcassch = 0x00000000,
.trefbwbasecyc = 0x0000000c,
},
{ // 24MHz
.cas = 0x00000002,
.pch = 0x00000002,
.act = 0x04010202,
.autoref = 0x02030000,
.selfref = 0x00003000,
.modereg = 0x00020000,
.arefparam = 0x00000101,
.mifcassch = 0x00000010,
}
}
};
static const struct amc_tunable amc_tunables[] = {
{ &rAMC_AIUPRT_CFG, 0x00070000},
{ &rAMC_AIUPRT_RD_GEN, 0x80000018},
{ &rAMC_AIU_CHNLCRD, 0x00180018},
{ &rAMC_AIU_CHNLTM, 0x40003101},
{ &rAMC_AIU_RDBRSTLEN, 0x01010101},
{ &rAMC_AIU_RDMAXCRD, 0x3012097f},
{ &rAMC_AIU_RDREFL, 0x280f087f},
{ &rAMC_AIU_WRBRSTLEN, 0x01010101},
{ &rAMC_AIU_WRMAXCRD, 0x3012097f},
{ &rAMC_AIU_WRREFL, 0x280f087f},
{ &rAMC_AIU_CPUSPCREQ, 0x00000013},
{ &rAMC_AIU_GFXSPCREQ, 0x00000019},
{ &rAMC_AIU_NRTSPCREQ, 0x00000019},
{ &rAMC_AIU_RTSPCREQ, 0x00000013},
{ &rAMC_AIU_WPQSCH, 0x08000800},
{ &rAMC_AIU_THOTLEN, 0x00000030},
{ &rAMC_AIU_THOTLCPUPARAM, 0x00000084},
{ &rAMC_AIU_THOTLRTPARAM, 0x00000084},
{ &rAMC_AIU_THOTLNRTPARAM, 0x00000080},
{ &rAMC_AIU_THOTLGFXPARAM, 0x00000080},
{ &rAMC_AIU_PUSHEN, 0x00001100},
{ &rAMC_AIU_THOTLCPUPARAM2, 0x00c00040},
{ &rAMC_AIU_THOTLRTPARAM2, 0x00c00040},
{ &rAMC_AIU_THOTLNRTPARAM2, 0x00000040},
{ &rAMC_AIU_THOTLGFXPARAM2, 0x00000040},
{ &rAMC_AIU_LLTSCHCTL, 0x00000001},
{ &rAMC_OPIDLETMR, 0x00200000},
{ &rAMC_OPTMRADJPARAM, 0x20400064},
{ &rAMC_MIFACTSCH, 0x00000001},
{ &rAMC_PSQRQCTL0, 0x01010000},
{ &rAMC_PSQRQCTL1, 0x0000132a},
{ &rAMC_PSQRQTIMER0, 0x00000018},
{ &rAMC_PSQRQTIMER1, 0x00000006},
{ &rAMC_PSQRQTIMER2, 0x00000020},
{ &rAMC_PSQRQBRST, 0x040c040c},
{ &rAMC_PSQRQSCHCRD, 0x002028f5},
{ &rAMC_PSQWQCTL1, 0x00000180},
{ &rAMC_PSQWQBRST, 0x02020208},
{ &rAMC_PSQWQSCHCRD, 0x000405f5},
{ &rAMC_MCUQOS, 0x00010f04},
{ &rAMC_MCUQOSLLT, 0x00010108},
{0, 0},
};
#endif
@@ -0,0 +1,49 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
/*
* The amc_param struct is defined in drivers/apple/amp/amp.h, and this
* file should only by included from that amp.c.
*/
#if WITH_TARGET_AMP_PARAMS
#include <target/ampconfig.h>
#else
static struct amp_params amc_phy_params = {
.freq = {
{
.caoutdllscl = 0x00000008,
.dqsindllscl = 0x00000008,
.rdcapcfg = 0x2102050b,
},
{
.caoutdllscl = 0x00000010,
.dqsindllscl = 0x00000010,
.rdcapcfg = 0x31020507,
},
{
.caoutdllscl = 0x00000020,
.dqsindllscl = 0x00000020,
.rdcapcfg = 0x51020505,
},
{
.caoutdllscl = 0x0000003f,
.dqsindllscl = 0x0000003f,
.rdcapcfg = 0x61020504,
},
},
.drive_strength = 0x12121212,
.cacalib_hw_loops = 8,
.cacalib_sw_loops = 8,
.wrlvl_togglephyupdt = true,
.imp_auto_cal = 0x001103ac,
};
#endif
+163
View File
@@ -0,0 +1,163 @@
/*
* Copyright (C) 2013-2014 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
/*
* Dmin.h is provided by the diags team, defining the 'DMin' key's format
* The contents below are copy-pasted verbatim from header files supplied by Diags.
*/
#ifndef _DMin_h_
#define _DMin_h_
/* vim: set ts=4 sw=4 softtabstop=4 noexpandtab */
#include <stdint.h>
#ifndef MULTICHARACTER_LITERAL
# define MULTICHARACTER_LITERAL(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
#endif
enum {
kEnclosureNone = 0,
kEnclosureAlumLight6063 = 1,
kEnclosureAlumDark6063 = 2,
kEnclosureAlumLight7003 = 3,
kEnclosureAlumDark7003 = 4,
kEnclosureSUSMirror = 5,
kEnclosureSUSBrushed = 6,
kEnclosureSUSBlackPVD = 7,
kEnclosureMaverickYellow = 8,
kEnclosureMaverickRose = 9,
kEnclosureZirconiaWhite = 10,
kEnclosureGlass = 11,
};
typedef uint32_t EnclosureType_t; // goes with above enum
enum {
kFCMTypeNone = 0,
kFCMTypeOnyx = 1,
kFCMTypeGlass = 2,
};
typedef uint32_t FCMType_t; // goes with above
enum {
kBCMWindowTypeNone = 0,
kBCMWindowTypeOnyx = 1,
kBCMWindowTypeGlass = 2,
};
typedef uint32_t BCMWindowType_t;
enum {
kBCMLensTypeNone = 0,
kBCMLensTypeNormal = 1,
kBCMLensTypeFresnel = 2,
};
typedef uint32_t BCMLensType_t;
enum {
kBCMLEDTypeNone = 0,
kBCMLEDTypeNormal = 1,
kBCMLEDTypeNew = 2,
};
typedef uint32_t BCMPTLEDType_t;
enum {
kBCMPlatinumTypeNone = 0,
kBCMPlatinumTypeProtoN_34 = 1,
kBCMPlatinumTypeProtoC = 2,
};
typedef uint32_t BCMPTSensorType_t;
/* Version 2 information - added Lisa Bits */
enum {
kLisaOpAmpNone = 0,
kLisaOpAmpMAX4321 = 1,
kLisaOpAmpLMV693 = 2,
kLisaOpAmpLMV881 = 3,
};
typedef uint32_t LisaOpAmpType_t;
enum {
kLisaSensorICNone = 0,
kLisaSensorICA0 = 1,
kLisaSensorICB0 = 2,
};
typedef uint32_t LisaSensorICType_t;
enum {
kLisaWheelNone = 0,
kLisaWheelLF31 = 1,
kLisaWheelLF31LowDiffusion = 2,
kLisaWheelLF31HighStripeVar = 3,
kLisaWheelLF31pSLaser = 4,
kLisaWheelLF45 = 5,
kLisaWheelSantek = 6,
kLisaWheelNisseiBlack = 7,
kLisaWheelNissei = 8,
kLisaWheelHeptagonGrind = 9,
kLisaWheelHeptagonFormed = 10
};
typedef uint32_t LisaWheelType_t;
enum {
kLisaKnurlNone = 0,
kLisaKnurlProtoN = 1,
};
typedef uint32_t LisaKnurlType_t;
/* Pack the structure, do not allow compiler padding */
typedef struct __attribute__((packed)) {
EnclosureType_t topEnclosure; // See enum at the top
EnclosureType_t botEnclosure; // Same values here
FCMType_t fcmType; // Onyx or Glass
uint32_t fcmARCoated; // 0x00000000 = no AR coating, 0x00000001 = AR coating
uint32_t fcmInkColor; // 0x00RRGGBB (little endian, 32-bit word, just like DClr)
BCMWindowType_t bcmWindow; // Onyx or Glass
BCMLensType_t bcmLens; // Normal or Fresnel
BCMPTSensorType_t bcmPTSensorType; // 3 or 4
BCMPTLEDType_t bcmPTLEDType; // Normal or "New"
} DMin_v1_t;
typedef struct __attribute__((packed)) {
EnclosureType_t topEnclosure; // See enum at the top
EnclosureType_t botEnclosure; // Same values here
FCMType_t fcmType; // Onyx or Glass
uint32_t fcmARCoated; // 0x00000000 = no AR coating, 0x00000001 = AR coating
uint32_t fcmInkColor; // 0x00RRGGBB (little endian, 32-bit word, just like DClr)
BCMWindowType_t bcmWindow; // Onyx or Glass
BCMLensType_t bcmLens; // Normal or Fresnel
BCMPTSensorType_t bcmPTSensorType; // 3 or 4
BCMPTLEDType_t bcmPTLEDType; // Normal or "New"
// v2 bits
LisaOpAmpType_t lisaOAType;
LisaSensorICType_t lisaSensorIC;
LisaWheelType_t lisaEncoderWheel;
LisaKnurlType_t lisaKnurl;
} DMin_v2_t;
#define DMIN_VERSION_1 0x00000001
#define DMIN_VERSION_2 0x00000002
typedef struct {
uint32_t version; // Set to DMIN_VERSION_2
union {
DMin_v1_t v1; // if version == DMIN_VERSION_1, use this struct
DMin_v2_t v2; // if version == DMIN_VERSION_2, use this struct
}; // Anonymous union to bridge between v1 and any later version
}DMin_t;
#define SYSCFG_DEVICE_MATERIAL_INFO_SIZE (sizeof(DMin_t)) /* v1 = 40 bytes, v2 = 56 bytes */
#define SYSCFG_DEVICE_MATERIAL_INFO MULTICHARACTER_LITERAL('D','M','i','n')
#endif /* _DMin_h_ */
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __DOCKFIFO_CONFIG_H
#define __DOCKFIFO_CONFIG_H
#include <drivers/dockfifo/dockfifo.h>
#include <platform/soc/hwclocks.h>
#include <platform/soc/hwisr.h>
// Fifo enumeration
#define DOCKFIFO_UART_WRITE (DOCKFIFO_0)
#define DOCKFIFO_UART_READ (DOCKFIFO_1)
#define DOCKFIFO_BULK_WRITE (DOCKFIFO_2)
#define DOCKFIFO_BULK_READ (DOCKFIFO_3)
static const struct dockfifo_config dockfifo_configs[] = {
/* read/write clock interrupt fifo name */
{ DOCKFIFO_W, CLK_DOCKFIFO, DBGFIFO_0_NOT_EMPTY, "uart write" },
{ DOCKFIFO_R, CLK_DOCKFIFO, DBGFIFO_1_NOT_EMPTY, "uart read" },
{ DOCKFIFO_W, CLK_DOCKFIFO, DBGFIFO_2_NOT_EMPTY, "bulk write" },
{ DOCKFIFO_R, CLK_DOCKFIFO, DBGFIFO_3_NOT_EMPTY, "bulk read" },
};
#endif /* __DOCKFIFO_CONFIG_H */
+56
View File
@@ -0,0 +1,56 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_GPIODEF_H
#define __PLATFORM_GPIODEF_H
/* S7002 specific gpio -> pin mappings */
#include <platform/gpio.h>
#include <platform/soc/hwregbase.h>
#if WITH_TARGET_CONFIG
# include <target/gpiodef.h>
#endif
/* define platform-specific gpios in a generic fashion here. */
#define GPIO_BOARD_ID0 GPIOC(GPIO_AP, 12, 1)
#define GPIO_BOARD_ID1 GPIOC(GPIO_AP, 12, 2)
#define GPIO_BOARD_ID2 GPIOC(GPIO_AP, 12, 3)
#define GPIO_BOARD_ID3 GPIOC(GPIO_AP, 4, 6)
#define GPIO_BERMUDA_TO_AP_CTS GPIOC(GPIO_AP, 8, 1)
#define GPIO_BOOT_CONFIG0 GPIOC(GPIO_AP, 4, 2)
#define GPIO_BOOT_CONFIG1 GPIOC(GPIO_AP, 4, 3)
#define GPIO_BOOT_CONFIG2 GPIOC(GPIO_AP, 4, 4)
#define GPIO_BOOT_CONFIG3 GPIOC(GPIO_AP, 4, 5)
#define GPIO_BOARD_REV0 GPIOC(GPIO_AP, 4, 7)
#define GPIO_BOARD_REV1 GPIOC(GPIO_AP, 5, 0)
#define GPIO_BOARD_REV2 GPIOC(GPIO_AP, 5, 1)
#define GPIO_BOARD_REV3 GPIOC(GPIO_AP, 5, 2)
#define GPIO_REQUEST_DFU1 GPIOC(GPIO_SPU, 0, 0)
#define GPIO_REQUEST_DFU2 GPIOC(GPIO_SPU, 0, 1)
#define GPIO_FORCE_DFU GPIOC(GPIO_SPU, 2, 6)
#define GPIO_DFU_STATUS GPIOC(GPIO_SPU, 2, 5)
#define GPIO_DOCK_CONNECT GPIOC(GPIO_SPU, 0, 2)
#define GPIO_DOCK_ATTENTION GPIOC(GPIO_SPU, 3, 2)
#define SPI_NOR0 (0)
#define GPIO_SPI0_CS GPIOC(GPIO_AP, 12, 4)
#define GPIO_IIC0_SCL GPIOC(GPIO_AP, 11, 7)
#define GPIO_IIC0_SDA GPIOC(GPIO_AP, 11, 6)
#define GPIO_IIC1_SCL GPIOC(GPIO_AP, 6, 1)
#define GPIO_IIC1_SDA GPIOC(GPIO_AP, 6, 0)
#endif /* ! __PLATFORM_GPIODEF_H */
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_IMAGE_DEVICES_H
#define __PLATFORM_IMAGE_DEVICES_H
static const struct image_device platform_image_devices[] = {
#if defined(WITH_HW_ASP)
{ "asp_fw", 0x00000 },
#if defined(WITH_LLB_NVRAM)
{ "anc_firmware", 0x00000 } // iBoot->Dali may also use ANC firmware instead of ASP
#endif
#if WITH_LLB_BLKDEV
, { "anc_llb", 0x00000 } // iBoot->Dali needs to read Dali out of block0
#endif
#elif defined(WITH_ANC_FIRMWARE)
{ "anc_firmware", 0x00000 }
#if WITH_LLB_BLKDEV
, { "anc_llb", 0x00000 }
#endif
#else
{ "nor0", 0x00000 }
#endif
};
#if WITH_SYSCFG
static const struct image_device platform_syscfg_devices[] = {
#if defined(WITH_NAND_BOOT)
{ "nand_syscfg", 0x00000 }
#else
{ "nor0", 0x00000 }
#endif
};
#endif /* WITH_SYSCFG */
#endif /* ! __PLATFORM_IMAGE_DEVICES_H */
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_MEMCONFIG_H
#define __PLATFORM_MEMCONFIG_H
/* Stub */
static const gpio_t memory_interface_gpios[] = {
/* Not needed */
};
#endif /* ! __PLATFORM_MEMCONFIG_H */
+204
View File
@@ -0,0 +1,204 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_MEMMAP_H
#define __PLATFORM_MEMMAP_H
#include <platform/memmap_defaults.h>
/* S7002 specific memory map */
///////////////////////////////////////////////////////////////////////////////////
// 0x80000000 + dram_size --> -------------------------------
// | Sleep Token Buffer (1KiB) |
// |-----------------------------|
// | Panic (512KiB) |
// |-----------------------------|
// | Display (16MiB) |
// | (Framebuffer + scratch) |
// | |
// | |
// | |
// |-----------------------------|
// | iBoot (32MiB) |
// | (Text + Data + Stacks ) |
// | (Page Tables + Heap) |
// | |
// |-----------------------------|
// | Unused |
// | |
// | |
// | |
// | |
// |-----------------------------|
// | |
// | (Ramdisk) |
// | (Kernel + DeviceTree) |
// | Secure memory |
// |-----------------------------|
// | |
// | |
// | Load region / |
// | Insecure Memory |
// | |
// | |
// | |
// 0x80000000 --> -------------------------------
///////////////////////////////////////////////////////////////////////////////////
#define SDRAM_BASE (0x80000000ULL)
#define SDRAM_BANK_LEN (SDRAM_LEN)
#define SDRAM_BANK_COUNT (1)
#define SDRAM_END (SDRAM_BASE + SDRAM_LEN)
#define SDRAM_BASE_UNCACHED (SDRAM_END)
#define VROM_BASE (0x40000000ULL)
#define VROM_BANK_LEN (0x00100000ULL)
#define VROM_LEN (0x00040000ULL)
#define SRAM_BASE (0x46000000ULL)
#define SRAM_LEN (0x00048000ULL)
#define SRAM_BANK_LEN (SRAM_LEN)
#define SRAM_BANK_COUNT (1)
#define SRAM_END (SRAM_BASE + SRAM_LEN)
#define IO_BASE (0x40000000ULL)
#define IO_SIZE (0x20000000ULL)
/* custom ROM is stored at first physical page DRAM, and booted by enabling remap */
#define SECUREROM_LOAD_ADDRESS (SDRAM_BASE)
/* sleep token is stored at first physical page in kernel memory */
#define SLEEP_TOKEN_BUFFER_BASE (SDRAM_BASE)
#define SLEEP_TOKEN_BUFFER_SIZE (1024)
/* reserved area for ASP */
#define ASP_SIZE (0x00500000ULL)
#define ASP_BASE (SDRAM_END - ASP_SIZE)
#define CONSISTENT_DEBUG_SIZE (0x00004000ULL)
#define CONSISTENT_DEBUG_BASE (ASP_BASE - CONSISTENT_DEBUG_SIZE)
/* reserved area for panic info */
#define PANIC_SIZE (0x00080000ULL)
#define PANIC_BASE (CONSISTENT_DEBUG_BASE - PANIC_SIZE)
/* reserved area for display
* DISPLAY_SIZE comes from platform's rules.mk
*/
#define DISPLAY_BASE (PANIC_BASE - DISPLAY_SIZE)
/* where to stick heap and insecure memory */
#if APPLICATION_SECUREROM
#define INSECURE_MEMORY_SIZE (SRAM_END - HEAP_END)
#define INSECURE_MEMORY_BASE (HEAP_END)
#define DATA_SIZE (0x00007000ULL)
#define BOOK_KEEPING_BASE (DATA_BASE + DATA_SIZE)
#define BOOT_TRAMPOLINE_BASE (BOOK_KEEPING_BASE)
#define BOOT_TRAMPOLINE_SIZE (0x00001000ULL)
#define MMU_TT_BASE (BOOK_KEEPING_BASE + BOOT_TRAMPOLINE_SIZE)
#define MMU_TT_SIZE (0x00004000ULL)
#define STACK_BASE (BOOK_KEEPING_BASE + BOOT_TRAMPOLINE_SIZE + MMU_TT_SIZE)
#define STACK_SIZE (0x00004000ULL)
#define BOOK_KEEPING_SIZE (BOOT_TRAMPOLINE_SIZE + STACK_SIZE + MMU_TT_SIZE)
#define HEAP_BASE (BOOK_KEEPING_BASE + BOOK_KEEPING_SIZE)
#define HEAP_SIZE (0x00008000ULL)
#define HEAP_END (HEAP_BASE + HEAP_SIZE)
#endif /* APPLICATION_SECUREROM */
#if APPLICATION_IBOOT
#if WITH_DFU_MODE
/* LLB, iBSS DFU */
/* reserved area for iBoot (aligned to 1MB boundary) */
#define IBOOT_SIZE (0x02000000ULL + 0x100000ULL - (PANIC_SIZE + DISPLAY_SIZE))
#define IBOOT_BASE (DISPLAY_BASE - IBOOT_SIZE)
#define INSECURE_MEMORY_SIZE (IBOOT_SIZE)
#define INSECURE_MEMORY_BASE (IBOOT_BASE)
#define STACK_SIZE (0x00004000ULL)
#define MMU_TT_SIZE (0x00004000ULL)
#define BOOK_KEEPING_SIZE (STACK_SIZE + MMU_TT_SIZE)
#define BOOK_KEEPING_BASE (SRAM_BASE)
#define MMU_TT_BASE (BOOK_KEEPING_BASE)
#define STACK_BASE (BOOK_KEEPING_BASE + MMU_TT_SIZE)
#define HEAP_SIZE (TEXT_BASE - HEAP_BASE)
#define HEAP_BASE (BOOK_KEEPING_BASE + BOOK_KEEPING_SIZE)
#define HEAP_END (HEAP_BASE + HEAP_SIZE)
#else /* !WITH_DFU_MODE */
#if WITH_RECOVERY_MODE_IBSS
/* reserved area for iBoot (aligned to 1MB boundary) */
#define IBOOT_SIZE (0x02000000ULL + 0x100000ULL - (PANIC_SIZE + DISPLAY_SIZE))
#define IBOOT_BASE (DISPLAY_BASE - IBOOT_SIZE)
#define INSECURE_MEMORY_SIZE (IBOOT_SIZE)
#define INSECURE_MEMORY_BASE (IBOOT_BASE)
#define STACK_SIZE (0x00004000ULL)
#define MMU_TT_SIZE (0x00004000ULL)
#define BOOK_KEEPING_SIZE (STACK_SIZE + MMU_TT_SIZE)
#define BOOK_KEEPING_BASE (TEXT_BASE + TEXT_FOOTPRINT)
#define MMU_TT_BASE (BOOK_KEEPING_BASE)
#define STACK_BASE (BOOK_KEEPING_BASE + MMU_TT_SIZE)
#define HEAP_SIZE (SRAM_END - HEAP_BASE)
#define HEAP_BASE (BOOK_KEEPING_BASE + BOOK_KEEPING_SIZE)
#define HEAP_END (HEAP_BASE + HEAP_SIZE)
#else
/* iBoot, iBEC */
#define IBOOT_BASE (TEXT_BASE)
#define IBOOT_SIZE (HEAP_END - IBOOT_BASE)
#define BOOK_KEEPING_BASE (IBOOT_BASE + TEXT_FOOTPRINT)
#define MMU_TT_BASE (BOOK_KEEPING_BASE)
#define MMU_TT_SIZE (0x00004000ULL)
#define STACK_BASE (BOOK_KEEPING_BASE + MMU_TT_SIZE)
#define STACK_SIZE (0x00004000ULL)
#define BOOK_KEEPING_SIZE (STACK_SIZE + MMU_TT_SIZE)
#define HEAP_BASE (BOOK_KEEPING_BASE + BOOK_KEEPING_SIZE)
#define HEAP_SIZE (DISPLAY_BASE - HEAP_BASE - PAGE_SIZE)
#define HEAP_END (HEAP_BASE + HEAP_SIZE)
#define HEAP_GUARD (HEAP_END)
#if (HEAP_GUARD != (DISPLAY_BASE - PAGE_SIZE))
#error "Memory map configuration error"
#endif
#define INSECURE_MEMORY_BASE (SDRAM_BASE)
#define INSECURE_MEMORY_SIZE (DEFAULT_LOAD_SIZE)
#define SECURE_MEMORY_BASE (INSECURE_MEMORY_BASE + INSECURE_MEMORY_SIZE)
#define SECURE_MEMORY_SIZE (DEFAULT_FREE_ADDRESS - SECURE_MEMORY_BASE)
/* unused area */
#define UNUSED_MEMORY_BASE (SECURE_MEMORY_BASE + SECURE_MEMORY_SIZE)
#define UNUSED_MEMORY_SIZE (IBOOT_BASE - UNUSED_MEMORY_BASE)
#endif /* WITH_RECOVERY_MODE_IBSS */
#endif /* !WITH_DFU_MODE */
#endif /* APPLICATION_IBOOT */
#endif /* ! __PLATFORM_MEMMAP_H */
+301
View File
@@ -0,0 +1,301 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_PINCONFIG_H
#define __PLATFORM_PINCONFIG_H
/* Default S7002 SoC Pin Configuration */
#define NAND_DRIVE_STR (DRIVE_X2 | SLOW_SLEW)
static const uint32_t gpio_default_cfg[GPIO_0_GROUP_COUNT * GPIOPADPINS] = {
/* Port 0 */
CFG_DISABLED, // I2S0_MCK ->
CFG_DISABLED, // I2S1_MCK ->
CFG_DISABLED, // SD_CLKOUT ->
CFG_DISABLED, // SD_CMD_IO ->
CFG_DISABLED, // SD_DATA_IO[0] ->
CFG_DISABLED, // SD_DATA_IO[1] ->
CFG_DISABLED, // SD_DATA_IO[2] ->
CFG_DISABLED, // SD_DATA_IO[3] ->
/* Port 1 */
CFG_DISABLED, // SDIO_IRQ ->
CFG_DISABLED, // WL_HOST_WAKE ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
/* Port 2 */
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
/* Port 3 */
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
/* Port 4 */
CFG_DISABLED, // GPIO0 ->
CFG_DISABLED, // GPIO1 ->
CFG_DISABLED, // GPIO2 -> BOOT_CONFIG[0]
CFG_DISABLED, // GPIO3 -> BOOT_CONFIG[1]
CFG_DISABLED, // GPIO4 -> BOOT_CONFIG[2]
CFG_DISABLED, // GPIO5 -> BOOT_CONFIG[3]
CFG_DISABLED, // GPIO6 -> BOARD_ID[3]
CFG_DISABLED, // GPIO7 ->
/* Port 5 */
CFG_DISABLED, // GPIO8 ->
CFG_DISABLED, // GPIO9 ->
CFG_DISABLED, // GPIO10 ->
CFG_DISABLED, // GPIO11 ->
CFG_DISABLED, // GPIO12 ->
CFG_DISABLED, // GPIO13 ->
CFG_DISABLED, // GPIO14 ->
CFG_DISABLED, // GPIO15 ->
/* Port 6 */
CFG_DISABLED, // I2C1_SDA ->
CFG_DISABLED, // I2C1_SCL ->
CFG_DISABLED, // I2S0_LRCK ->
CFG_DISABLED, // I2S0_BCLK ->
CFG_DISABLED, // I2S0_DOUT ->
CFG_DISABLED, // I2S0_DIN ->
CFG_DISABLED, // I2S1_LRCK ->
CFG_DISABLED, // I2S1_BCLK ->
/* Port 7 */
CFG_DISABLED, // I2S1_DOUT ->
CFG_DISABLED, // I2S1_DIN ->
CFG_DISABLED, // UART1_TXD ->
CFG_DISABLED, // UART1_RXD ->
CFG_DISABLED, // UART1_RTSN ->
CFG_DISABLED, // UART1_CTSN ->
CFG_DISABLED, // UART2_TXD ->
CFG_DISABLED, // UART2_RXD ->
/* Port 8 */
CFG_DISABLED, // UART2_RTSN ->
CFG_DISABLED, // UART2_CTSN ->
CFG_DISABLED, // UART4_TXD ->
CFG_DISABLED, // UART4_RXD ->
CFG_DISABLED, // UART3_RTXD ->
CFG_DISABLED, // CLK32K_OUT ->
CFG_DISABLED, // TEST_CLKOUT ->
CFG_DISABLED, // GPIO16 ->
/* Port 9 */
CFG_DISABLED, // GPIO17 ->
CFG_DISABLED, // GPIO18 ->
CFG_DISABLED, // TMR32_PWM1 ->
CFG_DISABLED, // TMR32_PWM2 ->
CFG_DISABLED, // TMR32_PWM3 ->
CFG_DISABLED, // DISP_TE ->
CFG_DISABLED, // GPIO19 ->
CFG_DISABLED | NAND_DRIVE_STR, // NAND_CEN[0] ->
/* Port 10 */
CFG_DISABLED | NAND_DRIVE_STR, // NAND_CEN[1] ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_IO[7] ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_IO[6] ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_IO[5] ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_IO[4] ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_DQS ->
CFG_DISABLED | PULL_UP | NAND_DRIVE_STR, // NAND_REN ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_IO[3] ->
/* Port 11 */
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_IO[2] ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_IO[1] ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_IO[0] ->
CFG_DISABLED | PULL_UP | NAND_DRIVE_STR, // NAND_WEN ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_CLE ->
CFG_DISABLED | PULL_DOWN | NAND_DRIVE_STR, // NAND_ALE ->
CFG_DISABLED, // I2C0_SDA ->
CFG_DISABLED, // I2C0_SCL ->
/* Port 12 */
CFG_DISABLED, // DISPLAY_SYNC ->
CFG_DISABLED, // SPI0_SCLK -> SPI0_SCLK/BOARD_ID[0]
CFG_DISABLED, // SPI0_MOSI -> SPI0_MOSI/BOARD_ID[1]
CFG_DISABLED, // SPI0_MISO -> SPI0_MISO/BOARD_ID[2]
CFG_DISABLED, // SPI0_SSIN ->
CFG_DISABLED, // UART0_TXD ->
CFG_DISABLED, // UART0_RXD ->
CFG_DISABLED, // SPI1_SCLK ->
/* Port 13 */
CFG_DISABLED, // SPI1_MOSI ->
CFG_DISABLED, // SPI1_MISO ->
CFG_DISABLED, // SPI1_SSIN ->
CFG_DISABLED, // GPIO20 ->
CFG_DISABLED, // GPIO21 ->
CFG_DISABLED, // GPIO22 ->
CFG_DISABLED, // GPIO23 ->
CFG_DISABLED, // GPIO24 ->
/* Port 14 */
CFG_DISABLED, // GPIO25 ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
/* Port 15 */
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
/* Port 16 */
CFG_DISABLED, // ENET_MDC ->
CFG_DISABLED, // ENET_MDIO ->
CFG_DISABLED, // RMII_RXER ->
CFG_DISABLED, // RMII_TXEN ->
CFG_DISABLED, // RMII_CLK ->
CFG_DISABLED, // RMII_TXD[0] ->
CFG_DISABLED, // RMII_TXD[1] ->
CFG_DISABLED, // RMII_RXD[0] ->
/* Port 17 */
CFG_DISABLED, // RMII_RXD[1] ->
CFG_DISABLED, // RMII_RXD[0] ->
CFG_DISABLED, // RMII_CRSDV ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
};
static const uint32_t gpio_1_default_cfg[GPIO_1_GROUP_COUNT * GPIOPADPINS] = {
/* Port 0 */
CFG_IN, // REQUEST_DFU1 ->
CFG_IN, // REQUEST_DFU2 ->
CFG_IN | PULL_DOWN, // DOCK_CONNECT ->
CFG_DISABLED, // CLK32K_IN ->
CFG_DISABLED, // SPU_UART0_TXD ->
CFG_DISABLED, // SPU_UART0_RXD ->
CFG_DISABLED, // SPU_UART0_RTSN ->
CFG_DISABLED, // SPU_UART0_CTSN ->
/* Port 1 */
CFG_DISABLED, // SPU_UART1_TXD ->
CFG_DISABLED, // SPU_UART1_RXD ->
CFG_DISABLED, // SPU_UART1_RTSN ->
CFG_DISABLED, // SPU_UART1_CTSN ->
CFG_DISABLED, // SPU_GPIO[0] ->
CFG_DISABLED, // SPU_GPIO[1] ->
CFG_DISABLED, // SPU_GPIO[2] ->
CFG_DISABLED, // SPU_GPIO[3] ->
/* Port 2 */
CFG_DISABLED, // SPU_GPIO[4] ->
CFG_DISABLED, // SPU_GPIO[5] ->
CFG_DISABLED, // SPU_GPIO[6] ->
CFG_DISABLED, // SPU_GPIO[7] ->
CFG_DISABLED, // SPU_GPIO[8] ->
CFG_DISABLED | PULL_DOWN, // DFU_STATUS ->
CFG_IN | PULL_DOWN, // FORCE_DFU ->
CFG_DISABLED, // POWER_GOOD ->
/* Port 3 */
CFG_DISABLED, // SOC_VDD_HI_LO ->
CFG_DISABLED, // SOC_VDD_ALL_ON ->
CFG_DISABLED | PULL_DOWN, // DOCK_ATTENTION ->
CFG_DISABLED, // PMU_HOST_WAKE ->
CFG_DISABLED, // SPU_SPI_SCLK ->
CFG_DISABLED, // SPU_SPI_MOSI ->
CFG_DISABLED, // SPU_SPI_MISO ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[0] ->
/* Port 4 */
CFG_DISABLED, // SPU_SPI_CS_TRIG[1] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[2] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[3] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[4] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[5] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[6] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[7] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[8] ->
/* Port 5 */
CFG_DISABLED, // SPU_SPI_CS_TRIG[9] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[10] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[11] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[12] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[13] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[14] ->
CFG_DISABLED, // SPU_SPI_CS_TRIG[15] ->
CFG_DISABLED, // SPU_GPIO[9] ->
/* Port 6 */
CFG_DISABLED, // SPU_I2C_SDA ->
CFG_DISABLED, // SPU_I2C_SCL ->
CFG_DISABLED, // WDOG ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
/* Port 7 */
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
/* Port 8 */
CFG_DISABLED, // NULL ->
CFG_DISABLED, // RESETN -> RESET_L
CFG_DISABLED, // JTAG_TRSTN ->
CFG_DISABLED, // JTAG_SEL ->
CFG_DISABLED, // JTAG_TCK ->
CFG_DISABLED, // JTAG_TMS ->
CFG_DISABLED, // JTAG_TRTCK ->
CFG_DISABLED, // JTAG_TDO ->
/* Port 9 */
CFG_DISABLED, // JTAG_TDI ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
CFG_DISABLED, // NULL ->
};
#endif /* ! __PLATFORM_PINCONFIG_H */
@@ -0,0 +1,43 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PL080DMAC_CONFIG_H
#define __PL080DMAC_CONFIG_H
#include <drivers/primecell/pl080dmac.h>
#include <platform/soc/hwclocks.h>
#include <platform/soc/hwdmachannels.h>
#include <platform/soc/hwisr.h>
/* LIO Integration spec contains details on PL080DMAC configuration */
static const struct pl080dmac_config pl080dmac_configs[PL080DMAC_COUNT] = {
{
CLK_DMARX,
INT_DMA_RX_TC,
INT_DMA_RX_ERR,
{
/* channel type config reg control reg fifo_address */
{ 0x0, PL080DMAC_PERPH_SRC, 0x00001014, 0x0A489000, 0x47380080 },
},
},
{
CLK_DMATX,
INT_DMA_TX_TC,
INT_DMA_TX_ERR,
{
/* channel type config reg control reg fifo_address */
{ 0x0, PL080DMAC_PERPH_DEST, 0x00000a80, 0x05489000, 0x47380040 },
},
},
};
#endif /* __PL080DMAC_CONFIG_H */
@@ -0,0 +1,33 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_SOC_CHIPID_H
#define __PLATFORM_SOC_CHIPID_H
#include <platform/chipid.h>
#include <platform/soc/hwregbase.h>
#define rCFG_FUSE0 (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x00))
#define rCFG_FUSE1 (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x04))
#define rCFG_FUSE2 (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x08))
#define rCFG_FUSE3 (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x0C))
#define rCFG_FUSE4 (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x10))
#define rCFG_FUSE5 (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x14))
#define rECIDLO (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x80))
#define rECIDHI (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x84))
#define rCFG_FUSE0_RAW (*(volatile uint32_t *)(CHIPID_BASE_ADDR + 0x100))
uint32_t chipid_get_total_rails_leakage();
uint32_t chipid_get_soc_voltage(uint32_t index);
uint32_t chipid_get_fuse_revision(void);
#endif /* __PLATFORM_SOC_CHIPID_H */
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2013-2014 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __APPLE_DISPLAY_H
#define __APPLE_DISPLAY_H
// Platform-specific displaypipe tunables
static struct adfe_v2_tuneable adfe_tuneables[] =
{
{
.name = "default",
.disp_dpcclkcntl = (ADPCCLKCNTL_FLOOR(0x20) | \
ADPCCLKCNTL_PIPE_ENABLE | \
ADPCCLKCNTL_LB_ENABLE | \
ADPCCLKCNTL_PIO_GATE_ENABLE | \
ADPCCLKCNTL_STAT_GATE_ENABLE | \
ADPCCLKCNTL_EXT_GATE_ENABLE | \
ADPCCLKCNTL_DYN_GATE_ENABLE),
.disp_dpcclklvl_clock_on_level = ADPCCLKLVL_ONLVL(0x130),
.disp_dpcclklvl_clock_off_level = ADPCCLKLVL_OFFLVL(0x1f8),
.disp_dpcqoscfg = (ADPCQOSCFG_QOS_TIMER(0x7d0) | \
ADPCQOSCFG_PIPE_ENABLE | \
ADPCQOSCFG_QOS_ENABLE),
.disp_dpcqosylvl_yellow_off = ADPCQOSYLVL_YELLOW_OFF(0x130),
.disp_dpcqosylvl_yellow_on = ADPCQOSYLVL_YELLOW_ON(0x128),
.disp_dpcqosrlvl_red_off = ADPCQOSRLVL_RED_OFF(0x118),
.disp_dpcqosrlvl_red_on = ADPCQOSRLVL_RED_ON(0x114),
.disp_dpclinkdown = (ADPCLINKDOWN_TEARDOWNNOSCL | \
ADPCLINKDOWN_TEARDOWNEN),
.disp_dpgpreqaggr = (ADPGPREQAGGR_REQAGGRTHRESH(0x24) | \
ADPGPREQAGGR_CACHEHINT(0x3) | \
ADPGPREQAGGR_REQAGGRENAB),
.disp_dpcenab = ADPCENAB_IDEAL_ARB_ENAB,
},
};
#endif /* ! __APPLE_DISPLAY_H */
@@ -0,0 +1,107 @@
/*
* Copyright (C) 2013-2015 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __APPLE_DISPLAY_TIMINGS_H
#define __APPLE_DISPLAY_TIMINGS_H
//Supported timings by this platform
static struct display_timing timing_list[] =
{
#if DEBUG_BUILD || SUB_TARGET_N27 || SUB_TARGET_N28 || SUB_TARGET_N27A || SUB_TARGET_N28A || SUB_TARGET_S7002SIM
{
.display_name = "C1",
.host_clock_id = CLK_VCLK0,
.pixel_clock = 6412500,
.dot_pitch = 326,
.h_active = 232,
.h_pulse_width = 2,
.h_back_porch = 44,
.h_front_porch = 42,
.v_active = 288,
.v_pulse_width = 1,
.v_back_porch = 23,
.v_front_porch = 22,
.neg_vclk = 0,
.neg_hsync = 0,
.neg_vsync = 0,
.neg_vden = 0,
.display_depth = 24,
.display_type = DISPLAY_TYPE_SUMMIT,
.display_config = NULL,
},
{
.display_name = "POR_DISP_S",
.host_clock_id = CLK_VCLK0,
.pixel_clock = 22200000,
.dot_pitch = 326,
.h_active = 272,
.h_pulse_width = 8,
.h_back_porch = 8,
.h_front_porch = 16,
.v_active = 340,
.v_pulse_width = 1,
.v_back_porch = 1,
.v_front_porch = 43,
.neg_vclk = 0,
.neg_hsync = 0,
.neg_vsync = 0,
.neg_vden = 0,
.display_depth = 24,
.display_type = DISPLAY_TYPE_SUMMIT,
.display_config = NULL,
},
{
.display_name = "POR_DISP_B",
.host_clock_id = CLK_VCLK0,
.pixel_clock = 22200000,
.dot_pitch = 326,
.h_active = 312,
.h_pulse_width = 8,
.h_back_porch = 8,
.h_front_porch = 16,
.v_active = 390,
.v_pulse_width = 1,
.v_back_porch = 1,
.v_front_porch = 38,
.neg_vclk = 0,
.neg_hsync = 0,
.neg_vsync = 0,
.neg_vden = 0,
.display_depth = 24,
.display_type = DISPLAY_TYPE_SUMMIT,
.display_config = NULL,
},
{
.display_name = "POR_DISP_B_VID",
.host_clock_id = CLK_VCLK0,
.pixel_clock = 12000000,
.dot_pitch = 326,
.h_active = 312,
.h_pulse_width = 4,
.h_back_porch = 102,
.h_front_porch = 42,
.v_active = 390,
.v_pulse_width = 1,
.v_back_porch = 23,
.v_front_porch = 22,
.neg_vclk = 0,
.neg_hsync = 0,
.neg_vsync = 0,
.neg_vden = 0,
.display_depth = 24,
.display_type = DISPLAY_TYPE_SUMMIT,
.display_config = NULL,
},
#endif
};
#endif /* ! __APPLE_DISPLAY_TIMINGS_H */
@@ -0,0 +1,87 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_SOC_HWCLOCKS_H
#define __PLATFORM_SOC_HWCLOCKS_H
#include <platform/clocks.h>
#if SUPPORT_FPGA
#define OSC_FREQ (5000000UL)
#else
#define OSC_FREQ (24000000UL)
#endif
// Start from an offset of 128. So that we are safely outside the PS indexes.
#define CLK_FCLK (HWCLOCK_BASE+128)
#define CLK_ACLK (HWCLOCK_BASE+129)
#define CLK_HCLK (HWCLOCK_BASE+130)
#define CLK_PCLK (HWCLOCK_BASE+131)
#define CLK_VCLK0 (HWCLOCK_BASE+132)
#define CLK_VCLK1 (HWCLOCK_BASE+133)
#define CLK_MCLK (HWCLOCK_BASE+134)
#define CLK_NCLK (HWCLOCK_BASE+135)
#define CLK_USBPHYCLK (HWCLOCK_BASE+136)
#define CLK_NCOREF (HWCLOCK_BASE+137)
#define CLK_ANS_LINK (HWCLOCK_BASE+138)
/*
* S7002 clock gate devices.
* Refers to the ps register offsets.
*/
enum {
CLK_CPU0,
CLK_AIC,
CLK_SPU,
CLK_SPU_AKF,
CLK_SPU_UART0,
CLK_SPU_UART1,
CLK_SPU_SMB,
CLK_SPU_SGPIO,
CLK_DOCKFIFO,
CLK_MCU,
CLK_AMP,
CLK_PIOSYS,
CLK_DISP0,
CLK_MIPI_DSI,
CLK_MIPI = CLK_MIPI_DSI,
CLK_MSR,
CLK_MEDIA,
CLK_ANS,
CLK_GFX,
CLK_SDIO,
CLK_LIO,
CLK_GPIO,
CLK_MCA0,
CLK_MCA1,
CLK_SPI0,
CLK_SPI1,
CLK_DMATX,
CLK_DMARX,
CLK_UART0,
CLK_UART1,
CLK_UART2,
CLK_UART3,
CLK_UART4,
CLK_AES0,
CLK_I2C0,
CLK_I2C1,
CLK_PWM0,
CLK_AUE,
CLK_USB = CLK_AUE,
CLK_USB_M7,
CLK_USBCTLREG = CLK_USB_M7,
CLK_USB_OTG = CLK_USB_M7,
CLK_ETH,
CLK_VDEC,
PMGR_LAST_DEVICE,
};
#endif /* ! __PLATFORM_SOC_HWCLOCKS_H */
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_SOC_HWDMACHANNELS_H
#define __PLATFORM_SOC_HWDMACHANNELS_H
#define DMA_AES_RD (0)
#define DMA_AES_WR ((1 << DMA_SELECTOR_SHIFT) | (0))
#define DMA_SELECTOR_SHIFT (4)
#define DMA_SELECTOR_MASK (0xf)
#define DMA_CHANNEL_MASK (0xf)
#define PL080DMAC_SUPPORTED_CHANNEL_COUNT (1)
#endif /* ! __PLATFORM_SOC_HWDMACHANNELS_H */
+159
View File
@@ -0,0 +1,159 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_SOC_HWISR_H
#define __PLATFORM_SOC_HWISR_H
#define INT_SW0 0 // Software 0 Interrupt
#define INT_SW1 1 // Software 1 Interrupt
#define INT_SW2 2 // Software 2 Interrupt
#define INT_SW3 3 // Software 3 Interrupt
// Reserved 4
#define INT_WDT 5 // Watchdog Timer Interrupt
// Reserved 6
#define INT_ANS_KF_INBOX_EMPTY 7 // ANS KF Inbox Empty Interrupt
#define INT_ANS_KF_INBOX_NOTEMPTY 8 // ANS KF Inbox Not Empty Interrupt
#define INT_ANS_KF_OUTBOX_EMPTY 9 // ANS KF Outbox Empty Interrupt
#define INT_ANS_KF_OUTBOX_NOTEMPTY 10 // ANS KF Outbox Not Empty Interrupt
#define INT_ANS_CHNL0 11 // ANS Channel 0 Interrupt
// Reserved 12
#define INT_ENET 13
#define INT_USB_OTG 14 // USB OTG Interrupt
#define INT_USB_20_BATT_CHRG_DET 15 // USB 2.0 Battery Charge Detect Interrupt
#define INT_USBOTG_RESUME 16 // USB OTG Resume Interrupt
// Reserved 17
#define INT_GPIO_CLASS0 18 // GPIO Class 0 Interrupt
#define INT_GPIO_CLASS1 19 // GPIO Class 1 Interrupt
#define INT_GPIO_CLASS2 20 // GPIO Class 2 Interrupt
#define INT_GPIO_CLASS3 21 // GPIO Class 3 Interrupt
#define INT_GPIO_CLASS4 22 // GPIO Class 4 Interrupt
#define INT_GPIO_CLASS5 23 // GPIO Class 5 Interrupt
#define INT_GPIO_CLASS6 24 // GPIO Class 6 Interrupt
// Reserved 25
#define INT_MEM_CONTROLLER 26 // Memory Controller Interrupt
// Reserved 27
#define INT_CPU0_PMU_IRQ 28 // CPU 0 PMU IRQ Interrupt
#define INT_CPU0_CTI_IRQ 29 // CPU 0 CTI Interrupt
#define INT_CPU0_COMM_TX 30 // CPU 0 COMM TX Interrupt
#define INT_CPU0_COMM_RX 31 // CPU 0 COMM RX Interrupt
#define INT_CPU0_AXI_ERR_IRQ 32 // CPU 0 AXI Error IRQ Interrupt
#define INT_CPU0_CX_ETB_FUKK 33 // CPU 0 CXETB Full Interrupt
#define INT_DISP0 35 // Display Interrupt
// Reserved 46
#define INT_DISP_DART 37 // Display DART Interrupt
#define INT_DISP_SMMU 38 // Display SMMU Interrupt
#define INT_DISP_BACK_END_VBI 39 // Display Back End VBI Interrupt
#define INT_DISP_BACK_END_VFTG_IDLE 40 // Display Back End VFTG Idle Interrupt
#define INT_DISP_BACK_END_VBL_CNTR 41 // Display Back End VBL Counter Interrupt
#define INT_MIPIDSI 42 // MIPI DSI Interrupt
// Reserved 43
#define INT_GFX 44 // GFX Interrupt
// Reserved 45-46
#define INT_MSR 47 // MSR Interrupt
#define INT_MSR_SMMU 48 // MSR SMMU Interrupt
#define INT_MSR_DART 49 // MSR DART Interrupt
#define INT_MSR_SMMU_PERF 50 // MSR SMMU Performance Interrupt
#define INT_MSR_DART_PERF 51 // MSR DART Performance Interrupt
// Reserved 52
#define INT_PIO 53 // PIO IRQ
// Reserved 54
#define INT_DMA_RX_TC 55 // DMA Rx Transfer Complete Interrupt
#define INT_DMA_RX_ERR 56 // DMA Rx Error Interrupt
#define INT_DMA_TX_TC 57 // DMA Tx Transfer Complete Interrupt
#define INT_DMA_TX_ERR 58 // DMA Tx Error Interrupt
// Reserved 59
#define INT_SPI0 60 // SPI 0 Interrupt
#define INT_SPI1 61 // SPI 1 Interrupt
// Reserved 62
#define INT_UART0 63 // UART 0 Interrupt
#define INT_UART1 64 // UART 1 Interrupt
#define INT_UART2 65 // UART 2 Interrupt
#define INT_UART3 66 // UART 3 Interrupt
#define INT_UART4 67 // UART 4 Interrupt
// Reserved 68
#define INT_PWM0 69 // PWM0 Interrupt
// Reserved 70
#define INT_MCA0 71 // Multi-Channel Audio 0 Interrupt
#define INT_MCA1 72 // Multi-Channel Audio 1 Interrupt
// Reserved 73
#define INT_IIC0 74 // I2C 0 Interrupt
#define INT_IIC1 75 // I2C 1 Interrupt
// Reserved 76
#define INT_AES 77 // AES Interrupt
// Reserved 78
#define INT_VDEC 79 // Video Decoder
// Reserved 80
#define INT_SDIO_KF_INBOX_EMPTY 81 // ANS KF Inbox Empty Interrupt
#define INT_SDIO_KF_INBOX_NOTEMPTY 82 // ANS KF Inbox Not Empty Interrupt
#define INT_SDIO_KF_OUTBOX_EMPTY 83 // ANS KF Outbox Empty Interrupt
#define INT_SDIO_KF_OUTBOX_NOTEMPTY 84 // ANS KF Outbox Not Empty Interrupt
#define INT_SDIO_SDHC_WAKEUP 85 // SDIO SDHC Wakeup
#define INT_SDIO_SDHC_INT 86 // SDIO SDHC Tnterrupt
#define INT_SDIO_CARD_INT 87 // SDIO SDHC Interrupt
#define INT_SDIO_IRQ 88 // SDIO IRQ
#define INT_SDIO_WL_HOST_WAKE_INT 89 // SDIO Host Wake Interrupt
// Reserved 90
// 91 - 117 SPU interrupts
#define DBGFIFO_0_NOT_EMPTY 118 // DebugFifo 0 Not Empty Interrupt
#define DBGFIFO_1_NOT_EMPTY 119 // DebugFifo 1 Not Empty Interrupt
#define DBGFIFO_2_NOT_EMPTY 120 // DebugFifo 2 Not Empty Interrupt
#define DBGFIFO_3_NOT_EMPTY 121 // DebugFifo 3 Not Empty Interrupt
#define DBGFIFO_4_NOT_EMPTY 122 // DebugFifo 4 Not Empty Interrupt
#define DBGFIFO_5_NOT_EMPTY 123 // DebugFifo 5 Not Empty Interrupt
#define DBGFIFO_6_NOT_EMPTY 124 // DebugFifo 6 Not Empty Interrupt
#define DBGFIFO_7_NOT_EMPTY 125 // DebugFifo 7 Not Empty Interrupt
// Reserved 126 - 127
#endif /* ! __PLATFORM_SOC_HWISR_H */
@@ -0,0 +1,188 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_SOC_HWREGBASE_H
#define __PLATFORM_SOC_HWREGBASE_H
#include <platform/memmap.h>
/* S7002 Reg Base Defs */
// Memory Subsystem
#define SECUREROM_BASE_ADDR (IO_BASE + 0x00000000) // SecureROM access through PIO
#define PIO_BASE_ADDR (IO_BASE + 0x00100000) // PIO Config
#define CPU_FABRIC_BASE_ADDR (IO_BASE + 0x00101000) // PL301 Config
#define NRT_FABRIC_BASE_ADDR (IO_BASE + 0x00102000) // PL301 Config
#define CPU_BASE_ADDR (IO_BASE + 0x00103000) // AP Config
#define AMC_BASE_ADDR (IO_BASE + 0x00200000) // AMC Config
#define AMPS_DQ_BASE_ADDR (IO_BASE + 0x00300000) // AMP DQ DRAM Phy
#define AMPS_CA_BASE_ADDR (IO_BASE + 0x00310000) // AMP CA DRAM Phy
// MSR Subsystem
#define MSR_BASE_ADDR (IO_BASE + 0x01000000) // MSR Config
#define MSR_SMMU_BASE_ADDR (IO_BASE + 0x01004000) // MSR SMMU
#define MSR_DART_BASE_ADDR (IO_BASE + 0x01008000) // MSR DART
#define VDEC_BASE_ADDR (IO_BASE + 0x02000000) // VXD394 Video Decoder
#define SGX544_SC_BASE_ADDR (IO_BASE + 0x02800000) // SGX544-SC Space
// Display Subsystem
#define DISP_ADP_BASE_ADDR (IO_BASE + 0x03200000) // Display pipe configuration
#define DISP0_BASE_ADDR DISP_ADP_BASE_ADDR
#define DISP_ADP_SMMU_BASE_ADDR (IO_BASE + 0x03300000) // Display pipe SMMU configuration
#define DISP_ADE_BASE_ADDR (IO_BASE + 0x03400000) // DBE Timing controller
#define DISP0_ADBE_BASE_ADDR DISP_ADE_BASE_ADDR
#define DISP_AAP_BASE_ADDR (IO_BASE + 0x03440000) // DBE Ambient-Adaptive Pixel
#define DISP_DITHER_BASE_ADDR (IO_BASE + 0x034C0000) // DBE Dither
#define DISP_MIPI_DSI_BASE_ADDR (IO_BASE + 0x03600000) // MIPI DSI Core configuration
// ANS Subsystem
#define ANS_PL301_BASE_ADDR (IO_BASE + 0x04010000) // ANS PL301 Configuration
#define ANS_PL301_TLIMIT0_BASE_ADDR (IO_BASE + 0x04020000) // ANS Cortex-A7 Transaction Limit
#define ANS_PL301_TLIMIT1_BASE_ADDR (IO_BASE + 0x04030000) // ANS NAND controoler Transaction Limit
#define ANS_AKF_BASE_ADDR (IO_BASE + 0x04040000) // ANS Cortex-A7 and wrapper
// ANS KF Debug registers
#define ANS_CFG_BASE_ADDR (IO_BASE + 0x04080000) // ANS Config
#define ANS_PPN_N_PL_BASE_ADDR (IO_BASE + 0x04081000)
#define ANS_ANC_BASE_ADDR (IO_BASE + 0x04800000) // NAND Controller
// SDIO Subsystem
#define SDIO_PL301_BASE_ADDR (IO_BASE + 0x05010000) // SDIO PL301 Configuration
#define SDIO_PL301_TLIMIT0_BASE_ADDR (IO_BASE + 0x05020000) // SDIO Cortex-A7 Transaction Limit
#define SDIO_PL301_TLIMIT1_BASE_ADDR (IO_BASE + 0x05030000) // SDIO controller Transaction Limit
#define SDIO_AKF_BASE_ADDR (IO_BASE + 0x05040000) // SDIO Cortex-A7 and wrapper
// SDIO KF Debug registers
#define SDIO_CFG_BASE_ADDR (IO_BASE + 0x05080000) // SDIO Config
// SPU Subsystem
#define SPU_SRAM_A_BASE_ADDR (IO_BASE + 0x06000000) // SPU Local SRAM-A
#define SPU_SRAM_B_BASE_ADDR (IO_BASE + 0x06040000) // SPU Local SRAM-B
#define SPU_SRAM_SIZE (0x48000) // SPU SRAM size is 288 KB
#define SPU_CPU_PL301_BASE_ADDR (IO_BASE + 0x06410000) // SPU CPU PL301 Configuration
#define SPU_SRAM_PL301_BASE_ADDR (IO_BASE + 0x06411000) // SPU SRAM PL301 Configuration
#define SPU_MEM_PL301_BASE_ADDR (IO_BASE + 0x06412000) // SPU MEM PL301 Configuration
#define SPU_AKF_BASE_ADDR (IO_BASE + 0x06500000) // SPU Cortex-A7 and wrapper
// SPU KF Debug registers
#define SPU_SPI_BASE_ADDR (IO_BASE + 0x06600000) // SPU SPI Device
#define SPU_SEQUENCER_BASE_ADDR (IO_BASE + 0x06700000) // SPU Sequencer configuration
#define SPU_SMB_BASE_ADDR (IO_BASE + 0x06800000) // SPU I2C
#define SPU_GPIO_BASE_ADDR (IO_BASE + 0x06810000) // SPU GPIO
#define SPU_UART_BASE_ADDR (IO_BASE + 0x06820000) // SPU UART
#define SPU_SOC_RECONFIG_BASE_ADDR (IO_BASE + 0x06900000) // SPU SOC ReConfig
#define SPU_AIC_WRAP_BASE_ADDR (IO_BASE + 0x06A00000) // AIC
#define SPU_AIC_BASE_ADDR (IO_BASE + 0x06B00000) // AIC
#define SPU_PMGR_BASE_ADDR (IO_BASE + 0x06C00000) // PMGR
#define SPU_DBG_FIFO_0_BASE_ADDR (IO_BASE + 0x06E00000) // Debug FIFO [0] registers
#define SPU_DBG_FIFO_1_BASE_ADDR (IO_BASE + 0x06E03000) // Debug FIFO [1] registers
#define SPU_DBG_FIFO_2_BASE_ADDR (IO_BASE + 0x06E06000) // Debug FIFO [2] registers
#define SPU_DBG_FIFO_3_BASE_ADDR (IO_BASE + 0x06E09000) // Debug FIFO [3] registers
#define SPU_DBG_FIFO_4_BASE_ADDR (IO_BASE + 0x06E0C000) // Debug FIFO [4] registers
#define SPU_DBG_FIFO_5_BASE_ADDR (IO_BASE + 0x06E0F000) // Debug FIFO [5] registers
#define SPU_DBG_FIFO_6_BASE_ADDR (IO_BASE + 0x06E12000) // Debug FIFO [6] registers
#define SPU_DBG_FIFO_7_BASE_ADDR (IO_BASE + 0x06E15000) // Debug FIFO [7] registers
#define SPU_DBG_WRAP_BASE_ADDR (IO_BASE + 0x06EB0000) // Debug sub-system config space
// LIO Subsystem
#define LIO_MISC_BASE_ADDR (IO_BASE + 0x07000000) // Miscellaneous registers
#define LIO_AUD_MUX_BASE_ADDR (IO_BASE + 0x07004000) // Audio I2S Switch registers
#define LIO_PWM_BASE_ADDR (IO_BASE + 0x07010000) // PWM Device registers
#define LIO_SMB_0_BASE_ADDR (IO_BASE + 0x07020000) // I2C Device registers
#define LIO_GPIO_BASE_ADDR (IO_BASE + 0x07100000) // GPIO
#define LIO_SPI_BASE_ADDR (IO_BASE + 0x07200000) // SPI Device registers
#define LIO_UART_BASE_ADDR (IO_BASE + 0x07230000) // UART Device registers
#define LIO_MCA_BASE_ADDR (IO_BASE + 0x07240000) // MCA Device registers
#define LIO_DMAC_BASE_ADDR (IO_BASE + 0x07300000) // PL080 DMAC registers
#define LIO_AES_BASE_ADDR (IO_BASE + 0x07380000) // AES
// AUE Subsystem
#define AUE_USBCONT_BASE_ADDR (IO_BASE + 0x08000000) // USB Control
#define AUE_USBOTG_BASE_ADDR (IO_BASE + 0x08100000) // USBOTG
#define AUE_AUSB_WIDGETS_BASE_ADDR (IO_BASE + 0x08200000) // AUSB Widgets
#define AUE_AUSB_AFIFO_WDGTS_BASE_ADDR (IO_BASE + 0x08300000) // AUSB Async Fifo Widgets
#define AUE_PL301_BASE_ADDR (IO_BASE + 0x08800000) // AUE PL301 Configuration
/* iBoot Specific Defs */
#define AKF_VERSION (1)
#define UART0_BASE_ADDR (LIO_UART_BASE_ADDR)
#define UART1_BASE_ADDR (LIO_UART_BASE_ADDR + 0x04000)
#define UART2_BASE_ADDR (LIO_UART_BASE_ADDR + 0x08000)
#define UART3_BASE_ADDR (LIO_UART_BASE_ADDR + 0x0C000)
#define UART4_BASE_ADDR (LIO_UART_BASE_ADDR + 0x10000)
#define UARTS_COUNT (5)
#define UART_VERSION (1)
#define SPI0_BASE_ADDR (LIO_SPI_BASE_ADDR)
#define SPI1_BASE_ADDR (LIO_SPI_BASE_ADDR + 0x04000)
#define SPI_VERSION (1)
#define SPIS_COUNT (2)
#define IIC_BASE_ADDR (LIO_SMB_0_BASE_ADDR)
#define IIC_SPACING (0x00004000)
#define IICS_COUNT (2)
#define DSIM_BASE_ADDR (DISP_MIPI_DSI_BASE_ADDR)
#define DSIM_LANE_COUNT (1)
#define DSIM_VERSION (3)
#define ADBE_DISPLAYPIPE_BASE_ADDR (DISP0_BASE_ADDR)
#define DISP_VERSION (5)
#define ADP_VERSION (1)
#define AMP_BASE_ADDR (AMPS_DQ_BASE_ADDR)
#define AMP_SPACING (0)
#define AMP_CA_SPACING (0x00010000)
#if !CONFIG_SIM
#define AMP_REG_OFFSET (4)
#else
// FIXME M7 fastsim has an Alcatraz-y AMP until <rdar://problem/15464244> M7: update AMC/AMP for M7
#define AMP_REG_OFFSET (0)
#endif
#define PMGR_BASE_ADDR (SPU_PMGR_BASE_ADDR)
#define CHIPID_BASE_ADDR (PMGR_BASE_ADDR + 0x2A000)
#define PMGR_WDG_VERSION (1)
#define GPIOC_COUNT (2)
#define GPIO_VERSION (4)
#define GPIO_BASE_ADDR (LIO_GPIO_BASE_ADDR)
#define GPIO_0_GROUP_COUNT (18)
#define GPIO_GROUP_COUNT (GPIO_0_GROUP_COUNT)
#define GPIO_1_BASE_ADDR (SPU_GPIO_BASE_ADDR)
#define GPIO_1_GROUP_COUNT (10)
#define GPIO_AP (GPIOC_0)
#define GPIO_SPU (GPIOC_1)
#define AIC_BASE_ADDR (SPU_AIC_BASE_ADDR)
#define AIC_VERSION (1)
#define AIC_INT_COUNT (192)
#define PL080DMAC_BASE_ADDR (LIO_DMAC_BASE_ADDR)
#define PL080DMAC_SPACING (0x4000)
#define PL080DMAC_COUNT (2)
#define PL080DMAC_CHANNEL_COUNT (8)
#define USBOTG_BASE_ADDR (AUE_USBOTG_BASE_ADDR)
#define AUSB_CTL_REG_BASE_ADDR (AUE_USBCONT_BASE_ADDR)
#define AUSB_CTL_USB20PHY_REG_OFFSET (0x30)
#define AUSB_USB20PHY_ONLY_VERSION (1)
#define AUSB_PL301_WIDGET_BASE_ADDR (AUE_PL301_BASE_ADDR)
#define AES_S7002_BASE_ADDR (LIO_AES_BASE_ADDR)
#define AES_S7002_VERSION (1)
#define DBGFIFO_0_BASE_ADDR (SPU_DBG_FIFO_0_BASE_ADDR)
#define DBGFIFO_SPACING (0x3000)
#define DBGFIFO_COUNT (8)
#define RECONFIG_RAM_SIZE_IN_WORDS (1024)
#endif /* ! __PLATFORM_SOC_HWREGBASE_H */
+67
View File
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2013-2014 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_SOC_MIU_H
#define __PLATFORM_SOC_MIU_H
#include <lib/devicetree.h>
#include <platform/soc/hwregbase.h>
// CPU Fabric Widget Registers (base address @ CPU_FABRIC_BASE_ADDR)
#define CPU_Fabric_pl301Wrap0_AMCRDRATELIMIT (0x0000) // AMC Read Rate Limit Register
#define CPU_Fabric_pl301Wrap0_AMCWRALIMIT (0x0004) // AMC Write Rate Limit Register
#define CPU_Fabric_pl301Wrap0_AMCRTRLIMIT (0x0008) // AMC Read Transactions Limit Register
#define CPU_Fabric_pl301Wrap0_AMCWTRLIMIT (0x000c) // AMC Write Transactions Limit Register
#define CPU_Fabric_pl301Wrap0_SPURDRATELIMIT (0x0040) // SPU Read Rate Limit Register
#define CPU_Fabric_pl301Wrap0_SPUWRALIMIT (0x0044) // SPU Write Rate Limit Register
#define CPU_Fabric_pl301Wrap0_SPURTRLIMIT (0x0048) // SPU Read Transactions Limit Register
#define CPU_Fabric_pl301Wrap0_SPUWTRLIMIT (0x004c) // SPU Write Transactions Limit Register
#define CPU_Fabric_pl301Wrap0_SPUWGATHER (0x0050) // SPU Write Gather Register
#define CPU_Fabric_pl301Wrap0_LIOWGATHER (0x0090) // LIO Write Gather Register
#define CPU_Fabric_pl301Wrap0_AUERDRATELIMIT (0x00c0) // AUE Read Rate Limit Register
#define CPU_Fabric_pl301Wrap0_AUEWRALIMIT (0x00c4) // AUE Write Rate Limit Register
#define CPU_Fabric_pl301Wrap0_AUERTRLIMIT (0x00c8) // AUE Read Transactions Limit Register
#define CPU_Fabric_pl301Wrap0_AUEWTRLIMIT (0x00cc) // AUE Write Transactions Limit Register
#define CPU_Fabric_pl301Wrap0_AUEWGATHER (0x00d0) // AUE Write Gather Register
#define CPU_Fabric_pl301Wrap0_ANSRDRATELIMIT (0x0100) // ANS Read Rate Limit Register
#define CPU_Fabric_pl301Wrap0_ANSWRALIMIT (0x0104) // ANS Write Rate Limit Register
#define CPU_Fabric_pl301Wrap0_ANSRTRLIMIT (0x0108) // ANS Read Transactions Limit Register
#define CPU_Fabric_pl301Wrap0_ANSWTRLIMIT (0x010c) // ANS Write Transactions Limit Register
#define CPU_Fabric_pl301Wrap0_ANSWGATHER (0x0110) // ANS Write Gather Register
#define CPU_Fabric_pl301Wrap0_AXI0_ARCHANARBMI0 (0x0408) // Configured AR channel arbitration value for MI 0
// NRT Fabric Widget Registers (base address @ NRT_FABRIC_BASE_ADDR)
#define NRT_Fabric_pl301Wrap1_AMCRDRATELIMIT (0x0000) // AMC Read Rate Limit Register
#define NRT_Fabric_pl301Wrap1_AMCWRALIMIT (0x0004) // AMC Write Rate Limit Register
#define NRT_Fabric_pl301Wrap1_AMCRTRLIMIT (0x0008) // AMC Read Transactions Limit Register
#define NRT_Fabric_pl301Wrap1_AMCWTRLIMIT (0x000c) // AMC Write Transactions Limit Register
#define NRT_Fabric_pl301Wrap1_MSRRDRATELIMIT (0x0040) // MSR Read Rate Limit Register
#define NRT_Fabric_pl301Wrap1_MSRWRALIMIT (0x0044) // MSR Write Rate Limit Register
#define NRT_Fabric_pl301Wrap1_MSRRTRLIMIT (0x0048) // MSR Read Transactions Limit Register
#define NRT_Fabric_pl301Wrap1_MSRWTRLIMIT (0x004c) // MSR Write Transactions Limit Register
#define NRT_Fabric_pl301Wrap1_SDIORDRATELIMIT (0x0080) // SDIO Read Rate Limit Register
#define NRT_Fabric_pl301Wrap1_SDIOWRALIMIT (0x0084) // SDIO Write Rate Limit Register
#define NRT_Fabric_pl301Wrap1_SDIORTRLIMIT (0x0088) // SDIO Read Transactions Limit Register
#define NRT_Fabric_pl301Wrap1_SDIOWTRLIMIT (0x008c) // SDIO Write Transactions Limit Register
#define rFABRIC_REMAP_REG *(volatile uint32_t *)(PMGR_BASE_ADDR + 0x31000)
#define rPIO_REMAP_CTL *(volatile uint32_t *)(PIO_BASE_ADDR + 0x00)
enum remap_select {
REMAP_SRAM = 1,
REMAP_SDRAM
};
extern void miu_select_remap(enum remap_select sel);
extern void miu_bypass_prep(void);
extern void miu_update_device_tree(DTNode *pmgr_node);
extern void miu_configure_bridge_soc_reconfig_ram(void);
#endif /* ! __PLATFORM_SOC_MIU_H */
+300
View File
@@ -0,0 +1,300 @@
/*
* Copyright (C) 2013-2014 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_SOC_PMGR_H
#define __PLATFORM_SOC_PMGR_H
#include <lib/devicetree.h>
#include <platform/soc/hwregbase.h>
enum {
PMGR_CLK_OSC = 0,
PMGR_CLK_PLL0,
PMGR_CLK_GPIO,
PMGR_CLK_SOURCE_FIRST = PMGR_CLK_GPIO,
PMGR_CLK_MCU,
PMGR_CLK_MCU_FIXED,
PMGR_CLK_GFX,
PMGR_CLK_MIPI_DSI,
PMGR_CLK_VID,
PMGR_CLK_MEDIA,
PMGR_CLK_DISP,
PMGR_CLK_SDIO,
PMGR_CLK_ANS,
PMGR_CLK_PIO,
PMGR_CLK_LIO,
PMGR_CLK_AUE,
PMGR_CLK_USB,
PMGR_CLK_SPI0_N,
PMGR_CLK_SPI1_N,
PMGR_CLK_NCO_REF0,
PMGR_CLK_NCO_REF1,
PMGR_CLK_NCO_ALG0,
PMGR_CLK_NCO_ALG1,
PMGR_CLK_MCA0_M,
PMGR_CLK_MCA1_M,
PMGR_CLK_SOURCE_LAST = PMGR_CLK_MCA1_M,
PMGR_CLK_S0,
PMGR_CLK_S1,
PMGR_CLK_COUNT,
PMGR_CLK_NOT_SUPPORTED
};
#define PMGR_CLK_CFG_INDEX(_clk) ((_clk) - PMGR_CLK_GPIO)
// PLL Config Regs
#define rPMGR_PLL0_CTL (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0000))
#define PMGR_PLL_ENABLE (1 << 31)
#define PMGR_PLL_LOAD (1 << 29)
#define PMGR_PLL_PENDING (1 << 25)
#define PMGR_PLL_M_SHIFT (12)
#define PMGR_PLL_M_MASK (0x1FF)
#define PMGR_PLL_P_SHIFT (4)
#define PMGR_PLL_P_MASK (0x1F)
#define PMGR_PLL_S_SHIFT (0)
#define PMGR_PLL_S_MASK (0xF)
#define PMGR_PLL_M(_m) (((_m) & PMGR_PLL_M_MASK) << PMGR_PLL_M_SHIFT)
#define PMGR_PLL_P(_p) (((_p) & PMGR_PLL_P_MASK) << PMGR_PLL_P_SHIFT)
#define PMGR_PLL_S(_s) (((_s) & PMGR_PLL_S_MASK) << PMGR_PLL_S_SHIFT)
#define PMGR_PLL_FREQ(_m, _p, _s) ((((_m) * OSC_FREQ) / (_p))/((_s) + 1))
#define rPMGR_PLL0_EXT_BYPASS_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0004))
#define PMGR_PLL_BYP_ENABLED (1 << 31)
#define PMGR_PLL_PLL_ENABLED (1 << 30)
#define PMGR_PLL_EXT_BYPASS (1 << 0)
#define rPMGR_PLL0_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0008))
#define rPMGR_PLL0_ANA_PARAMS0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x000c))
#define rPMGR_PLL0_ANA_PARAMS1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0010))
//#define rPMGR_PLL0_FD_CTL (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0014))
//#define rPMGR_PLL0_FRAC (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0018))
//#define rPMGR_PLL0_DEBUG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x001c))
//#define rPMGR_PLL0_DEBUG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0020))
#define rPMGR_PLL0_PLL_DELAY_CTL0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0024))
#define rPMGR_PLL0_PLL_DELAY_CTL1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x0028))
// General Clocks Config Regs
#define rPMGR_GPIO_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10000))
#define rPMGR_MCU_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10004))
#define rPMGR_MCU_FIXED_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10008))
#define rPMGR_GFX_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x1000c))
#define rPMGR_MIPI_DSI_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10010))
#define rPMGR_VID_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10014))
#define PMGR_MEDIA_CLK_CFG (0x10018)
#define rPMGR_MEDIA_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + PMGR_MEDIA_CLK_CFG))
#define rPMGR_DISP_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x1001c))
#define rPMGR_SDIO_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10020))
#define rPMGR_ANS_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10024))
#define rPMGR_PIO_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10028))
#define rPMGR_LIO_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x1002c))
#define rPMGR_AUE_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10030))
#define rPMGR_USB_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10034))
#define rPMGR_SPI0_N_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10038))
#define rPMGR_SPI1_N_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x1003c))
#define rPMGR_NCO_REF0_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10040))
#define rPMGR_NCO_REF1_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10044))
#define rPMGR_NCO_ALG0_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10048))
#define rPMGR_NCO_ALG1_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x1004c))
#define rPMGR_MCA0_M_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10050))
#define rPMGR_MCA1_M_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10054))
#define PMGR_FIRST_CLK_CFG (&rPMGR_GPIO_CLK_CFG)
#define PMGR_LAST_CLK_CFG (&rPMGR_MCA1_M_CLK_CFG)
#define PMGR_CLK_CFG_COUNT (((((void *)(PMGR_LAST_CLK_CFG)) - ((void *)(PMGR_FIRST_CLK_CFG))) / 4) + 1)
#define PMGR_CLK_NUM(_r) (((void *)&(rPMGR_ ## _r ## _CLK_CFG) - ((void *)(PMGR_FIRST_CLK_CFG))) / 4)
// Spare Clocks Config Regs
#define rPMGR_S0_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10200))
#define rPMGR_S1_CLK_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10204))
#define PMGR_FIRST_SPARE_CLK_CFG (&rPMGR_S0_CLK_CFG)
#define PMGR_LAST_SPARE_CLK_CFG (&rPMGR_S1_CLK_CFG)
#define PMGR_SPARE_CLK_CFG_COUNT (((((void *)(PMGR_LAST_SPARE_CLK_CFG)) - ((void *)(PMGR_FIRST_SPARE_CLK_CFG))) / 4) + 1)
#define PMGR_SPARE_CLK_NUM(_r) (((void *)&(rPMGR_ ## _r ## _CLK_CFG) - ((void *)(PMGR_FIRST_SPARE_CLK_CFG))) / 4)
// CLK_CFG Bits
#define PMGR_CLK_CFG_ENABLE (1 << 31)
#define PMGR_CLK_CFG_PENDING (1 << 30)
#define PMGR_CLK_CFG_PENDING_SHIFT (30)
#define PMGR_CLK_CFG_SRC_SEL_MASK (0x3F)
#define PMGR_CLK_CFG_CFG_SEL_SHIFT (16)
#define PMGR_CLK_CFG_SRC_SEL_SHIFT (24)
#define PMGR_CLK_CFG_SRC_SEL(_n) ((_n) << PMGR_CLK_CFG_SRC_SEL_SHIFT)
#define PMGR_CLK_CFG_DIVISOR_MASK (0x3F)
#define PMGR_CLK_CFG_DIVISOR(_n) ((_n) << 0)
// NCO Config block
#define rPMGR_NCO_CLK_CFG(_n) (*(volatile uint32_t *) (PMGR_BASE_ADDR + (_n) * 0x1000 + 0x11000 + 0x0))
// Misc Clock Tree Power Saving Regs
#define rPMGR_CLK_DIVIDER_ACG_CFG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10300))
#define rPMGR_CLK_POWER_CONFIG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x10304))
//PERF_STATE
#define rPMGR_SOC_PERF_STATE_CTL (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x1a000))
// Power State Regs
#define rPMGR_CPU_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20000))
#define rPMGR_AIC_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20008))
#define rPMGR_SPU_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20010))
#define rPMGR_SPU_AKF_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20018))
#define rPMGR_SPU_UART0_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20020))
#define rPMGR_SPU_UART1_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20028))
#define rPMGR_SPU_SMB_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20030))
#define rPMGR_SPU_SGPIO_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20038))
#define rPMGR_DOCKFIFO_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20040))
#define rPMGR_MCU_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20048))
#define rPMGR_AMP_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20050))
#define rPMGR_PIOSYS_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20058))
#define rPMGR_DISP_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20060))
#define rPMGR_MIPI_DSI_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20068))
#define PMGR_MSR_PS (0x20070)
#define rPMGR_MSR_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + PMGR_MSR_PS))
#define rPMGR_MEDIA_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20078))
#define rPMGR_ANS_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20080))
#define rPMGR_GFX_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20088))
#define rPMGR_SDIO_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20090))
#define rPMGR_LIO_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20098))
#define rPMGR_GPIO_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200a0))
#define rPMGR_MCA0_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200a8))
#define rPMGR_MCA1_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200b0))
#define rPMGR_SPI0_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200b8))
#define rPMGR_SPI1_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200c0))
#define rPMGR_DMATX_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200c8))
#define rPMGR_DMARX_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200d0))
#define rPMGR_UART0_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200d8))
#define rPMGR_UART1_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200e0))
#define rPMGR_UART2_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200e8))
#define rPMGR_UART3_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200f0))
#define rPMGR_UART4_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x200f8))
#define rPMGR_AES_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20100))
#define rPMGR_I2C0_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20108))
#define rPMGR_I2C1_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20110))
#define rPMGR_PWM0_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20118))
#define rPMGR_AUE_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20120))
#define rPMGR_USB_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20128))
#define rPMGR_ETH_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20130))
#define rPMGR_VDEC_PS (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x20138))
#define rSPU_PMGR_DEBUG_PS (*(volatile uint32_t *) (SPU_SEQUENCER_BASE_ADDR + 0x03004))
#define PMGR_PS_RESET (1 << 31)
#define PMGR_PS_ACTUAL_PS_SHIFT (4)
#define PMGR_PS_ACTUAL_PS_MASK (0xF)
#define PMGR_PS_MANUAL_PS_MASK (0xF)
#define PMGR_PS_RUN_MAX (0xF)
#define PMGR_PS_CLOCK_OFF (0x4)
#define PMGR_PS_POWER_OFF (0x0)
#define PMGR_FIRST_PS (&rPMGR_CPU_PS)
#define PMGR_LAST_PS (&rPMGR_VDEC_PS)
#define PMGR_PS_COUNT (((((void *)(PMGR_LAST_PS)) - ((void *)(PMGR_FIRST_PS))) / 8) + 1)
#define PMGR_PS_NUM(_r) (((void *)&(rPMGR_ ## _r ## _PS) - ((void *)(PMGR_FIRST_PS))) / 8)
// Power Gate Tunable Regs
#define rPMGR_PWR_CPU_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22000))
#define rPMGR_PWR_CPU_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22004))
#define rPMGR_PWR_CPU_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22008))
#define rPMGR_PWR_CPU_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2200c))
#define rPMGR_PWR_AMCPIO_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22010))
#define rPMGR_PWR_AMCPIO_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22014))
#define rPMGR_PWR_AMCPIO_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22018))
#define rPMGR_PWR_AMCPIO_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2201c))
#define rPMGR_PWR_DISP_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22020))
#define rPMGR_PWR_DISP_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22024))
#define rPMGR_PWR_DISP_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22028))
#define rPMGR_PWR_DISP_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2202c))
#define rPMGR_PWR_DISP_BE_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22030))
#define rPMGR_PWR_DISP_BE_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22034))
#define rPMGR_PWR_DISP_BE_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22038))
#define rPMGR_PWR_DISP_BE_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2203c))
#define rPMGR_PWR_MSR_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22040))
#define rPMGR_PWR_MSR_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22044))
#define rPMGR_PWR_MSR_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22048))
#define rPMGR_PWR_MSR_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2204c))
#define rPMGR_PWR_ANS_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22050))
#define rPMGR_PWR_ANS_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22054))
#define rPMGR_PWR_ANS_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22058))
#define rPMGR_PWR_ANS_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2205c))
#define rPMGR_PWR_GFX_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22060))
#define rPMGR_PWR_GFX_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22064))
#define rPMGR_PWR_GFX_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22068))
#define rPMGR_PWR_GFX_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2206c))
#define rPMGR_PWR_SDIO_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22070))
#define rPMGR_PWR_SDIO_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22074))
#define rPMGR_PWR_SDIO_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22078))
#define rPMGR_PWR_SDIO_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2207c))
#define rPMGR_PWR_LIO_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22080))
#define rPMGR_PWR_LIO_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22084))
#define rPMGR_PWR_LIO_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22088))
#define rPMGR_PWR_LIO_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2208c))
#define rPMGR_PWR_AUE_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22090))
#define rPMGR_PWR_AUE_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22094))
#define rPMGR_PWR_AUE_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22098))
#define rPMGR_PWR_AUE_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2209c))
#define rPMGR_PWR_VDEC_CFG0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x220a0))
#define rPMGR_PWR_VDEC_CFG1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x220a4))
#define rPMGR_PWR_VDEC_CFG2 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x220a8))
#define rPMGR_PWR_VDEC_DBG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x220ac))
#define rPMGR_MCU_ASYNC_RESET (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x22300))
// EMA Tunable Regs
#define rPMGR_EMA_SOC0 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x26000))
#define rPMGR_EMA_SOC1 (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x26004))
// Timer Regs
#define rPMGR_CHIP_WDOG_TMR (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27000))
#define rPMGR_CHIP_WDOG_RST_CNT (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27004))
#define rPMGR_CHIP_WDOG_INTR_CNT (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27008))
#define rPMGR_CHIP_WDOG_CTL (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2700c))
#define rPMGR_SYS_WDOG_TMR (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27010))
#define rPMGR_SYS_WDOG_RST_CNT (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27014))
#define rPMGR_SYS_WDOG_CTL (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x2701c))
#define rPMGR_EVENT_TMR (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27100))
#define rPMGR_EVENT_TMR_PERIOD (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27104))
#define rPMGR_EVENT_TMR_CTL (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27108))
#define rPMGR_INTERVAL_TMR (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27200))
#define rPMGR_INTERVAL_TMR_CTL (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x27204))
#define rPMGR_SCRATCH(_n) (*(volatile uint32_t *)(PMGR_BASE_ADDR + 0x29000 + ((_n)*4)))
#define rPMGR_SCRATCH0 rPMGR_SCRATCH(0) /* Flags */
#define rPMGR_SCRATCH1 rPMGR_SCRATCH(1)
#define rPMGR_SCRATCH2 rPMGR_SCRATCH(2)
#define rPMGR_SCRATCH3 rPMGR_SCRATCH(3)
#define rPMGR_SCRATCH4 rPMGR_SCRATCH(4)
#define rPMGR_SCRATCH5 rPMGR_SCRATCH(5)
#define rPMGR_SCRATCH6 rPMGR_SCRATCH(6)
#define rPMGR_SCRATCH7 rPMGR_SCRATCH(7) /* Consistent debug root pointer */
#define rPMGR_SCRATCH8 rPMGR_SCRATCH(8)
#define rPMGR_SCRATCH9 rPMGR_SCRATCH(9)
#define rPMGR_SCRATCH10 rPMGR_SCRATCH(10)
#define rPMGR_SCRATCH11 rPMGR_SCRATCH(11)
#define rPMGR_SCRATCH12 rPMGR_SCRATCH(12)
#define rPMGR_SCRATCH13 rPMGR_SCRATCH(13) /* Memory info */
#define rPMGR_SCRATCH14 rPMGR_SCRATCH(14) /* Boot Nonce 0 */
#define rPMGR_SCRATCH15 rPMGR_SCRATCH(15) /* Boot Nonce 1 */
#define rPMGR_SCRATCH16 rPMGR_SCRATCH(16) /* Boot Manifest Hash 0 */
#define rPMGR_SCRATCH17 rPMGR_SCRATCH(17) /* Boot Manifest Hash 1 */
#define rPMGR_SCRATCH18 rPMGR_SCRATCH(18) /* Boot Manifest Hash 2 */
#define rPMGR_SCRATCH19 rPMGR_SCRATCH(19) /* Boot Manifest Hash 3 */
#define rPMGR_SCRATCH20 rPMGR_SCRATCH(20) /* Boot Manifest Hash 4 */
#define rPMGR_SCRATCH21 rPMGR_SCRATCH(21)
#define rPMGR_SCRATCH22 rPMGR_SCRATCH(22)
#define rPMGR_SCRATCH23 rPMGR_SCRATCH(23)
#define rPMGR_SECURITY (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x31020))
#define rPMGR_MISC_GFX_CTL (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x31040))
#define rPMGR_MISC_ACG (*(volatile uint32_t *) (PMGR_BASE_ADDR + 0x32000))
extern void pmgr_update_device_tree(DTNode *pmgr_node);
#endif /* ! __PLATFORM_SOC_PMGR_H */
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2013-2014 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_RECONFIG_H
#define __PLATFORM_RECONFIG_H
#include <sys/types.h>
#define rRECONFIG_CONFIGURATION *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x0000)
#define rRECONFIG_CONFIG_MEM *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x0004)
#define rRECONFIG_TIMEOUT_MEM *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x0008)
#define rRECONFIG_INTERRUPT_MEM *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x000C)
#define rRECONFIG_CONFIG_SOC *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x0010)
#define rRECONFIG_TIMEOUT_SOC *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x0014)
#define rRECONFIG_INTERRUPT_SOC *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x0018)
#define rRECONFIG_CONFIG_AKF *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x001C)
#define rRECONFIG_TIMEOUT_AKF *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x0020)
#define rRECONFIG_INTERRUPT_AKF *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x0024)
#define rRECONFIG_RAM_CMD(i) *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x1000 + (i * 4))
#define rRECONFIG_RAM_DATA(i) *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x2000 + (i * 4))
#define rRECONFIG_RAM_MASK(i) *(volatile uint32_t *)(SPU_SOC_RECONFIG_BASE_ADDR + 0x3000 + (i * 4))
#define RECONFIG_RAM_CMD_READ (1 << 0)
// Removing this debug region now that reconfig engine/code seems to be working fine
// Do not use this space since SPU may have reclaimed it
#if 0
// last page of SPU SRAM allocated to RECONFIG for reconfig debug purposes
#define RECONFIG_DEBUG_SPACE (SPU_SRAM_A_BASE_ADDR + SPU_SRAM_SIZE - PAGE_SIZE)
#endif
typedef enum {RECONFIG_TYPE_MEM, RECONFIG_TYPE_SOC, RECONFIG_TYPE_AKF} reconfig_type_t;
/**
* Adds a reconfig command of the given type to the reconfig buffer
*
* Note that the reconfig driver expects you to program in all the RECONFIG_TYPE_MEM commands,
* followed by SOC commands, followed by AKF commands. The driver will panic if you attempt to program
* the block in a different sequence.
*
**/
void reconfig_append_command(reconfig_type_t type, uint32_t cmd, uint32_t data, uint32_t mask);
/**
* Program the RECONFIG_CONFIG_{SOC/MEM/AKF} registers with the start / counts, and enables the reconfig block.
*
* Call this after you've fully reprogrammed the reconfig memory using reconfig_append_command()
**/
void reconfig_commit();
/**
* Prints the contents of the reconfig buffer via printf. For debugging purposes only
**/
void reconfig_dbg_dump_contents(void);
#endif /* __PLATFORM_RECONFIG_H */
+26
View File
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_SOC_SPU_H
#define __PLATFORM_SOC_SPU_H
#include <platform/soc/hwregbase.h>
#define rSPU_AKF_AXI_BASE (*(volatile uint32_t *) (SPU_AKF_BASE_ADDR + 0x8))
#define rSPU_AKF_AXI_BASE_EXT (*(volatile uint32_t *) (SPU_AKF_BASE_ADDR + 0xC))
#define rSPU_AKF_AXI_START (*(volatile uint32_t *) (SPU_AKF_BASE_ADDR + 0x10))
#define rSPU_AKF_AXI_END (*(volatile uint32_t *) (SPU_AKF_BASE_ADDR + 0x18))
#define rSPU_AKF_AXI_EN (*(volatile uint32_t *) (SPU_AKF_BASE_ADDR + 0x20))
#define rSPU_AKF_AXI_IDLE_CTRL (*(volatile uint32_t *) (SPU_AKF_BASE_ADDR + 0x24))
#define rSPU_AKF_AXI_CPU_CTRL (*(volatile uint32_t *) (SPU_AKF_BASE_ADDR + 0x28))
#define SP_AKF_AXI_CPU_CTRL_RUN (1 << 4)
#endif /* ! __PLATFORM_SOC_SPU_H */
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_TRAMPOLINE_H
#define __PLATFORM_TRAMPOLINE_H
#include <platform/soc/hwregbase.h>
/* ROM related registers in PMGR space */
#define SECURITY_REG (PMGR_BASE_ADDR + 0x31020)
#define ROM_READ_DISABLE (1 << 4)
#endif /* ! __PLATFORM_TRAMPOLINE_H */
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __PLATFORM_USBCONFIG_H
#define __PLATFORM_USBCONFIG_H
#ifdef WITH_TARGET_USB_CONFIG
#include <target/usbconfig.h>
#endif /* WITH_TARGET_USB_CONFIG */
#define USBPHY_OTGTUNE0 (0x374413F3)
#define USBOTG_AHB_DMA_BURST (DWCUSB_GAHBCFG_HBST_INCR16)
#endif /* ! __PLATFORM_USBCONFIG_H */