Alex Smith | 911a888 | 2015-03-09 14:29:04 +0000 | [diff] [blame] | 1 | /* |
| 2 | * JZ4780 NAND/external memory controller (NEMC) |
| 3 | * |
| 4 | * Copyright (c) 2015 Imagination Technologies |
| 5 | * Author: Alex Smith <alex@alex-smith.me.uk> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it |
| 8 | * under the terms of the GNU General Public License as published by the |
| 9 | * Free Software Foundation; either version 2 of the License, or (at your |
| 10 | * option) any later version. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __LINUX_JZ4780_NEMC_H__ |
| 14 | #define __LINUX_JZ4780_NEMC_H__ |
| 15 | |
| 16 | #include <linux/types.h> |
| 17 | |
| 18 | struct device; |
| 19 | |
| 20 | /* |
| 21 | * Number of NEMC banks. Note that there are actually 6, but they are numbered |
| 22 | * from 1. |
| 23 | */ |
| 24 | #define JZ4780_NEMC_NUM_BANKS 7 |
| 25 | |
| 26 | /** |
| 27 | * enum jz4780_nemc_bank_type - device types which can be connected to a bank |
| 28 | * @JZ4780_NEMC_BANK_SRAM: SRAM |
| 29 | * @JZ4780_NEMC_BANK_NAND: NAND |
| 30 | */ |
| 31 | enum jz4780_nemc_bank_type { |
| 32 | JZ4780_NEMC_BANK_SRAM, |
| 33 | JZ4780_NEMC_BANK_NAND, |
| 34 | }; |
| 35 | |
| 36 | extern unsigned int jz4780_nemc_num_banks(struct device *dev); |
| 37 | |
| 38 | extern void jz4780_nemc_set_type(struct device *dev, unsigned int bank, |
| 39 | enum jz4780_nemc_bank_type type); |
| 40 | extern void jz4780_nemc_assert(struct device *dev, unsigned int bank, |
| 41 | bool assert); |
| 42 | |
| 43 | #endif /* __LINUX_JZ4780_NEMC_H__ */ |