提交 78ca0b28 编写于 作者: R Richard Cochran 提交者: David S. Miller

cpsw: add a DT field for the active time stamping port

Because time stamping on both external ports of the switch simultaneously
is positively useless from the application's point of view, this patch
provides a DT configuration method to choose the active port.
Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6b60393e
......@@ -23,6 +23,7 @@ Required properties:
- mac_control : Specifies Default MAC control register content
for the specific platform
- slaves : Specifies number for slaves
- cpts_active_slave : Specifies the slave to use for time stamping
- slave_reg_ofs : Specifies slave register offset
- sliver_reg_ofs : Specifies slave sliver register offset
- phy_id : Specifies slave phy id
......@@ -60,6 +61,7 @@ Examples:
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
cpts_active_slave = <0>;
cpsw_emac0: slave@0 {
slave_reg_ofs = <0x200>;
sliver_reg_ofs = <0xd80>;
......@@ -95,6 +97,7 @@ Examples:
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
cpts_active_slave = <0>;
cpsw_emac0: slave@0 {
slave_reg_ofs = <0x200>;
sliver_reg_ofs = <0xd80>;
......
......@@ -847,6 +847,13 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
}
data->slaves = prop;
if (of_property_read_u32(node, "cpts_active_slave", &prop)) {
pr_err("Missing cpts_active_slave property in the DT.\n");
ret = -EINVAL;
goto error_ret;
}
data->cpts_active_slave = prop;
data->slave_data = kzalloc(sizeof(struct cpsw_slave_data) *
data->slaves, GFP_KERNEL);
if (!data->slave_data) {
......
......@@ -33,6 +33,7 @@ struct cpsw_platform_data {
u32 slaves; /* number of slave cpgmac ports */
struct cpsw_slave_data *slave_data;
u32 cpts_active_slave; /* time stamping slave */
u32 ale_reg_ofs; /* address lookup engine reg offset */
u32 ale_entries; /* ale table size */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册