Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
0ac7ee3d
Commit
0ac7ee3d
authored
Jan 19, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel modules: fixed init/remap in nic
parent
a8379d91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
device.c
kernel/wr_nic/device.c
+4
-7
nic-hardware.h
kernel/wr_nic/nic-hardware.h
+3
-4
No files found.
kernel/wr_nic/device.c
View file @
0ac7ee3d
...
...
@@ -10,7 +10,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/netdevice.h>
...
...
@@ -64,7 +63,7 @@ static int __devexit wrn_remove(struct platform_device *pdev)
/* This helper is used by probe below */
static
int
__devinit
__wrn_map_resources
(
struct
platform_device
*
pdev
)
{
int
i
=
0
;
int
i
;
struct
resource
*
res
;
void
__iomem
*
ptr
;
struct
wrn_dev
*
wrn
=
pdev
->
dev
.
platform_data
;
...
...
@@ -73,8 +72,9 @@ static int __devinit __wrn_map_resources(struct platform_device *pdev)
* The memory regions are mapped once for all endpoints.
* We don't populate the whole array, but use the resource list
*/
while
(
(
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
i
))
)
{
if
(
!
res
->
start
)
for
(
i
=
0
;
i
<
pdev
->
num_resources
;
i
++
)
{
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
i
);
if
(
!
res
||
!
res
->
start
)
continue
;
ptr
=
ioremap
(
res
->
start
,
res
->
end
+
1
-
res
->
start
);
if
(
!
ptr
)
{
...
...
@@ -86,8 +86,6 @@ static int __devinit __wrn_map_resources(struct platform_device *pdev)
pr_debug
(
"Remapped %08x (block %i) to %p
\n
"
,
res
->
start
,
i
,
ptr
);
wrn
->
bases
[
i
]
=
ptr
;
i
++
;
/* next please */
}
return
0
;
}
...
...
@@ -115,7 +113,6 @@ static int __devinit wrn_probe(struct platform_device *pdev)
/* Map our resource list and instantiate the shortcut pointers */
if
(
(
err
=
__wrn_map_resources
(
pdev
))
)
goto
out
;
wrn
->
regs
=
wrn
->
bases
[
WRN_FB_NIC
];
wrn
->
txtsu_regs
=
wrn
->
bases
[
WRN_FB_TS
];
...
...
kernel/wr_nic/nic-hardware.h
View file @
0ac7ee3d
...
...
@@ -37,7 +37,7 @@
* 0x20000 - 0x20fff NIC control regs and descriptor area
* 0x28000 - 0x2bfff NIC packet buffer (16k)
* 0x30000 - 0x4ffff: Endpoints
* 0x30000 + N * 0x
2
00 Endpoint N control registers
* 0x30000 + N * 0x
4
00 Endpoint N control registers
* 0x50000 - 0x50fff: VIC
* 0x51000 - 0x51fff: Tstamp unit
* 0x52000 - 0x52fff: PPS gen
...
...
@@ -47,8 +47,8 @@
#define FPGA_SIZE_NIC 0x00010000
#define FPGA_BASE_EP 0x10030000
#define FPGA_SIZE_EP 0x00010000
#define FPGA_SIZE_EACH_EP 0x
2
00
#define FPGA_BASE_VIC 0x10050000
#define FPGA_SIZE_EACH_EP 0x
4
00
#define FPGA_BASE_VIC 0x10050000
/* not used here */
#define FPGA_SIZE_VIC 0x00001000
#define FPGA_BASE_TS 0x10051000
#define FPGA_SIZE_TS 0x00001000
...
...
@@ -58,7 +58,6 @@
enum
fpga_blocks
{
WRN_FB_NIC
,
WRN_FB_EP
,
WRN_FB_VIC
,
/* not mapped here (but in wr-vic.ko) */
WRN_FB_TS
,
WRN_FB_PPSG
,
WRN_NR_OF_BLOCKS
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment