Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
fbb0c7bd
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fbb0c7bd
编写于
10月 02, 2015
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-tegra
上级
b8d24212
fe82857c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
65 addition
and
57 deletion
+65
-57
board/nvidia/p2371-2180/pinmux-config-p2371-2180.h
board/nvidia/p2371-2180/pinmux-config-p2371-2180.h
+35
-21
drivers/gpio/tegra_gpio.c
drivers/gpio/tegra_gpio.c
+26
-32
include/configs/tegra114-common.h
include/configs/tegra114-common.h
+1
-1
include/configs/tegra20-common.h
include/configs/tegra20-common.h
+1
-1
include/configs/tegra210-common.h
include/configs/tegra210-common.h
+1
-1
include/configs/tegra30-common.h
include/configs/tegra30-common.h
+1
-1
未找到文件。
board/nvidia/p2371-2180/pinmux-config-p2371-2180.h
浏览文件 @
fbb0c7bd
...
...
@@ -24,6 +24,17 @@
static
const
struct
tegra_gpio_config
p2371_2180_gpio_inits
[]
=
{
/* gpio, init_val */
GPIO_INIT
(
A5
,
IN
),
GPIO_INIT
(
B0
,
IN
),
GPIO_INIT
(
B1
,
IN
),
GPIO_INIT
(
B2
,
IN
),
GPIO_INIT
(
B3
,
IN
),
GPIO_INIT
(
C0
,
IN
),
GPIO_INIT
(
C1
,
IN
),
GPIO_INIT
(
C2
,
IN
),
GPIO_INIT
(
C3
,
IN
),
GPIO_INIT
(
C4
,
IN
),
GPIO_INIT
(
E4
,
IN
),
GPIO_INIT
(
E5
,
IN
),
GPIO_INIT
(
E6
,
IN
),
GPIO_INIT
(
H0
,
OUT0
),
GPIO_INIT
(
H1
,
OUT0
),
...
...
@@ -32,7 +43,7 @@ static const struct tegra_gpio_config p2371_2180_gpio_inits[] = {
GPIO_INIT
(
H4
,
OUT0
),
GPIO_INIT
(
H5
,
IN
),
GPIO_INIT
(
H6
,
IN
),
GPIO_INIT
(
H7
,
OUT0
),
GPIO_INIT
(
H7
,
IN
),
GPIO_INIT
(
I0
,
OUT0
),
GPIO_INIT
(
I1
,
IN
),
GPIO_INIT
(
I2
,
OUT0
),
...
...
@@ -47,6 +58,8 @@ static const struct tegra_gpio_config p2371_2180_gpio_inits[] = {
GPIO_INIT
(
S7
,
OUT0
),
GPIO_INIT
(
T0
,
OUT0
),
GPIO_INIT
(
T1
,
OUT0
),
GPIO_INIT
(
U2
,
IN
),
GPIO_INIT
(
U3
,
IN
),
GPIO_INIT
(
V1
,
OUT0
),
GPIO_INIT
(
V2
,
OUT0
),
GPIO_INIT
(
V3
,
IN
),
...
...
@@ -65,8 +78,9 @@ static const struct tegra_gpio_config p2371_2180_gpio_inits[] = {
GPIO_INIT
(
Z0
,
IN
),
GPIO_INIT
(
Z2
,
IN
),
GPIO_INIT
(
Z3
,
OUT0
),
GPIO_INIT
(
BB0
,
IN
),
GPIO_INIT
(
BB2
,
OUT0
),
GPIO_INIT
(
BB3
,
OUT0
),
GPIO_INIT
(
BB3
,
IN
),
GPIO_INIT
(
CC1
,
IN
),
};
...
...
@@ -91,19 +105,19 @@ static const struct pmux_pingrp_config p2371_2180_pingrps[] = {
PINCFG
(
PEX_L1_CLKREQ_N_PA4
,
PE1
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
HIGH
),
PINCFG
(
SATA_LED_ACTIVE_PA5
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
PA6
,
SATA
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP1_FS_PB0
,
I2S1
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP1_DIN_PB1
,
I2S1
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP1_DOUT_PB2
,
I2S1
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP1_SCLK_PB3
,
I2S1
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP1_FS_PB0
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP1_DIN_PB1
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP1_DOUT_PB2
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP1_SCLK_PB3
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI2_MOSI_PB4
,
SPI2
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI2_MISO_PB5
,
SPI2
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI2_SCK_PB6
,
SPI2
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI2_CS0_PB7
,
SPI2
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_MOSI_PC0
,
SPI1
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_MISO_PC1
,
SPI1
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_SCK_PC2
,
SPI1
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_CS0_PC3
,
SPI1
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_CS1_PC4
,
SPI1
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_MOSI_PC0
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_MISO_PC1
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_SCK_PC2
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_CS0_PC3
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI1_CS1_PC4
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI4_SCK_PC5
,
SPI4
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI4_CS0_PC6
,
SPI4
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
SPI4_MOSI_PC7
,
SPI4
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
...
...
@@ -116,9 +130,9 @@ static const struct pmux_pingrp_config p2371_2180_pingrps[] = {
PINCFG
(
DMIC1_DAT_PE1
,
I2S3
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DMIC2_CLK_PE2
,
I2S3
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DMIC2_DAT_PE3
,
I2S3
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DMIC3_CLK_PE4
,
D
MIC3
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DMIC3_DAT_PE5
,
D
MIC3
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
PE6
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DMIC3_CLK_PE4
,
D
EFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DMIC3_DAT_PE5
,
D
EFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
PE6
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
PE7
,
PWM3
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
GEN3_I2C_SCL_PF0
,
I2C3
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
NORMAL
),
PINCFG
(
GEN3_I2C_SDA_PF1
,
I2C3
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
NORMAL
),
...
...
@@ -133,7 +147,7 @@ static const struct pmux_pingrp_config p2371_2180_pingrps[] = {
PINCFG
(
BT_RST_PH4
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
BT_WAKE_AP_PH5
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
PH6
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
AP_WAKE_NFC_PH7
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
AP_WAKE_NFC_PH7
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
NFC_EN_PI0
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
NFC_INT_PI1
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
GPS_EN_PI2
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
...
...
@@ -184,8 +198,8 @@ static const struct pmux_pingrp_config p2371_2180_pingrps[] = {
PINCFG
(
CAM1_STROBE_PT1
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
UART1_TX_PU0
,
UARTA
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
UART1_RX_PU1
,
UARTA
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
UART1_RTS_PU2
,
UARTA
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
UART1_CTS_PU3
,
UARTA
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
UART1_RTS_PU2
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
UART1_CTS_PU3
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
LCD_BL_PWM_PV0
,
PWM0
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
LCD_BL_EN_PV1
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
LCD_RST_PV2
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
...
...
@@ -194,10 +208,10 @@ static const struct pmux_pingrp_config p2371_2180_pingrps[] = {
PINCFG
(
AP_READY_PV5
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
TOUCH_RST_PV6
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
TOUCH_CLK_PV7
,
TOUCH
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
MODEM_WAKE_AP_PX0
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
MODEM_WAKE_AP_PX0
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
TOUCH_INT_PX1
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
MOTION_INT_PX2
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
ALS_PROX_INT_PX3
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
ALS_PROX_INT_PX3
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
TEMP_ALERT_PX4
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
BUTTON_POWER_ON_PX5
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
BUTTON_VOL_UP_PX6
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
...
...
@@ -218,10 +232,10 @@ static const struct pmux_pingrp_config p2371_2180_pingrps[] = {
PINCFG
(
DAP2_SCLK_PAA1
,
I2S2
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP2_DIN_PAA2
,
I2S2
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DAP2_DOUT_PAA3
,
I2S2
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
AUD_MCLK_PBB0
,
AUD
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
AUD_MCLK_PBB0
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DVFS_PWM_PBB1
,
CLDVFS
,
NORMAL
,
TRISTATE
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
DVFS_CLK_PBB2
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
GPIO_X1_AUD_PBB3
,
DEFAULT
,
NORMAL
,
NORMAL
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
GPIO_X1_AUD_PBB3
,
DEFAULT
,
UP
,
NORMAL
,
INPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
GPIO_X3_AUD_PBB4
,
RSVD0
,
DOWN
,
TRISTATE
,
OUTPUT
,
DISABLE
,
DEFAULT
),
PINCFG
(
HDMI_CEC_PCC0
,
CEC
,
NORMAL
,
NORMAL
,
INPUT
,
DISABLE
,
HIGH
),
PINCFG
(
HDMI_INT_DP_HPD_PCC1
,
DEFAULT
,
DOWN
,
NORMAL
,
INPUT
,
DISABLE
,
NORMAL
),
...
...
drivers/gpio/tegra_gpio.c
浏览文件 @
fbb0c7bd
/*
* NVIDIA Tegra20 GPIO handling.
* (C) Copyright 2010-2012
* (C) Copyright 2010-2012
,2015
* NVIDIA Corporation <www.nvidia.com>
*
* SPDX-License-Identifier: GPL-2.0+
...
...
@@ -25,12 +25,10 @@
DECLARE_GLOBAL_DATA_PTR
;
enum
{
TEGRA_CMD_INFO
,
TEGRA_CMD_PORT
,
TEGRA_CMD_OUTPUT
,
TEGRA_CMD_INPUT
,
};
static
const
int
CONFIG_SFIO
=
0
;
static
const
int
CONFIG_GPIO
=
1
;
static
const
int
DIRECTION_INPUT
=
0
;
static
const
int
DIRECTION_OUTPUT
=
1
;
struct
tegra_gpio_platdata
{
struct
gpio_ctlr_bank
*
bank
;
...
...
@@ -44,7 +42,7 @@ struct tegra_port_info {
int
base_gpio
;
/* Port number for this port (0, 1,.., n-1) */
};
/* Return config of pin 'gpio' as GPIO (1) or SF
P
IO (0) */
/* Return config of pin 'gpio' as GPIO (1) or SFIO (0) */
static
int
get_config
(
unsigned
gpio
)
{
struct
gpio_ctlr
*
ctlr
=
(
struct
gpio_ctlr
*
)
NV_PA_GPIO_BASE
;
...
...
@@ -53,15 +51,15 @@ static int get_config(unsigned gpio)
int
type
;
u
=
readl
(
&
bank
->
gpio_config
[
GPIO_PORT
(
gpio
)]);
type
=
(
u
>>
GPIO_BIT
(
gpio
))
&
1
;
type
=
(
u
>>
GPIO_BIT
(
gpio
))
&
1
;
debug
(
"get_config: port = %d, bit = %d is %s
\n
"
,
GPIO_FULLPORT
(
gpio
),
GPIO_BIT
(
gpio
),
type
?
"GPIO"
:
"SFPIO"
);
return
type
;
return
type
?
CONFIG_GPIO
:
CONFIG_SFIO
;
}
/* Config pin 'gpio' as GPIO or SF
P
IO, based on 'type' */
/* Config pin 'gpio' as GPIO or SFIO, based on 'type' */
static
void
set_config
(
unsigned
gpio
,
int
type
)
{
struct
gpio_ctlr
*
ctlr
=
(
struct
gpio_ctlr
*
)
NV_PA_GPIO_BASE
;
...
...
@@ -72,7 +70,7 @@ static void set_config(unsigned gpio, int type)
GPIO_FULLPORT
(
gpio
),
GPIO_BIT
(
gpio
),
type
?
"GPIO"
:
"SFPIO"
);
u
=
readl
(
&
bank
->
gpio_config
[
GPIO_PORT
(
gpio
)]);
if
(
type
)
/* GPIO */
if
(
type
!=
CONFIG_SFIO
)
u
|=
1
<<
GPIO_BIT
(
gpio
);
else
u
&=
~
(
1
<<
GPIO_BIT
(
gpio
));
...
...
@@ -93,7 +91,7 @@ static int get_direction(unsigned gpio)
debug
(
"get_direction: port = %d, bit = %d, %s
\n
"
,
GPIO_FULLPORT
(
gpio
),
GPIO_BIT
(
gpio
),
dir
?
"OUT"
:
"IN"
);
return
dir
;
return
dir
?
DIRECTION_OUTPUT
:
DIRECTION_INPUT
;
}
/* Config GPIO pin 'gpio' as input or output (OE) as per 'output' */
...
...
@@ -107,7 +105,7 @@ static void set_direction(unsigned gpio, int output)
GPIO_FULLPORT
(
gpio
),
GPIO_BIT
(
gpio
),
output
?
"OUT"
:
"IN"
);
u
=
readl
(
&
bank
->
gpio_dir_out
[
GPIO_PORT
(
gpio
)]);
if
(
output
)
if
(
output
!=
DIRECTION_INPUT
)
u
|=
1
<<
GPIO_BIT
(
gpio
);
else
u
&=
~
(
1
<<
GPIO_BIT
(
gpio
));
...
...
@@ -136,24 +134,16 @@ static void set_level(unsigned gpio, int high)
* Generic_GPIO primitives.
*/
static
int
tegra_gpio_request
(
struct
udevice
*
dev
,
unsigned
offset
,
const
char
*
label
)
{
struct
tegra_port_info
*
state
=
dev_get_priv
(
dev
);
/* Configure as a GPIO */
set_config
(
state
->
base_gpio
+
offset
,
1
);
return
0
;
}
/* set GPIO pin 'gpio' as an input */
static
int
tegra_gpio_direction_input
(
struct
udevice
*
dev
,
unsigned
offset
)
{
struct
tegra_port_info
*
state
=
dev_get_priv
(
dev
);
/* Configure GPIO direction as input. */
set_direction
(
state
->
base_gpio
+
offset
,
0
);
set_direction
(
state
->
base_gpio
+
offset
,
DIRECTION_INPUT
);
/* Enable the pin as a GPIO */
set_config
(
state
->
base_gpio
+
offset
,
1
);
return
0
;
}
...
...
@@ -169,7 +159,10 @@ static int tegra_gpio_direction_output(struct udevice *dev, unsigned offset,
set_level
(
gpio
,
value
);
/* Configure GPIO direction as output. */
set_direction
(
gpio
,
1
);
set_direction
(
gpio
,
DIRECTION_OUTPUT
);
/* Enable the pin as a GPIO */
set_config
(
state
->
base_gpio
+
offset
,
1
);
return
0
;
}
...
...
@@ -211,16 +204,18 @@ void gpio_config_table(const struct tegra_gpio_config *config, int len)
for
(
i
=
0
;
i
<
len
;
i
++
)
{
switch
(
config
[
i
].
init
)
{
case
TEGRA_GPIO_INIT_IN
:
gpio_direction_input
(
config
[
i
].
gpio
);
set_direction
(
config
[
i
].
gpio
,
DIRECTION_INPUT
);
break
;
case
TEGRA_GPIO_INIT_OUT0
:
gpio_direction_output
(
config
[
i
].
gpio
,
0
);
set_level
(
config
[
i
].
gpio
,
0
);
set_direction
(
config
[
i
].
gpio
,
DIRECTION_OUTPUT
);
break
;
case
TEGRA_GPIO_INIT_OUT1
:
gpio_direction_output
(
config
[
i
].
gpio
,
1
);
set_level
(
config
[
i
].
gpio
,
1
);
set_direction
(
config
[
i
].
gpio
,
DIRECTION_OUTPUT
);
break
;
}
set_config
(
config
[
i
].
gpio
,
1
);
set_config
(
config
[
i
].
gpio
,
CONFIG_GPIO
);
}
}
...
...
@@ -254,7 +249,6 @@ static int tegra_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
}
static
const
struct
dm_gpio_ops
gpio_tegra_ops
=
{
.
request
=
tegra_gpio_request
,
.
direction_input
=
tegra_gpio_direction_input
,
.
direction_output
=
tegra_gpio_direction_output
,
.
get_value
=
tegra_gpio_get_value
,
...
...
include/configs/tegra114-common.h
浏览文件 @
fbb0c7bd
...
...
@@ -34,7 +34,7 @@
/*-----------------------------------------------------------------------
* Physical Memory Map
*/
#define CONFIG_SYS_TEXT_BASE 0x801
0E
000
#define CONFIG_SYS_TEXT_BASE 0x801
10
000
/*
* Memory layout for where various images get loaded by boot scripts:
...
...
include/configs/tegra20-common.h
浏览文件 @
fbb0c7bd
...
...
@@ -32,7 +32,7 @@
/*-----------------------------------------------------------------------
* Physical Memory Map
*/
#define CONFIG_SYS_TEXT_BASE 0x001
0E
000
#define CONFIG_SYS_TEXT_BASE 0x001
10
000
/*
* Memory layout for where various images get loaded by boot scripts:
...
...
include/configs/tegra210-common.h
浏览文件 @
fbb0c7bd
...
...
@@ -26,7 +26,7 @@
/*-----------------------------------------------------------------------
* Physical Memory Map
*/
#define CONFIG_SYS_TEXT_BASE 0x801
0E
000
#define CONFIG_SYS_TEXT_BASE 0x801
10
000
/* Generic Interrupt Controller */
#define CONFIG_GICV2
...
...
include/configs/tegra30-common.h
浏览文件 @
fbb0c7bd
...
...
@@ -31,7 +31,7 @@
/*-----------------------------------------------------------------------
* Physical Memory Map
*/
#define CONFIG_SYS_TEXT_BASE 0x801
0E
000
#define CONFIG_SYS_TEXT_BASE 0x801
10
000
/*
* Memory layout for where various images get loaded by boot scripts:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录