Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
f4b0df18
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,发现更多精彩内容 >>
提交
f4b0df18
编写于
8月 12, 2016
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge
git://git.denx.de/u-boot-dm
上级
ab65006b
b647f554
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
100 addition
and
33 deletion
+100
-33
common/fdt_support.c
common/fdt_support.c
+11
-10
drivers/core/device.c
drivers/core/device.c
+1
-1
drivers/gpio/mpc85xx_gpio.c
drivers/gpio/mpc85xx_gpio.c
+1
-1
drivers/i2c/fsl_i2c.c
drivers/i2c/fsl_i2c.c
+1
-1
drivers/misc/misc-uclass.c
drivers/misc/misc-uclass.c
+11
-0
drivers/mmc/msm_sdhci.c
drivers/mmc/msm_sdhci.c
+2
-1
drivers/net/cpsw.c
drivers/net/cpsw.c
+2
-1
drivers/power/pmic/act8846.c
drivers/power/pmic/act8846.c
+2
-2
drivers/power/regulator/act8846.c
drivers/power/regulator/act8846.c
+2
-2
drivers/spmi/spmi-msm.c
drivers/spmi/spmi-msm.c
+3
-2
include/fdt_support.h
include/fdt_support.h
+3
-2
include/fdtdec.h
include/fdtdec.h
+11
-3
include/misc.h
include/misc.h
+35
-0
lib/fdtdec.c
lib/fdtdec.c
+15
-7
未找到文件。
common/fdt_support.c
浏览文件 @
f4b0df18
...
...
@@ -997,8 +997,8 @@ static void of_dump_addr(const char *s, const fdt32_t *addr, int na) { }
struct
of_bus
{
const
char
*
name
;
const
char
*
addresses
;
int
(
*
match
)(
void
*
blob
,
int
parentoffset
);
void
(
*
count_cells
)(
void
*
blob
,
int
parentoffset
,
int
(
*
match
)(
const
void
*
blob
,
int
parentoffset
);
void
(
*
count_cells
)(
const
void
*
blob
,
int
parentoffset
,
int
*
addrc
,
int
*
sizec
);
u64
(
*
map
)(
fdt32_t
*
addr
,
const
fdt32_t
*
range
,
int
na
,
int
ns
,
int
pna
);
...
...
@@ -1006,7 +1006,7 @@ struct of_bus {
};
/* Default translator (generic bus) */
void
of_bus_default_count_cells
(
void
*
blob
,
int
parentoffset
,
void
of_bus_default_count_cells
(
const
void
*
blob
,
int
parentoffset
,
int
*
addrc
,
int
*
sizec
)
{
const
fdt32_t
*
prop
;
...
...
@@ -1055,7 +1055,7 @@ static int of_bus_default_translate(fdt32_t *addr, u64 offset, int na)
#ifdef CONFIG_OF_ISA_BUS
/* ISA bus translator */
static
int
of_bus_isa_match
(
void
*
blob
,
int
parentoffset
)
static
int
of_bus_isa_match
(
const
void
*
blob
,
int
parentoffset
)
{
const
char
*
name
;
...
...
@@ -1066,7 +1066,7 @@ static int of_bus_isa_match(void *blob, int parentoffset)
return
!
strcmp
(
name
,
"isa"
);
}
static
void
of_bus_isa_count_cells
(
void
*
blob
,
int
parentoffset
,
static
void
of_bus_isa_count_cells
(
const
void
*
blob
,
int
parentoffset
,
int
*
addrc
,
int
*
sizec
)
{
if
(
addrc
)
...
...
@@ -1126,7 +1126,7 @@ static struct of_bus of_busses[] = {
},
};
static
struct
of_bus
*
of_match_bus
(
void
*
blob
,
int
parentoffset
)
static
struct
of_bus
*
of_match_bus
(
const
void
*
blob
,
int
parentoffset
)
{
struct
of_bus
*
bus
;
...
...
@@ -1148,7 +1148,7 @@ static struct of_bus *of_match_bus(void *blob, int parentoffset)
return
NULL
;
}
static
int
of_translate_one
(
void
*
blob
,
int
parent
,
struct
of_bus
*
bus
,
static
int
of_translate_one
(
const
void
*
blob
,
int
parent
,
struct
of_bus
*
bus
,
struct
of_bus
*
pbus
,
fdt32_t
*
addr
,
int
na
,
int
ns
,
int
pna
,
const
char
*
rprop
)
{
...
...
@@ -1211,8 +1211,8 @@ static int of_translate_one(void * blob, int parent, struct of_bus *bus,
* that can be mapped to a cpu physical address). This is not really specified
* that way, but this is traditionally the way IBM at least do things
*/
static
u64
__of_translate_address
(
void
*
blob
,
int
node_offset
,
const
fdt32_t
*
in_addr
,
const
char
*
rprop
)
static
u64
__of_translate_address
(
const
void
*
blob
,
int
node_offset
,
const
fdt32_t
*
in_addr
,
const
char
*
rprop
)
{
int
parent
;
struct
of_bus
*
bus
,
*
pbus
;
...
...
@@ -1284,7 +1284,8 @@ static u64 __of_translate_address(void *blob, int node_offset, const fdt32_t *in
return
result
;
}
u64
fdt_translate_address
(
void
*
blob
,
int
node_offset
,
const
fdt32_t
*
in_addr
)
u64
fdt_translate_address
(
const
void
*
blob
,
int
node_offset
,
const
fdt32_t
*
in_addr
)
{
return
__of_translate_address
(
blob
,
node_offset
,
in_addr
,
"ranges"
);
}
...
...
drivers/core/device.c
浏览文件 @
f4b0df18
...
...
@@ -671,7 +671,7 @@ fdt_addr_t dev_get_addr_index(struct udevice *dev, int index)
addr
=
fdtdec_get_addr_size_auto_parent
(
gd
->
fdt_blob
,
dev
->
parent
->
of_offset
,
dev
->
of_offset
,
"reg"
,
index
,
NULL
);
index
,
NULL
,
false
);
if
(
CONFIG_IS_ENABLED
(
SIMPLE_BUS
)
&&
addr
!=
FDT_ADDR_T_NONE
)
{
if
(
device_get_uclass_id
(
dev
->
parent
)
==
UCLASS_SIMPLE_BUS
)
...
...
drivers/gpio/mpc85xx_gpio.c
浏览文件 @
f4b0df18
...
...
@@ -170,7 +170,7 @@ static int mpc85xx_gpio_ofdata_to_platdata(struct udevice *dev) {
fdt_size_t
size
;
addr
=
fdtdec_get_addr_size_auto_noparent
(
gd
->
fdt_blob
,
dev
->
of_offset
,
"reg"
,
0
,
&
size
);
"reg"
,
0
,
&
size
,
false
);
plat
->
addr
=
addr
;
plat
->
size
=
size
;
...
...
drivers/i2c/fsl_i2c.c
浏览文件 @
f4b0df18
...
...
@@ -587,7 +587,7 @@ static int fsl_i2c_ofdata_to_platdata(struct udevice *bus)
fdt_size_t
size
;
addr
=
fdtdec_get_addr_size_auto_noparent
(
gd
->
fdt_blob
,
bus
->
of_offset
,
"reg"
,
0
,
&
size
);
"reg"
,
0
,
&
size
,
false
);
dev
->
base
=
map_sysmem
(
CONFIG_SYS_IMMR
+
addr
,
size
);
...
...
drivers/misc/misc-uclass.c
浏览文件 @
f4b0df18
...
...
@@ -45,6 +45,17 @@ int misc_ioctl(struct udevice *dev, unsigned long request, void *buf)
return
ops
->
ioctl
(
dev
,
request
,
buf
);
}
int
misc_call
(
struct
udevice
*
dev
,
int
msgid
,
void
*
tx_msg
,
int
tx_size
,
void
*
rx_msg
,
int
rx_size
)
{
const
struct
misc_ops
*
ops
=
device_get_ops
(
dev
);
if
(
!
ops
->
call
)
return
-
ENOSYS
;
return
ops
->
call
(
dev
,
msgid
,
tx_msg
,
tx_size
,
rx_msg
,
rx_size
);
}
UCLASS_DRIVER
(
misc
)
=
{
.
id
=
UCLASS_MISC
,
.
name
=
"misc"
,
...
...
drivers/mmc/msm_sdhci.c
浏览文件 @
f4b0df18
...
...
@@ -178,7 +178,8 @@ static int msm_ofdata_to_platdata(struct udevice *dev)
priv
->
base
=
(
void
*
)
fdtdec_get_addr_size_auto_parent
(
gd
->
fdt_blob
,
parent
->
of_offset
,
dev
->
of_offset
,
"reg"
,
1
,
NULL
);
"reg"
,
1
,
NULL
,
false
);
if
(
priv
->
base
==
(
void
*
)
FDT_ADDR_T_NONE
||
host
->
ioaddr
==
(
void
*
)
FDT_ADDR_T_NONE
)
return
-
EINVAL
;
...
...
drivers/net/cpsw.c
浏览文件 @
f4b0df18
...
...
@@ -1146,7 +1146,8 @@ static const struct eth_ops cpsw_eth_ops = {
static
inline
fdt_addr_t
cpsw_get_addr_by_node
(
const
void
*
fdt
,
int
node
)
{
return
fdtdec_get_addr_size_auto_noparent
(
fdt
,
node
,
"reg"
,
0
,
NULL
);
return
fdtdec_get_addr_size_auto_noparent
(
fdt
,
node
,
"reg"
,
0
,
NULL
,
false
);
}
static
int
cpsw_eth_ofdata_to_platdata
(
struct
udevice
*
dev
)
...
...
drivers/power/pmic/act8846.c
浏览文件 @
f4b0df18
...
...
@@ -29,7 +29,7 @@ static int act8846_write(struct udevice *dev, uint reg, const uint8_t *buff,
int
len
)
{
if
(
dm_i2c_write
(
dev
,
reg
,
buff
,
len
))
{
debug
(
"write error to device: %p register: %#x!"
,
dev
,
reg
);
debug
(
"write error to device: %p register: %#x!
\n
"
,
dev
,
reg
);
return
-
EIO
;
}
...
...
@@ -39,7 +39,7 @@ static int act8846_write(struct udevice *dev, uint reg, const uint8_t *buff,
static
int
act8846_read
(
struct
udevice
*
dev
,
uint
reg
,
uint8_t
*
buff
,
int
len
)
{
if
(
dm_i2c_read
(
dev
,
reg
,
buff
,
len
))
{
debug
(
"read error from device: %p register: %#x!"
,
dev
,
reg
);
debug
(
"read error from device: %p register: %#x!
\n
"
,
dev
,
reg
);
return
-
EIO
;
}
...
...
drivers/power/regulator/act8846.c
浏览文件 @
f4b0df18
...
...
@@ -88,7 +88,7 @@ static int reg_get_value(struct udevice *dev)
int
reg
=
dev
->
driver_data
;
int
ret
;
ret
=
pmic_reg_read
(
dev
->
parent
,
reg
);
ret
=
pmic_reg_read
(
dev
->
parent
,
addr_vol
[
reg
]
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -120,7 +120,7 @@ static bool reg_get_enable(struct udevice *dev)
int
reg
=
dev
->
driver_data
;
int
ret
;
ret
=
pmic_reg_read
(
dev
->
parent
,
reg
);
ret
=
pmic_reg_read
(
dev
->
parent
,
addr_ctl
[
reg
]
);
if
(
ret
<
0
)
return
ret
;
...
...
drivers/spmi/spmi-msm.c
浏览文件 @
f4b0df18
...
...
@@ -153,11 +153,12 @@ static int msm_spmi_probe(struct udevice *dev)
priv
->
spmi_core
=
fdtdec_get_addr_size_auto_parent
(
gd
->
fdt_blob
,
parent
->
of_offset
,
dev
->
of_offset
,
"reg"
,
1
,
NULL
);
"reg"
,
1
,
NULL
,
false
);
priv
->
spmi_obs
=
fdtdec_get_addr_size_auto_parent
(
gd
->
fdt_blob
,
parent
->
of_offset
,
dev
->
of_offset
,
"reg"
,
2
,
NULL
);
2
,
NULL
,
false
);
if
(
priv
->
arb_chnl
==
FDT_ADDR_T_NONE
||
priv
->
spmi_core
==
FDT_ADDR_T_NONE
||
priv
->
spmi_obs
==
FDT_ADDR_T_NONE
)
...
...
include/fdt_support.h
浏览文件 @
f4b0df18
...
...
@@ -180,7 +180,8 @@ static inline void fdt_fixup_mtdparts(void *fdt, void *node_info,
#endif
void
fdt_del_node_and_alias
(
void
*
blob
,
const
char
*
alias
);
u64
fdt_translate_address
(
void
*
blob
,
int
node_offset
,
const
__be32
*
in_addr
);
u64
fdt_translate_address
(
const
void
*
blob
,
int
node_offset
,
const
__be32
*
in_addr
);
int
fdt_node_offset_by_compat_reg
(
void
*
blob
,
const
char
*
compat
,
phys_addr_t
compat_off
);
int
fdt_alloc_phandle
(
void
*
blob
);
...
...
@@ -239,7 +240,7 @@ static inline u64 of_read_number(const fdt32_t *cell, int size)
return
r
;
}
void
of_bus_default_count_cells
(
void
*
blob
,
int
parentoffset
,
void
of_bus_default_count_cells
(
const
void
*
blob
,
int
parentoffset
,
int
*
addrc
,
int
*
sizec
);
int
ft_verify_fdt
(
void
*
fdt
);
int
arch_fixup_memory_node
(
void
*
blob
);
...
...
include/fdtdec.h
浏览文件 @
f4b0df18
...
...
@@ -297,11 +297,13 @@ int fdtdec_next_compatible_subnode(const void *blob, int node,
* @param na the number of cells used to represent an address
* @param ns the number of cells used to represent a size
* @param sizep a pointer to store the size into. Use NULL if not required
* @param translate Indicates whether to translate the returned value
* using the parent node's ranges property.
* @return address, if found, or FDT_ADDR_T_NONE if not
*/
fdt_addr_t
fdtdec_get_addr_size_fixed
(
const
void
*
blob
,
int
node
,
const
char
*
prop_name
,
int
index
,
int
na
,
int
ns
,
fdt_size_t
*
sizep
);
fdt_size_t
*
sizep
,
bool
translate
);
/*
* Look up an address property in a node and return the parsed address, and
...
...
@@ -317,10 +319,13 @@ fdt_addr_t fdtdec_get_addr_size_fixed(const void *blob, int node,
* @param prop_name name of property to find
* @param index which address to retrieve from a list of addresses. Often 0.
* @param sizep a pointer to store the size into. Use NULL if not required
* @param translate Indicates whether to translate the returned value
* using the parent node's ranges property.
* @return address, if found, or FDT_ADDR_T_NONE if not
*/
fdt_addr_t
fdtdec_get_addr_size_auto_parent
(
const
void
*
blob
,
int
parent
,
int
node
,
const
char
*
prop_name
,
int
index
,
fdt_size_t
*
sizep
);
int
node
,
const
char
*
prop_name
,
int
index
,
fdt_size_t
*
sizep
,
bool
translate
);
/*
* Look up an address property in a node and return the parsed address, and
...
...
@@ -340,10 +345,13 @@ fdt_addr_t fdtdec_get_addr_size_auto_parent(const void *blob, int parent,
* @param prop_name name of property to find
* @param index which address to retrieve from a list of addresses. Often 0.
* @param sizep a pointer to store the size into. Use NULL if not required
* @param translate Indicates whether to translate the returned value
* using the parent node's ranges property.
* @return address, if found, or FDT_ADDR_T_NONE if not
*/
fdt_addr_t
fdtdec_get_addr_size_auto_noparent
(
const
void
*
blob
,
int
node
,
const
char
*
prop_name
,
int
index
,
fdt_size_t
*
sizep
);
const
char
*
prop_name
,
int
index
,
fdt_size_t
*
sizep
,
bool
translate
);
/*
* Look up an address property in a node and return the parsed address.
...
...
include/misc.h
浏览文件 @
f4b0df18
...
...
@@ -37,6 +37,27 @@ int misc_write(struct udevice *dev, int offset, void *buf, int size);
*/
int
misc_ioctl
(
struct
udevice
*
dev
,
unsigned
long
request
,
void
*
buf
);
/*
* Send a message to the device and wait for a response.
*
* The caller provides the message type/ID and payload to be sent.
* The callee constructs any message header required, transmits it to the
* target, waits for a response, checks any error code in the response,
* strips any message header from the response, and returns the error code
* (or a parsed version of it) and the response message payload.
*
* @dev: the device.
* @msgid: the message ID/number to send.
* tx_msg: the request/transmit message payload.
* tx_size: the size of the buffer pointed at by tx_msg.
* rx_msg: the buffer to receive the response message payload. May be NULL if
* the caller only cares about the error code.
* rx_size: the size of the buffer pointed at by rx_msg.
* @return the response message size if OK, -ve on error
*/
int
misc_call
(
struct
udevice
*
dev
,
int
msgid
,
void
*
tx_msg
,
int
tx_size
,
void
*
rx_msg
,
int
rx_size
);
/*
* struct misc_ops - Driver model Misc operations
*
...
...
@@ -74,6 +95,20 @@ struct misc_ops {
* @return: 0 if OK, -ve on error
*/
int
(
*
ioctl
)(
struct
udevice
*
dev
,
unsigned
long
request
,
void
*
buf
);
/*
* Send a message to the device and wait for a response.
*
* @dev: the device
* @msgid: the message ID/number to send
* tx_msg: the request/transmit message payload
* tx_size: the size of the buffer pointed at by tx_msg
* rx_msg: the buffer to receive the response message payload. May be
* NULL if the caller only cares about the error code.
* rx_size: the size of the buffer pointed at by rx_msg
* @return the response message size if OK, -ve on error
*/
int
(
*
call
)(
struct
udevice
*
dev
,
int
msgid
,
void
*
tx_msg
,
int
tx_size
,
void
*
rx_msg
,
int
rx_size
);
};
#endif
/* _MISC_H_ */
lib/fdtdec.c
浏览文件 @
f4b0df18
...
...
@@ -9,6 +9,7 @@
#include <errno.h>
#include <serial.h>
#include <libfdt.h>
#include <fdt_support.h>
#include <fdtdec.h>
#include <asm/sections.h>
#include <linux/ctype.h>
...
...
@@ -77,7 +78,7 @@ const char *fdtdec_get_compatible(enum fdt_compat_id id)
fdt_addr_t
fdtdec_get_addr_size_fixed
(
const
void
*
blob
,
int
node
,
const
char
*
prop_name
,
int
index
,
int
na
,
int
ns
,
fdt_size_t
*
sizep
)
fdt_size_t
*
sizep
,
bool
translate
)
{
const
fdt32_t
*
prop
,
*
prop_end
;
const
fdt32_t
*
prop_addr
,
*
prop_size
,
*
prop_after_size
;
...
...
@@ -112,6 +113,11 @@ fdt_addr_t fdtdec_get_addr_size_fixed(const void *blob, int node,
return
FDT_ADDR_T_NONE
;
}
#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_OF_LIBFDT)
if
(
translate
)
addr
=
fdt_translate_address
(
blob
,
node
,
prop_addr
);
else
#endif
addr
=
fdtdec_get_number
(
prop_addr
,
na
);
if
(
sizep
)
{
...
...
@@ -126,7 +132,8 @@ fdt_addr_t fdtdec_get_addr_size_fixed(const void *blob, int node,
}
fdt_addr_t
fdtdec_get_addr_size_auto_parent
(
const
void
*
blob
,
int
parent
,
int
node
,
const
char
*
prop_name
,
int
index
,
fdt_size_t
*
sizep
)
int
node
,
const
char
*
prop_name
,
int
index
,
fdt_size_t
*
sizep
,
bool
translate
)
{
int
na
,
ns
;
...
...
@@ -147,11 +154,12 @@ fdt_addr_t fdtdec_get_addr_size_auto_parent(const void *blob, int parent,
debug
(
"na=%d, ns=%d, "
,
na
,
ns
);
return
fdtdec_get_addr_size_fixed
(
blob
,
node
,
prop_name
,
index
,
na
,
ns
,
sizep
);
ns
,
sizep
,
translate
);
}
fdt_addr_t
fdtdec_get_addr_size_auto_noparent
(
const
void
*
blob
,
int
node
,
const
char
*
prop_name
,
int
index
,
fdt_size_t
*
sizep
)
const
char
*
prop_name
,
int
index
,
fdt_size_t
*
sizep
,
bool
translate
)
{
int
parent
;
...
...
@@ -164,7 +172,7 @@ fdt_addr_t fdtdec_get_addr_size_auto_noparent(const void *blob, int node,
}
return
fdtdec_get_addr_size_auto_parent
(
blob
,
parent
,
node
,
prop_name
,
index
,
sizep
);
index
,
sizep
,
translate
);
}
fdt_addr_t
fdtdec_get_addr_size
(
const
void
*
blob
,
int
node
,
...
...
@@ -174,7 +182,7 @@ fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
return
fdtdec_get_addr_size_fixed
(
blob
,
node
,
prop_name
,
0
,
sizeof
(
fdt_addr_t
)
/
sizeof
(
fdt32_t
),
ns
,
sizep
);
ns
,
sizep
,
false
);
}
fdt_addr_t
fdtdec_get_addr
(
const
void
*
blob
,
int
node
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录