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

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2015 Apple Inc. All rights reserved.
*
* This document is the property of Apple Computer, 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 __TARGET_ADBE_SETTINGS_H
#define __TARGET_ADBE_SETTINGS_H
static struct adbe_v2_tuneable adbe_tuneables[] = {
{
.name = "default",
.adbe0_vblank_clk_gate_wakeup = 0x0000,
.adbe0_vblank_clk_gate_idle = 0x0000,
.adbe0_vblank_busy_finish = 0x2,
.adbe0_tunable_mode_ctrl = (DBEMODECNTL_DPB_BUSY_MASK | \
DBEMODECNTL_PMGR_CLK_GATE_ENABLE | \
DBEMODECNTL_DYN_CLK_GATE_ENABLE | \
DBEMODECNTL_BLK_CLK_GATE_ENABLE),
.adbe0_aap_support = 1,
.adbe0_aap_format_control_reg1 = (AAP_FORMAT_CONTROL_REG1_AUTOPOS | AAP_FORMAT_CONTROL_REG1_RSVD(8) | AAP_FORMAT_CONTROL_REG1_VS_POL),
},
};
#endif
@@ -0,0 +1,38 @@
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* This document is the property of Apple Computer, 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 __TARGET_ASPNANDCONFIG_H
#define __TARGET_ASPNANDCONFIG_H
//MLC devices
#define ASPNAND_MLC_WRITE_DIES_IN_PARALLEL 4
#define ASPNAND_SLC_WRITE_DIES_IN_PARALLEL 2
#define ASPNAND_ERASE_DIES_IN_PARALLEL 4
#define ASPNAND_READ_DIES_IN_PARALLEL 4
#define ASPNAND_MLC_WRITE_LOW_POWER_DIES_IN_PARALLEL 2
#define ASPNAND_SLC_WRITE_LOW_POWER_DIES_IN_PARALLEL 2
#define ASPNAND_ERASE_LOW_POWER_DIES_IN_PARALLEL 2
#define ASPNAND_READ_LOW_POWER_DIES_IN_PARALLEL 2
//TLC devices
#define ASPNAND_TLC_TLC_WRITE_DIES_IN_PARALLEL 8
#define ASPNAND_TLC_SLC_WRITE_DIES_IN_PARALLEL 8
#define ASPNAND_TLC_ERASE_DIES_IN_PARALLEL 2
#define ASPNAND_TLC_READ_DIES_IN_PARALLEL 8
#define ASPNAND_TLC_TLC_WRITE_LOW_POWER_DIES_IN_PARALLEL 2
#define ASPNAND_TLC_SLC_WRITE_LOW_POWER_DIES_IN_PARALLEL 2
#define ASPNAND_TLC_ERASE_LOW_POWER_DIES_IN_PARALLEL 2
#define ASPNAND_TLC_READ_LOW_POWER_DIES_IN_PARALLEL 2
// rdar://problem/18371949 - these values should be the same for post-OkemoTaos targets
#define ASPNAND_INDIRECTION_MEMORY (2*1024*1024)
#define ASPNAND_LEGACY_INDIRECTION_MEMORY (2*1024*1024)
#endif
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2012-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 __TARGET_GPIODEF_H
#define __TARGET_GPIODEF_H
/* Typhonic specific gpio -> pin mappings */
#include <platform/gpio.h>
/* define target-specific gpios in a generic fashion here. */
#endif /* ! __TARGET_GPIODEF_H */
@@ -0,0 +1,153 @@
// Copyright (C) 2008-2010 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.
//
// NOTE: This is a generated file and should not be hand-edited!
//
// =============================================================================
// Nand Geometry Table
static NandGeometry _nandGeometryTable[] =
{
{
/* chipId */ { 0x98, 0xE7, 0x94, 0x32 },
/* blocksPerCS */ 4100,
/* pagesPerBlock */ 128,
/* dataBytesPerPage */ 8192,
/* spareBytesPerPage */ 448,
/* eccPer512Bytes */ 16,
/* initialBBType */ INIT_BBT_TOSHIBA_MLC,
/* diesPerCS */ 1
}
};
// =============================================================================
// Nand Timing Table
static NandTiming _nandTimingTable[] =
{
{
/* configId */
{
/* connectedBusCnt */ 2,
/* packageCnt */ 1,
/* packageIds[] */
{
{
/* chipId */ { 0x98, 0xE7, 0x94, 0x32 },
/* ceCnt */ 2
}
}
},
/* writeCycleNanosecs */ 25,
/* writeSetupNanosecs */ 12,
/* writeHoldNanosecs */ 10,
/* readCycleNanosecs */ 25,
/* readSetupNanosecs */ 12,
/* readHoldNanosecs */ 10,
/* readDelayNanosecs */ 20,
/* readValidNanosecs */ 25
}
};
#if (defined (AND_ENABLE_NAND_DESCRIPTION_TEXT) || AND_ENABLE_NAND_DESCRIPTION_TEXT)
// =============================================================================
// NandChipId Description
const NandChipIdDescription _nandChipIdDescriptionTable[] =
{
{
/* chipId */ { 0x98, 0xE7, 0x94, 0x32 },
/* die */ "32nm",
/* vendor_name */ "Toshiba"
}
};
// =============================================================================
// Nand Description Table
static const NandDescription _nandDescriptionTable[] =
{
{
/* packageId */
{
/* chipId */ { 0x98, 0xE7, 0x94, 0x32 },
/* ceCnt */ 2
},
/* appleName */ "335S0700",
/* vendor_part_num */ "TH58NVG6D2FLA49",
/* package_type */ "DDP",
/* package_size */ "1.00mm LGA"
}
};
const UInt32 _nandDescriptionTableSize = sizeof(_nandDescriptionTable) / sizeof(NandDescription);
#endif // (defined(AND_ENABLE_NAND_DESCRIPTION_TEXT) || AND_ENABLE_NAND_DESCRIPTION_TEXT)
// =============================================================================
// Nand Board Support Table
static NandBoardSupport _nandBoardSupportTable[] =
{
{
/* configId */
{
/* connectedBusCnt */ 2,
/* packageCnt */ 1,
/* packageIds[] */
{
{
/* deviceId */ { 0x98, 0xE7, 0x94, 0x32 },
/* ceCnt */ 2
}
}
},
/* vsType */ FIL_VS_TOSHIBA_2P_EXT
}
};
// =============================================================================
// Nand Board Timing Table
static NandBoardInfo _nandBoardInfo =
{
/* controlDstr */ NAND_DRIVE_STRENGTH_DEFAULT,
/* dataDstr */ NAND_DRIVE_STRENGTH_DEFAULT,
/* chipEnableDstr */ NAND_DRIVE_STRENGTH_DEFAULT,
/* socToNandRiseNanosecs */ 10,
/* socToNandFallNanosecs */ 10,
/* nandToSocRiseNanosecs */ 10,
/* nandToSocFallNanosecs */ 10,
/* landing map */
{
0x00000303
},
/* useToggleMode */ 0,
/* useDiffDQSMode */ 0,
/* useDiffREMode */ 0,
/* useVref */ 0
};
static NandFormat _nandFormatPpn =
{
/* metaPerLogicalPage */ 16,
/* validMetaPerLogicalPage */ 16,
/* logicalPageSize */ 0
};
static NandFormat _nandFormatRaw =
{
/* metaPerLogicalPage */ 12,
/* validMetaPerLogicalPage */ 10,
/* logicalPageSize */ 0
};
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* This document is the property of Apple Computer, 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 __TARGET_POWERCONFIG_H
#define __TARGET_POWERCONFIG_H
// Minimal definitions to make lib/power.c happy
#define TARGET_POWER_NO_BATTERY 1
#define PRECHARGE_BACKLIGHT_LEVEL 824
#define ALWAYS_BOOT_BATTERY_VOLTAGE (5000)
// This fake SoC block takes the place of the external PMU in Fastsim
#define SWIFTER_PMU_BASE 0x20F050000
#endif
@@ -0,0 +1,17 @@
/*
* Copyright (C) 2011 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 __TARGET_UARTCONFIG_H
#define __TARGET_UARTCONFIG_H
/* define two debug serial ports */
#define DEBUG_SERIAL_PORT (0)
#endif
+226
View File
@@ -0,0 +1,226 @@
/*
* Copyright (C) 2012-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.
*/
#include <debug.h>
#include <drivers/flash_nor.h>
#include <lib/devicetree.h>
#include <lib/env.h>
#include <lib/mib.h>
#include <platform.h>
#include <platform/gpiodef.h>
#include <platform/memmap.h>
#include <sys.h>
#include <sys/menu.h>
#include <sys/task.h>
#include <target.h>
MIB_CONSTANT(kMIBTargetOsPictureScale, kOIDTypeUInt32, 2);
MIB_CONSTANT(kMIBTargetPictureRotate, kOIDTypeInt32, 0);
void target_early_init(void)
{
}
void target_late_init(void)
{
}
void target_init(void)
{
#if WITH_HW_FLASH_NOR
flash_nor_init(SPI_NOR0);
#endif
}
void target_quiesce_hardware(void)
{
}
void target_poweroff(void)
{
}
int target_bootprep(enum boot_target target)
{
return 0;
}
bool target_should_recover(void)
{
return 0;
}
bool target_should_poweron(bool *cold_button_boot)
{
*cold_button_boot = true;
return true;
}
bool target_should_poweroff(bool at_boot)
{
return 0;
}
#if !PRODUCT_LLB
bool target_get_property(enum target_property prop, void *data, int maxdata, int *retlen)
{
return false;
}
#endif
void * target_get_display_configuration(void)
{
return NULL;
}
#if WITH_ENV
void target_setup_default_environment(void)
{
env_set("boot-args", "debug=0x14e serial=3 amfi=0x83 cs_enforcement_disable=1 fips_mode=0 -disable_aslr", ENV_PERSISTENT);
// boot-device is set in platform's init.c
env_set("display-color-space","RGB888", 0);
env_set("idle-off", "false", 0);
env_set("kaslr-slide", "0x10000000", 0);
env_set("wifiaddr", "12:22:33:44:55:66", 0);
env_set("ethaddr", "12:22:33:44:55:77", 0);
env_set("btaddr", "00:00:00:00:00:00", 0);
#if SUB_TARGET_S8001SIM
env_set("display-timing", "ipad6", 0);
env_set("adfe-tunables", "ipad6", 0);
#else
env_set("display-timing", "D520", 0);
env_set("adfe-tunables", "D520", 0);
#endif
}
#endif
#if WITH_DEVICETREE
#define ROOT_DTPATH ""
int target_update_device_tree(void)
{
DTNode *node;
uint32_t propSize;
char *propName;
void *propData;
// Overwrite the serial-number with data from the simplertc fastsim model
if (FindNode(0, ROOT_DTPATH, &node)) {
propName = "serial-number";
if (FindProperty(node, &propName, &propData, &propSize)) {
if (propSize != 0x20) {
dprintf(DEBUG_CRITICAL, "serial-number property size 0x%x (expected 0x20)\n", propSize);
return -1;
}
uint64_t *serial = (uint64_t *)propData;
serial[0] = *(volatile uint64_t *)0x20f050040;
serial[1] = *(volatile uint64_t *)0x20f050048;
serial[2] = *(volatile uint64_t *)0x20f050050;
serial[3] = *(volatile uint64_t *)0x20f050058;
}
}
// Overwrite the region-info with data from the simplertc fastsim model
if (FindNode(0, ROOT_DTPATH, &node)) {
propName = "region-info";
if (FindProperty(node, &propName, &propData, &propSize)) {
if (propSize != 0x20) {
dprintf(DEBUG_CRITICAL, "region-info property size 0x%x (expected 0x20)\n", propSize);
return -1;
}
uint64_t *region = (uint64_t *)propData;
region[0] = *(volatile uint64_t *)0x20f050060;
region[1] = *(volatile uint64_t *)0x20f050068;
region[2] = *(volatile uint64_t *)0x20f050070;
region[3] = *(volatile uint64_t *)0x20f050078;
}
}
return 0;
}
#endif
#if !WITH_HW_POWER
bool power_needs_precharge(void)
{
return false;
}
void power_cancel_buttonwait(void)
{
}
bool power_do_chargetrap(void)
{
return false;
}
bool power_is_suspended(void)
{
return false;
}
void power_will_resume(void)
{
}
bool power_has_usb(void)
{
return false;
}
int power_read_dock_id(unsigned *id)
{
return -1;
}
bool power_get_diags_dock(void)
{
return false;
}
u_int32_t power_get_boot_battery_level(void)
{
return 0;
}
int power_get_nvram(u_int8_t key, u_int8_t *data)
{
return -1;
}
int power_set_nvram(u_int8_t key, u_int8_t data)
{
return -1;
}
int power_set_soc_voltage(unsigned mv, int override)
{
return -1;
}
bool force_usb_power = false;
void power_set_usb_state(bool configured, bool suspended)
{
}
int power_backlight_enable(u_int32_t backlight_level)
{
return 0;
}
#endif /* ! WITH_HW_POWER */
+323
View File
@@ -0,0 +1,323 @@
/*
* 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.
*/
#include <debug.h>
#include <stdint.h>
#include <drivers/apple/gpio.h>
#include <platform/soc/hwregbase.h>
static const uint32_t gpio_default_cfg[GPIO_GROUP_COUNT * GPIOPADPINS] = {
/* Port 0 */
CFG_DISABLED, // 0 : SWD_TMS2 ->
CFG_DISABLED, // 1 : SWD_TMS3 ->
CFG_DISABLED, // 2 : UART5_RTXD ->
CFG_DISABLED, // 3 : I2S4_MCK ->
CFG_DISABLED, // 4 : I2S4_BCLK ->
CFG_DISABLED, // 5 : I2S4_LRCK ->
CFG_DISABLED, // 6 : I2S4_DIN ->
CFG_DISABLED, // 7 : I2S4_DOUT ->
/* Port 1 */
CFG_DISABLED, // 8 : I2S2_MCK ->
CFG_DISABLED, // 9 : I2S2_BCLK ->
CFG_DISABLED, // 10 : I2S2_LRCK ->
CFG_DISABLED, // 11 : I2S2_DIN ->
CFG_DISABLED, // 12 : I2S2_DOUT ->
CFG_DISABLED, // 13 : SPI1_SCLK ->
CFG_DISABLED, // 14 : SPI1_MOSI ->
CFG_DISABLED, // 15 : SPI1_MISO ->
/* Port 2 */
CFG_DISABLED, // 16 : SPI1_SSIN ->
CFG_DISABLED, // 17 : I2S0_MCK ->
CFG_DISABLED, // 18 : I2S0_BCLK ->
CFG_DISABLED, // 19 : I2S0_LRCK ->
CFG_DISABLED, // 20 : I2S0_DIN ->
CFG_DISABLED, // 21 : I2S0_DOUT ->
CFG_DISABLED, // 22 : I2C2_SDA ->
CFG_DISABLED, // 23 : I2C2_SCL ->
/* Port 3 */
CFG_DISABLED, // 24 : UART1_TXD ->
CFG_DISABLED, // 25 : UART1_RXD ->
CFG_DISABLED, // 26 : UART1_RTSN ->
CFG_DISABLED, // 27 : UART1_CTSN ->
CFG_DISABLED, // 28 : UART4_TXD ->
CFG_DISABLED, // 29 : UART4_RXD ->
CFG_DISABLED, // 30 : UART4_RTSN ->
CFG_DISABLED, // 31 : UART4_CTSN ->
/* Port 4 */
CFG_DISABLED, // 32 : UART7_TXD ->
CFG_DISABLED, // 33 : UART7_RXD ->
CFG_DISABLED, // 34 : CLK32K_OUT ->
CFG_DISABLED, // 35 : DP_WAKEUP ->
CFG_DISABLED, // 36 : MIPICSI_MUXSEL ->
CFG_DISABLED, // 37 : ISP_I2C1_SDA ->
CFG_DISABLED, // 38 : ISP_I2C1_SCL ->
CFG_DISABLED, // 39 : ISP_I2C0_SDA ->
/* Port 5 */
CFG_DISABLED, // 40 : ISP_I2C0_SCL ->
CFG_DISABLED, // 41 : SPI2_SCLK ->
CFG_DISABLED, // 42 : SPI2_MOSI ->
CFG_DISABLED, // 43 : SPI2_MISO ->
CFG_DISABLED, // 44 : SPI2_SSIN ->
CFG_DISABLED, // 45 : I2C0_SDA ->
CFG_DISABLED, // 46 : I2C0_SCL ->
CFG_DISABLED, // 47 : SENSOR0_ISTRB ->
/* Port 6 */
CFG_DISABLED, // 48 : SENSOR0_RST ->
CFG_DISABLED, // 49 : SENSOR0_CLK ->
CFG_DISABLED, // 50 : SENSOR0_XSHUTDOWN ->
CFG_DISABLED, // 51 : SENSOR1_ISTRB ->
CFG_DISABLED, // 52 : SENSOR1_RST ->
CFG_DISABLED, // 53 : SENSOR1_CLK ->
CFG_DISABLED, // 54 : SENSOR1_XSHUTDOWN ->
CFG_DISABLED,
/* Port 7 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 8 */
CFG_DISABLED, // 64 : GPIO[0] ->
CFG_DISABLED, // 65 : GPIO[1] ->
CFG_DISABLED, // 66 : GPIO[2] ->
CFG_DISABLED, // 67 : GPIO[3] ->
CFG_DISABLED, // 68 : GPIO[4] ->
CFG_DISABLED, // 69 : GPIO[5] ->
CFG_DISABLED, // 70 : GPIO[6] ->
CFG_DISABLED, // 71 : GPIO[7] ->
/* Port 9 */
CFG_DISABLED, // 72 : GPIO[8] ->
CFG_DISABLED, // 73 : GPIO[9] ->
CFG_DISABLED, // 74 : GPIO[10] ->
CFG_DISABLED, // 75 : GPIO[11] ->
CFG_DISABLED, // 76 : GPIO[12] ->
CFG_DISABLED, // 77 : GPIO[13] ->
CFG_DISABLED, // 78 : GPIO[14] ->
CFG_DISABLED, // 79 : GPIO[15] ->
/* Port 10 */
CFG_DISABLED, // 80 : GPIO[16] -> BOARD_ID[3]
CFG_DISABLED, // 81 : GPIO[17] ->
CFG_DISABLED, // 82 : GPIO[18] -> BOOT_CONFIG[0]
CFG_DISABLED, // 83 : I2S1_MCK ->
CFG_DISABLED, // 84 : I2S1_BCLK ->
CFG_DISABLED, // 85 : I2S1_LRCK ->
CFG_DISABLED, // 86 : I2S1_DIN ->
CFG_DISABLED, // 87 : I2S1_DOUT ->
/* Port 11 */
CFG_DISABLED, // 88 : UART3_TXD ->
CFG_DISABLED, // 89 : UART3_RXD ->
CFG_DISABLED, // 90 : UART3_RTSN ->
CFG_DISABLED, // 91 : UART3_CTSN ->
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 12 */
CFG_IN, // 96 : MENU_KEY_L -> REQUEST_DFU2
CFG_IN, // 97 : HOLD_KEY_L -> REQUEST_DFU1
CFG_DISABLED, // 98 : SKEY_L ->
CFG_DISABLED, // 99 : SPI3_SCLK ->
CFG_DISABLED, // 100 : SPI3_MOSI ->
CFG_DISABLED, // 101 : SPI3_MISO ->
CFG_DISABLED, // 102 : SPI3_SSIN ->
CFG_FUNC0, // 103 : SPI0_SCLK -> SPI0_SCLK/BOARD_ID[0]
/* Port 13 */
CFG_FUNC0, // 104 : SPI0_MOSI -> SPI0_MOSI/BOARD_ID[1]
CFG_FUNC0, // 105 : SPI0_MISO -> SPI0_MISO/BOARD_ID[2]
CFG_OUT_1, // 106 : SPI0_SSIN -> SPI0_CS
CFG_DISABLED, // 107 : UART0_TXD ->
CFG_DISABLED, // 108 : UART0_RXD ->
CFG_DISABLED, // 109 : UART6_TXD ->
CFG_DISABLED, // 110 : UART6_RXD ->
CFG_DISABLED, // 111 : TMR32_PWM0 ->
/* Port 14 */
CFG_DISABLED, // 112 : TMR32_PWM1 ->
CFG_DISABLED, // 113 : TMR32_PWM2 ->
CFG_DISABLED, // 114 : I2C1_SDA ->
CFG_DISABLED, // 115 : I2C1_SCL ->
CFG_DISABLED, // 116 : GPIO[19] ->
CFG_DISABLED, // 117 : GPIO[20] ->
CFG_DISABLED, // 118 : GPIO[21] ->
CFG_DISABLED, // 119 : GPIO[22] ->
/* Port 15 */
CFG_DISABLED, // 120 : GPIO[23] ->
CFG_DISABLED, // 121 : GPIO[24] ->
CFG_DISABLED, // 122 : GPIO[25] -> BOOT_CONFIG[1]
CFG_IN | PULL_DOWN, // 123 : GPIO[26] -> FORCE_DFU
CFG_DISABLED | PULL_DOWN, // 124 : PMGR_MOSI -> DFU_STATUS
CFG_DISABLED, // 125 : PMGR_MISO ->
CFG_DISABLED, // 126 : PMGR_SCLK0 ->
CFG_DISABLED, // 127 : PMGR_SSCLK1 ->
/* Port 16 */
CFG_DISABLED, // 128 : SOCHOT0 ->
CFG_DISABLED, // 129 : SOCHOT1 ->
CFG_DISABLED, // 130 : EDP_HPD ->
CFG_DISABLED, // 131 : I2S3_MCK ->
CFG_DISABLED, // 132 : I2S3_BCLK ->
CFG_DISABLED, // 133 : I2S3_LRCK ->
CFG_DISABLED, // 134 : I2S3_DOUT ->
CFG_DISABLED, // 135 : I2S3_DIN ->
/* Port 17 */
CFG_DISABLED, // 136 : GPIO[27] ->
CFG_DISABLED, // 137 : GPIO[28] -> BOOT_CONFIG[2]
CFG_DISABLED, // 138 : GPIO[29] -> BOARD_ID[4]
CFG_DISABLED, // 139 : GPIO[30] ->
CFG_DISABLED, // 140 : GPIO[31] ->
CFG_DISABLED, // 141 : GPIO[32] ->
CFG_DISABLED, // 142 : GPIO[33] ->
CFG_DISABLED, // 143 : GPIO[34] ->
/* Port 18 */
CFG_DISABLED, // 144 : GPIO[35] ->
CFG_DISABLED, // 145 : GPIO[36] ->
CFG_DISABLED, // 146 : GPIO[37] ->
CFG_DISABLED, // 147 : GPIO[38] ->
CFG_DISABLED, // 148 : GPIO[39] ->
CFG_DISABLED, // 149 : GPIO[40] ->
CFG_DISABLED, // 150 : GPIO[41] ->
CFG_DISABLED, // 151 : GPIO[42] ->
/* Port 19 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 20 */
CFG_DISABLED, // 160 : PCIE_PERST0_N -> NAND_PERST
CFG_DISABLED, // 161 : PCIE_PERST1_N ->
CFG_DISABLED, // 162 : PCIE_PERST2_N ->
CFG_DISABLED, // 163 : PCIE_PERST3_N ->
CFG_DISABLED, // 164 : PCIE_CLKREQ0_N -> NAND_CLKREQ
CFG_DISABLED, // 165 : PCIE_CLKREQ1_N ->
CFG_DISABLED, // 166 : PCIE_CLKREQ2_N ->
CFG_DISABLED, // 167 : PCIE_CLKREQ3_N ->
/* Port 21 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 22 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 23 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 24 */
CFG_DISABLED, // 192 : UART2_TXD ->
CFG_DISABLED, // 193 : UART2_RXD ->
CFG_DISABLED, // 194 : UART2_RTSN ->
CFG_DISABLED, // 195 : UART2_CTSN ->
CFG_DISABLED, // 196 : NAND_SYS_CLK -> NAND_SYS_CLK
CFG_DISABLED, // 197 : S3E_RESETN -> NAND_RESET
CFG_DISABLED, // 198 : TST_CLKOUT ->
CFG_DISABLED,
};
static const uint32_t gpio_1_default_cfg[GPIO_1_GROUP_COUNT * GPIOPADPINS] = {
/* Port 0 */
CFG_DISABLED, // 0 : AOP_SPI_SCLK ->
CFG_DISABLED, // 1 : AOP_SPI_MOSI ->
CFG_DISABLED, // 2 : AOP_SPI_MISO ->
CFG_DISABLED, // 3 : AOP_UART1_TXD ->
CFG_DISABLED, // 4 : AOP_UART1_RXD ->
CFG_DISABLED, // 5 : AOP_UART0_TXD ->
CFG_DISABLED, // 6 : AOP_UART0_RXD ->
CFG_DISABLED, // 7 : AOP_UART2_TXD ->
/* Port 1 */
CFG_DISABLED, // 8 : AOP_UART2_RXD ->
CFG_DISABLED, // 9 : AOP_I2CM_SDA ->
CFG_DISABLED, // 10 : AOP_I2CM_SCL ->
CFG_DISABLED, // 11 : AOP_FUNC[0] ->
CFG_DISABLED, // 12 : AOP_FUNC[1] ->
CFG_DISABLED, // 13 : AOP_FUNC[2] ->
CFG_DISABLED, // 14 : AOP_FUNC[3] ->
CFG_DISABLED, // 15 : AOP_FUNC[4] ->
/* Port 2 */
CFG_DISABLED, // 16 : AOP_FUNC[5] ->
CFG_DISABLED, // 17 : AOP_FUNC[6] ->
CFG_DISABLED, // 18 : AOP_FUNC[7] ->
CFG_DISABLED, // 19 : AOP_FUNC[8] ->
CFG_DISABLED, // 20 : AOP_FUNC[9] ->
CFG_DISABLED, // 21 : AOP_SWD_TCK_OUT ->
CFG_DISABLED, // 22 : AOP_SWD_TMS0 ->
CFG_DISABLED, // 23 : AOP_SWD_TMS1 ->
/* Port 3 */
CFG_DISABLED, // 24 : AOP_I2S_MCK ->
CFG_DISABLED, // 25 : AOP_I2S_BCLK ->
CFG_DISABLED, // 26 : AOP_I2S_LRCK ->
CFG_DISABLED, // 27 : AOP_I2S_DIN ->
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
};
const uint32_t *target_get_default_gpio_cfg(uint32_t gpioc)
{
switch (gpioc) {
case 0:
return gpio_default_cfg;
case 1:
return gpio_1_default_cfg;
default:
panic("unknown gpio controller %u", gpioc);
}
}
+353
View File
@@ -0,0 +1,353 @@
/*
* 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.
*/
#include <debug.h>
#include <stdint.h>
#include <drivers/apple/gpio.h>
#include <platform/soc/hwregbase.h>
static const uint32_t gpio_default_cfg[GPIO_GROUP_COUNT * GPIOPADPINS] = {
/* Port 0 */
CFG_DISABLED, // 0 : SPI1_SCLK ->
CFG_DISABLED, // 1 : SPI1_MOSI ->
CFG_DISABLED, // 2 : SPI1_MISO ->
CFG_DISABLED, // 3 : SPI1_SSIN ->
CFG_DISABLED, // 4 : ISP_I2C0_SDA ->
CFG_DISABLED, // 5 : ISP_I2C0_SCL ->
CFG_DISABLED, // 6 : ISP_I2C0_SDA ->
CFG_DISABLED, // 7 : ISP_I2C0_SCL ->
/* Port 1 */
CFG_DISABLED, // 8 : SENSOR0_ISTRB ->
CFG_DISABLED, // 9 : SENSOR0_RST ->
CFG_DISABLED, // 10 : SENSOR0_CLK ->
CFG_DISABLED, // 11 : SENSOR0_XSHUTDOWN ->
CFG_DISABLED, // 12 : SENSOR1_ISTRB ->
CFG_DISABLED, // 13 : SENSOR1_RST ->
CFG_DISABLED, // 14 : SENSOR1_CLK ->
CFG_DISABLED, // 15 : SENSOR1_XSHUTDOWN ->
/* Port 2 */
CFG_DISABLED, // 16 : GPIO[16] -> BOARD_ID[3]
CFG_DISABLED, // 17 : GPIO[17] ->
CFG_DISABLED, // 18 : GPIO[18] -> BOOT_CONFIG[0]
CFG_DISABLED, // 19 : I2S1_MCK ->
CFG_DISABLED, // 20 : I2S1_BLCK ->
CFG_DISABLED, // 21 : I2S1_LRCK ->
CFG_DISABLED, // 22 : I2S1_DIN ->
CFG_DISABLED, // 23 : I2S1_DOUT ->
/* Port 3 */
CFG_DISABLED, // 24 : NAND_SYS_CLK ->
CFG_DISABLED, // 25 : S3E0_RESETN ->
CFG_DISABLED, // 26 : S3E1_RESETN ->
CFG_DISABLED, // 27 : UART1_TXD ->
CFG_DISABLED, // 28 : UART1_RXD ->
CFG_DISABLED, // 29 : UART1_RTSN ->
CFG_DISABLED, // 30 : UART1_CTSN ->
CFG_DISABLED, // 31 : GPIO43 ->
/* Port 4 */
CFG_DISABLED, // 32 : I2S0_BCLK ->
CFG_DISABLED, // 33 : I2S0_LRCK ->
CFG_DISABLED, // 34 : I2S0_DIN ->
CFG_DISABLED, // 35 : I2S0_DOUT ->
CFG_DISABLED, // 36 : I2S0_MCK ->
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 5 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 6 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 7 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 8 */
CFG_DISABLED, // 64 : I2S4_MCK ->
CFG_DISABLED, // 65 : I2S4_BCLK ->
CFG_DISABLED, // 66 : I2S4_LRCK ->
CFG_DISABLED, // 67 : I2S4_DIN ->
CFG_DISABLED, // 68 : I2S4_DOUT ->
CFG_DISABLED, // 69 : I2S2_MCK ->
CFG_DISABLED, // 70 : I2S2_BCLK ->
CFG_DISABLED, // 71 : I2S2_LRCK ->
/* Port 9 */
CFG_DISABLED, // 72 : I2S2_DIN ->
CFG_DISABLED, // 73 : I2S2_DOUT ->
CFG_DISABLED, // 74 : GPIO[0] ->
CFG_DISABLED, // 75 : GPIO[1] ->
CFG_DISABLED, // 76 : GPIO[2] ->
CFG_DISABLED, // 77 : GPIO[3] ->
CFG_DISABLED, // 78 : GPIO[4] ->
CFG_DISABLED, // 79 : GPIO[5] ->
/* Port 10 */
CFG_DISABLED, // 80 : GPIO[6] ->
CFG_DISABLED, // 81 : GPIO[7] ->
CFG_DISABLED, // 82 : GPIO[8] ->
CFG_DISABLED, // 83 : GPIO[9] ->
CFG_DISABLED, // 84 : GPIO[10] ->
CFG_DISABLED, // 85 : GPIO[11] ->
CFG_DISABLED, // 86 : GPIO[12] ->
CFG_DISABLED, // 87 : GPIO[13] ->
/* Port 11 */
CFG_DISABLED, // 88 : GPIO[14] ->
CFG_DISABLED, // 89 : GPIO[15] ->
CFG_DISABLED, // 90 : UART3_TXD ->
CFG_DISABLED, // 91 : UART3_RXD ->
CFG_DISABLED, // 92 : UART3_RTSN ->
CFG_DISABLED, // 93 : UART3_CTSN ->
CFG_FUNC0, // 94 : SPI0_SCLK -> SPI0_SCLK/BOARD_ID[0]
CFG_FUNC0, // 95 : SPI0_MOSI -> SPI0_MOSI/BOARD_ID[1]
/* Port 12 */
CFG_FUNC0, // 96 : SPI0_MISO -> SPI0_MISO/BOARD_ID[2]
CFG_OUT_1, // 97 : SPI0_SSIN -> SPI0_CS
CFG_DISABLED, // 98 : PCIE_PERST0_N -> NAND_PERST
CFG_DISABLED, // 99 : PCIE_PERST1_N ->
CFG_DISABLED, // 100 : PCIE_PERST2_N ->
CFG_DISABLED, // 101 : PCIE_PERST3_N ->
CFG_DISABLED, // 102 : PCIE_PERST4_N ->
CFG_DISABLED, // 103 : PCIE_PERST5_N ->
/* Port 13 */
CFG_DISABLED, // 104 : PCIE_CLKREQ0_N -> NAND_CLKREQ
CFG_DISABLED, // 105 : PCIE_CLKREQ1_N ->
CFG_DISABLED, // 106 : PCIE_CLKREQ2_N ->
CFG_DISABLED, // 107 : PCIE_CLKREQ3_N ->
CFG_DISABLED, // 108 : PCIE_CLKREQ4_N ->
CFG_DISABLED, // 109 : PCIE_CLKREQ5_N ->
CFG_DISABLED, // 110 : UART2_TXD ->
CFG_DISABLED, // 111 : UART2_RXD ->
/* Port 14 */
CFG_DISABLED, // 112 : UART2_RTSN ->
CFG_DISABLED, // 113 : UART2_CTSN ->
CFG_DISABLED, // 114 : I2C3_SDA ->
CFG_DISABLED, // 115 : I2C3_SCL ->
CFG_DISABLED, // 116 : GPIO[44] ->
CFG_DISABLED, // 117 : GPIO[45] ->
CFG_DISABLED, // 118 : GPIO[46] ->
CFG_DISABLED, // 119 : GPIO[47] ->
/* Port 15 */
CFG_DISABLED, // 120 : GPIO[48] ->
CFG_DISABLED, // 121 : GPIO[49] ->
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 16 */
CFG_IN, // 128 : MENU_KEY_L -> REQUEST_DFU2
CFG_IN, // 129 : HOLD_KEY_L -> REQUEST_DFU1
CFG_DISABLED, // 130 : SKEY_L ->
CFG_DISABLED, // 131 : SWD_TMS2 ->
CFG_DISABLED, // 132 : SWD_TMS3 ->
CFG_DISABLED, // 133 : UART5_RTXD ->
CFG_DISABLED, // 134 : I2C2_SDA ->
CFG_DISABLED, // 135 : I2C2_SCL ->
/* Port 17 */
CFG_DISABLED, // 136 : UART4_TXD ->
CFG_DISABLED, // 137 : UART4_RXD ->
CFG_DISABLED, // 138 : UART4_RTSN ->
CFG_DISABLED, // 139 : UART4_CTSN ->
CFG_DISABLED, // 140 : UART7_TXD ->
CFG_DISABLED, // 141 : UART7_RXD ->
CFG_DISABLED, // 142 : CLK32K_OUT ->
CFG_DISABLED, // 143 : DP_WAKEUP0 ->
/* Port 18 */
CFG_DISABLED, // 144 : DP_WAKEUP0 ->
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 19 */
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
/* Port 20 */
CFG_DISABLED, // 160 : SPI2_SCLK ->
CFG_DISABLED, // 161 : SPI2_MOSI ->
CFG_DISABLED, // 162 : SPI2_MISO ->
CFG_DISABLED, // 163 : SPI2_SSIN ->
CFG_DISABLED, // 164 : I2C0_SDA ->
CFG_DISABLED, // 165 : I2C0_SCL ->
CFG_DISABLED, // 166 : SPI3_SCLK ->
CFG_DISABLED, // 167 : SPI3_MOSI ->
/* Port 21 */
CFG_DISABLED, // 168 : SPI3_MISO ->
CFG_DISABLED, // 169 : SPI3_SSIN ->
CFG_DISABLED, // 170 : UART0_TXD ->
CFG_DISABLED, // 171 : UART0_RXD ->
CFG_DISABLED, // 172 : UART6_TXD ->
CFG_DISABLED, // 173 : UART6_RXD ->
CFG_DISABLED, // 174 : TMR32_PWM0 ->
CFG_DISABLED, // 175 : TMR32_PWM1 ->
/* Port 22 */
CFG_DISABLED, // 176 : TMR32_PWM2 ->
CFG_DISABLED, // 177 : I2C1_SDA ->
CFG_DISABLED, // 178 : I2C1_SCL ->
CFG_DISABLED, // 179 : GPIO[19] ->
CFG_DISABLED, // 180 : GPIO[20] ->
CFG_DISABLED, // 181 : GPIO[21] ->
CFG_DISABLED, // 182 : GPIO[22] ->
CFG_DISABLED, // 183 : GPIO[23] ->
/* Port 23 */
CFG_DISABLED, // 184 : GPIO[24] ->
CFG_DISABLED, // 185 : GPIO[25] -> BOOT_CONFIG[1]
CFG_IN | PULL_DOWN, // 186 : GPIO[26] -> FORCE_DFU
CFG_DISABLED, // 187 : PSPI_MOSI ->
CFG_DISABLED, // 188 : DWI_DO ->
CFG_DISABLED, // 189 : PMGR_MISO ->
CFG_DISABLED, // 190 : PMGR_SCLK0 ->
CFG_DISABLED, // 191 : PMGR_SSCLK1 ->
/* Port 24 */
CFG_DISABLED, // 192 : DROOP ->
CFG_DISABLED, // 193 : SOCHOT1 ->
CFG_DISABLED, // 194 : EDP_HPD0 ->
CFG_DISABLED, // 195 : EDP_HPD1 ->
CFG_DISABLED, // 196 : I2S3_MCK ->
CFG_DISABLED, // 197 : I2S3_BCLK ->
CFG_DISABLED, // 198 : I2S3_LRCK ->
CFG_DISABLED, // 199 : I2S3_DOUT ->
/* Port 25 */
CFG_DISABLED, // 200 : I2S3_DIN ->
CFG_DISABLED | PULL_DOWN, // 201 : GPIO[27] -> DFU_STATUS
CFG_DISABLED, // 202 : GPIO[28] -> BOOT_CONFIG[2]
CFG_DISABLED, // 203 : GPIO[29] -> BOARD_ID[4]
CFG_DISABLED, // 204 : GPIO[30] ->
CFG_DISABLED, // 205 : GPIO[31] ->
CFG_DISABLED, // 206 : GPIO[32] ->
CFG_DISABLED, // 207 : GPIO[33] ->
/* Port 26 */
CFG_DISABLED, // 208 : GPIO[34] ->
CFG_DISABLED, // 209 : GPIO[35] ->
CFG_DISABLED, // 210 : GPIO[36] ->
CFG_DISABLED, // 211 : GPIO[37] ->
CFG_DISABLED, // 212 : GPIO[38] ->
CFG_DISABLED, // 213 : GPIO[39] ->
CFG_DISABLED, // 214 : GPIO[40] ->
CFG_DISABLED, // 215 : GPIO[41] ->
/* Port 27 */
CFG_DISABLED, // 216 : GPIO[42] ->
CFG_DISABLED, // 217 : TST_CLKOUT ->
CFG_DISABLED, // 218 : GPU_TRIGGER1 ->
CFG_DISABLED, // 219 : GPU_TRIGGER2 ->
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
};
static const uint32_t gpio_1_default_cfg[GPIO_1_GROUP_COUNT * GPIOPADPINS] = {
/* Port 0 */
CFG_DISABLED, // 0 : AOP_SPI_SCLK ->
CFG_DISABLED, // 1 : AOP_SPI_MOSI ->
CFG_DISABLED, // 2 : AOP_SPI_MISO ->
CFG_DISABLED, // 3 : AOP_UART1_TXD ->
CFG_DISABLED, // 4 : AOP_UART1_RXD ->
CFG_DISABLED, // 5 : AOP_UART0_TXD ->
CFG_DISABLED, // 6 : AOP_UART0_RXD ->
CFG_DISABLED, // 7 : AOP_UART2_TXD ->
/* Port 1 */
CFG_DISABLED, // 8 : AOP_UART2_RXD ->
CFG_DISABLED, // 9 : AOP_I2CM_SDA ->
CFG_DISABLED, // 10 : AOP_I2CM_SCL ->
CFG_DISABLED, // 11 : AOP_FUNC[0] ->
CFG_DISABLED, // 12 : AOP_FUNC[1] ->
CFG_DISABLED, // 13 : AOP_FUNC[2] ->
CFG_DISABLED, // 14 : AOP_FUNC[3] ->
CFG_DISABLED, // 15 : AOP_FUNC[4] ->
/* Port 2 */
CFG_DISABLED, // 16 : AOP_FUNC[5] ->
CFG_DISABLED, // 17 : AOP_FUNC[6] ->
CFG_DISABLED, // 18 : AOP_FUNC[7] ->
CFG_DISABLED, // 19 : AOP_FUNC[8] ->
CFG_DISABLED, // 20 : AOP_FUNC[9] ->
CFG_DISABLED, // 21 : AOP_SWD_TCK_OUT ->
CFG_DISABLED, // 22 : AOP_SWD_TMS0 ->
CFG_DISABLED, // 23 : AOP_SWD_TMS1 ->
/* Port 3 */
CFG_DISABLED, // 24 : AOP_I2S_MCK ->
CFG_DISABLED, // 25 : AOP_I2S_BCLK ->
CFG_DISABLED, // 26 : AOP_I2S_LRCK ->
CFG_DISABLED, // 27 : AOP_I2S_DIN ->
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
CFG_DISABLED,
};
const uint32_t *target_get_default_gpio_cfg(uint32_t gpioc)
{
switch (gpioc) {
case 0:
return gpio_default_cfg;
case 1:
return gpio_1_default_cfg;
default:
panic("unknown gpio controller %u", gpioc);
}
}
+46
View File
@@ -0,0 +1,46 @@
# Copyright (C) 2012-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.
#
LOCAL_DIR := $(GET_LOCAL_DIR)
TARGET_DIR := $(LOCAL_DIR)
# TBD - BUCK_*
OPTIONS += \
TARGET_BOOT_CPU_VOLTAGE=0 \
TARGET_BOOT_RAM_VOLTAGE=0 \
TARGET_BOOT_SOC_VOLTAGE=0 \
DCS_NUM_RANKS=1 \
AMP_CALIBRATION_SKIP=1 \
BUCK_CPU=0 \
BUCK_CPU_RAM=7 \
BUCK_SOC=2 \
BUCK_GPU=1 \
BUCK_GPU_RAM=8 \
WITH_CPU_APSC=1 \
WIFI_DTPATH=\"arm-io/wlan\"
ifeq ($(SUB_PLATFORM),s8001)
OPTIONS += \
DCS_NUM_CHANNELS=8 \
DISPLAY_LANDSCAPE_IPAD_TUNABLES=1
else
OPTIONS += \
DCS_NUM_CHANNELS=4
endif
GLOBAL_INCLUDES += $(LOCAL_DIR)/include
ALL_OBJS += $(LOCAL_DIR)/init.o
ifeq ($(SUB_PLATFORM),s8003)
ALL_OBJS += $(LOCAL_DIR)/pinconfig_s8000sim.o
else
ALL_OBJS += $(LOCAL_DIR)/pinconfig_$(SUB_TARGET).o
endif