Home
last modified time | relevance | path

Searched refs:fmc (Results 1 – 27 of 27) sorted by relevance

/linux-4.4.14/drivers/fmc/
Dfmc-core.c72 struct fmc_device *fmc = container_of(dev, struct fmc_device, dev); in fmc_release() local
74 kfree(fmc); in fmc_release()
86 struct fmc_device *fmc; in fmc_read_eeprom() local
90 fmc = container_of(dev, struct fmc_device, dev); in fmc_read_eeprom()
91 eelen = fmc->eeprom_len; in fmc_read_eeprom()
98 memcpy(buf, fmc->eeprom + off, count); in fmc_read_eeprom()
107 struct fmc_device *fmc; in fmc_write_eeprom() local
110 fmc = container_of(dev, struct fmc_device, dev); in fmc_write_eeprom()
111 return fmc->op->write_ee(fmc, off, buf, count); in fmc_write_eeprom()
146 struct fmc_device *fmc, **devarray; in fmc_device_register_n() local
[all …]
Dfmc-match.c54 int fmc_fill_id_info(struct fmc_device *fmc) in fmc_fill_id_info() argument
61 if (fmc->eeprom_len && !fmc->eeprom) { in fmc_fill_id_info()
62 fmc->eeprom = kzalloc(fmc->eeprom_len, GFP_KERNEL); in fmc_fill_id_info()
63 if (!fmc->eeprom) in fmc_fill_id_info()
66 ret = fmc->op->read_ee(fmc, 0, fmc->eeprom, fmc->eeprom_len); in fmc_fill_id_info()
72 if (!fmc->eeprom) in fmc_fill_id_info()
75 dev_info(fmc->hwdev, "mezzanine %i\n", fmc->slot_id); /* header */ in fmc_fill_id_info()
78 h = (void *)fmc->eeprom; in fmc_fill_id_info()
92 fmc->id.manufacturer = fru_get_board_manufacturer(h); in fmc_fill_id_info()
93 fmc->id.product_name = fru_get_product_name(h); in fmc_fill_id_info()
[all …]
Dfmc-trivial.c25 struct fmc_device *fmc = dev_id; in t_handler() local
27 fmc->op->irq_ack(fmc); in t_handler()
28 dev_info(&fmc->dev, "received irq %i\n", irq); in t_handler()
44 static int t_probe(struct fmc_device *fmc) in t_probe() argument
49 if (fmc->op->validate) in t_probe()
50 index = fmc->op->validate(fmc, &t_drv); in t_probe()
54 ret = fmc->op->irq_request(fmc, t_handler, "fmc-trivial", IRQF_SHARED); in t_probe()
58 fmc->op->gpio_config(fmc, t_gpio, ARRAY_SIZE(t_gpio)); in t_probe()
62 if (fmc->op->reprogram) in t_probe()
63 ret = fmc->op->reprogram(fmc, &t_drv, ""); in t_probe()
[all …]
Dfmc-write-eeprom.c32 static int fwe_run_tlv(struct fmc_device *fmc, const struct firmware *fw, in fwe_run_tlv() argument
45 dev_err(&fmc->dev, "invalid tlv at offset %ti\n", in fwe_run_tlv()
51 dev_info(&fmc->dev, "write %i bytes at 0x%04x\n", in fwe_run_tlv()
53 err = fmc->op->write_ee(fmc, thisaddr, p + 5, thislen); in fwe_run_tlv()
56 dev_err(&fmc->dev, "write failure @0x%04x\n", in fwe_run_tlv()
64 dev_info(&fmc->dev, "write_eeprom: success\n"); in fwe_run_tlv()
68 static int fwe_run_bin(struct fmc_device *fmc, const struct firmware *fw) in fwe_run_bin() argument
72 dev_info(&fmc->dev, "programming %zi bytes\n", fw->size); in fwe_run_bin()
73 ret = fmc->op->write_ee(fmc, 0, (void *)fw->data, fw->size); in fwe_run_bin()
75 dev_info(&fmc->dev, "write_eeprom: error %i\n", ret); in fwe_run_bin()
[all …]
Dfmc-chardev.c25 struct fmc_device *fmc; member
32 struct fmc_device *fmc; in fc_open() local
41 fmc = fc->fmc; in fc_open()
42 if (try_module_get(fmc->owner) == 0) in fc_open()
45 f->private_data = fmc; in fc_open()
51 struct fmc_device *fmc = f->private_data; in fc_release() local
52 module_put(fmc->owner); in fc_release()
60 struct fmc_device *fmc = f->private_data; in fc_read() local
69 if (addr > fmc->memlen) in fc_read()
71 val = fmc_readl(fmc, addr); in fc_read()
[all …]
Dfmc-fakedev.c90 struct fmc_device *fmc[FF_MAX_MEZZANINES]; member
96 static int ff_reprogram(struct fmc_device *fmc, struct fmc_driver *drv, in ff_reprogram() argument
104 fmc->flags &= ~FMC_DEVICE_HAS_CUSTOM; in ff_reprogram()
105 fmc->flags |= FMC_DEVICE_HAS_GOLDEN; in ff_reprogram()
109 dev_info(&fmc->dev, "reprogramming with %s\n", gw); in ff_reprogram()
110 ret = request_firmware(&fw, gw, &fmc->dev); in ff_reprogram()
112 dev_warn(&fmc->dev, "request firmware \"%s\": error %i\n", in ff_reprogram()
116 fmc->flags &= ~FMC_DEVICE_HAS_GOLDEN; in ff_reprogram()
117 fmc->flags |= FMC_DEVICE_HAS_CUSTOM; in ff_reprogram()
124 static int ff_irq_request(struct fmc_device *fmc, irq_handler_t handler, in ff_irq_request() argument
[all …]
DMakefile2 obj-$(CONFIG_FMC) += fmc.o
4 fmc-y = fmc-core.o
5 fmc-y += fmc-match.o
6 fmc-y += fmc-sdb.o
7 fmc-y += fru-parse.o
8 fmc-y += fmc-dump.o
10 obj-$(CONFIG_FMC_FAKEDEV) += fmc-fakedev.o
11 obj-$(CONFIG_FMC_TRIVIAL) += fmc-trivial.o
12 obj-$(CONFIG_FMC_WRITE_EEPROM) += fmc-write-eeprom.o
13 obj-$(CONFIG_FMC_CHARDEV) += fmc-chardev.o
Dfmc-dump.c44 void fmc_dump_eeprom(const struct fmc_device *fmc) in fmc_dump_eeprom() argument
52 pr_info("FMC: %s (%s), slot %i, device %s\n", dev_name(fmc->hwdev), in fmc_dump_eeprom()
53 fmc->carrier_name, fmc->slot_id, dev_name(&fmc->dev)); in fmc_dump_eeprom()
54 pr_info("FMC: dumping eeprom 0x%x (%i) bytes\n", fmc->eeprom_len, in fmc_dump_eeprom()
55 fmc->eeprom_len); in fmc_dump_eeprom()
57 line = fmc->eeprom; in fmc_dump_eeprom()
59 for (i = 0; i < fmc->eeprom_len; i += LINELEN, line += LINELEN) in fmc_dump_eeprom()
63 void fmc_dump_sdb(const struct fmc_device *fmc) in fmc_dump_sdb() argument
68 if (!fmc->sdb) in fmc_dump_sdb()
75 fmc_show_sdb_tree(fmc); in fmc_dump_sdb()
[all …]
Dfmc-sdb.c18 static uint32_t __sdb_rd(struct fmc_device *fmc, unsigned long address, in __sdb_rd() argument
21 uint32_t res = fmc_readl(fmc, address); in __sdb_rd()
27 static struct sdb_array *__fmc_scan_sdb_tree(struct fmc_device *fmc, in __fmc_scan_sdb_tree() argument
35 onew = fmc_readl(fmc, sdb_addr); in __fmc_scan_sdb_tree()
46 onew = __sdb_rd(fmc, sdb_addr + 4, convert); in __fmc_scan_sdb_tree()
62 arr->fmc = fmc; in __fmc_scan_sdb_tree()
68 __sdb_rd(fmc, sdb_addr + (i * 64) + j, convert); in __fmc_scan_sdb_tree()
79 sub = __fmc_scan_sdb_tree(fmc, subaddr, newbase, in __fmc_scan_sdb_tree()
91 int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address) in fmc_scan_sdb_tree() argument
94 if (fmc->sdb) in fmc_scan_sdb_tree()
[all …]
DKconfig17 is at git://ohwr.org/fmc-projects/fmc-bus.git .
/linux-4.4.14/include/linux/
Dfmc.h132 uint32_t (*read32)(struct fmc_device *fmc, int offset);
133 void (*write32)(struct fmc_device *fmc, uint32_t value, int offset);
134 int (*validate)(struct fmc_device *fmc, struct fmc_driver *drv);
136 int (*irq_request)(struct fmc_device *fmc, irq_handler_t h,
138 void (*irq_ack)(struct fmc_device *fmc);
139 int (*irq_free)(struct fmc_device *fmc);
140 int (*gpio_config)(struct fmc_device *fmc, struct fmc_gpio *gpio,
142 int (*read_ee)(struct fmc_device *fmc, int pos, void *d, int l);
143 int (*write_ee)(struct fmc_device *fmc, int pos, const void *d, int l);
195 static inline uint32_t fmc_readl(struct fmc_device *fmc, int offset) in fmc_readl() argument
[all …]
Dfmc-sdb.h28 struct fmc_device *fmc; /* the device that hosts it */ member
34 extern int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
35 extern void fmc_show_sdb_tree(const struct fmc_device *fmc);
38 extern int fmc_free_sdb_tree(struct fmc_device *fmc);
/linux-4.4.14/Documentation/fmc/
D00-INDEX3 wrote for the externally-developed fmc-bus package. The complete
5 http://www.ohwr.org/projects/fmc-bus/files
28 fmc-fakedev.txt
29 - about drivers/fmc/fmc-fakedev.ko
31 fmc-trivial.txt
32 - about drivers/fmc/fmc-trivial.ko
34 fmc-write-eeprom.txt
35 - about drivers/fmc/fmc-write-eeprom.ko
37 fmc-chardev.txt
38 - about drivers/fmc/fmc-chardev.ko
Dfmc-chardev.txt1 fmc-chardev
9 the name can be a silly fmc-0000 look-alike if the device has no
10 identifiers nor bus_id, a more specific fmc-0400 if the device has a
30 default name is fmc-<bus><devfn>, and there are two cards in the system:
32 spusa.root# insmod fmc-chardev.ko
34 [ 1073.345051] spec 0000:02:00.0: Created misc device "fmc-0200"
36 [ 1073.356525] spec 0000:04:00.0: Created misc device "fmc-0400"
37 spusa.root# ls -l /dev/fmc*
38 crw------- 1 root root 10, 58 Nov 20 19:23 /dev/fmc-0200
39 crw------- 1 root root 10, 57 Nov 20 19:23 /dev/fmc-0400
[all …]
Dfmc-fakedev.txt1 fmc-fakedev
4 This package includes a software-only device, called fmc-fakedev, which
21 spusa.root# insmod fmc-fakedev.ko
22 [ 99.971247] fake-fmc-carrier: mezzanine 0
25 spusa.root# rmmod fmc-fakedev
26 spusa.root# insmod fmc-fakedev.ko eeprom=fdelay-eeprom.bin
27 [ 121.447464] fake-fmc-carrier: Mezzanine 0: eeprom "fdelay-eeprom.bin"
28 [ 121.462725] fake-fmc-carrier: mezzanine 0
31 spusa.root# rmmod fmc-fakedev
36 This is shown in fmc-write-eeprom.txt
Dfmc-write-eeprom.txt1 fmc-write-eeprom
48 spusa.root# insmod /tmp/fmc-write-eeprom.ko busid=0x0200 file=try.tlv
58 fmc-fakedev.ko module (see *note fmc-fakedev::). Whenever you change
60 after two seconds. Please note, however, that if fmc-write-eeprom is
66 spusa.root# insmod fmc-fakedev.ko
67 [ 72.984733] fake-fmc: Manufacturer: fake-vendor
68 [ 72.989434] fake-fmc: Product name: fake-design-for-testing
69 spusa.root# insmod fmc-write-eeprom.ko busid=0 file=fdelay-eeprom.bin; \
70 rmmod fmc-write-eeprom
71 [ 130.874098] fake-fmc: Matching a generic driver (no ID)
[all …]
DAPI.txt1 Functions Exported by fmc.ko
9 int fmc_device_register(struct fmc_device *fmc);
10 void fmc_device_unregister(struct fmc_device *fmc);
12 int fmc_device_register_n(struct fmc_device **fmc, int n);
13 void fmc_device_unregister_n(struct fmc_device **fmc, int n);
15 uint32_t fmc_readl(struct fmc_device *fmc, int offset);
16 void fmc_writel(struct fmc_device *fmc, uint32_t val, int off);
17 void *fmc_get_drvdata(struct fmc_device *fmc);
18 void fmc_set_drvdata(struct fmc_device *fmc, void *data);
27 The fmc-bus itself takes care of releasing the structure when their use
DFMC-and-SDB.txt21 git://ohwr.org/fmc-projects/fmc-bus.git (read-only)
22 git@ohwr.org:fmc-projects/fmc-bus.git (read-write for developers)
26 project: `http://www.ohwr.org/projects/fmc-bus/files'
75 The fmc.ko bus driver exports a few functions to help drivers taking
80 <linux/fmc-sdb.h>. The linux/ prefix in the name is there because we
84 int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
85 void fmc_show_sdb_tree(struct fmc_device *fmc);
88 int fmc_free_sdb_tree(struct fmc_device *fmc);
Dcarrier.txt26 change in layout of some fmc data structures). Device writers should
53 char *mezzanine_name; /* Defaults to ``fmc'' */
115 * mezzanine_name: filled by fmc-bus during identification.
123 the fmc-bus environment, and is a good reference to look at.
135 uint32_t (*readl)(struct fmc_device *fmc, int offset);
136 void (*writel)(struct fmc_device *fmc, uint32_t value, int offset);
138 int (*validate)(struct fmc_device *fmc, struct fmc_driver *drv);
139 int (*irq_request)(struct fmc_device *fmc, irq_handler_t h,
141 void (*irq_ack)(struct fmc_device *fmc);
142 int (*irq_free)(struct fmc_device *fmc);
[all …]
Dfmc-trivial.txt1 fmc-trivial
4 The simple module fmc-trivial is just a simple client that registers an
Dparameters.txt1 Module Parameters in fmc.ko
6 /sys/module/fmc/parameters/, because they are used when client drivers
7 are devices are registered, not when fmc.ko is loaded.
Dmezzanine.txt29 the `fmc.h' file - we hope other users will exploit our framework with
72 A better reference, with full explanation, is the <linux/fmc.h> header.
109 Note: the parameter is being obsoleted, because fmc.ko itself now
118 insmod fmc-trivial.ko \
120 gateware=fmc/fine-delay.bin,fmc/simple-dio.bin
Didentifiers.txt48 FRU_VENDOR -v "Board Manufacturer" fmc-example
111 for more-than-minimal FRU structures, the fmc.ko will look for the SDB
/linux-4.4.14/drivers/
DMakefile163 obj-$(CONFIG_FMC) += fmc/
DKconfig175 source "drivers/fmc/Kconfig"
/linux-4.4.14/Documentation/
D00-INDEX194 fmc/
/linux-4.4.14/
DMAINTAINERS4406 W: http://www.ohwr.org/projects/fmc-bus
4408 F: drivers/fmc/
4409 F: include/linux/fmc*.h