WIP FPC-III support
[linux/fpc-iii.git] / drivers / gpu / drm / litevideo / mmcm.h
blobde25c5a0ac955bfca270e71cb65c3557c353787f
1 /* SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2020 Antmicro <www.antmicro.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifndef _LITEVIDEO_MMCM_H_
16 #define _LITEVIDEO_MMCM_H_
18 /* mmcm addresses */
20 #define MMCM_CLKFBOUT1 0x14
21 #define MMCM_DIVCLK 0x16
22 #define MMCM_CLKOUT0 0x08
23 #define MMCM_CLKOUT1 0x0a
25 /* predefined values and shifts */
27 #define MMCM_HT_FALLING_EDGE 0x1000
28 #define MMCM_HT_SHIFT 6
29 #define MMCM_LT_SHIFT 0
31 /* This values should be set both to HIGH_TIME and LOW_TIME in CLKOUTx
32 * - clk division time = 2*VALUE // (i.e. MMCM_CLKOUT_DIV10)
33 * - duty = 50% // (HIGH_TIME / (HIGH_TIME + LOW_TIME))
36 #define MMCM_CLKOUT_DIV10 5
37 #define MMCM_CLKOUT_DIV2 1
39 #define MMCM_WRITE 1
41 #define MMCM_MIN_M 2
42 #define MMCM_MAX_M 128
43 #define MMCM_MIN_D 1
44 #define MMCM_MAX_D 128
46 #endif /* _LITEVIDEO_MMCM_H_ */