Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
87
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
706b0a02
Commit
706b0a02
authored
10 years ago
by
Adam Wujek
Browse files
Options
Downloads
Patches
Plain Diff
userspace/libwr: remove files sfp.c and sfp.h, since not used
parent
2fd05d3f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
userspace/libwr/sfp.c
+0
-56
0 additions, 56 deletions
userspace/libwr/sfp.c
userspace/libwr/sfp.h
+0
-60
0 additions, 60 deletions
userspace/libwr/sfp.h
with
0 additions
and
116 deletions
userspace/libwr/sfp.c
deleted
100644 → 0
+
0
−
56
View file @
2fd05d3f
#include
"sfp.h"
#define MUX_ADDR(sel) ((0xE << 3) | (sel & 0x7))
static
const
pio_pin_t
mux_sda
=
{
PIOB
,
0
,
PIO_MODE_GPIO
,
PIO_OUT_1
};
static
const
pio_pin_t
mux_scl
=
{
PIOB
,
1
,
PIO_MODE_GPIO
,
PIO_OUT_1
};
struct
i2c_bus_t
*
mux_bus
;
struct
wr_i2c_mux
sfp_mux
=
{
.
address
=
{
MUX_ADDR
(
0
),
MUX_ADDR
(
1
)
},
.
reset
=
{
.
port
=
PIOD
,
.
pin
=
12
,
.
mode
=
PIO_MODE_GPIO
,
.
dir
=
PIO_OUT_1
}
};
struct
i2c_bus_t
*
sfp_bus0
;
struct
i2c_bus_t
*
sfp_bus1
;
struct
pca9554d
wr_sfp_gpio
[]
=
{
{
/* 0 */
},
{
/* 1 */
},
{
/* 2 */
},
{
/* 3 */
},
{
/* 4 */
},
{
/* 5 */
},
{
/* 6 */
},
{
/* 7 */
},
{
/* 8 */
},
};
struct
wr_sfp_module
[
18
]
void
sfp_init
(
void
)
{
/* Create a bit-banged i2c for the muxes */
mux_bus
=
i2c_cpu_bb_new_bus
(
&
mux_scl
,
&
mux_sda
);
/* Set the bus to be used for the mux control */
sfp_mux
.
bus
=
mux_bus
;
}
This diff is collapsed.
Click to expand it.
userspace/libwr/sfp.h
deleted
100644 → 0
+
0
−
60
View file @
2fd05d3f
#ifndef SFP_H
#define SFP_H
/* This structure describes the pair of PCA9548A chip used as muxes for i2c */
struct
wr_i2c_mux
{
/* I2C bus */
struct
i2c_bus
*
bus
;
/* I2C addresses of the two PCA9548 chips */
int
address
[
2
];
/* Reset pin */
struct
pio_pin_t
reset
;
};
int
wr_i2c_mux_set_channel
(
struct
wr_i2c_mux
*
,
int
);
/* This structure describes a single PCA9554D chip */
struct
pca9554d
{
/* The i2c bus used for access */
struct
i2c_bus_t
*
bus
;
/* The address of this PCA9554D (set by A0,A1,A2 pins) */
int
address
;
int
(
*
init
)(
struct
pca9554d
*
);
int
(
*
exit
)(
struct
pca9554d
*
);
};
int
pca9554d_get_input_reg
(
struct
pca9554d
*
);
int
pca9554d_set_output_reg
(
struct
pca9554d
*
);
int
pca9554d_set_polarity_reg
(
struct
pca9554d
*
);
int
pca9554d_set_config_reg
(
struct
pca9554d
*
);
#define GPIO_BITS_LOWER 0
#define GPIO_BITS_UPPER 1
#define WRLINK_LED_LINK(m) \
(1 << (((m->bits_type == GPIO_BITS_LOWER) ? 0 : 2) + 4*m->bits_type))
#define WRLINK_LED_WRMODE(m) \
(1 << (((m->bits_type == GPIO_BITS_LOWER) ? 1 : 0) + 4*m->bits_type))
#define WRLINK_LED_SYNCED(m) \
(1 << (((m->bits_type == GPIO_BITS_LOWER) ? 3 : 1) + 4*m->bits_type))
#define SFP_TX_DISABLE(m) \
(1 << (((m->bits_type == GPIO_BITS_LOWER) ? 2 : 3) + 4*m->bits_type))
struct
wr_sfp_module
{
/*
* The PCA9554D associated with this device. Use a pointer here
* as a single PCA9554D controls the pins for two SFP modules
* each.
*/
struct
pca9554d
*
gpio_ctl
;
/* One of PCA9554_BITS_LOWER or PCA9554_BITS_UPPER */
int
bits_type
;
/* The PCA9548 chip for accessing this SFP module */
struct
wr_i2c_mux
*
mux
;
/*
* The channel for writing to control register of the
* PCA9548 chips.
*/
int
channel
;
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment