1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
3 * Copyright 2010-2011 Freescale Semiconductor, Inc.
13 /* The process device underlies process-wide user/kernel interactions, such as
14 * mapping dma_mem memory and providing accompanying ioctl()s. (This isn't used
15 * for portals, which use one UIO device each.).
17 #define PROCESS_PATH "/dev/fsl-usdpaa"
19 /* Allocation of resource IDs uses a generic interface. This enum is used to
20 * distinguish between the type of underlying object being manipulated.
27 dpaa_id_max /* <-- not a valid type, represents the number of types */
30 int process_alloc(enum dpaa_id_type id_type, uint32_t *base, uint32_t num,
31 uint32_t align, int partial);
32 void process_release(enum dpaa_id_type id_type, uint32_t base, uint32_t num);
34 int process_reserve(enum dpaa_id_type id_type, uint32_t base, uint32_t num);
36 /* Mapping and using QMan/BMan portals */
37 enum dpaa_portal_type {
42 struct dpaa_portal_map {
47 struct dpaa_ioctl_portal_map {
48 /* Input parameter, is a qman or bman portal required. */
49 enum dpaa_portal_type type;
50 /* Specifes a specific portal index to map or 0xffffffff
55 /* Return value if the map succeeds, this gives the mapped
56 * cache-inhibited (cinh) and cache-enabled (cena) addresses.
58 struct dpaa_portal_map addr;
60 /* Qman-specific return values */
65 int process_portal_map(struct dpaa_ioctl_portal_map *params);
66 int process_portal_unmap(struct dpaa_portal_map *map);
68 struct dpaa_ioctl_irq_map {
69 enum dpaa_portal_type type; /* Type of portal to map */
70 int fd; /* File descriptor that contains the portal */
71 void *portal_cinh; /* Cache inhibited area to identify the portal */
74 int process_portal_irq_map(int fd, struct dpaa_ioctl_irq_map *irq);
75 int process_portal_irq_unmap(int fd);
77 #endif /* __PROCESS_H */