blob: a4ee313eb40415009c447598fc14bc52df6d5b3e [file] [log] [blame]
Kuogee Hsiehd58c8092015-07-07 10:31:34 -07001/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are met:
5 * * Redistributions of source code must retain the above copyright
6 * notice, this list of conditions and the following disclaimer.
7 * * Redistributions in binary form must reproduce the above copyright
8 * notice, this list of conditions and the following disclaimer in the
9 * documentation and/or other materials provided with the distribution.
10 * * Neither the name of The Linux Foundation nor
11 * the names of its contributors may be used to endorse or promote
12 * products derived from this software without specific prior written
13 * permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <debug.h>
29#include <mdp5.h>
30#include <reg.h>
31#include <bits.h>
32#include <msm_panel.h>
33#include <panel.h>
34#include <platform/iomap.h>
35#include <mipi_dsi.h>
36
37/*
38 * rc_buf_thresh = {896, 1792, 2688, 3548, 4480, 5376, 6272, 6720,
39 * 7168, 7616, 7744, 7872, 8000, 8064, 8192};
40 * (x >> 6) & 0x0ff)
41 */
42static char dsc_rc_buf_thresh[] = {0x0e, 0x1c, 0x2a, 0x38, 0x46, 0x54,
43 0x62, 0x69, 0x70, 0x77, 0x79, 0x7b, 0x7d, 0x7e};
44static char dsc_rc_range_min_qp[] = {0, 0, 1, 1, 3, 3, 3, 3, 3, 3, 5,
45 5, 5, 7, 13};
46static char dsc_rc_range_max_qp[] = {4, 4, 5, 6, 7, 7, 7, 8, 9, 10, 11,
47 12, 13, 13, 15};
48static char dsc_rc_range_bpg_offset[] = {2, 0, 0, -2, -4, -6, -8, -8,
49 -8, -10, -10, -12, -12, -12, -12};
50
51#define CEIL(x, y) (((x) + ((y)-1)) / (y))
52
53int mdss_dsc_to_buf(struct msm_panel_info *pinfo)
54{
55 struct dsc_desc *dsc;
56 char *bp;
57 char data;
58 int i, bpp;
59
60 dsc = &pinfo->dsc;
61 bp = dsc->pps_buf;
62
63 *bp++ = 128; /* pps length */
64 *bp++ = 0;
65 *bp++ = 0x0a; /* PPS data type */
66 *bp++ = 0xc0; /* last + long pkt */
67
68 /* pps payload */
69 *bp++ = ((dsc->major << 4) | dsc->minor); /* pps0 */
70 *bp++ = dsc->pps_id; /* pps1 */
71 bp++; /* pps2, reserved */
72
73 data = dsc->line_buf_depth & 0x0f;
74 data |= (dsc->bpc << 4);
75 *bp++ = data; /* pps3 */
76
77 bpp = dsc->bpp;
78 bpp <<= 4; /* 4 fraction bits */
79 data = (bpp >> 8);
80 data &= 0x03; /* upper two bits */
81 data |= (dsc->block_pred_enable << 5);
82 data |= (dsc->convert_rgb << 4);
83 data |= (dsc->enable_422 << 3);
84 data |= (dsc->vbr_enable << 2);
85 *bp++ = data; /* pps4 */
86 *bp++ = bpp; /* pps5 */
87
88 *bp++ = (dsc->pic_height >> 8); /* pps6 */
89 *bp++ = (dsc->pic_height & 0x0ff); /* pps7 */
90 *bp++ = (dsc->pic_width >> 8); /* pps8 */
91 *bp++ = (dsc->pic_width & 0x0ff); /* pps9 */
92
93 *bp++ = (dsc->slice_height >> 8); /* pps10 */
94 *bp++ = (dsc->slice_height & 0x0ff); /* pps11 */
95 *bp++ = (dsc->slice_width >> 8); /* pps12 */
96 *bp++ = (dsc->slice_width & 0x0ff); /* pps13 */
97
98 *bp++ = (dsc->chunk_size >> 8); /* pps14 */
99 *bp++ = (dsc->chunk_size & 0x0ff); /* pps15 */
100
101 data = dsc->initial_xmit_delay >> 8;
102 data &= 0x03;
103 *bp++ = data; /* pps16, bit 0, 1 */
104 *bp++ = dsc->initial_xmit_delay; /* pps17 */
105
106 *bp++ = (dsc->initial_dec_delay >> 8); /* pps18 */
107 *bp++ = dsc->initial_dec_delay; /* pps19 */
108
109 bp++; /* pps20, reserved */
110
111 *bp++ = (dsc->initial_scale_value & 0x3f); /* pps21 */
112
113 data = (dsc->scale_increment_interval >> 8);
114 data &= 0x0f;
115 *bp++ = data; /* pps22 */
116 *bp++ = dsc->scale_increment_interval; /* pps23 */
117
118 data = (dsc->scale_decrement_interval >> 8);
119 data &= 0x0f;
120 *bp++ = data; /* pps24 */
121 *bp++ = (dsc->scale_decrement_interval & 0x0ff);/* pps25 */
122
123 bp++; /* pps26, reserved */
124
125 *bp++ = (dsc->first_line_bpg_offset & 0x1f);/* pps27 */
126
127 *bp++ = (dsc->nfl_bpg_offset >> 8); /* pps28 */
128 *bp++ = (dsc->nfl_bpg_offset & 0x0ff); /* pps29 */
129 *bp++ = (dsc->slice_bpg_offset >> 8); /* pps30 */
130 *bp++ = (dsc->slice_bpg_offset & 0x0ff);/* pps31 */
131
132 *bp++ = (dsc->initial_offset >> 8); /* pps32 */
133 *bp++ = (dsc->initial_offset & 0x0ff); /* pps33 */
134
135 *bp++ = (dsc->final_offset >> 8); /* pps34 */
136 *bp++ = (dsc->final_offset & 0x0ff); /* pps35 */
137
138 *bp++ = (dsc->min_qp_flatness & 0x1f); /* pps36 */
139 *bp++ = (dsc->max_qp_flatness & 0x1f); /* pps37 */
140
141 *bp++ = (dsc->rc_model_size >> 8); /* pps38 */
142 *bp++ = (dsc->rc_model_size & 0x0ff); /* pps39 */
143
144 *bp++ = (dsc->edge_factor & 0x0f); /* pps40 */
145
146 *bp++ = (dsc->quant_incr_limit0 & 0x1f); /* pps41 */
147 *bp++ = (dsc->quant_incr_limit1 & 0x1f); /* pps42 */
148
149 data = (dsc->tgt_offset_hi << 4);
150 data |= (dsc->tgt_offset_lo & 0x0f);
151 *bp++ = data; /* pps43 */
152
153 for (i = 0; i < 14; i++)
154 *bp++ = dsc->buf_thresh[i]; /* pps44 - pps57 */
155
156 for (i = 0; i < 15; i++) { /* pps58 - pps87 */
157 data = (dsc->range_min_qp[i] & 0x1f); /* 5 bits */
158 data <<= 3;
159 data |= ((dsc->range_max_qp[i] >> 2) & 0x07); /* 3 bits */
160 *bp++ = data;
161 data = (dsc->range_max_qp[i] & 0x03); /* 2 bits */
162 data <<= 6;
163 data |= (dsc->range_bpg_offset[i] & 0x3f); /* 6 bits */
164 *bp++ = data;
165 }
166
167 /* pps88 to pps127 are reserved */
168
169 return 128;
170}
171
172static int mdss_dsc_initial_line_calc(int bpc, int xmit_delay,
173 int slice_width, int slice_per_line)
174{
175 int ssm_delay;
176 int total_pixels;
177
178 ssm_delay = ((bpc < 10) ? 83 : 91);
179 total_pixels = ssm_delay * 3 + 30 + xmit_delay + 6;
180 total_pixels += ((slice_per_line > 1) ? (ssm_delay * 3) : 0);
181
182 return CEIL(total_pixels, slice_width);
183}
184
185void mdss_dsc_parameters_calc(struct msm_panel_info *pinfo)
186{
187 struct dsc_desc *dsc;
188 int bpp, bpc;
189 int mux_words_size;
190 int groups_per_line, groups_total;
191 int min_rate_buffer_size;
192 int hrd_delay;
193 int pre_num_extra_mux_bits, num_extra_mux_bits;
194 int slice_bits;
195 int target_bpp_x16;
196 int data;
197 int final_value, final_scale;
198 int slice_per_line, bytes_in_slice, total_bytes;
199
200 dsc = &pinfo->dsc;
201 dsc->rc_model_size = 8192; /* rate_buffer_size */
202 dsc->first_line_bpg_offset = 12;
203 dsc->min_qp_flatness = 3;
204 dsc->max_qp_flatness = 12;
205 dsc->line_buf_depth = 9;
206
207 dsc->edge_factor = 6;
208 dsc->quant_incr_limit0 = 11;
209 dsc->quant_incr_limit1 = 11;
210 dsc->tgt_offset_hi = 3;
211 dsc->tgt_offset_lo = 3;
212
213 dsc->buf_thresh = dsc_rc_buf_thresh;
214 dsc->range_min_qp = dsc_rc_range_min_qp;
215 dsc->range_max_qp = dsc_rc_range_max_qp;
216 dsc->range_bpg_offset = dsc_rc_range_bpg_offset;
217
218 dsc->pic_width = pinfo->xres;
219 dsc->pic_height = pinfo->yres;
220
221 bpp = dsc->bpp;
222 bpc = dsc->bpc;
223
224 if (bpp == 8)
225 dsc->initial_offset = 6144;
226 else
227 dsc->initial_offset = 2048; /* bpp = 12 */
228
229 if (bpc == 8)
230 mux_words_size = 48;
231 else
232 mux_words_size = 64; /* bpc == 12 */
233
234 slice_per_line = CEIL(dsc->pic_width, dsc->slice_width);
235
236 dsc->pkt_per_line = slice_per_line / dsc->slice_per_pkt;
237 if (slice_per_line % dsc->slice_per_pkt)
238 dsc->pkt_per_line = 1; /* default*/
239
240 bytes_in_slice = CEIL(dsc->pic_width, slice_per_line);
241
242 bytes_in_slice *= dsc->bpp; /* bites per compressed pixel */
243 bytes_in_slice = CEIL(bytes_in_slice, 8);
244
245 dsc->bytes_in_slice = bytes_in_slice;
246
247 dprintf(SPEW, "%s: slice_per_line=%d pkt_per_line=%d bytes_in_slice=%d\n",
248 __func__, slice_per_line, dsc->pkt_per_line, bytes_in_slice);
249
250 total_bytes = bytes_in_slice * slice_per_line;
251 dsc->eol_byte_num = total_bytes % 3;
252 dsc->pclk_per_line = CEIL(total_bytes, 3);
253
254 dsc->slice_last_group_size = 3 - dsc->eol_byte_num;
255
256 dprintf(SPEW, "%s: pclk_per_line=%d total_bytes=%d eol_byte_num=%d\n",
257 __func__, dsc->pclk_per_line, total_bytes, dsc->eol_byte_num);
258
259 dsc->bytes_per_pkt = bytes_in_slice * dsc->slice_per_pkt;
260
261 dsc->det_thresh_flatness = 7 + (bpc - 8);
262
263 dsc->initial_xmit_delay = dsc->rc_model_size / (2 * bpp);
264
265 dsc->initial_lines = mdss_dsc_initial_line_calc(bpc,
266 dsc->initial_xmit_delay, dsc->slice_width, slice_per_line);
267
268 groups_per_line = CEIL(dsc->slice_width, 3);
269
270 dsc->chunk_size = dsc->slice_width * bpp / 8;
271 if ((dsc->slice_width * bpp) % 8)
272 dsc->chunk_size++;
273
274
275 /* rbs-min */
276 min_rate_buffer_size = dsc->rc_model_size - dsc->initial_offset +
277 dsc->initial_xmit_delay * bpp +
278 groups_per_line * dsc->first_line_bpg_offset;
279
280 hrd_delay = CEIL(min_rate_buffer_size, bpp);
281
282 dsc->initial_dec_delay = hrd_delay - dsc->initial_xmit_delay;
283
284 dsc->initial_scale_value = 8 * dsc->rc_model_size /
285 (dsc->rc_model_size - dsc->initial_offset);
286
287 slice_bits = 8 * dsc->chunk_size * dsc->slice_height;
288
289 groups_total = groups_per_line * dsc->slice_height;
290
291 data = dsc->first_line_bpg_offset * 2048;
292
293 dsc->nfl_bpg_offset = CEIL(data, (dsc->slice_height - 1));
294
295 pre_num_extra_mux_bits = 3 * (mux_words_size + (4 * bpc + 4) - 2);
296
297 num_extra_mux_bits = pre_num_extra_mux_bits - (mux_words_size -
298 ((slice_bits - pre_num_extra_mux_bits) % mux_words_size));
299
300 data = 2048 * (dsc->rc_model_size - dsc->initial_offset
301 + num_extra_mux_bits);
302 dsc->slice_bpg_offset = CEIL(data, groups_total);
303
304 /* bpp * 16 + 0.5 */
305 data = bpp * 16;
306 data *= 2;
307 data++;
308 data /= 2;
309 target_bpp_x16 = data;
310
311 data = (dsc->initial_xmit_delay * target_bpp_x16) / 16;
312 final_value = dsc->rc_model_size - data + num_extra_mux_bits;
313
314 final_scale = 8 * dsc->rc_model_size /
315 (dsc->rc_model_size - final_value);
316
317 dsc->final_offset = final_value;
318
319 data = (final_scale - 9) * (dsc->nfl_bpg_offset +
320 dsc->slice_bpg_offset);
321 dsc->scale_increment_interval = (2048 * dsc->final_offset) / data;
322
323 dsc->scale_decrement_interval = groups_per_line /
324 (dsc->initial_scale_value - 8);
325
326 dprintf(SPEW, "%s: initial_xmit_delay=%d\n", __func__,
327 dsc->initial_xmit_delay);
328
329 dprintf(SPEW, "%s: bpg_offset, nfl=%d slice=%d\n", __func__,
330 dsc->nfl_bpg_offset, dsc->slice_bpg_offset);
331
332 dprintf(SPEW, "%s: groups_per_line=%d chunk_size=%d\n", __func__,
333 groups_per_line, dsc->chunk_size);
334 dprintf(SPEW, "%s:min_rate_buffer_size=%d hrd_delay=%d\n", __func__,
335 min_rate_buffer_size, hrd_delay);
336 dprintf(SPEW, "%s:initial_dec_delay=%d initial_scale_value=%d\n", __func__,
337 dsc->initial_dec_delay, dsc->initial_scale_value);
338 dprintf(SPEW, "%s:slice_bits=%d, groups_total=%d\n", __func__,
339 slice_bits, groups_total);
340 dprintf(SPEW, "%s: first_line_bgp_offset=%d slice_height=%d\n", __func__,
341 dsc->first_line_bpg_offset, dsc->slice_height);
342 dprintf(SPEW, "%s:final_value=%d final_scale=%d\n", __func__,
343 final_value, final_scale);
344 dprintf(SPEW, "%s: sacle_increment_interval=%d scale_decrement_interval=%d\n",
345 __func__, dsc->scale_increment_interval,
346 dsc->scale_decrement_interval);
347}
348
Ujwal Patel41a665a2015-07-17 13:51:30 -0700349void mdss_dsc_mdp_config(struct msm_panel_info *pinfo,
350 unsigned int pp_base, unsigned int dsc_base,
351 bool mux, bool split_mode)
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700352{
353 unsigned int data;
354 unsigned int offset, off;
355 struct dsc_desc *dsc;
356 char *lp;
357 char *cp;
358 int i, bpp, lsb;
359
360 /* dce0_sel->pp0, dce1_sel->pp1 */
361 writel(0x0, MDSS_MDP_REG_DCE_SEL);
362
363 /* dsc enable */
Ujwal Patel41a665a2015-07-17 13:51:30 -0700364 writel(1, pp_base + MDSS_MDP_PP_DSC_MODE);
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700365
Ujwal Patel41a665a2015-07-17 13:51:30 -0700366 data = readl(pp_base + MDSS_MDP_PP_DCE_DATA_OUT_SWAP);
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700367 data |= BIT(18); /* endian flip */
Ujwal Patel41a665a2015-07-17 13:51:30 -0700368 writel(data, pp_base + MDSS_MDP_PP_DCE_DATA_OUT_SWAP);
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700369
Ujwal Patel41a665a2015-07-17 13:51:30 -0700370 offset = dsc_base;
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700371
372 data = 0;
373 dsc = &pinfo->dsc;
374 if (pinfo->type == MIPI_VIDEO_PANEL)
375 data = BIT(2); /* video mode */
376
Ujwal Patel41a665a2015-07-17 13:51:30 -0700377 if (split_mode)
378 data |= BIT(0);
379 if (mux)
380 data |= BIT(1);
381
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700382 writel(data, offset + MDSS_MDP_DSC_COMMON_MODE);
383
Ujwal Patel1a897a22015-10-01 18:25:52 -0700384 data = (dsc->initial_lines << 20);
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700385 data |= ((dsc->slice_last_group_size - 1) << 18);
386
387 /* bpp is 6.4 format, 4 LSBs bits are for fractional part */
388 lsb = dsc->bpp % 4;
389 bpp = dsc->bpp / 4;
390 bpp *= 4; /* either 8 or 12 */
391 bpp <<= 4;
392 bpp |= lsb;
393 data |= (bpp << 8);
394 data |= (dsc->block_pred_enable << 7);
395 data |= (dsc->line_buf_depth << 3);
396 data |= (dsc->enable_422 << 2);
397 data |= (dsc->convert_rgb << 1);
398 data |= dsc->input_10_bits;
399
Ujwal Patel1a897a22015-10-01 18:25:52 -0700400 dprintf(SPEW, "%s: %d %d %d %d %d %d %d %d, data=%x\n",
401 __func__,
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700402 dsc->initial_lines , dsc->slice_last_group_size,
403 dsc->bpp, dsc->block_pred_enable, dsc->line_buf_depth,
404 dsc->enable_422, dsc->convert_rgb, dsc->input_10_bits, data);
405
406 writel(data, offset + MDSS_MDP_DSC_ENC);
407
408 data = dsc->pic_width << 16;
409 data |= dsc->pic_height;
410 writel(data, offset + MDSS_MDP_DSC_PICTURE);
411
412 data = dsc->slice_width << 16;
413 data |= dsc->slice_height;
414 writel(data, offset + MDSS_MDP_DSC_SLICE);
415
416 data = dsc->chunk_size << 16;
417 writel(data, offset + MDSS_MDP_DSC_CHUNK_SIZE);
418
419 dprintf(SPEW, "%s: pic_w=%d pic_h=%d, slice_h=%d slice_w=%d, chunk=%d\n",
420 __func__, dsc->pic_width, dsc->pic_height,
421 dsc->slice_width, dsc->slice_height, dsc->chunk_size);
422
423 data = dsc->initial_dec_delay << 16;
424 data |= dsc->initial_xmit_delay;
425 writel(data, offset + MDSS_MDP_DSC_DELAY);
426
427 data = dsc->initial_scale_value;
428 writel(data, offset + MDSS_MDP_DSC_SCALE_INITIAL);
429
430 data = dsc->scale_decrement_interval;
431 writel(data, offset + MDSS_MDP_DSC_SCALE_DEC_INTERVAL);
432
433 data = dsc->scale_increment_interval;
434 writel(data, offset + MDSS_MDP_DSC_SCALE_INC_INTERVAL);
435
436 data = dsc->first_line_bpg_offset;
437 writel(data, offset + MDSS_MDP_DSC_FIRST_LINE_BPG_OFFSET);
438
439 data = dsc->nfl_bpg_offset << 16;
440 data |= dsc->slice_bpg_offset;
441 writel(data, offset + MDSS_MDP_DSC_BPG_OFFSET);
442
443 data = dsc->initial_offset << 16;
444 data |= dsc->final_offset;
445 writel(data, offset + MDSS_MDP_DSC_DSC_OFFSET);
446
447 data = dsc->det_thresh_flatness << 10;
448 data |= dsc->max_qp_flatness << 5;
449 data |= dsc->min_qp_flatness;
450 writel(data, offset + MDSS_MDP_DSC_FLATNESS);
451
452 data = dsc->rc_model_size; /* rate_buffer_size */
453 writel(data, offset + MDSS_MDP_DSC_RC_MODEL_SIZE);
454
455 data = dsc->tgt_offset_lo << 18;
456 data |= dsc->tgt_offset_hi << 14;
457 data |= dsc->quant_incr_limit1 << 9;
458 data |= dsc->quant_incr_limit0 << 4;
459 data |= dsc->edge_factor;
460 writel(data, offset + MDSS_MDP_DSC_RC);
461
462 lp = dsc->buf_thresh;
463 off = offset + MDSS_MDP_DSC_RC_BUF_THRESH;
464 for (i = 0; i < 14; i++) {
465 writel(*lp++, off);
466 off += 4;
467 }
468
469 cp = dsc->range_min_qp;
470 off = offset + MDSS_MDP_DSC_RANGE_MIN_QP;
471 for (i = 0; i < 15; i++) {
472 writel(*cp++, off);
473 off += 4;
474 }
475
476 cp = dsc->range_max_qp;
477 off = offset + MDSS_MDP_DSC_RANGE_MAX_QP;
478 for (i = 0; i < 15; i++) {
479 writel(*cp++, off);
480 off += 4;
481 }
482
483 cp = dsc->range_bpg_offset;
484 off = offset + MDSS_MDP_DSC_RANGE_BPG_OFFSET;
485 for (i = 0; i < 15; i++) {
486 writel(*cp++, off);
487 off += 4;
488 }
489}
490
491void mdss_dsc_dsi_config(uint32_t ctl_base, int mode,
492 struct dsc_desc *dsc)
493{
494 unsigned int data;
495
496 if (mode == DSI_VIDEO_MODE) {
497 writel(0, ctl_base + VIDEO_COMPRESSION_MODE_CTRL_2);
498 data = dsc->bytes_per_pkt << 16;
499 data |= (0x0b << 8); /* dtype of compressed image */
500 data |= (dsc->pkt_per_line - 1) << 6;
501 data |= dsc->eol_byte_num << 4;
502 data |= 1; /* enable */
503
504 writel(data, ctl_base + VIDEO_COMPRESSION_MODE_CTRL);
505 } else {
506 /* strem 0 */
507 writel(0, ctl_base + CMD_COMPRESSION_MODE_CTRL_3);
508
509 data = dsc->bytes_in_slice;
510 writel(data, ctl_base + CMD_COMPRESSION_MODE_CTRL_2);
511
512 data = 0x39 << 8;
513 data |= (dsc->pkt_per_line - 1) << 6;
514 data |= dsc->eol_byte_num << 4;
515 data |= 1; /* enable */
516 writel(data, ctl_base + CMD_COMPRESSION_MODE_CTRL);
517 }
518}