Peter Griffin | bb6869b | 2016-10-18 10:39:06 +0100 | [diff] [blame] | 1 | /* |
| 2 | * SLIM core rproc driver header |
| 3 | * |
| 4 | * Copyright (C) 2016 STMicroelectronics |
| 5 | * |
| 6 | * Author: Peter Griffin <peter.griffin@linaro.org> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | */ |
| 13 | #ifndef _ST_REMOTEPROC_SLIM_H |
| 14 | #define _ST_REMOTEPROC_SLIM_H |
| 15 | |
| 16 | #define ST_SLIM_MEM_MAX 2 |
| 17 | #define ST_SLIM_MAX_CLK 4 |
| 18 | |
| 19 | enum { |
| 20 | ST_SLIM_DMEM, |
| 21 | ST_SLIM_IMEM, |
| 22 | }; |
| 23 | |
| 24 | /** |
| 25 | * struct st_slim_mem - slim internal memory structure |
| 26 | * @cpu_addr: MPU virtual address of the memory region |
| 27 | * @bus_addr: Bus address used to access the memory region |
| 28 | * @size: Size of the memory region |
| 29 | */ |
| 30 | struct st_slim_mem { |
| 31 | void __iomem *cpu_addr; |
| 32 | phys_addr_t bus_addr; |
| 33 | size_t size; |
| 34 | }; |
| 35 | |
| 36 | /** |
| 37 | * struct st_slim_rproc - SLIM slim core |
| 38 | * @rproc: rproc handle |
| 39 | * @mem: slim memory information |
| 40 | * @slimcore: slim slimcore regs |
| 41 | * @peri: slim peripheral regs |
| 42 | * @clks: slim clocks |
| 43 | */ |
| 44 | struct st_slim_rproc { |
| 45 | struct rproc *rproc; |
| 46 | struct st_slim_mem mem[ST_SLIM_MEM_MAX]; |
| 47 | void __iomem *slimcore; |
| 48 | void __iomem *peri; |
| 49 | |
| 50 | /* st_slim_rproc private */ |
| 51 | struct clk *clks[ST_SLIM_MAX_CLK]; |
| 52 | }; |
| 53 | |
| 54 | struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev, |
| 55 | char *fw_name); |
| 56 | void st_slim_rproc_put(struct st_slim_rproc *slim_rproc); |
| 57 | |
| 58 | #endif |