author | Florian Pose <fp@igh.de> |
Fri, 27 Oct 2017 12:18:11 +0200 | |
branch | stable-1.5 |
changeset 2690 | d984f57bef97 |
parent 2638 | 5995331a55fe |
permissions | -rw-r--r-- |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
1 |
/** |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
2 |
Network Driver for Beckhoff CCAT communication controller |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
3 |
Copyright (C) 2014 Beckhoff Automation GmbH |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
4 |
Author: Patrick Bruenn <p.bruenn@beckhoff.com> |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
5 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
6 |
This program is free software; you can redistribute it and/or modify |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
7 |
it under the terms of the GNU General Public License as published by |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
8 |
the Free Software Foundation; either version 2 of the License, or |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
9 |
(at your option) any later version. |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
10 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
11 |
This program is distributed in the hope that it will be useful, |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
14 |
GNU General Public License for more details. |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
15 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
16 |
You should have received a copy of the GNU General Public License along |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
17 |
with this program; if not, write to the Free Software Foundation, Inc., |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
18 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
19 |
*/ |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
20 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
21 |
#include <linux/kernel.h> |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
22 |
#include <linux/module.h> |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
23 |
#include <linux/sched.h> |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
24 |
#include <linux/uaccess.h> |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
25 |
#include "module.h" |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
26 |
|
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
27 |
#define CCAT_DEVICES_MAX 5 |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
28 |
#define CCAT_DATA_IN_4 0x038 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
29 |
#define CCAT_DATA_IN_N 0x7F0 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
30 |
#define CCAT_DATA_OUT_4 0x030 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
31 |
#define CCAT_DATA_BLOCK_SIZE (size_t)((CCAT_DATA_IN_N - CCAT_DATA_IN_4)/8) |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
32 |
#define CCAT_WRITE_BLOCK_SIZE 128 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
33 |
#define CCAT_FLASH_SIZE (size_t)0xE0000 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
34 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
35 |
/** FUNCTION_NAME CMD, CLOCKS */ |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
36 |
#define CCAT_BULK_ERASE 0xE3, 8 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
37 |
#define CCAT_GET_PROM_ID 0xD5, 40 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
38 |
#define CCAT_READ_FLASH 0xC0, 32 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
39 |
#define CCAT_READ_STATUS 0xA0, 16 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
40 |
#define CCAT_WRITE_ENABLE 0x60, 8 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
41 |
#define CCAT_WRITE_FLASH 0x40, 32 |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
42 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
43 |
/* from http://graphics.stanford.edu/~seander/bithacks.html#ReverseByteWith32Bits */ |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
44 |
#define SWAP_BITS(B) \ |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
45 |
((((B) * 0x0802LU & 0x22110LU) | ((B) * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16) |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
46 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
47 |
/** |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
48 |
* wait_until_busy_reset() - wait until the busy flag was reset |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
49 |
* @ioaddr: address of the CCAT Update function in PCI config space |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
50 |
*/ |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
51 |
static inline void wait_until_busy_reset(void __iomem * const ioaddr) |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
52 |
{ |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
53 |
wmb(); |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
54 |
while (ioread8(ioaddr + 1)) { |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
55 |
schedule(); |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
56 |
} |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
57 |
} |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
58 |
|
2571
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
59 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
60 |
* __ccat_update_cmd() - Helper to issue a FPGA flash command |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
61 |
* @ioaddr: address of the CCAT Update function in PCI config space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
62 |
* @cmd: the command identifier |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
63 |
* @clocks: the number of clocks associated with the specified command |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
64 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
65 |
* no write memory barrier is called and the busy flag is not evaluated |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
66 |
*/ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
67 |
static inline void __ccat_update_cmd(void __iomem * const ioaddr, u8 cmd, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
68 |
u16 clocks) |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
69 |
{ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
70 |
iowrite8((0xff00 & clocks) >> 8, ioaddr); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
71 |
iowrite8(0x00ff & clocks, ioaddr + 0x8); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
72 |
iowrite8(cmd, ioaddr + 0x10); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
73 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
74 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
75 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
76 |
* ccat_update_cmd() - Helper to issue a FPGA flash command |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
77 |
* @ioaddr: address of the CCAT Update function in PCI config space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
78 |
* @cmd: the command identifier |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
79 |
* @clocks: the number of clocks associated with the specified command |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
80 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
81 |
* Triggers a full flash command cycle with write memory barrier and |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
82 |
* command activate. This call blocks until the busy flag is reset. |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
83 |
*/ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
84 |
static inline void ccat_update_cmd(void __iomem * const ioaddr, u8 cmd, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
85 |
u16 clocks) |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
86 |
{ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
87 |
__ccat_update_cmd(ioaddr, cmd, clocks); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
88 |
wmb(); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
89 |
iowrite8(0xff, ioaddr + 0x7f8); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
90 |
wait_until_busy_reset(ioaddr); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
91 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
92 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
93 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
94 |
* ccat_update_cmd_addr() - Helper to issue a FPGA flash command with address parameter |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
95 |
* @ioaddr: address of the CCAT Update function in PCI config space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
96 |
* @cmd: the command identifier |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
97 |
* @clocks: the number of clocks associated with the specified command |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
98 |
* @addr: 24 bit address associated with the specified command |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
99 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
100 |
* Triggers a full flash command cycle with write memory barrier and |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
101 |
* command activate. This call blocks until the busy flag is reset. |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
102 |
*/ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
103 |
static inline void ccat_update_cmd_addr(void __iomem * const ioaddr, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
104 |
u8 cmd, u16 clocks, u32 addr) |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
105 |
{ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
106 |
const u8 addr_0 = SWAP_BITS(addr & 0xff); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
107 |
const u8 addr_1 = SWAP_BITS((addr & 0xff00) >> 8); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
108 |
const u8 addr_2 = SWAP_BITS((addr & 0xff0000) >> 16); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
109 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
110 |
__ccat_update_cmd(ioaddr, cmd, clocks); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
111 |
iowrite8(addr_2, ioaddr + 0x18); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
112 |
iowrite8(addr_1, ioaddr + 0x20); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
113 |
iowrite8(addr_0, ioaddr + 0x28); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
114 |
wmb(); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
115 |
iowrite8(0xff, ioaddr + 0x7f8); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
116 |
wait_until_busy_reset(ioaddr); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
117 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
118 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
119 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
120 |
* ccat_get_status() - Read CCAT Update status |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
121 |
* @ioaddr: address of the CCAT Update function in PCI config space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
122 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
123 |
* Return: the current status of the CCAT Update function |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
124 |
*/ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
125 |
static u8 ccat_get_status(void __iomem * const ioaddr) |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
126 |
{ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
127 |
ccat_update_cmd(ioaddr, CCAT_READ_STATUS); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
128 |
return ioread8(ioaddr + 0x20); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
129 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
130 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
131 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
132 |
* ccat_read_flash_block() - Read a block of CCAT configuration data from flash |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
133 |
* @ioaddr: address of the CCAT Update function in PCI config space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
134 |
* @addr: 24 bit address of the block to read |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
135 |
* @len: number of bytes to read from this block, len <= CCAT_DATA_BLOCK_SIZE |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
136 |
* @buf: output buffer in user space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
137 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
138 |
* Copies one block of configuration data from the CCAT FPGA's flash to |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
139 |
* the user space buffer. |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
140 |
* Note that the size of the FPGA's firmware is not known exactly so it |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
141 |
* is very possible that the overall buffer ends with a lot of 0xff. |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
142 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
143 |
* Return: the number of bytes copied |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
144 |
*/ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
145 |
static int ccat_read_flash_block(void __iomem * const ioaddr, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
146 |
const u32 addr, const u16 len, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
147 |
char __user * const buf) |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
148 |
{ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
149 |
u16 i; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
150 |
const u16 clocks = 8 * len; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
151 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
152 |
ccat_update_cmd_addr(ioaddr, CCAT_READ_FLASH + clocks, addr); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
153 |
for (i = 0; i < len; i++) { |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
154 |
put_user(ioread8(ioaddr + CCAT_DATA_IN_4 + 8 * i), buf + i); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
155 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
156 |
return len; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
157 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
158 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
159 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
160 |
* ccat_read_flash() - Read a chunk of CCAT configuration data from flash |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
161 |
* @ioaddr: address of the CCAT Update function in PCI config space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
162 |
* @buf: output buffer in user space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
163 |
* @len: number of bytes to read |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
164 |
* @off: offset in the configuration data |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
165 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
166 |
* Copies multiple blocks of configuration data from the CCAT FPGA's |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
167 |
* flash to the user space buffer. |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
168 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
169 |
* Return: the number of bytes copied |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
170 |
*/ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
171 |
static int ccat_read_flash(void __iomem * const ioaddr, char __user * buf, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
172 |
u32 len, loff_t * off) |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
173 |
{ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
174 |
const loff_t start = *off; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
175 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
176 |
while (len > CCAT_DATA_BLOCK_SIZE) { |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
177 |
*off += |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
178 |
ccat_read_flash_block(ioaddr, *off, CCAT_DATA_BLOCK_SIZE, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
179 |
buf); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
180 |
buf += CCAT_DATA_BLOCK_SIZE; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
181 |
len -= CCAT_DATA_BLOCK_SIZE; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
182 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
183 |
*off += ccat_read_flash_block(ioaddr, *off, len, buf); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
184 |
return *off - start; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
185 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
186 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
187 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
188 |
* ccat_wait_status_cleared() - wait until CCAT status is cleared |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
189 |
* @ioaddr: address of the CCAT Update function in PCI config space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
190 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
191 |
* Blocks until bit 7 of the CCAT Update status is reset |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
192 |
*/ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
193 |
static void ccat_wait_status_cleared(void __iomem * const ioaddr) |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
194 |
{ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
195 |
u8 status; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
196 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
197 |
do { |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
198 |
status = ccat_get_status(ioaddr); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
199 |
} while (status & (1 << 7)); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
200 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
201 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
202 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
203 |
* ccat_write_flash_block() - Write a block of CCAT configuration data to flash |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
204 |
* @ioaddr: address of the CCAT Update function in PCI config space |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
205 |
* @addr: 24 bit start address in the CCAT FPGA's flash |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
206 |
* @len: number of bytes to write in this block, len <= CCAT_WRITE_BLOCK_SIZE |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
207 |
* @buf: input buffer |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
208 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
209 |
* Copies one block of configuration data to the CCAT FPGA's flash |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
210 |
* |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
211 |
* Return: the number of bytes copied |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
212 |
*/ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
213 |
static int ccat_write_flash_block(void __iomem * const ioaddr, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
214 |
const u32 addr, const u16 len, |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
215 |
const char *const buf) |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
216 |
{ |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
217 |
const u16 clocks = 8 * len; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
218 |
u16 i; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
219 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
220 |
ccat_update_cmd(ioaddr, CCAT_WRITE_ENABLE); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
221 |
for (i = 0; i < len; i++) { |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
222 |
iowrite8(buf[i], ioaddr + CCAT_DATA_OUT_4 + 8 * i); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
223 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
224 |
ccat_update_cmd_addr(ioaddr, CCAT_WRITE_FLASH + clocks, addr); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
225 |
ccat_wait_status_cleared(ioaddr); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
226 |
return len; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
227 |
} |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
228 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
229 |
/** |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
230 |
* ccat_write_flash() - Write a new CCAT configuration to FPGA's flash |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
231 |
* @update: a CCAT Update buffer containing the new FPGA configuration |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
232 |
*/ |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
233 |
static void ccat_write_flash(const struct cdev_buffer *const buffer) |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
234 |
{ |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
235 |
const char *buf = buffer->data; |
2571
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
236 |
u32 off = 0; |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
237 |
size_t len = buffer->size; |
2571
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
238 |
|
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
239 |
while (len > CCAT_WRITE_BLOCK_SIZE) { |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
240 |
ccat_write_flash_block(buffer->ccdev->ioaddr, off, |
2571
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
241 |
(u16) CCAT_WRITE_BLOCK_SIZE, buf); |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
242 |
off += CCAT_WRITE_BLOCK_SIZE; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
243 |
buf += CCAT_WRITE_BLOCK_SIZE; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
244 |
len -= CCAT_WRITE_BLOCK_SIZE; |
a4fdad543554
reorder functions in update.c to omit forward declarations
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2570
diff
changeset
|
245 |
} |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
246 |
ccat_write_flash_block(buffer->ccdev->ioaddr, off, (u16) len, buf); |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
247 |
} |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
248 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
249 |
static int ccat_update_release(struct inode *const i, struct file *const f) |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
250 |
{ |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
251 |
const struct cdev_buffer *const buf = f->private_data; |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
252 |
void __iomem *ioaddr = buf->ccdev->ioaddr; |
2567
d70aad2f131f
- use short kernel types, add empty lines after variable declaration to conform better with linux coding style
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2565
diff
changeset
|
253 |
|
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
254 |
if (buf->size > 0) { |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
255 |
ccat_update_cmd(ioaddr, CCAT_WRITE_ENABLE); |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
256 |
ccat_update_cmd(ioaddr, CCAT_BULK_ERASE); |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
257 |
ccat_wait_status_cleared(ioaddr); |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
258 |
ccat_write_flash(buf); |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
259 |
} |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
260 |
return ccat_cdev_release(i, f); |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
261 |
} |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
262 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
263 |
/** |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
264 |
* ccat_update_read() - Read CCAT configuration data from flash |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
265 |
* @f: file handle previously initialized with ccat_update_open() |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
266 |
* @buf: buffer in user space provided for our data |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
267 |
* @len: length of the user space buffer |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
268 |
* @off: current offset of our file operation |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
269 |
* |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
270 |
* Copies data from the CCAT FPGA's configuration flash to user space. |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
271 |
* Note that the size of the FPGA's firmware is not known exactly so it |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
272 |
* is very possible that the overall buffer ends with a lot of 0xff. |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
273 |
* |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
274 |
* Return: the number of bytes written, or 0 if EOF reached |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
275 |
*/ |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
276 |
static ssize_t ccat_update_read(struct file *const f, char __user * buf, |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
277 |
size_t len, loff_t * off) |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
278 |
{ |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
279 |
struct cdev_buffer *buffer = f->private_data; |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
280 |
const size_t iosize = buffer->ccdev->iosize; |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
281 |
|
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
282 |
if (*off >= iosize) { |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
283 |
return 0; |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
284 |
} |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
285 |
|
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
286 |
len = min(len, (size_t) (iosize - *off)); |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
287 |
|
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
288 |
return ccat_read_flash(buffer->ccdev->ioaddr, buf, len, off); |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
289 |
} |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
290 |
|
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
291 |
/** |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
292 |
* ccat_update_write() - Write data to the CCAT FPGA's configuration flash |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
293 |
* @f: file handle previously initialized with ccat_update_open() |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
294 |
* @buf: buffer in user space providing the new configuration data (from *.rbf) |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
295 |
* @len: length of the user space buffer |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
296 |
* @off: current offset in the configuration data |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
297 |
* |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
298 |
* Copies data from user space (possibly a *.rbf) to the CCAT FPGA's |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
299 |
* configuration flash. |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
300 |
* |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
301 |
* Return: the number of bytes written, or 0 if flash end is reached |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
302 |
*/ |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
303 |
static ssize_t ccat_update_write(struct file *const f, const char __user * buf, |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
304 |
size_t len, loff_t * off) |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
305 |
{ |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
306 |
struct cdev_buffer *const buffer = f->private_data; |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
307 |
|
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
308 |
if (*off + len > buffer->ccdev->iosize) { |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
309 |
return 0; |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
310 |
} |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
311 |
|
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
312 |
if (copy_from_user(buffer->data + *off, buf, len)) { |
2559
a24ff468cb25
Avoided unused return value warning.
Florian Pose <fp@igh-essen.com>
parents:
2553
diff
changeset
|
313 |
return -EFAULT; |
a24ff468cb25
Avoided unused return value warning.
Florian Pose <fp@igh-essen.com>
parents:
2553
diff
changeset
|
314 |
} |
a24ff468cb25
Avoided unused return value warning.
Florian Pose <fp@igh-essen.com>
parents:
2553
diff
changeset
|
315 |
|
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
316 |
*off += len; |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
317 |
buffer->size = *off; |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
318 |
return len; |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
319 |
} |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
320 |
|
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
321 |
static struct ccat_cdev dev_table[CCAT_DEVICES_MAX]; |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
322 |
static struct ccat_class cdev_class = { |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
323 |
.count = CCAT_DEVICES_MAX, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
324 |
.devices = dev_table, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
325 |
.name = "ccat_update", |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
326 |
.fops = { |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
327 |
.owner = THIS_MODULE, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
328 |
.open = ccat_cdev_open, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
329 |
.release = ccat_update_release, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
330 |
.read = ccat_update_read, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
331 |
.write = ccat_update_write, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
332 |
}, |
2550
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
333 |
}; |
7e25950ea941
replace not working symlinks with real copies from the ccat main repository(git)
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2549
diff
changeset
|
334 |
|
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
335 |
static int ccat_update_probe(struct ccat_function *func) |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
336 |
{ |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
337 |
static const u16 SUPPORTED_REVISION = 0x00; |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
338 |
|
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
339 |
if (SUPPORTED_REVISION != func->info.rev) { |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
340 |
pr_warn("CCAT Update rev. %d not supported\n", func->info.rev); |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
341 |
return -ENODEV; |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
342 |
} |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
343 |
return ccat_cdev_probe(func, &cdev_class, CCAT_FLASH_SIZE); |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
344 |
} |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
345 |
|
2638
5995331a55fe
update ccat driver to v0.14
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2636
diff
changeset
|
346 |
const struct ccat_driver update_driver = { |
2636
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
347 |
.type = CCATINFO_EPCS_PROM, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
348 |
.probe = ccat_update_probe, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
349 |
.remove = ccat_cdev_remove, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
350 |
.cdev_class = &cdev_class, |
0613017547fe
update ccat driver to v0.13
Patrick Bruenn <p.bruenn@beckhoff.com>
parents:
2573
diff
changeset
|
351 |
}; |