1 /* 2 * LCD peripheral support for the JZ4780 and related SoCs. 3 * 4 * Copyright (C) 2018, 2020 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #pragma once 23 24 #include "lcd-jz4740.h" 25 26 27 28 /* C++ language interface. */ 29 30 #ifdef __cplusplus 31 32 #include <l4/devices/hw_mmio_register_block.h> 33 34 class Lcd_jz4780_chip : public Lcd_jz4740_chip 35 { 36 protected: 37 /* Priority level threshold value calculation. */ 38 39 uint32_t _priority_transfer(); 40 41 /* Position value calculation. */ 42 43 uint32_t _position_bpp(); 44 45 /* Descriptor initialisation. */ 46 47 void _set_descriptor(struct Jz4740_lcd_descriptor &desc, l4_addr_t source, 48 l4_size_t size, struct Jz4740_lcd_descriptor *next, 49 uint32_t flags = 0, bool frame_enable = true); 50 51 public: 52 Lcd_jz4780_chip(l4_addr_t addr, Jz4740_lcd_panel *panel); 53 54 /* Configuration. */ 55 56 void config(struct Jz4740_lcd_descriptor *desc_vaddr, 57 struct Jz4740_lcd_descriptor *desc_paddr, 58 l4_addr_t fb_paddr); 59 }; 60 61 #endif 62 63 64 65 /* C language interface mainly provided by jz4740_lcd functions. */ 66 67 EXTERN_C_BEGIN 68 69 void *jz4780_lcd_init(l4_addr_t lcd_base, struct Jz4740_lcd_panel *panel); 70 71 EXTERN_C_END