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

+47
View File
@@ -0,0 +1,47 @@
/*
* 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.
*/
#include <debug.h>
#include <platform.h>
#include <platform/clocks.h>
#include <platform/soc/hwclocks.h>
#include "dwi.h"
#ifndef TARGET_DWI_FREQUENCY
#error TARGET_DWI_FREQUENCY not defined by the target
#endif
#ifndef TARGET_DWI_TRANSFER_GAP_US
#error TARGET_DWI_TRANSFER_GAP_US not defined by the target
#endif
int dwi_init(void)
{
u_int32_t dwi_divider, dwi_transfer_gap;
clock_gate(CLK_DWI, true);
dwi_divider = (clock_get_frequency(CLK_NCLK) + TARGET_DWI_FREQUENCY - 1) / TARGET_DWI_FREQUENCY;
dwi_transfer_gap = (clock_get_frequency(CLK_NCLK) * TARGET_DWI_TRANSFER_GAP_US) / 1000000;
rDWI_CLOCK_CONFIG = DWI_CLOCK_CONFIG_CLOCK_SCALER(dwi_divider) | DWI_CLOCK_CONFIG_TX_CPHA_1;
rDWI_TRANSFER_GAP = dwi_transfer_gap;
return 0;
}
int dwi_send_backlight_command(uint32_t backlight_command, uint32_t backlight_level)
{
rDWI_ITR0_TX_DATA = (backlight_command << 28) | (backlight_level & 0x7FF);
rDWI_ITR0_CONTROL = DWI_TR_CTRL_BYTE_SWAP | DWI_TR_CTRL_BYTE_CNT(4) | DWI_TR_CTRL_TRAN_EN;
return 0;
}
+48
View File
@@ -0,0 +1,48 @@
/*
* 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 __SAMSUNG_DWI_H
#define __SAMSUNG_DWI_H
#include <platform/soc/hwregbase.h>
#define rDWI_CLOCK_CONFIG (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0000))
#define DWI_CLOCK_CONFIG_TX_CPHA_1 (1 << 0)
#define DWI_CLOCK_CONFIG_TX_CPHA_2 (0 << 0)
#define DWI_CLOCK_CONFIG_RX_CPHA_1 (1 << 1)
#define DWI_CLOCK_CONFIG_RX_CPHA_2 (0 << 1)
#define DWI_CLOCK_CONFIG_CPOL_LOW (0 << 2)
#define DWI_CLOCK_CONFIG_CPOL_HIGH (1 << 2)
#define DWI_CLOCK_CONFIG_CLOCK_SCALER(_x) (((_x) - 1) << 16)
#define rDWI_TRANSFER_GAP (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0004))
#define rDWI_ITR0_CONTROL (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0010))
#define DWI_TR_CTRL_TRAN_EN (1 << 0)
#define DWI_TR_CTRL_BYTE_CNT(_c) (((_c) - 1) << 4)
#define DWI_TR_CTRL_BYTE_SWAP (1 << 6)
#define DWI_TR_CTRL_BIT_ORDER (1 << 7)
#define DWI_TR_CTRL_INT_EN (1 << 8)
#define rDWI_ITR0_TX_DATA (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0014))
#define rDWI_ITR0_RX_DATA (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0018))
#define rDWI_ITR0_INT_STATUS (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x001C))
#define rDWI_ITR1_CONTROL (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0020))
#define rDWI_ITR1_TX_DATA (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0024))
#define rDWI_ITR1_RX_DATA (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0028))
#define rDWI_ITR1_INT_STATUS (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x002C))
#define rDWI_ITR1_RAMP_COUNT (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0030))
#define rDWI_ITR1_DELTAV_ACTIVE (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0034))
#define rDWI_STR_CONTROL (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0040))
#define rDWI_STR_TX_DATA (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0044))
#define rDWI_STR_RX_DATA (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0048))
#define rDWI_STR_INT_STATUS (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x004C))
#define rDWI_STR_DELAY (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0050))
#define rDWI_VERSION (*(volatile u_int32_t *)(DWI_BASE_ADDR + 0x0070))
#endif /* ! __SAMSUNG_DWI_H */
+15
View File
@@ -0,0 +1,15 @@
# 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.
#
LOCAL_DIR := $(GET_LOCAL_DIR)
OPTIONS += \
WITH_HW_DWI=1
ALL_OBJS += $(LOCAL_DIR)/dwi.o