|
@@ -60,9 +60,35 @@ static const uint8_t realtek_eeprom_bits[] = {
|
60
|
60
|
[SPI_BIT_SCLK] = RTL_9346CR_EESK,
|
61
|
61
|
[SPI_BIT_MOSI] = RTL_9346CR_EEDI,
|
62
|
62
|
[SPI_BIT_MISO] = RTL_9346CR_EEDO,
|
63
|
|
- [SPI_BIT_SS(0)] = ( RTL_9346CR_EECS | RTL_9346CR_EEM1 ),
|
|
63
|
+ [SPI_BIT_SS(0)] = RTL_9346CR_EECS,
|
64
|
64
|
};
|
65
|
65
|
|
|
66
|
+/**
|
|
67
|
+ * Open bit-bashing interface
|
|
68
|
+ *
|
|
69
|
+ * @v basher Bit-bashing interface
|
|
70
|
+ */
|
|
71
|
+static void realtek_spi_open_bit ( struct bit_basher *basher ) {
|
|
72
|
+ struct realtek_nic *rtl = container_of ( basher, struct realtek_nic,
|
|
73
|
+ spibit.basher );
|
|
74
|
+
|
|
75
|
+ /* Enable EEPROM access */
|
|
76
|
+ writeb ( RTL_9346CR_EEM_EEPROM, rtl->regs + RTL_9346CR );
|
|
77
|
+}
|
|
78
|
+
|
|
79
|
+/**
|
|
80
|
+ * Close bit-bashing interface
|
|
81
|
+ *
|
|
82
|
+ * @v basher Bit-bashing interface
|
|
83
|
+ */
|
|
84
|
+static void realtek_spi_close_bit ( struct bit_basher *basher ) {
|
|
85
|
+ struct realtek_nic *rtl = container_of ( basher, struct realtek_nic,
|
|
86
|
+ spibit.basher );
|
|
87
|
+
|
|
88
|
+ /* Disable EEPROM access */
|
|
89
|
+ writeb ( RTL_9346CR_EEM_NORMAL, rtl->regs + RTL_9346CR );
|
|
90
|
+}
|
|
91
|
+
|
66
|
92
|
/**
|
67
|
93
|
* Read input bit
|
68
|
94
|
*
|
|
@@ -108,6 +134,8 @@ static void realtek_spi_write_bit ( struct bit_basher *basher,
|
108
|
134
|
|
109
|
135
|
/** SPI bit-bashing interface */
|
110
|
136
|
static struct bit_basher_operations realtek_basher_ops = {
|
|
137
|
+ .open = realtek_spi_open_bit,
|
|
138
|
+ .close = realtek_spi_close_bit,
|
111
|
139
|
.read = realtek_spi_read_bit,
|
112
|
140
|
.write = realtek_spi_write_bit,
|
113
|
141
|
};
|