1.1 --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc Fri Jun 05 23:59:12 2020 +0200
1.2 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4740.cc Sat Jun 06 00:02:05 2020 +0200
1.3 @@ -23,7 +23,6 @@
1.4
1.5 #include <l4/devices/hw_mmio_register_block.h>
1.6 #include <l4/sys/cache.h>
1.7 -#include <l4/sys/err.h>
1.8 #include <l4/sys/irq.h>
1.9 #include <l4/sys/types.h>
1.10 #include <l4/util/util.h>
1.11 @@ -32,7 +31,6 @@
1.12 #include "lcd-jz4740-config.h"
1.13
1.14 #include <stdint.h>
1.15 -#include <stdio.h>
1.16
1.17 enum Regs : unsigned
1.18 {
1.19 @@ -352,9 +350,6 @@
1.20 _regs = new Hw::Mmio_register_block<32>(addr);
1.21 _burst_size = 64; // 64-word burst size (JZ4780)
1.22 //_burst_size = 16; // 16-word burst size
1.23 -
1.24 - // add_cid("lcd");
1.25 - // add_cid("lcd-jz4740");
1.26 }
1.27
1.28 struct Jz4740_lcd_panel *
1.29 @@ -388,7 +383,6 @@
1.30 _regs[Osd_status] = 0;
1.31 _regs[Lcd_status] = 0;
1.32 _regs[Lcd_control] = (_regs[Lcd_control] & ~(1U << Control_disable)) | (1U << Control_enable);
1.33 - printf("LCD control: %x\n", (unsigned int) _regs[Lcd_control]);
1.34 }
1.35
1.36 bool
1.37 @@ -717,8 +711,7 @@
1.38 uint32_t
1.39 Lcd_jz4740_chip::_control_irq()
1.40 {
1.41 - return // (1U << Control_out_underrun_irq_enable) |
1.42 - ((_irq_conditions & Lcd_irq_frame_start) ? (1U << Control_frame_start_irq_enable) : 0) |
1.43 + return ((_irq_conditions & Lcd_irq_frame_start) ? (1U << Control_frame_start_irq_enable) : 0) |
1.44 ((_irq_conditions & Lcd_irq_frame_end) ? (1U << Control_frame_end_irq_enable) : 0);
1.45 }
1.46
1.47 @@ -745,8 +738,7 @@
1.48 uint32_t
1.49 Lcd_jz4740_chip::_status_irq()
1.50 {
1.51 - return // (1U << Status_out_underrun_irq) |
1.52 - ((_irq_conditions & Lcd_irq_frame_start) ? (1U << Status_frame_start_irq) : 0) |
1.53 + return ((_irq_conditions & Lcd_irq_frame_start) ? (1U << Status_frame_start_irq) : 0) |
1.54 ((_irq_conditions & Lcd_irq_frame_end) ? (1U << Status_frame_end_irq) : 0);
1.55 }
1.56
1.57 @@ -966,17 +958,10 @@
1.58
1.59 _regs[Rgb_control] = (1U << Rgb_format_enable) | Rgb_odd_line_rgb | Rgb_even_line_rgb;
1.60 _regs[Priority_level] = _priority_transfer();
1.61 - _regs[Osd_config] = //_osd_config_irq() |
1.62 - (1U << Osd_config_enable) |
1.63 + _regs[Osd_config] = (1U << Osd_config_enable) |
1.64 (1U << Osd_config_alpha_enable);
1.65 _regs[Alpha_levels] = ((255U << Alpha_level_fg1) & Alpha_level_fg1_mask) |
1.66 ((255U << Alpha_level_fg0) & Alpha_level_fg0_mask);
1.67 -
1.68 - printf("LCD control: %08x\n", (unsigned int) _regs[Lcd_control]);
1.69 - printf("LCD status: %08x\n", (unsigned int) _regs[Lcd_status]);
1.70 - printf("OSD control: %08x\n", (unsigned int) _regs[Osd_control]);
1.71 - printf("OSD config: %08x\n", (unsigned int) _regs[Osd_config]);
1.72 - printf("OSD status: %08x\n", (unsigned int) _regs[Osd_status]);
1.73 }
1.74
1.75 // Set the interrupt for controller-related events.
1.76 @@ -999,35 +984,14 @@
1.77
1.78 // Wait for a condition.
1.79
1.80 - //printf("Waiting for IRQ...\n");
1.81 tag = l4_irq_receive(_irq, l4_timeout(L4_IPC_TIMEOUT_NEVER, l4util_micros2l4to(2000000)));
1.82
1.83 - //if (_regs[Lcd_status] & (1U << Status_out_underrun_irq))
1.84 - // enable();
1.85 -
1.86 -#if 0
1.87 - printf("LCD config: %08x\n", (unsigned int) _regs[Lcd_config]);
1.88 - printf("LCD control: %08x\n", (unsigned int) _regs[Lcd_control]);
1.89 - printf("LCD status: %08x\n", (unsigned int) _regs[Lcd_status]);
1.90 - printf("OSD config: %08x\n", (unsigned int) _regs[Osd_config]);
1.91 - printf("OSD control: %08x\n", (unsigned int) _regs[Osd_control]);
1.92 - printf("OSD status: %08x\n", (unsigned int) _regs[Osd_status]);
1.93 - printf("LCD command: %08x\n", (unsigned int) _regs[Command_0]);
1.94 - printf("LCD IRQ id: %08x\n", (unsigned int) _regs[Lcd_irq_id]);
1.95 - printf("LCD descriptor: %08x\n", (unsigned int) _regs[Desc_address_0]);
1.96 - printf("LCD source: %08x\n", (unsigned int) _regs[Source_address_0]);
1.97 - printf("LCD frame id: %08x\n", (unsigned int) _regs[Frame_id_0]);
1.98 - printf("LCD counter/position: %08x\n", (unsigned int) _regs[Counter_position_0]);
1.99 - printf("LCD foreground size: %08x\n", (unsigned int) _regs[Foreground_size_0]);
1.100 -#endif
1.101 -
1.102 // Acknowledge interrupts.
1.103
1.104 _regs[Lcd_status] = 0;
1.105
1.106 // Return errors.
1.107
1.108 - //printf("Error: %s\n", l4sys_errtostr(l4_error(tag)));
1.109 return l4_error(tag);
1.110 }
1.111