Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340598
b: refs/heads/master
c: 00ab94e
h: refs/heads/master
v: v3
  • Loading branch information
Richard Cochran authored and David S. Miller committed Nov 1, 2012
1 parent 4836909 commit 55e655d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 78ca0b287314ad6b7b06161b3ff9b13e8a8bcce0
refs/heads/master: 00ab94eeaf6c1ad38ad7368c5148fed31403c8a2
6 changes: 6 additions & 0 deletions trunk/Documentation/devicetree/bindings/net/cpsw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Required properties:
for the specific platform
- slaves : Specifies number for slaves
- cpts_active_slave : Specifies the slave to use for time stamping
- cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
- cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
- slave_reg_ofs : Specifies slave register offset
- sliver_reg_ofs : Specifies slave sliver register offset
- phy_id : Specifies slave phy id
Expand Down Expand Up @@ -62,6 +64,8 @@ Examples:
mac_control = <0x20>;
slaves = <2>;
cpts_active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
cpsw_emac0: slave@0 {
slave_reg_ofs = <0x200>;
sliver_reg_ofs = <0xd80>;
Expand Down Expand Up @@ -98,6 +102,8 @@ Examples:
mac_control = <0x20>;
slaves = <2>;
cpts_active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
cpsw_emac0: slave@0 {
slave_reg_ofs = <0x200>;
sliver_reg_ofs = <0xd80>;
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,20 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
}
data->cpts_active_slave = prop;

if (of_property_read_u32(node, "cpts_clock_mult", &prop)) {
pr_err("Missing cpts_clock_mult property in the DT.\n");
ret = -EINVAL;
goto error_ret;
}
data->cpts_clock_mult = prop;

if (of_property_read_u32(node, "cpts_clock_shift", &prop)) {
pr_err("Missing cpts_clock_shift property in the DT.\n");
ret = -EINVAL;
goto error_ret;
}
data->cpts_clock_shift = prop;

data->slave_data = kzalloc(sizeof(struct cpsw_slave_data) *
data->slaves, GFP_KERNEL);
if (!data->slave_data) {
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/platform_data/cpsw.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ 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 cpts_clock_mult; /* convert input clock ticks to nanoseconds */
u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */

u32 ale_reg_ofs; /* address lookup engine reg offset */
u32 ale_entries; /* ale table size */
Expand Down

0 comments on commit 55e655d

Please sign in to comment.