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

+29
View File
@@ -0,0 +1,29 @@
/*
* 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.
*/
#include <drivers/display.h>
#include <lib/paint.h>
#include <platform.h>
#include <platform/memmap.h>
#include <target.h>
int display_get_info(struct display_info *info)
{
// Relatively sane defaults of 1136x640 @2x
info->stride = 640 * 4;
info->width = 640;
info->height = 1136;
// 32bpp and @2x scale
info->depth = 32 | 1 << 16;
info->framebuffer = (uintptr_t)PANIC_BASE - (((info->stride * info->height + 0xFFFUL) & ~0xFFFUL) * 3);
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
/*
* 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_GPIODEF_H
#define __TARGET_GPIODEF_H
/* iaccy1 specific gpio -> pin mappings */
#include <platform/gpio.h>
/* define target-specific gpios in a generic fashion here. */
#endif /* ! __TARGET_GPIODEF_H */
+97
View File
@@ -0,0 +1,97 @@
/*
* Copyright (C) 2011-2012 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_PINCONFIG_H
#define __TARGET_PINCONFIG_H
/* Default iAccy1 Hardware Pin Configuration */
/* Updated to match B137B165_io_pinlist_013.xls */
#if SUB_TARGET_B137
#define PCON_B137_B165(x, y) (PCON_##x)
#elif SUB_TARGET_B165
#define PCON_B137_B165(x, y) (PCON_##y)
#else
#error "Unknown subtarget"
#endif
static const struct gpio_default_config gpio_default_config[GPIO_GROUP_COUNT] = {
/* P0 */ PINCONFIG(
PCON_OUT_0, NO_PUPDN, // I2S0_MCK -> FORCE_PWM_3V3_L
PCON_OUT_1, NO_PUPDN, // I2S0_LRCK -> 5V_EN
PCON_IN, NO_PUPDN, // I2S0_BCK -> TRI_INT
PCON_B137_B165(DISABLE, OUT_1), NO_PUPDN, // I2S0_DOUT -> FORCE_PWM_1V8
PCON_OUT_1, NO_PUPDN, // I2S0_DIN -> FORCE_PWM_1V2
PCON_FUNC2, NO_PUPDN, // UART0_RXD ->
PCON_FUNC2, NO_PUPDN, // UART0_TXD ->
PCON_B137_B165(DISABLE, IN), NO_PUPDN // UART0_NRTS -> DAC_SENSE_STS
),
/* P1 */ PINCONFIG(
PCON_B137_B165(DISABLE, IN), NO_PUPDN, // UART0_NCTS -> DAC_HEARTBEAT
PCON_FUNC2, NO_PUPDN, // I2C0_SCL -> I2C0_SCL
PCON_FUNC2, NO_PUPDN, // I2C0_SDA -> I2C0_SCL
PCON_DISABLE, NO_PUPDN, // SPI0_CEN -> SPI0_CS
PCON_DISABLE, NO_PUPDN, // SPI0_CLK -> SPI0_CLK
PCON_DISABLE, NO_PUPDN, // SPI0_MOSI -> SPI0_MOSI
PCON_DISABLE, NO_PUPDN, // SPI0_MISO -> SPI0_MISO
PCON_DISABLE, NO_PUPDN // - ->
),
/* P2 */ PINCONFIG(
PCON_DISABLE, NO_PUPDN, // GPIO0 -> BOARD_REV[0]
PCON_DISABLE, NO_PUPDN, // GPIO1 -> BOOT_CONFIG[0]
PCON_DISABLE, NO_PUPDN, // GPIO2 -> BOOT_CONFIG[1]
PCON_DISABLE, NO_PUPDN, // GPIO3 -> BOARD_ID[1]
PCON_DISABLE, NO_PUPDN, // GPIO4 -> BOARD_ID[2]
PCON_DISABLE, NO_PUPDN, // GPIO5 -> BOARD_ID[3]
PCON_DISABLE, NO_PUPDN, // GPIO6 -> BOARD_ID[4]
PCON_DISABLE, NO_PUPDN // GPIO7 -> BOARD_REV[1]
),
/* P3 */ PINCONFIG(
PCON_DISABLE, NO_PUPDN, // CLK0_OUT -> G1_CLK0
PCON_DISABLE, NO_PUPDN, // CLK1_OUT ->
PCON_B137_B165(FUNC2, DISABLE), NO_PUPDN, // HDMI_HPD -> G1_HPD
PCON_DISABLE, NO_PUPDN, // HDMI_CEC -> G1_HDMI_CEC
PCON_DISABLE, NO_PUPDN, // FORCE_DFU -> FORCE_DFU
PCON_DISABLE, NO_PUPDN, // DFU_STATUS -> DFU_STATUS
PCON_FUNC2, NO_PUPDN, // I2C1_SCL -> G1_I2C1_SCL
PCON_FUNC2, NO_PUPDN // I2C1_SDA -> G1_I2C1_SDA
),
/* P4 */ PINCONFIG(
PCON_FUNC2, NO_PUPDN, // UART2_RXD -> G1_UART_RXFROMPOD
PCON_FUNC2, NO_PUPDN, // UART2_TXD -> G1_UART_TXTOPOD
PCON_DISABLE, NO_PUPDN, // UART2_NRTS ->
PCON_DISABLE, NO_PUPDN, // UART2_NCTS ->
PCON_DISABLE, NO_PUPDN, // SPI1_CEN ->
PCON_DISABLE, NO_PUPDN, // SPI1_CLK ->
PCON_DISABLE, NO_PUPDN, // SPI1_MOSI ->
PCON_DISABLE, NO_PUPDN // SPI1_MISO -> BOARD_REV[2]
),
/* P5 */ PINCONFIG(
PCON_FUNC2, NO_PUPDN, // UART1_RXD -> G1_UART_RXFROMACC
PCON_FUNC2, NO_PUPDN, // UART1_TXD -> G1_UART_TXTOACC
PCON_DISABLE, NO_PUPDN, // UART1_NRTS ->
PCON_B137_B165(DISABLE, OUT_1), NO_PUPDN, // UART1_NCTS -> DAC_RESETN
PCON_DISABLE, NO_PUPDN, // VGA_VDEN ->
PCON_DISABLE, NO_PUPDN, // VGA_HSYNC ->
PCON_DISABLE, NO_PUPDN, // VGA_VSYNC ->
PCON_DISABLE, NO_PUPDN // - ->
),
};
/* default push-pull/open-drain configuration */
#define DEFAULT_ODEN (0x00000007) // PoR Defaults
/* default drive strength */
#define DEFAULT_DSTR0 (0x00000555) // PoR Defaults
#define DEFAULT_OSC_DSTR (0x00000004)
#endif /* ! __TARGET_PINCONFIG_H */
+17
View File
@@ -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
+168
View File
@@ -0,0 +1,168 @@
/*
* Copyright (C) 2011-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 <drivers/power.h>
#include <lib/env.h>
#include <lib/mib.h>
#include <platform.h>
#include <platform/gpio.h>
#include <platform/gpiodef.h>
#include <platform/memmap.h>
#include <sys.h>
#include <sys/boot.h>
#include <sys/menu.h>
#include <sys/task.h>
#include <target.h>
MIB_CONSTANT(kMIBTargetAcceptGlobalTicket, kOIDTypeBoolean, true);
void target_init(void)
{
#if WITH_HW_FLASH_NOR
flash_nor_init(SPI_NOR0);
#endif
#if !RELEASE_BUILD
// <rdar://problem/10967375> API for B137 test harness to control G1 CLK0_OUT state
gpio_configure(GPIO_CLK0_OUT, GPIO_CFG_FUNC0);
#endif
}
void target_poweroff(void)
{
}
int target_bootprep(enum boot_target target)
{
switch (target) {
case BOOT_DARWIN: {
break;
}
default:
; // do nothing
}
return 0;
}
bool target_should_recover(void)
{
return 0;
}
bool target_should_poweron(bool *cold_button_boot)
{
return 1;
}
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
#if WITH_ENV
void target_setup_default_environment(void)
{
#if DEVELOPMENT_BUILD || DEBUG_BUILD
env_set("boot-args", "debug=0x14e serial=3 rd=md0", 0);
env_set("debug-uarts", "3", 0);
#else
env_set("boot-args", "rd=md0", 0);
#endif
env_set("auto-boot", "false", 0);
env_set("idle-off", "false", 0);
}
#endif // WITH_ENV
// Dummy function to make LIBENV happy.
int syscfgCopyDataForTag(u_int32_t tag, u_int8_t *buffer, size_t size) {
#pragma unused ( tag, buffer, size )
return -1;
}
#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;
}
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 */
+32
View File
@@ -0,0 +1,32 @@
# Copyright (C) 2007 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)
OPTIONS += \
TARGET_DREX_CLK_RATIO=2 \
TARGET_DREX_TIMING_AREF=0x0000005D \
TARGET_DREX_TIMING_ROW=0x34488611 \
TARGET_DREX_TIMING_DATA=0x36330306 \
TARGET_DREX_TIMING_POWER=0x50380335 \
TARGET_DREX_QOS_TIDEMARK=9 \
TARGET_DREX_QOS_ACCESS=12 \
TARGET_USB_DEVICE_SELF_POWERED=1 \
WITH_BRIEF_BOOT_BANNER=1
ifeq ($(APPLICATION),iBoot)
OPTIONS += \
DISABLE_CLEAR_MEMORY=1
endif
GLOBAL_INCLUDES += $(LOCAL_DIR)/include
ALL_OBJS += $(LOCAL_DIR)/init.o \
$(LOCAL_DIR)/display_get_info.o