Neil Armstrong | add986c | 2018-07-24 17:45:28 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (C) 2016 BayLibre, SAS |
| 4 | * Author: Neil Armstrong <narmstrong@baylibre.com> |
| 5 | * Copyright (C) 2015 Amlogic, Inc. All rights reserved. |
| 6 | */ |
| 7 | |
| 8 | #ifndef __MESON_DW_HDMI_H |
| 9 | #define __MESON_DW_HDMI_H |
| 10 | |
| 11 | /* |
| 12 | * Bit 7 RW Reserved. Default 1. |
| 13 | * Bit 6 RW Reserved. Default 1. |
| 14 | * Bit 5 RW Reserved. Default 1. |
| 15 | * Bit 4 RW sw_reset_phyif: PHY interface. 1=Apply reset; 0=Release from reset. |
| 16 | * Default 1. |
| 17 | * Bit 3 RW sw_reset_intr: interrupt module. 1=Apply reset; |
| 18 | * 0=Release from reset. |
| 19 | * Default 1. |
| 20 | * Bit 2 RW sw_reset_mem: KSV/REVOC mem. 1=Apply reset; 0=Release from reset. |
| 21 | * Default 1. |
| 22 | * Bit 1 RW sw_reset_rnd: random number interface to HDCP. 1=Apply reset; |
| 23 | * 0=Release from reset. Default 1. |
| 24 | * Bit 0 RW sw_reset_core: connects to IP's ~irstz. 1=Apply reset; |
| 25 | * 0=Release from reset. Default 1. |
| 26 | */ |
Simon Glass | 4dcacfc | 2020-05-10 11:40:13 -0600 | [diff] [blame] | 27 | #include <linux/bitops.h> |
Neil Armstrong | add986c | 2018-07-24 17:45:28 +0200 | [diff] [blame] | 28 | #define HDMITX_TOP_SW_RESET (0x000) |
| 29 | |
| 30 | /* |
| 31 | * Bit 12 RW i2s_ws_inv:1=Invert i2s_ws; 0=No invert. Default 0. |
| 32 | * Bit 11 RW i2s_clk_inv: 1=Invert i2s_clk; 0=No invert. Default 0. |
| 33 | * Bit 10 RW spdif_clk_inv: 1=Invert spdif_clk; 0=No invert. Default 0. |
| 34 | * Bit 9 RW tmds_clk_inv: 1=Invert tmds_clk; 0=No invert. Default 0. |
| 35 | * Bit 8 RW pixel_clk_inv: 1=Invert pixel_clk; 0=No invert. Default 0. |
| 36 | * Bit 4 RW cec_clk_en: 1=enable cec_clk; 0=disable. Default 0. |
| 37 | * Bit 3 RW i2s_clk_en: 1=enable i2s_clk; 0=disable. Default 0. |
| 38 | * Bit 2 RW spdif_clk_en: 1=enable spdif_clk; 0=disable. Default 0. |
| 39 | * Bit 1 RW tmds_clk_en: 1=enable tmds_clk; 0=disable. Default 0. |
| 40 | * Bit 0 RW pixel_clk_en: 1=enable pixel_clk; 0=disable. Default 0. |
| 41 | */ |
| 42 | #define HDMITX_TOP_CLK_CNTL (0x001) |
| 43 | |
| 44 | /* |
| 45 | * Bit 11: 0 RW hpd_valid_width: filter out width <= M*1024. Default 0. |
| 46 | * Bit 15:12 RW hpd_glitch_width: filter out glitch <= N. Default 0. |
| 47 | */ |
| 48 | #define HDMITX_TOP_HPD_FILTER (0x002) |
| 49 | |
| 50 | /* |
| 51 | * intr_maskn: MASK_N, one bit per interrupt source. |
| 52 | * 1=Enable interrupt source; 0=Disable interrupt source. Default 0. |
| 53 | * [ 4] hdcp22_rndnum_err |
| 54 | * [ 3] nonce_rfrsh_rise |
| 55 | * [ 2] hpd_fall_intr |
| 56 | * [ 1] hpd_rise_intr |
| 57 | * [ 0] core_intr |
| 58 | */ |
| 59 | #define HDMITX_TOP_INTR_MASKN (0x003) |
| 60 | |
| 61 | /* |
| 62 | * Bit 30: 0 RW intr_stat: For each bit, write 1 to manually set the interrupt |
| 63 | * bit, read back the interrupt status. |
| 64 | * Bit 31 R IP interrupt status |
| 65 | * Bit 2 RW hpd_fall |
| 66 | * Bit 1 RW hpd_rise |
| 67 | * Bit 0 RW IP interrupt |
| 68 | */ |
| 69 | #define HDMITX_TOP_INTR_STAT (0x004) |
| 70 | |
| 71 | /* |
| 72 | * [4] hdcp22_rndnum_err |
| 73 | * [3] nonce_rfrsh_rise |
| 74 | * [2] hpd_fall |
| 75 | * [1] hpd_rise |
| 76 | * [0] core_intr_rise |
| 77 | */ |
| 78 | #define HDMITX_TOP_INTR_STAT_CLR (0x005) |
| 79 | |
| 80 | #define HDMITX_TOP_INTR_CORE BIT(0) |
| 81 | #define HDMITX_TOP_INTR_HPD_RISE BIT(1) |
| 82 | #define HDMITX_TOP_INTR_HPD_FALL BIT(2) |
| 83 | |
| 84 | /* Bit 14:12 RW tmds_sel: 3'b000=Output zero; 3'b001=Output normal TMDS data; |
| 85 | * 3'b010=Output PRBS data; 3'b100=Output shift pattern. Default 0. |
| 86 | * Bit 11: 9 RW shift_pttn_repeat: 0=New pattern every clk cycle; 1=New pattern |
| 87 | * every 2 clk cycles; ...; 7=New pattern every 8 clk cycles. Default 0. |
| 88 | * Bit 8 RW shift_pttn_en: 1= Enable shift pattern generator; 0=Disable. |
| 89 | * Default 0. |
| 90 | * Bit 4: 3 RW prbs_pttn_mode: 0=PRBS11; 1=PRBS15; 2=PRBS7; 3=PRBS31. Default 0. |
| 91 | * Bit 2: 1 RW prbs_pttn_width: 0=idle; 1=output 8-bit pattern; |
| 92 | * 2=Output 1-bit pattern; 3=output 10-bit pattern. Default 0. |
| 93 | * Bit 0 RW prbs_pttn_en: 1=Enable PRBS generator; 0=Disable. Default 0. |
| 94 | */ |
| 95 | #define HDMITX_TOP_BIST_CNTL (0x006) |
| 96 | |
| 97 | /* Bit 29:20 RW shift_pttn_data[59:50]. Default 0. */ |
| 98 | /* Bit 19:10 RW shift_pttn_data[69:60]. Default 0. */ |
| 99 | /* Bit 9: 0 RW shift_pttn_data[79:70]. Default 0. */ |
| 100 | #define HDMITX_TOP_SHIFT_PTTN_012 (0x007) |
| 101 | |
| 102 | /* Bit 29:20 RW shift_pttn_data[29:20]. Default 0. */ |
| 103 | /* Bit 19:10 RW shift_pttn_data[39:30]. Default 0. */ |
| 104 | /* Bit 9: 0 RW shift_pttn_data[49:40]. Default 0. */ |
| 105 | #define HDMITX_TOP_SHIFT_PTTN_345 (0x008) |
| 106 | |
| 107 | /* Bit 19:10 RW shift_pttn_data[ 9: 0]. Default 0. */ |
| 108 | /* Bit 9: 0 RW shift_pttn_data[19:10]. Default 0. */ |
| 109 | #define HDMITX_TOP_SHIFT_PTTN_67 (0x009) |
| 110 | |
| 111 | /* Bit 25:16 RW tmds_clk_pttn[19:10]. Default 0. */ |
| 112 | /* Bit 9: 0 RW tmds_clk_pttn[ 9: 0]. Default 0. */ |
| 113 | #define HDMITX_TOP_TMDS_CLK_PTTN_01 (0x00A) |
| 114 | |
| 115 | /* Bit 25:16 RW tmds_clk_pttn[39:30]. Default 0. */ |
| 116 | /* Bit 9: 0 RW tmds_clk_pttn[29:20]. Default 0. */ |
| 117 | #define HDMITX_TOP_TMDS_CLK_PTTN_23 (0x00B) |
| 118 | |
| 119 | /* Bit 1 RW shift_tmds_clk_pttn:1=Enable shifting clk pattern, |
| 120 | * used when TMDS CLK rate = TMDS character rate /4. Default 0. |
| 121 | * Bit 0 R Reserved. Default 0. |
| 122 | * [ 1] shift_tmds_clk_pttn |
| 123 | * [ 0] load_tmds_clk_pttn |
| 124 | */ |
| 125 | #define HDMITX_TOP_TMDS_CLK_PTTN_CNTL (0x00C) |
| 126 | |
| 127 | /* Bit 0 RW revocmem_wr_fail: Read back 1 to indicate Host write REVOC MEM |
| 128 | * failure, write 1 to clear the failure flag. Default 0. |
| 129 | */ |
| 130 | #define HDMITX_TOP_REVOCMEM_STAT (0x00D) |
| 131 | |
| 132 | /* Bit 0 R filtered HPD status. */ |
| 133 | #define HDMITX_TOP_STAT0 (0x00E) |
| 134 | |
| 135 | #endif /* __MESON_DW_HDMI_H */ |