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,251 @@
/*
* Copyright (C) 2010, 2014 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_DISPLAY_GAMMA_TABLES_H
#define __TARGET_DISPLAY_GAMMA_TABLES_H
/* K9x display gamma tables */
static const display_gamma_table k93a_display_gamma_tables[] =
{
{
0x00960C49, 0x00FFFF7F, // LGD P5 table V0
{
0x62, 0xca, 0x1d, 0xd0, 0x1d, 0x00, 0x00, 0x0d,
0x0d, 0x00, 0xc0, 0x1d, 0x77, 0xd3, 0x1d, 0x1c,
0xc7, 0x71, 0x1c, 0x00, 0x70, 0x00, 0x00, 0x00,
0x00, 0x00, 0xd0, 0x40, 0x03, 0x0d, 0x34, 0x34,
0x0d, 0x0d, 0x00, 0x1c, 0x77, 0xdc, 0x71, 0x1c,
0xc7, 0x71, 0xc7, 0xc1, 0x01, 0x70, 0xc0, 0x01,
0x07, 0xc0, 0x01, 0x40, 0x00, 0x1c, 0x00, 0x1c,
0x1c, 0xc7, 0xdd, 0x4d, 0xd3, 0x4d, 0x00, 0x00,
0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x04, 0x40, 0xc7, 0x01, 0xd0, 0xd0,
0x00, 0x00, 0x70, 0x77, 0x37, 0xdd, 0x74, 0xdc,
0x71, 0xdc, 0x1d, 0x07, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x00, 0x00, 0xd0, 0xd0, 0x40, 0x03, 0x0d,
0x4d, 0x43, 0x03, 0x1c, 0xc7, 0x1d, 0x77, 0x1c,
0x07, 0xc7, 0xc1, 0x71, 0x00, 0x70, 0x00, 0x70,
0x00, 0x00, 0x1c, 0xd0, 0x01, 0x00, 0x00, 0xc0,
0x01, 0x07, 0x77, 0x77, 0x77, 0x13, 0x07, 0x00,
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x04, 0x40, 0x77, 0x00, 0x40, 0x43,
0x03, 0x0d, 0x07, 0x07, 0xc7, 0x1d, 0x07, 0x07,
0x70, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0,
0x00, 0x0d, 0xd0, 0x34, 0x34, 0x0d, 0x4d, 0xd3,
0x0d, 0x0d, 0xc0, 0x71, 0x1c, 0xc7, 0x71, 0x70,
0x70, 0x1c, 0x1c, 0x00, 0x07, 0xc0, 0x01, 0x70,
0x00, 0x1c, 0x00, 0x01, 0x1c, 0x00, 0x1c, 0x77,
0xdc, 0x4d, 0x03, 0x0d, 0x00, 0x34, 0x4d, 0xd3,
0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
},
{
0x00950C49, 0x00FFFF7F, // LGD P6 table V0 (same as P5)
{
0x62, 0xca, 0x1d, 0xd0, 0x1d, 0x00, 0x00, 0x0d,
0x0d, 0x00, 0xc0, 0x1d, 0x77, 0xd3, 0x1d, 0x1c,
0xc7, 0x71, 0x1c, 0x00, 0x70, 0x00, 0x00, 0x00,
0x00, 0x00, 0xd0, 0x40, 0x03, 0x0d, 0x34, 0x34,
0x0d, 0x0d, 0x00, 0x1c, 0x77, 0xdc, 0x71, 0x1c,
0xc7, 0x71, 0xc7, 0xc1, 0x01, 0x70, 0xc0, 0x01,
0x07, 0xc0, 0x01, 0x40, 0x00, 0x1c, 0x00, 0x1c,
0x1c, 0xc7, 0xdd, 0x4d, 0xd3, 0x4d, 0x00, 0x00,
0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x04, 0x40, 0xc7, 0x01, 0xd0, 0xd0,
0x00, 0x00, 0x70, 0x77, 0x37, 0xdd, 0x74, 0xdc,
0x71, 0xdc, 0x1d, 0x07, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x00, 0x00, 0xd0, 0xd0, 0x40, 0x03, 0x0d,
0x4d, 0x43, 0x03, 0x1c, 0xc7, 0x1d, 0x77, 0x1c,
0x07, 0xc7, 0xc1, 0x71, 0x00, 0x70, 0x00, 0x70,
0x00, 0x00, 0x1c, 0xd0, 0x01, 0x00, 0x00, 0xc0,
0x01, 0x07, 0x77, 0x77, 0x77, 0x13, 0x07, 0x00,
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x04, 0x40, 0x77, 0x00, 0x40, 0x43,
0x03, 0x0d, 0x07, 0x07, 0xc7, 0x1d, 0x07, 0x07,
0x70, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0,
0x00, 0x0d, 0xd0, 0x34, 0x34, 0x0d, 0x4d, 0xd3,
0x0d, 0x0d, 0xc0, 0x71, 0x1c, 0xc7, 0x71, 0x70,
0x70, 0x1c, 0x1c, 0x00, 0x07, 0xc0, 0x01, 0x70,
0x00, 0x1c, 0x00, 0x01, 0x1c, 0x00, 0x1c, 0x77,
0xdc, 0x4d, 0x03, 0x0d, 0x00, 0x34, 0x4d, 0xd3,
0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
},
{
0x00970C49, 0x00FFFF7F, // LGD P3 table V0
{
0x62, 0xca, 0x04, 0x00, 0x71, 0x00, 0x40, 0x03,
0x0d, 0x00, 0x70, 0xdc, 0xdd, 0xdd, 0x1d, 0x07,
0x07, 0xc7, 0x01, 0xd7, 0x00, 0x00, 0x00, 0xd0,
0xd0, 0x40, 0x43, 0x37, 0xdd, 0x34, 0xdd, 0x74,
0x37, 0x0d, 0x00, 0xc7, 0x1d, 0x77, 0x1c, 0x1c,
0x1c, 0xc7, 0xc1, 0x01, 0x70, 0xc0, 0x01, 0x07,
0xc0, 0x01, 0x47, 0x07, 0x00, 0x1c, 0xc0, 0x1d,
0xc7, 0xdd, 0x40, 0x03, 0xd0, 0x40, 0x77, 0x77,
0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x74, 0xd0, 0x04, 0x07, 0x00, 0x0d,
0x00, 0x00, 0x70, 0x77, 0x77, 0xd3, 0xdd, 0x71,
0x70, 0x1c, 0xc7, 0x01, 0x00, 0x00, 0x00, 0x40,
0x03, 0x0d, 0x34, 0x74, 0xd3, 0x34, 0xdd, 0x74,
0x77, 0xd3, 0x00, 0xc7, 0x71, 0xc7, 0x71, 0x70,
0x70, 0x1c, 0x1c, 0x70, 0x00, 0x70, 0x00, 0x70,
0x00, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x70,
0x1c, 0x77, 0x37, 0x34, 0xd0, 0xd0, 0xdd, 0xdd,
0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x74, 0x0d, 0x1d, 0x07, 0xd0, 0x40,
0x03, 0x00, 0x00, 0x07, 0x1c, 0xc7, 0x01, 0xc0,
0x01, 0xc0, 0x01, 0x0d, 0x34, 0x00, 0x34, 0x4d,
0x37, 0x4d, 0xd3, 0xdd, 0xdd, 0xdd, 0x1d, 0x77,
0x37, 0x7d, 0x70, 0x1c, 0x1c, 0xc7, 0x01, 0x07,
0x1c, 0x1c, 0x00, 0x1c, 0xc0, 0x01, 0x1c, 0xc0,
0x01, 0x1c, 0x1d, 0x00, 0x70, 0x70, 0xdc, 0x4d,
0x37, 0x00, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c,
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
},
{
0x00E40C49, 0x00FFFF7F, // Samsung 6mask table V0
{
0x62, 0xca, 0x74, 0xd0, 0x04, 0x07, 0x00, 0x0d,
0xd0, 0x00, 0x1c, 0x1c, 0x1c, 0x77, 0x70, 0x00,
0x00, 0x00, 0x00, 0x4d, 0x43, 0x43, 0x43, 0xd3,
0x40, 0x03, 0x0d, 0x34, 0x00, 0x0d, 0x00, 0x34,
0x00, 0x00, 0x34, 0x00, 0x34, 0x00, 0x1c, 0x70,
0x70, 0x1c, 0x1c, 0x07, 0xc7, 0x71, 0x77, 0x77,
0xd3, 0x74, 0xd3, 0x01, 0x00, 0x00, 0x40, 0x43,
0x77, 0x77, 0x77, 0x07, 0xc7, 0xc1, 0x41, 0x43,
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x04, 0x00, 0x1d, 0xb0, 0x32, 0x00,
0x0d, 0x40, 0x1f, 0x70, 0xdc, 0x71, 0xc7, 0x01,
0x1c, 0x00, 0x07, 0x40, 0x43, 0x03, 0x34, 0x40,
0x03, 0x0d, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x70,
0x70, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, 0x77,
0x77, 0xd3, 0x4d, 0x77, 0x07, 0x00, 0x00, 0xd0,
0x74, 0x77, 0x1c, 0x07, 0x1c, 0x00, 0xd0, 0xdd,
0x71, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x74, 0x00, 0xdd, 0x01, 0x00, 0x00,
0x34, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x34,
0x40, 0x03, 0x74, 0x37, 0xdd, 0x74, 0x37, 0xdd,
0x34, 0x4d, 0xd3, 0xd0, 0x40, 0x43, 0x03, 0x0d,
0xd0, 0x40, 0x03, 0x0d, 0x34, 0x1c, 0xc0, 0x01,
0x07, 0x1c, 0x1c, 0x1c, 0x1c, 0x77, 0x37, 0xdd,
0x4d, 0x77, 0x07, 0x00, 0x00, 0x00, 0x40, 0xd3,
0x34, 0x34, 0xdd, 0x34, 0x4d, 0xd3, 0x34, 0xdd,
0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
},
{
0x00E30C49, 0x00FFFF7F, // Samsung 5mask table V0
{
0x22, 0xce, 0x4d, 0x07, 0xd0, 0x74, 0x1c, 0x1c,
0x1c, 0x1c, 0xd3, 0xdd, 0xdd, 0x34, 0xdd, 0x74,
0x07, 0x1c, 0x1c, 0x1c, 0x00, 0x0d, 0xd0, 0x00,
0x34, 0x0d, 0x0d, 0x34, 0xd0, 0x40, 0x03, 0x34,
0xd0, 0x40, 0x03, 0x34, 0x34, 0x0d, 0x0d, 0x00,
0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0xc0, 0x71,
0x1c, 0x77, 0xc7, 0x1d, 0x00, 0xd0, 0x00, 0x4d,
0x07, 0x07, 0x1c, 0x00, 0x00, 0x00, 0xd0, 0x1d,
0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x22, 0xce, 0x4d, 0x07, 0x40, 0x77, 0x07, 0x07,
0xc7, 0x71, 0x37, 0xdd, 0x74, 0xd3, 0x34, 0x74,
0xc7, 0xc1, 0x71, 0x07, 0x07, 0x0d, 0x00, 0x40,
0x03, 0x34, 0x40, 0x03, 0xd0, 0x00, 0x0d, 0x00,
0x0d, 0xd0, 0x00, 0x34, 0xd0, 0xd0, 0x40, 0x03,
0x00, 0x07, 0xc0, 0x01, 0x00, 0x1c, 0x00, 0x07,
0xc7, 0x1d, 0x77, 0xdc, 0x41, 0x43, 0x43, 0xd3,
0x71, 0x00, 0x1c, 0x00, 0x0d, 0xd0, 0xc4, 0x01,
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x22, 0xce, 0x0d, 0x01, 0x40, 0x13, 0x77, 0x70,
0xc0, 0xc1, 0x1d, 0xc7, 0x71, 0xc7, 0xdd, 0x71,
0x00, 0x00, 0x07, 0x00, 0x4d, 0xd3, 0xd0, 0x34,
0x4d, 0x37, 0x4d, 0xd3, 0x34, 0x34, 0x34, 0x4d,
0x43, 0xd3, 0xd0, 0x74, 0xd3, 0x34, 0x00, 0x00,
0x00, 0x70, 0x00, 0x00, 0x00, 0x07, 0x70, 0xdc,
0x1d, 0x77, 0x07, 0x00, 0x00, 0x0d, 0xd0, 0x74,
0xdc, 0xdd, 0x1d, 0x77, 0xdc, 0x71, 0x1c, 0x77,
0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
},
{
0x00890C49, 0x00FFFF7F, // CMI T1 table V0
{
0x62, 0xca, 0x01, 0x74, 0x00, 0xd0, 0xdd, 0x1d,
0x77, 0x4c, 0x43, 0x03, 0x40, 0xd3, 0xdd, 0xdd,
0x1d, 0xc7, 0xc1, 0x1d, 0xc7, 0x71, 0x77, 0x77,
0x77, 0xd3, 0x34, 0x0d, 0x0d, 0x0d, 0x34, 0xd0,
0x00, 0x34, 0x00, 0x70, 0x70, 0xc7, 0x71, 0xdc,
0x1d, 0x77, 0x77, 0x77, 0x43, 0x03, 0xd0, 0x00,
0xd0, 0x74, 0x1c, 0x77, 0xdc, 0xc1, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x40, 0x03, 0x4d, 0xd3,
0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x01, 0x74, 0x00, 0xd0, 0x74, 0xdc,
0x71, 0xd3, 0x34, 0x00, 0xd0, 0xd0, 0xdd, 0xdd,
0xdd, 0x1d, 0x1c, 0xc7, 0x1d, 0xc7, 0xdd, 0xdd,
0xdd, 0x74, 0x43, 0xd3, 0x34, 0x34, 0x34, 0x40,
0x03, 0x34, 0x00, 0xc0, 0x71, 0x1c, 0xc7, 0x71,
0xc7, 0xdd, 0x1d, 0x37, 0x0d, 0x34, 0x40, 0x03,
0xd0, 0x74, 0x1c, 0x77, 0x1c, 0x07, 0x00, 0x07,
0x00, 0x00, 0x00, 0x34, 0x00, 0x40, 0xd3, 0x34,
0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x62, 0xca, 0x01, 0x74, 0x00, 0xd0, 0x74, 0xdc,
0x71, 0x77, 0xd3, 0xd0, 0xd0, 0x74, 0xdc, 0x1d,
0x77, 0x70, 0x70, 0x70, 0x1c, 0x1c, 0x77, 0xdc,
0xdd, 0x4d, 0x37, 0x4d, 0xd3, 0x34, 0x34, 0x0d,
0x0d, 0x34, 0x00, 0x70, 0x1c, 0x07, 0xc7, 0x1d,
0xc7, 0x1d, 0x77, 0x37, 0x34, 0xd0, 0x00, 0x0d,
0x74, 0xc7, 0x71, 0xc7, 0x71, 0x00, 0x07, 0x00,
0x1c, 0x00, 0x70, 0x00, 0x1c, 0x00, 0xc0, 0x01,
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
},
{
0x00900C49, 0x00FFFF7F, // CMI T1x table V0
{
0x26, 0x11, 0x07, 0xd0, 0x1d, 0x00, 0x00, 0xdd,
0xdd, 0xc1, 0x01, 0x07, 0x1c, 0x1c, 0xc7, 0xdd,
0x34, 0x34, 0xd0, 0x00, 0x0d, 0x34, 0x00, 0x0d,
0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00,
0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x1c,
0x00, 0x00, 0x00, 0x70, 0xc0, 0xc1, 0xc1, 0xc1,
0xc1, 0x71, 0x1c, 0x77, 0xdc, 0x71, 0x1c, 0x07,
0xc7, 0x71, 0x70, 0x1c, 0x1c, 0x40, 0x1c, 0x70,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x26, 0xd1, 0x1d, 0xd0, 0x74, 0x1c, 0x00, 0x34,
0x4d, 0xc7, 0x1d, 0xc7, 0x1d, 0x77, 0x77, 0xd3,
0xd0, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x07, 0x70,
0xc0, 0x01, 0x00, 0x07, 0x70, 0x00, 0x07, 0xc0,
0x01, 0x1c, 0xc0, 0x01, 0x07, 0x1c, 0xc7, 0x71,
0x1c, 0x77, 0xdc, 0x1d, 0x77, 0x77, 0x77, 0xc7,
0xdd, 0x71, 0x77, 0xdc, 0x71, 0xc7, 0x1d, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x26, 0x41, 0x77, 0x00, 0x74, 0x77, 0x00, 0x00,
0x40, 0xd3, 0x4d, 0x77, 0x37, 0xdd, 0x34, 0x0d,
0x40, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0xc0,
0x01, 0x70, 0x00, 0x1c, 0x70, 0xc0, 0xc1, 0x71,
0x1c, 0xc7, 0xc1, 0xc1, 0x71, 0x1c, 0xc7, 0xc1,
0x71, 0x1c, 0x1c, 0x77, 0x1c, 0x77, 0xdc, 0xdd,
0x31, 0xdd, 0xdd, 0x4d, 0x37, 0x4d, 0x43, 0xd3,
0x34, 0x4d, 0xd3, 0xd0, 0x34, 0x34, 0x34, 0x34,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
},
};
#endif
+40
View File
@@ -0,0 +1,40 @@
/*
* 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
/* K93a specific gpio -> pin mappings */
#include <platform/gpio.h>
/* define target-specific gpios in a generic fashion here. */
#define GPIO_LCD_RST GPIO(16, 0)
#define GPIO_LCD_RST_POLARITY (0)
#define GPIO_LCD_PWR_EN GPIO(16, 1)
#define GPIO_RINGER_AB GPIO( 0, 4)
#define POWER_GPIO_BATTERY_SWI (5)
#define POWER_GPIO_BATTERY_SWI_CONFIG_OUTPUT 0x0B
#define POWER_GPIO_BATTERY_SWI_CONFIG_INPUT 0xD8
/* Board Revision */
#define GPIO_BOARD_REV0 GPIO( 4, 5)
#define GPIO_BOARD_REV1 GPIO( 4, 6)
#define GPIO_BOARD_REV2 GPIO( 4, 7)
/* which IICs to initialize */
#define IICS_MASK (7)
/* D1946 watchdog tickle, 'KEEPACT' */
#define GPIO_WDOG_TICKLE GPIO(2, 3)
#endif /* ! __TARGET_GPIODEF_H */
@@ -0,0 +1,92 @@
// 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[] =
{
};
// =============================================================================
// Nand Timing Table
static NandTiming _nandTimingTable[] =
{
};
#if (defined (AND_ENABLE_NAND_DESCRIPTION_TEXT) || AND_ENABLE_NAND_DESCRIPTION_TEXT)
// =============================================================================
// NandChipId Description
const NandChipIdDescription _nandChipIdDescriptionTable[] =
{
};
// =============================================================================
// Nand Description Table
static const NandDescription _nandDescriptionTable[] =
{
};
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[] =
{
};
// =============================================================================
// 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 */
{
0x00000101
},
/* useToggleMode */ FALSE32,
/* useDiffDQSMode */ FALSE32,
/* useDiffREMode */ FALSE32,
/* useVref */ FALSE32,
/* useSingleHostChannel */ FALSE32,
/* allowSingleChipEnable */ FALSE32
};
static NandFormat _nandFormatPpn =
{
/* metaPerLogicalPage */ 16,
/* validMetaPerLogicalPage */ 16,
/* logicalPageSize */ 4096
};
static NandFormat _nandFormatRaw =
{
/* metaPerLogicalPage */ 12,
/* validMetaPerLogicalPage */ 10,
/* logicalPageSize */ 0
};
+334
View File
@@ -0,0 +1,334 @@
/*
* Copyright (C) 2009-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.
*/
/* Default K93a SoC Pin Configuration */
/* Same drive strength for AP and DEV */
#define AUD_SPKRAMP_MUTE_L_DRIVE_STR DRIVE_X1
#define DFU_STATUS_DRIVE_STR DRIVE_X1
#define DWI_DRIVE_STR DRIVE_X2
#define FMI_DRIVE_STR DRIVE_X1 // SecureROM is X2
#define GRAPE_DRIVE_STR DRIVE_X1
#define MLC_DRIVE_STR DRIVE_X1
#define PM_BT_WAKE_DRIVE_STR DRIVE_X2
#define PM_CAM_SHUTDOWN_DRIVE_STR DRIVE_X1
#define CLK_CAM_DRIVE_STR DRIVE_X3
#define PM_KEEPACT_DRIVE_STR DRIVE_X1
#define RST_PMU_IN_DRIVE_STR DRIVE_X1
#define SDIO_WL_DRIVE_STR DRIVE_X1
#define VIDEO_AMP_EN_DRIVE_STR DRIVE_X1
#define I2C_DRIVE_STR DRIVE_X2
#define UART_5_DRIVE_STR DRIVE_X2
#define I2S_DRIVE_STR DRIVE_X2
#define I2S_MCK_DRIVE_STR DRIVE_X3
#define SPI_CS_DRIVE_STR DRIVE_X1
#define SPI_DATA_DRIVE_STR DRIVE_X2
/* Different drive strength for AP and DEV. // AP DEV */
#if PIN_CFG_AP
#define BT_UART_DRIVE_STR DRIVE_X2 // X2 X3
#define UART_0_DRIVE_STR DRIVE_X1 // X2 X3
#else
#define BT_UART_DRIVE_STR DRIVE_X3 // X2 X3
#define UART_0_DRIVE_STR DRIVE_X2 // X2 X2
#endif
#define FMI_SLEW_RATE SLEW_RATE_SLOW
#if PIN_CFG_AP
static const u_int32_t gpio_default_cfg_ap[GPIO_GROUP_COUNT * GPIOPADPINS] = {
#elif PIN_CFG_DEV
static const u_int32_t gpio_default_cfg_dev[GPIO_GROUP_COUNT * GPIOPADPINS] = {
#endif
/* Port 0 */
CFG_IN, // GPIO0 -> MENU_KEY (REQUEST_DFU2)
CFG_IN, // GPIO1 -> HOLD_KEY (REQUEST_DFU1)
CFG_IN | PULL_UP, // GPIO2 -> AUD_VOL_UP_L
CFG_IN | PULL_UP, // GPIO3 -> AUD_VOL_DOWN_L
CFG_IN, // GPIO4 -> SRL_L
CFG_OUT_0 | AUD_SPKRAMP_MUTE_L_DRIVE_STR, // GPIO5 -> AUD_SPKRAMP_MUTE_L
CFG_DISABLED, // GPIO6 ->
CFG_OUT_0 | PM_BT_WAKE_DRIVE_STR, // GPIO7 -> PM_BT_WAKE
/* Port 1 */
CFG_DISABLED, // GPIO8 ->
CFG_DISABLED, // GPIO9 ->
CFG_DISABLED, // GPIO10 ->
CFG_DISABLED, // GPIO11 ->
CFG_DISABLED, // GPIO12 ->
CFG_IN | PULL_UP, // GPIO13 -> IRQ_PMU_L
CFG_OUT_1 | GRAPE_DRIVE_STR, // GPIO14 -> GRAPE_FW_DNLD_EN_L
CFG_IN | PULL_UP, // GPIO15 -> IRQ_CODEC_L
/* Port 2 */
CFG_DISABLED, // GPIO16 -> BOARD_ID_3
CFG_IN | PULL_DOWN, // GPIO17 -> IRQ_GYRO_INT2
CFG_DISABLED, // GPIO18 -> BOOT_CONFIG_0
CFG_OUT_0 | PM_KEEPACT_DRIVE_STR, // GPIO19 -> PM_KEEPACT
CFG_DISABLED, // GPIO20 ->
CFG_DISABLED, // GPIO21 ->
CFG_OUT_0 | GRAPE_DRIVE_STR, // GPIO22 -> RST_GRAPE_L
CFG_DISABLED, // GPIO23 ->
/* Port 3 */
CFG_DISABLED, // GPIO24 ->
CFG_DISABLED, // GPIO25 -> BOOT_CONFIG_1
CFG_IN | PULL_DOWN, // GPIO26 -> FORCE_DFU
CFG_OUT_0 | DFU_STATUS_DRIVE_STR | PULL_DOWN, // GPIO27 -> DFU_STATUS
CFG_DISABLED, // GPIO28 -> BOOT_CONFIG_2
CFG_DISABLED, // GPIO29 -> BOOT_CONFIG_3
CFG_DISABLED, // GPIO30 ->
CFG_DISABLED, // GPIO31 ->
/* Port 4 */
CFG_DISABLED, // GPIO32 ->
CFG_IN | PULL_DOWN, // GPIO33 -> IRQ_GYRO_INT1
CFG_IN | PULL_UP, // GPIO34 -> IRQ_ALS_INT_L
CFG_IN | PULL_UP, // GPIO35 -> IRQ_ACCEL_INT2_L
CFG_IN | PULL_UP, // GPIO36 -> IRQ_ACCEL_INT1_L
CFG_DISABLED, // EHCI_PORT_PWR[0] -> AP_GPIO37_BRD_REV0
CFG_DISABLED, // EHCI_PORT_PWR[1] -> AP_GPIO38_BRD_REV1
CFG_DISABLED, // EHCI_PORT_PWR[2] -> AP_GPIO39_BRD_REV2
/* Port 5 */
CFG_DISABLED, // UART1_TXD ->
CFG_DISABLED, // UART1_RXD ->
CFG_DISABLED, // UART1_RTSN ->
CFG_DISABLED, // UART1_CTSN ->
CFG_DISABLED, // UART2_TXD ->
CFG_DISABLED, // UART2_RXD ->
CFG_DISABLED, // UART2_RTSN ->
CFG_DISABLED, // UART2_CTSN ->
/* Port 6 */
CFG_FUNC0 | BT_UART_DRIVE_STR, // UART3_TXD -> UART_3_TXD
CFG_FUNC0, // UART3_RXD -> UART_3_RXD
CFG_OUT_1 | BT_UART_DRIVE_STR, // UART3_RTSN -> UART_3_RTS_L
CFG_FUNC0, // UART3_CTSN -> UART_3_CTS_L
CFG_FUNC0 | I2C_DRIVE_STR, // I2C0_SDA -> I2C0_SDA_1V8
CFG_FUNC0 | I2C_DRIVE_STR, // I2C0_SCL -> I2C0_SCL_1V8
CFG_DISABLED, // I2C1_SDA -> I2C1_SDA_1V8
CFG_DISABLED, // I2C1_SCL -> I2C1_SCL_1V8
/* Port 7 */
CFG_FUNC0 | I2C_DRIVE_STR, // ISP0_SDA -> ISP_AP_0_SDA
CFG_FUNC0 | I2C_DRIVE_STR, // ISP0_SCL -> ISP_AP_0_SCL
CFG_FUNC0 | I2C_DRIVE_STR, // ISP1_SDA -> ISP_AP_1_SDA
CFG_FUNC0 | I2C_DRIVE_STR, // ISP1_SCL -> ISP_AP_1_SCL
CFG_DISABLED, // UART5_TXD/MIPI_VSYNC ->
CFG_DISABLED, // TMR32_PWM0 ->
CFG_DISABLED, // TMR32_PWM1 ->
CFG_DISABLED, // TMR32_PWM2 ->
/* Port 8 */
CFG_DISABLED, // SWI_DATA ->
CFG_FUNC0 | PULL_DOWN, // DWI_DI -> DWI_AP_DI
CFG_FUNC0 | DWI_DRIVE_STR, // DWI_DO -> DWI_AP_DO
CFG_FUNC0 | DWI_DRIVE_STR, // DWI_CLK -> DWI_AP_CLK
CFG_OUT_0 | PM_CAM_SHUTDOWN_DRIVE_STR, // SENSOR0_RST -> PM_REAR_CAM_SHUTDOWN_L
CFG_OUT_0 | CLK_CAM_DRIVE_STR, // SENSOR0_CLK -> CLK_CAM_RF
CFG_OUT_1 | PM_CAM_SHUTDOWN_DRIVE_STR, // SENSOR1_RST -> PM_FRONT_CAM_SHUTDOWN
CFG_OUT_0 | CLK_CAM_DRIVE_STR, // SENSOR1_CLK -> CLK_CAM_FF
/* Port 9 */
CFG_DISABLED, // ISP0_PRE_FLASH ->
CFG_DISABLED, // ISP0_FLASH ->
CFG_DISABLED, // ISP1_PRE_FLASH ->
CFG_DISABLED, // ISP1_FLASH ->
CFG_FUNC0 | I2S_MCK_DRIVE_STR, // I2S0_MCK -> I2S_AP_0_MCK
CFG_FUNC0 | I2S_DRIVE_STR, // I2S0_LRCK -> I2S_AP_0_LRCK
CFG_FUNC0 | I2S_DRIVE_STR, // I2S0_SCLK -> I2S_AP_0_BCLK
CFG_FUNC0 | I2S_DRIVE_STR, // I2S0_DOUT -> I2S_AP_0_DOUT
/* Port 10 */
CFG_FUNC0, // I2S0_DIN -> I2S_AP_0_DIN
CFG_DISABLED, // I2S1_MCK ->
CFG_DISABLED, // I2S1_LRCK ->
CFG_DISABLED, // I2S1_SCLK ->
CFG_DISABLED, // I2S1_DOUT ->
CFG_DISABLED, // I2S1_DIN ->
CFG_DISABLED, // I2S2_MCK ->
CFG_FUNC0 | I2S_DRIVE_STR, // I2S2_LRCK -> I2S_AP_2_LRCK
/* Port 11 */
CFG_FUNC0 | I2S_DRIVE_STR, // I2S2_BCLK -> I2S_AP_2_BCLK
CFG_FUNC0 | I2S_DRIVE_STR, // I2S2_DOUT -> I2S_AP_2_DOUT
CFG_FUNC0, // I2S2_DIN -> I2S_AP_2_DIN
CFG_DISABLED, // I2S2_MCK ->
CFG_FUNC0 | I2S_DRIVE_STR, // I2S3_LRCK -> I2S_AP_3_LRCK
CFG_FUNC0 | I2S_DRIVE_STR, // I2S3_BCLK -> I2S_AP_3_BCLK
CFG_FUNC0 | I2S_DRIVE_STR, // I2S3_DOUT -> I2S_AP_3_DOUT
CFG_FUNC0, // I2S3_DIN -> I2S_AP_3_DIN
/* Port 12 */
CFG_DISABLED, // SPI0_SCLK -> BOARD_ID_0_SPI_FLASH_CLK
CFG_DISABLED, // SPI0_MOSI -> BOARD_ID_1_SPI_FLASH_DIN
CFG_DISABLED, // SPI0_MISO -> BOARD_ID_2_SPI_FLASH_DOUT
CFG_DISABLED | PULL_UP, // SPI0_SSIN ->
CFG_FUNC0 | SPI_DATA_DRIVE_STR, // SPI1_SCLK -> SPI_GRAPE_SCLK
CFG_FUNC0 | SPI_DATA_DRIVE_STR, // SPI1_MOSI -> SPI_GRAPE_MOSI
CFG_FUNC0, // SPI1_MISO -> SPI_GRAPE_MISO
CFG_OUT_1 | SPI_CS_DRIVE_STR, // SPI1_SSIN -> SPI_GRAPE_CS_L
/* Port 13 */
CFG_DISABLED, // SPI2_SCLK ->
CFG_DISABLED, // SPI2_MOSI ->
CFG_DISABLED, // SPI2_MISO ->
CFG_DISABLED, // SPI2_SSIN ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
/* Port 14 */
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
/* Port 15 */
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
/* Port 16 */
CFG_OUT_0 | MLC_DRIVE_STR, // UART4_TXD -> RST_MLC_L
CFG_OUT_0 | MLC_DRIVE_STR, // UART4_RXD -> PM_MLC_PWR_EN
CFG_OUT_0 | VIDEO_AMP_EN_DRIVE_STR, // UART4_RTSN -> VIDEO_AMP_EN
CFG_IN | PULL_UP, // UART4_CTSN -> IRQ_GRAPE_HOST_INT_L
CFG_FUNC0 | SDIO_WL_DRIVE_STR | PULL_UP, // SDIO0_DATA3 -> SDIO_WL_DATA<3>
CFG_FUNC0 | SDIO_WL_DRIVE_STR | PULL_UP, // SDIO0_DATA2 -> SDIO_WL_DATA<2>
CFG_FUNC0 | SDIO_WL_DRIVE_STR | PULL_UP, // SDIO0_DATA1 -> SDIO_WL_DATA<1>
CFG_FUNC0 | SDIO_WL_DRIVE_STR | PULL_UP, // SDIO0_DATA0 -> SDIO_WL_DATA<0>
/* Port 17 */
CFG_FUNC0 | SDIO_WL_DRIVE_STR | PULL_UP, // SDIO0_CMD -> SDIO_WL_CMD
CFG_FUNC0 | SDIO_WL_DRIVE_STR, // SDIO0_CLK ->
CFG_FUNC0 | FMI_DRIVE_STR, // FMI0_CEN3 -> F0CE3_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI0_CEN2 -> F0CE2_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI0_CEN1 -> F0CE1_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI0_CEN0 -> F0CE0_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI0_CLE -> F0CLE
CFG_FUNC0 | FMI_DRIVE_STR, // FMI0_ALE -> F0ALE
/* Port 18 */
CFG_FUNC0 | FMI_DRIVE_STR, // FMI0_REN -> F0RE_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI0_WEN -> F0WE_L
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI0_IO7 -> F0AD<7>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI0_IO6 -> F0AD<6>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI0_IO5 -> F0AD<5>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI0_IO4 -> F0AD<4>
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 | PULL_DOWN, // FMI0_DQS ->
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI0_IO3 -> F0AD<3>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI0_IO2 -> F0AD<2>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI0_IO1 -> F0AD<1>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI0_IO0 -> F0AD<0>
CFG_FUNC0 | FMI_DRIVE_STR, // FMI1_CEN3 -> F1CE3_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI1_CEN2 -> F1CE2_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI1_CEN1 -> F1CE1_L
/* Port 21 */
CFG_FUNC0 | FMI_DRIVE_STR, // FMI1_CEN0 -> F1CE0_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI1_CLE -> F1CLE
CFG_FUNC0 | FMI_DRIVE_STR, // FMI1_ALE -> F1ALE
CFG_FUNC0 | FMI_DRIVE_STR, // FMI1_REN -> F1RE_L
CFG_FUNC0 | FMI_DRIVE_STR, // FMI1_WEN -> F1WE_L
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI1_IO7 -> F1AD<7>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI1_IO6 -> F1AD<6>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI1_IO5 -> F1AD<5>
/* Port 22 */
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI1_IO4 -> F1AD<4>
CFG_DISABLED | PULL_DOWN, // FMI1_DQS ->
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI1_IO3 -> F1AD<3>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI1_IO2 -> F1AD<2>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI1_IO1 -> F1AD<1>
CFG_FUNC0 | BUS_HOLD | FMI_DRIVE_STR, // FMI1_IO0 -> F1AD<0>
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_FUNC0 | I2C_DRIVE_STR, // I2C2_SDA -> I2C2_SDA_1V8
CFG_FUNC0 | I2C_DRIVE_STR, // I2C2_SCL -> I2C2_SCL_1V8
CFG_FUNC0 | UART_0_DRIVE_STR, // UART0_TXD -> UART_0_TXD
CFG_FUNC0 | UART_0_DRIVE_STR, // UART0_RXD -> UART_0_RXD
CFG_FUNC0 | UART_5_DRIVE_STR, // UART5_RTXD -> UART_5_RTXD
CFG_FUNC0, // DP_HPD -> DP_AP_HPD
CFG_DISABLED, // TST_CLKOUT -> TP_AP_TST_CLKOUT
CFG_DISABLED, // TST_STPCLK ->
/* Port 25 */
CFG_FUNC0 | RST_PMU_IN_DRIVE_STR, // WDOG -> RST_PMU_IN
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
CFG_DISABLED, // ->
};
#undef AUD_SPKRAMP_MUTE_L_DRIVE_STR
#undef DFU_STATUS_DRIVE_STR
#undef DWI_DRIVE_STR
#undef FMI_DRIVE_STR
#undef GRAPE_DRIVE_STR
#undef MLC_DRIVE_STR
#undef PM_BT_WAKE_DRIVE_STR
#undef PM_CAM_SHUTDOWN_DRIVE_STR
#undef CLK_CAM_DRIVE_STR
#undef PM_KEEPACT_DRIVE_STR
#undef RST_PMU_IN_DRIVE_STR
#undef SDIO_WL_DRIVE_STR
#undef VIDEO_AMP_EN_DRIVE_STR
#undef I2C_DRIVE_STR
#undef UART_5_DRIVE_STR
#undef I2S_DRIVE_STR
#undef I2S_MCK_DRIVE_STR
#undef SPI_CS_DRIVE_STR
#undef SPI_DATA_DRIVE_STR
#undef BT_UART_DRIVE_STR
#undef UART_0_DRIVE_STR
#undef FMI_SLEW_RATE
+185
View File
@@ -0,0 +1,185 @@
/*
* Copyright (C) 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.
*/
#ifndef __TARGET_POWERCONFIG_H
#define __TARGET_POWERCONFIG_H
#include <drivers/gasgauge.h>
/* configuration per target */
#define PMU_IIC_BUS 0
/* this configuration is very PMU specific and must be included exactly once in power.c */
#ifdef POWERCONFIG_PMU_SETUP
static const struct pmu_setup_struct pmu_ldo_warm_setup[] =
{
{ PMU_IIC_BUS, kDIALOG_LDO_CONTROL, 0x00 }, // Force bypass off
{ PMU_IIC_BUS, kD1946_LDO1, 0x0A }, // PP3V0_GRAPE 3.00V
{ PMU_IIC_BUS, kD1946_LDO2, 0x0A }, // PP1V7_VA_VCP 1.70V
{ PMU_IIC_BUS, kD1946_LDO3, 0x0A }, // PP3V0_VIDEO 3.00V
{ PMU_IIC_BUS, kD1946_LDO4, 0x18 }, // PP3V0_OPTICAL 3.00V
{ PMU_IIC_BUS, kD1946_LDO5, 0x0E }, // PP3V2_SD 3.20V
{ PMU_IIC_BUS, kD1946_LDO6, 0x10 }, // PP3V3_ACC 3.30V
{ PMU_IIC_BUS, kD1946_LDO7, 0x03 }, // PP1V8_VIDEO 1.80V
{ PMU_IIC_BUS, kD1946_LDO8, 0x18 }, // PP3V2_S2R_USBMUX 3.20V
{ PMU_IIC_BUS, kD1946_LDO9, 0x12 }, // PP3V0_IO 3.00V
{ PMU_IIC_BUS, kD1946_LDO10, 0x0A }, // PP3V2_SD_CTRL 3.00V
{ PMU_IIC_BUS, kD1946_LDO11, 0x17 }, // PP2V85_CAM 2.85V
{ PMU_IIC_BUS, kD1946_LDO12, 0x10 }, // PP1V0 1.00V
{ PMU_IIC_BUS, kDIALOG_LDO_CONTROL, 0x00 }, // Leave bypass off
};
static const struct pmu_setup_struct pmu_ldo_cold_setup[] =
{
{ PMU_IIC_BUS, kD1946_ACTIVE1, 0xDD }, // Everything but BUCK1 and LDO1
{ PMU_IIC_BUS, kD1946_ACTIVE2, 0xE9 }, // Everything but SD and ACC, LDO8
{ PMU_IIC_BUS, kD1946_ACTIVE3, 0x61 }, // BUCK5, VBOOST_LCM, PP1V1
{ PMU_IIC_BUS, kD1946_ACTIVE4, 0xA0 }, // CPU1V8_SW and CPU1V2_SW
{ PMU_IIC_BUS, kD1946_LCM_CONTROL1, 0x02 }, // unused 5.10V
{ PMU_IIC_BUS, kD1946_LCM_CONTROL2, 0x0E }, // unused 5.70V
{ PMU_IIC_BUS, kD1946_LCM_CONTROL3, 0x00 }, // BB_VBUS_DET 5.00V
{ PMU_IIC_BUS, kD1946_LCM_BST_CONTROL, 0x14 }, // VBOOST_LCM 6.00V
};
static const struct pmu_setup_struct pmu_warm_init[] =
{
{ PMU_IIC_BUS, kDIALOG_SYS_CONTROL2, 0x10 }, // HIB_32K on, DWI off
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_A, 0x00 },
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_B, 0x00 },
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_C, 0x00 },
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_D, 0x00 },
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_E, 0x00 },
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_F, 0x00 },
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_G, 0x00 },
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_H, 0x00 },
{ PMU_IIC_BUS, kDIALOG_IRQ_MASK_K, 0x00 },
};
static const struct pmu_setup_struct pmu_cold_init[] =
{
{ PMU_IIC_BUS, kD1946_BUCK4, 0x9B }, // BUCK4 1.21V
{ PMU_IIC_BUS, kD1946_BUCK4_HIB, 0x9B }, // BUCK4_HIB 1.21V
{ PMU_IIC_BUS, kD1946_SYS_GPIO_1, 0x11 }, // CLK_32K_PMU Out 0, Push-Pull, CPU_1V8
{ PMU_IIC_BUS, kD1946_SYS_GPIO_2, 0x49 }, // CLK_32K_WLAN CLK32K, Pull Down, VBUCK3
{ PMU_IIC_BUS, kD1946_SYS_GPIO_3, 0x09 }, // RST_BT_L Out 0, Push-Pull, VBUCK3
{ PMU_IIC_BUS, kD1946_SYS_GPIO_4, 0x09 }, // RST_WLAN_L Out 0, Push-Pull, VBUCK3
{ PMU_IIC_BUS, kD1946_SYS_GPIO_5, 0x09 }, // RST_BB_PMU_L Out 0, Push-pull, VBUCK3
{ PMU_IIC_BUS, kD1946_SYS_GPIO_6, 0xDA }, // BATTERY_SWI In, F Edge, Wake, Pull Up, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_7, 0xBB }, // PM_BT_HOST_WAKE In, R Edge, Wake, Pull Down, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_8, 0xBB }, // PM_WLAN_HOST_WAKE In, R Edge, Wake, Pull Down, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_9, 0xBB }, // PM_BB_HOST_WAKE In, R Edge, Wake, Pull Down, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_10, 0xEA }, // AUD_MIK_HS1_INT_L In, Change, Wake, Pull Up, VBUCK3
{ PMU_IIC_BUS, kD1946_SYS_GPIO_11, 0x09 }, // DOCK_BB_EN Out 0, Push-Pull, VBUCK3
{ PMU_IIC_BUS, kD1946_SYS_GPIO_12, 0x49 }, // CLK_32K_GPS CLK32K, Push-Pull, VBUCK3
{ PMU_IIC_BUS, kD1946_SYS_GPIO_13, 0xB9 }, // SD_CON_CD In, R Edge, No Wake, Pull Down, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_14, 0xC8 }, // RST_L63_L In, F Edge, No Wake, Pull Up, VBUCK3
{ PMU_IIC_BUS, kD1946_SYS_GPIO_15, 0xFA }, // HALL_IRQ In, E Edge, Wake, Pull Up, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_16, 0xB9 }, // unused In, R Edge, No Wake, Pull Down, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_17, 0xB9 }, // unused In, R Edge, No Wake, Pull Down, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_18, 0xB9 }, // unused In, R Edge, No Wake, Pull Down, Disable Pull-Up
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB1, 0x12 }, // 10ms debounce
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB2, 0x12 }, // 10ms debounce
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB3, 0x02 }, // no debounce on GPIO6
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB4, 0x10 }, // no debounce on GPIO7
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB5, 0x02 }, // no debounce on GPIO10
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB6, 0x12 }, // 10ms debounce
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB7, 0x12 }, // 10ms debounce
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB8, 0x12 }, // 10ms debounce
{ PMU_IIC_BUS, kD1946_SYS_GPIO_DEB9, 0x12 }, // 10ms debounce
// <rdar://problem/8932682>
{ PMU_IIC_BUS, kDIALOG_BANKSEL, 0x02 },
{ PMU_IIC_BUS, kD1946_TEST_MODE, 0x01 }, // Enable test mode
{ PMU_IIC_BUS, kDIALOG_BANKSEL, 0x01 },
{ PMU_IIC_BUS, kD1946_WLED_CONTROL5, 0x00 }, // set WLED to IDAC always
{ PMU_IIC_BUS, kDIALOG_BANKSEL, 0x02 },
{ PMU_IIC_BUS, kD1946_TEST_MODE, 0x00 }, // Disable test mode
{ PMU_IIC_BUS, kDIALOG_BANKSEL, 0x00 },
// <rdar://problem/8784560>
{ PMU_IIC_BUS, kDIALOG_BANKSEL, 0x01 }, // Select Bank 1
{ PMU_IIC_BUS, kD1946_BUCK_CONTROL1, 0x0e }, // Force Buck0 into PWM Mode
{ PMU_IIC_BUS, kD1946_BUCK_CONTROL3, 0x0e }, // Force Buck2 into PWM Mode
{ PMU_IIC_BUS, kDIALOG_BANKSEL, 0x00 }, // Select Bank 0
};
static const struct pmu_setup_struct pmu_backlight_enable[] =
{
{ PMU_IIC_BUS, kDIALOG_WLED_ISET, 0xD4 }, // 50% value from OS
{ PMU_IIC_BUS, kDIALOG_WLED_ISET2, 0x00 },
{ PMU_IIC_BUS, kDIALOG_WLED_CONTROL, // enable all LED strings
(kDIALOG_WLED_CONTROL_WLED_ENABLE1 |
kDIALOG_WLED_CONTROL_WLED_ENABLE2 |
kDIALOG_WLED_CONTROL_WLED_ENABLE3 |
kDIALOG_WLED_CONTROL_WLED_ENABLE4 |
kDIALOG_WLED_CONTROL_WLED_ENABLE5 |
kDIALOG_WLED_CONTROL_WLED_ENABLE6) },
{ PMU_IIC_BUS, kDIALOG_WLED_CONTROL2, // enable LED Power
(kDIALOG_WLED_CONTROL2_WLED_RAMP_EN |
kDIALOG_WLED_CONTROL2_WLED_DITH_EN) }
};
static const struct pmu_setup_struct pmu_backlight_disable[] =
{
{ PMU_IIC_BUS, kDIALOG_WLED_CONTROL, 0x0 } // disable LED power
};
static const struct core_rails_struct soc_rails[] =
{
{ PMU_IIC_BUS, 0, kDIALOG_BUCK2 }
};
static const struct core_rails_struct cpu_rails[] =
{
{ PMU_IIC_BUS, 0, kDIALOG_BUCK0 }
};
#endif /* POWERCONFIG_PMU_SETUP */
#define TARGET_USE_CHARGE_TABLE 1
static const struct power_charge_limits pmu_charge_table[16] = { // gas gauge can have up to 16 entries
{ 4000, 1000, 1600, 3000 }, // 10 - 16C 0.44C
{ 4100, 1000, 1600, 1375 }, // 0.2C
{ USHRT_MAX, 1000, 1600, 750 }, // 0.11C
{ 4000, 1500, 2100, 3000 }, // 15 - 21C 0.44C
{ 4100, 1500, 2100, 2000 }, // 0.29C
{ USHRT_MAX, 1500, 2100, 1375 }, // 0.2C
{ 4000, 2000, 3500, 3000 }, // 20 - 35C 0.44C
{ 4100, 2000, 3500, 3000 }, // 0.44C
{ USHRT_MAX, 2000, 3500, 2000 }, // 0.29C
{ 4000, 3400, 4500, 3000 }, // 34 - 45C 0.44C
{ 4100, 3400, 4500, 3000 }, // 0.44C
{ USHRT_MAX, 3400, 4500, 3000 }, // 0.44C
};
// matches OTP for ICHG_TBAT_x
#define TARGET_ICHG_TBAT_MAX { 0x00, 0x00, 0x3f, 0x3f, 0x3f }
#define NO_BATTERY_VOLTAGE 2700
#define MIN_BOOT_BATTERY_VOLTAGE 3600
#define TARGET_BOOT_BATTERY_VOLTAGE 3700
#define TARGET_BOOT_BATTERY_CAPACITY 50
#define PRECHARGE_BACKLIGHT_LEVEL 1287 /* 10% brightness */
#define TARGET_PRECHARGE_ALWAYS_DISPLAY_IDLE 1
#define TARGET_MAX_USB_INPUT_CURRENT 2100
#define TARGET_BRICKID_FULL_SCALE (5000 * 3) // H4A has resistor divider for USB monitor
#define GASGAUGE_BATTERYID_BLOCK 1
#define GASGAUGE_CHARGETABLE_BLOCK 3
static const unsigned int atv_voltage_limit[16] = { 3600, 3650, 3700, 3750, 3800, 3850, 3900, 3950, 4000, 4050, 4100, 4150, 4200, 4250, 4300, 4350 };
static const unsigned int atv_current_limit[16] = { 0, 0, 625, 750, 875, 1000, 1125, 1250, 1375, 1500, 1750, 2000, 2250, 2500, 2750, 3000 };
#endif
+22
View File
@@ -0,0 +1,22 @@
/*
* Copyright (C) 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.
*/
#ifndef __TARGET_UARTCONFIG_H
#define __TARGET_UARTCONFIG_H
/* define two debug serial ports */
#define DEBUG_SERIAL_PORT (0)
/* define HDQ serial port */
#define HDQGAUGE_SERIAL_PORT (5)
#define UART_FLOWCONTROL_MASK (0x08)
#endif
+255
View File
@@ -0,0 +1,255 @@
/*
* Copyright (C) 2011-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/display.h>
#include <drivers/flash_nor.h>
#include <drivers/iic.h>
#include <drivers/power.h>
#include <lib/devicetree.h>
#include <lib/env.h>
#include <lib/mib.h>
#include <lib/syscfg.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>
#include <target/powerconfig.h>
#include <target/display_gamma_tables.h>
MIB_CONSTANT_PTR(kMIBTargetDisplayGammaTablePtr,kOIDTypeStruct, (void *)k93a_display_gamma_tables);
MIB_CONSTANT(kMIBTargetDisplayGammaTableCount, kOIDTypeUInt32, ARRAY_SIZE(k93a_display_gamma_tables));
MIB_CONSTANT(kMIBTargetOsPictureScale, kOIDTypeUInt32, 1);
MIB_CONSTANT(kMIBTargetPictureRotate, kOIDTypeInt32, 90);
static uint32_t display_config;
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)
{
switch (target) {
case BOOT_DARWIN:
case BOOT_DARWIN_RESTORE:
case BOOT_DIAGS:
break;
default:
; // do nothing
}
return 0;
}
bool target_should_recover(void)
{
return platform_get_request_dfu2() && power_has_usb();
}
bool target_should_poweron(bool *cold_button_boot)
{
#if WITH_HW_POWER
if (power_get_boot_flag() == kPowerBootFlagColdButton) *cold_button_boot = true;
#else
*cold_button_boot = false;
#endif
return !*cold_button_boot || platform_get_request_dfu1();
}
bool target_should_poweroff(bool at_boot)
{
return platform_get_request_dfu1() && (!at_boot || !power_has_usb());
}
#if APPLICATION_IBOOT
void target_watchdog_tickle(void)
{
u_int32_t value = gpio_read(GPIO_WDOG_TICKLE);
gpio_write(GPIO_WDOG_TICKLE, value ^ 1);
}
#endif // APPLICATION_IBOOT
void * target_get_display_configuration(void)
{
display_config = 0x00000644;
return ((void *)(&display_config));
}
#if WITH_ENV
void target_setup_default_environment(void)
{
env_set("boot-device", "nand0", 0);
env_set("display-color-space","RGB888", 0);
env_set("display-timing", "k48", 0);
}
#endif
#if WITH_DEVICETREE
int target_update_device_tree(void)
{
DTNode *node, *clcd_node, *backlight_node;
uint32_t propSize, propCnt;
char *propName;
void *propData;
// Update the DWI node with the actual voltages
if (FindNode(0, "arm-io/dwi", &node)) {
propName = "voltages-buck0";
if (FindProperty(node, &propName, &propData, &propSize)) {
propCnt = propSize / sizeof(u_int32_t);
platform_get_cpu_voltages(propCnt, propData);
platform_convert_voltages(0, propCnt, propData);
}
propName = "voltages-buck2";
if (FindProperty(node, &propName, &propData, &propSize)) {
propCnt = propSize / sizeof(u_int32_t);
platform_get_soc_voltages(propCnt, propData);
platform_convert_voltages(2, propCnt, propData);
}
}
// Find the CLCD node
FindNode(0, "arm-io/clcd", &clcd_node);
#if WITH_HW_DISPLAY_PINOT
if (FindNode(0, "arm-io/mipi-dsim/lcd", &node)) {
extern int pinot_update_device_tree(DTNode *pinot_node, DTNode *clcd_node, DTNode *backlight_node);
FindNode(0, "backlight", &backlight_node);
pinot_update_device_tree(node, clcd_node, backlight_node);
}
#endif
// Update the bottom prox calibration data
if (FindNode(0, "arm-io/i2c1/prox", &node)) {
propName = "prox-bottom-calibration";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('PBCl', propData, propSize);
}
propName = "prox-temp-base";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('PBTb', propData, propSize);
}
propName = "prox-centerpoint-base";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('PBCb', propData, propSize);
}
propName = "prox-calibration-blob";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('CPCl', propData, propSize);
}
}
// Update als node with calibration data
if (FindNode(0, "arm-io/i2c2/als", &node)) {
propName = "backlight-leakage-channel0";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('ALC0', propData, propSize);
}
propName = "backlight-leakage-channel1";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('ALC1', propData, propSize);
}
propName = "alsCalibration";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('AlsC', propData, propSize);
}
propName = "als-colorCfg";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('ClrC', propData, propSize);
}
}
// Update the gyro calibration data
if (FindNode(0, "arm-io/i2c2/gyro", &node)) {
propName = "low-temp-offset";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('LTGO', propData, propSize);
}
propName = "high-temp-offset";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('HTGO', propData, propSize);
}
propName = "gyro-sensitivity-calibration";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('GSCl', propData, propSize);
}
propName = "gyro-temp-table";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('GYTT', propData, propSize);
}
propName = "gyro-interrupt-calibration";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('GICl', propData, propSize);
}
}
// Update accelerometer calibration data
if (FindNode(0, "arm-io/i2c2/accelerometer", &node)) {
propName = "low-temp-accel-offset";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('LTAO', propData, propSize);
}
propName = "accel-sensitivity-calibration";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('ASCl', propData, propSize);
}
}
// Update camera calibration data
if (FindNode(0, "arm-io/isp", &node)) {
propName = "camera-calibration";
if (FindProperty(node, &propName, &propData, &propSize)) {
syscfgCopyDataForTag('CmCl', propData, propSize);
}
}
// Update USB input current limit
if (FindNode(0, "charger", &node)) {
propName = "usb-input-limit-max";
if (FindProperty(node, &propName, &propData, &propSize)) {
*(uint32_t *)propData = TARGET_MAX_USB_INPUT_CURRENT;
}
}
return 0;
}
#endif
+29
View File
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2009-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 <drivers/apple/gpio.h>
#include <platform/soc/hwregbase.h>
#include <target.h>
#define PIN_CFG_AP 1
#include <target/pinconfig.h>
#undef PIN_CFG_AP
#define PIN_CFG_DEV 1
#include <target/pinconfig.h>
#undef PIN_CFG_DEV
const uint32_t *target_get_default_gpio_cfg(uint32_t gpioc)
{
if (target_config_ap())
return gpio_default_cfg_ap;
else
return gpio_default_cfg_dev;
}
+45
View File
@@ -0,0 +1,45 @@
/*
* 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.
*/
#include <debug.h>
#include <target.h>
#if WITH_DEVICETREE
bool
target_get_property(enum target_property prop, void *data, int maxdata, int *retlen)
{
int length = 0;
bool result = false;
if ((result = target_get_property_base(prop, data, maxdata, retlen)) == false) {
switch(prop) {
case TARGET_PROPERTY_RESTORE_BACKLIGHT_LEVEL:
// fix the restore backlight level at the precharge level,
// to make sure the backlight does not cause the battery to
// drain during restore
if (maxdata >= (ssize_t)sizeof(uint32_t)) {
result = true;
length = sizeof(uint32_t);
*(uint32_t *)data = PRECHARGE_BACKLIGHT_LEVEL;
}
break;
default:
break;
}
}
if (retlen != NULL) *retlen = length;
return result;
}
#endif
+43
View File
@@ -0,0 +1,43 @@
# Copyright (C) 2010-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.
#
LOCAL_DIR := $(GET_LOCAL_DIR)
TARGET_DIR := $(LOCAL_DIR)
OPTIONS += \
DIALOG_D1946=1 \
TARGET_HIGH_SOC_VOLTAGE=CHIPID_SOC_VOLTAGE_HIGH \
TARGET_HIGH_CPU_VOLTAGE=CHIPID_CPU_VOLTAGE_HIGH \
TARGET_CPU_VOLTAGE_MASK=5 \
TARGET_EMA_CTL_CPU_SEL=2 \
TARGET_CPU_SOURCE=1 \
TARGET_MIPI_DSI_SOURCE=2 \
TARGET_MANAGED2H_SOURCE=1 \
TARGET_MANAGED2L_SOURCE=2 \
TARGET_MANAGED2H_DIV=2 \
TARGET_MANAGED2L_DIV=3 \
TARGET_PCLK1_SOURCE=2 \
TARGET_PCLK1_DIV=6 \
TARGET_GFX_SOURCE=2 \
TARGET_GFX_SLC_SOURCE=2 \
TARGET_SPI2_SOURCE=0 \
TARGET_IOP_SOURCE=3 \
TARGET_LPERFS_SOURCE=3 \
TARGET_HPERFNRT_SOURCE=0 \
TARGET_CLCD_VSPP=0 \
TARGET_DSIM_CONFIG=0x00800000 \
AMC_NUM_CHANNELS=2 \
AMC_NUM_RANKS=1 \
AMC_CHANNEL_WIDTH=4 \
MULTITOUCH_DTPATH=\"arm-io/spi1/multi-touch\"
GLOBAL_INCLUDES += $(LOCAL_DIR)/include
ALL_OBJS += $(LOCAL_DIR)/init.o \
$(LOCAL_DIR)/pinconfig.o