# HG changeset patch # User Paul Boddie # Date 1498604662 -7200 # Node ID 44fcbb779a70f5dbb565fc8a8fe68836310429b0 # Parent 95be7694d99945d06e117d8e34e88ba2ffbb2bdb Replaced u8, u16 and u32 with uint8_t, uint16_t and uint32_t respectively. diff -r 95be7694d999 -r 44fcbb779a70 include/xburst_types.h --- a/include/xburst_types.h Wed Jun 28 00:20:14 2017 +0200 +++ b/include/xburst_types.h Wed Jun 28 01:04:22 2017 +0200 @@ -3,6 +3,7 @@ * * Copyright 2009 (C) Qi Hardware Inc. * Author: Xiangfu Liu + * Copyright (C) 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,13 +22,10 @@ #ifndef __XBURST_TYPES_H__ #define __XBURST_TYPES_H__ -typedef unsigned int size_t; -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; +#include -#define REG8(addr) *((volatile u8 *)(addr)) -#define REG16(addr) *((volatile u16 *)(addr)) -#define REG32(addr) *((volatile u32 *)(addr)) +#define REG8(addr) *((volatile uint8_t *)(addr)) +#define REG16(addr) *((volatile uint16_t *)(addr)) +#define REG32(addr) *((volatile uint32_t *)(addr)) #endif /* __XBURST_TYPES_H__ */ diff -r 95be7694d999 -r 44fcbb779a70 stage1/board.c --- a/stage1/board.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage1/board.c Wed Jun 28 01:04:22 2017 +0200 @@ -5,7 +5,7 @@ * Copyright (C) 2005-2006 Ingenic Semiconductor, * Copyright (C) 2006 Stefan Roese, DENX Software Engineering, sr@denx.de. * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,13 +36,13 @@ /etc/xburst-tools/usbboot.cfg. */ struct fw_args *fw_args; -volatile u32 FW_CPU_ID; -volatile u8 FW_SDRAM_BW16; -volatile u8 FW_SDRAM_BANK4; -volatile u8 FW_SDRAM_ROW; -volatile u8 FW_SDRAM_COL; -volatile u8 FW_CONFIG_MOBILE_SDRAM; -volatile u8 FW_IS_SHARE; +volatile uint32_t FW_CPU_ID; +volatile uint8_t FW_SDRAM_BW16; +volatile uint8_t FW_SDRAM_BANK4; +volatile uint8_t FW_SDRAM_ROW; +volatile uint8_t FW_SDRAM_COL; +volatile uint8_t FW_CONFIG_MOBILE_SDRAM; +volatile uint8_t FW_IS_SHARE; void load_args() { diff -r 95be7694d999 -r 44fcbb779a70 stage2/board-minipc.c --- a/stage2/board-minipc.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/board-minipc.c Wed Jun 28 01:04:22 2017 +0200 @@ -4,7 +4,7 @@ * Copyright (C) 2000-2009 Wolfgang Denk, DENX Software Engineering, * Copyright (C) 2005-2006 Ingenic Semiconductor, * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -116,7 +116,7 @@ __intc_unmask_irq(GPIO_IRQ); } -int gpio_have_irq(u8 gpio) +int gpio_have_irq(uint8_t gpio) { return (REG_GPIO_GPFR(gpio / 32) & (1 << (gpio % 32))); } diff -r 95be7694d999 -r 44fcbb779a70 stage2/board-nanonote.c --- a/stage2/board-nanonote.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/board-nanonote.c Wed Jun 28 01:04:22 2017 +0200 @@ -4,7 +4,7 @@ * Copyright (C) 2000-2009 Wolfgang Denk, DENX Software Engineering, * Copyright (C) 2006 Ingenic Semiconductor, * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -164,7 +164,7 @@ __intc_unmask_irq(GPIO_IRQ); } -int gpio_have_irq(u8 gpio) +int gpio_have_irq(uint8_t gpio) { return (REG_GPIO_PXFLG(gpio / 32) & (1 << (gpio % 32))); } diff -r 95be7694d999 -r 44fcbb779a70 stage2/board.c --- a/stage2/board.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/board.c Wed Jun 28 01:04:22 2017 +0200 @@ -3,7 +3,7 @@ * * Copyright (C) 2005-2006 Ingenic Semiconductor, * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -159,7 +159,7 @@ /* GPIO interrupt administration. */ -void gpio_clear(u8 gpio) +void gpio_clear(uint8_t gpio) { /* Clear interrupt status. */ @@ -171,7 +171,7 @@ void irq_clear() { - u8 i; + uint8_t i; for (i = 0; i < 32; i++) { if (REG_INTC_IPR & (1 << i)) diff -r 95be7694d999 -r 44fcbb779a70 stage2/cpu.c --- a/stage2/cpu.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/cpu.c Wed Jun 28 01:04:22 2017 +0200 @@ -4,7 +4,7 @@ * See: u-boot/arch/mips/include/asm/cacheops.h * * Copyright (C) 2000-2009 Wolfgang Denk, DENX Software Engineering, - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -30,7 +30,7 @@ void flush_icache_all() { - u32 addr; + uint32_t addr; flush_icache_tag(); @@ -42,7 +42,7 @@ void flush_dcache_all() { - u32 addr; + uint32_t addr; for (addr = KSEG0; addr < KSEG0 + CONFIG_SYS_DCACHE_SIZE; addr += CONFIG_SYS_CACHELINE_SIZE) flush_dcache_region(addr); @@ -56,9 +56,9 @@ flush_icache_all(); } -void init_registers(u32 *base, u32 got, void (*function)(), u32 args[], u8 nargs) +void init_registers(uint32_t *base, uint32_t got, void (*function)(), uint32_t args[], uint8_t nargs) { - u8 i; + uint8_t i; /* Provide arguments to the function. */ @@ -69,14 +69,14 @@ /* Store essential data for the function environment. */ - base[25] = (u32) function - 0x80000000; /* store the function address as t9 */ + base[25] = (uint32_t) function - 0x80000000; /* store the function address as t9 */ base[26] = got - 0x80000000; /* store the global pointer */ - base[29] = (u32) function - 0x80000000; /* store the function address as EPC (for the handler) */ + base[29] = (uint32_t) function - 0x80000000; /* store the function address as EPC (for the handler) */ } -void init_tlb(u8 first_random) +void init_tlb(uint8_t first_random) { - u32 limit = configure_tlb(first_random), i; + uint32_t limit = configure_tlb(first_random), i; /* Reset the mappings. The total number is bits 30..25 of Config1. */ @@ -86,10 +86,10 @@ } } -void init_page_table(u32 page_table, u32 virtual, u32 physical, u32 pagesize, u8 flags, u8 asid) +void init_page_table(uint32_t page_table, uint32_t virtual, uint32_t physical, uint32_t pagesize, uint8_t flags, uint8_t asid) { - u32 lower = ((physical & 0xfffff000) >> 6) | flags; - u32 upper = (((physical + pagesize) & 0xfffff000) >> 6) | flags; + uint32_t lower = ((physical & 0xfffff000) >> 6) | flags; + uint32_t upper = (((physical + pagesize) & 0xfffff000) >> 6) | flags; /* With a complete address space mapping involving pairs of 4KB pages @@ -121,12 +121,12 @@ 0x1000 * 8 == 0x8000 bytes */ - u32 base = page_table + STAGE2_PAGE_TABLE_TASK * asid; + uint32_t base = page_table + STAGE2_PAGE_TABLE_TASK * asid; /* Each page table entry corresponds to a pair of 4KB pages and holds two values. */ - u32 entry = ((virtual & 0xffffe000) >> 13) * 8; - u32 *address = (u32 *) (base + entry); + uint32_t entry = ((virtual & 0xffffe000) >> 13) * 8; + uint32_t *address = (uint32_t *) (base + entry); /* The page tables should be permanently mapped to avoid hierarchical TLB miss handling. */ @@ -134,22 +134,22 @@ *(address + 1) = upper; } -void map_page(u32 virtual, u32 physical, u32 pagesize, u8 flags, u8 asid) +void map_page(uint32_t virtual, uint32_t physical, uint32_t pagesize, uint8_t flags, uint8_t asid) { - u32 start = (virtual & 0xffffe000) | asid; /* VPN2 | ASID*/ - u32 lower = ((physical & 0xfffff000) >> 6) | flags; - u32 upper = (((physical + pagesize) & 0xfffff000) >> 6) | flags; - u32 pagemask = ((pagesize - 1) & 0xfffff000) << 1; + uint32_t start = (virtual & 0xffffe000) | asid; /* VPN2 | ASID*/ + uint32_t lower = ((physical & 0xfffff000) >> 6) | flags; + uint32_t upper = (((physical + pagesize) & 0xfffff000) >> 6) | flags; + uint32_t pagemask = ((pagesize - 1) & 0xfffff000) << 1; map_page_op(lower, upper, start, pagemask); } -void map_page_index(u32 virtual, u32 physical, u32 pagesize, u8 flags, u8 asid, u32 index) +void map_page_index(uint32_t virtual, uint32_t physical, uint32_t pagesize, uint8_t flags, uint8_t asid, uint32_t index) { - u32 start = (virtual & 0xffffe000) | asid; /* VPN2 | ASID*/ - u32 lower = ((physical & 0xfffff000) >> 6) | flags; - u32 upper = (((physical + pagesize) & 0xfffff000) >> 6) | flags; - u32 pagemask = ((pagesize - 1) & 0xfffff000) << 1; + uint32_t start = (virtual & 0xffffe000) | asid; /* VPN2 | ASID*/ + uint32_t lower = ((physical & 0xfffff000) >> 6) | flags; + uint32_t upper = (((physical + pagesize) & 0xfffff000) >> 6) | flags; + uint32_t pagemask = ((pagesize - 1) & 0xfffff000) << 1; map_page_set_index(index); map_page_index_op(lower, upper, start, pagemask); diff -r 95be7694d999 -r 44fcbb779a70 stage2/cpu.h --- a/stage2/cpu.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/cpu.h Wed Jun 28 01:04:22 2017 +0200 @@ -4,10 +4,10 @@ #include "xburst_types.h" void flush_cache_all(); -void init_registers(u32 *, u32, void (*)(), u32[], u8); -void init_tlb(u8); -void init_page_table(u32, u32, u32, u32, u8, u8); -void map_page(u32, u32, u32, u8, u8); -void map_page_index(u32, u32, u32, u8, u8, u32); +void init_registers(uint32_t *, uint32_t, void (*)(), uint32_t[], uint8_t); +void init_tlb(uint8_t); +void init_page_table(uint32_t, uint32_t, uint32_t, uint32_t, uint8_t, uint8_t); +void map_page(uint32_t, uint32_t, uint32_t, uint8_t, uint8_t); +void map_page_index(uint32_t, uint32_t, uint32_t, uint8_t, uint8_t, uint32_t); #endif /* __CPU_H__ */ diff -r 95be7694d999 -r 44fcbb779a70 stage2/cpu_op.h --- a/stage2/cpu_op.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/cpu_op.h Wed Jun 28 01:04:22 2017 +0200 @@ -4,16 +4,16 @@ #include "xburst_types.h" void flush_icache_tag(); -void flush_icache_region(u32); +void flush_icache_region(uint32_t); void flush_icache_config(); -void flush_dcache_region(u32); +void flush_dcache_region(uint32_t); void handle_error_level(); void enable_interrupts(); void init_interrupts(); -void invoke_task(u8, u32 *, u32 *); -u32 configure_tlb(u32); -void map_page_set_index(u32); -void map_page_op(u32, u32, u32, u32); -void map_page_index_op(u32, u32, u32, u32); +void invoke_task(uint8_t, uint32_t *, uint32_t *); +uint32_t configure_tlb(uint32_t); +void map_page_set_index(uint32_t); +void map_page_op(uint32_t, uint32_t, uint32_t, uint32_t); +void map_page_index_op(uint32_t, uint32_t, uint32_t, uint32_t); #endif /* __CPU_OP_H__ */ diff -r 95be7694d999 -r 44fcbb779a70 stage2/init.h --- a/stage2/init.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/init.h Wed Jun 28 01:04:22 2017 +0200 @@ -18,8 +18,8 @@ /* GPIO. */ void gpio_init_irq(); -int gpio_have_irq(u8); -void gpio_clear(u8); +int gpio_have_irq(uint8_t); +void gpio_clear(uint8_t); /* General. */ diff -r 95be7694d999 -r 44fcbb779a70 stage2/jzlcd.c --- a/stage2/jzlcd.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/jzlcd.c Wed Jun 28 01:04:22 2017 +0200 @@ -2,7 +2,7 @@ * JzRISC LCD controller * * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -32,7 +32,7 @@ extern struct jzfb_info jzfb; extern vidinfo_t panel_info; -static unsigned short lcd_get_panels() +static uint16_t lcd_get_panels() { return ((jzfb.cfg & MODE_MASK) == MODE_STN_MONO_DUAL) || ((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_DUAL) ? 2 : 1; @@ -42,55 +42,55 @@ /* Functions returning region sizes. */ -static unsigned long lcd_get_size(vidinfo_t *vid) +static uint32_t lcd_get_size(vidinfo_t *vid) { /* Lines must be aligned to a word boundary. */ - unsigned long line_length = ALIGN((vid->vl_col * NBITS(vid->vl_bpix)) / 8, sizeof(u32)); + uint32_t line_length = ALIGN((vid->vl_col * NBITS(vid->vl_bpix)) / 8, sizeof(uint32_t)); return line_length * vid->vl_row; } -static unsigned long lcd_get_aligned_size(vidinfo_t *vid) +static uint32_t lcd_get_aligned_size(vidinfo_t *vid) { /* LCD_CTRL_BST_16 requires 16-word alignment. */ - return ALIGN(lcd_get_size(vid), 16 * sizeof(u32)); + return ALIGN(lcd_get_size(vid), 16 * sizeof(uint32_t)); } -static unsigned long lcd_get_min_size(vidinfo_t *vid) +static uint32_t lcd_get_min_size(vidinfo_t *vid) { /* Lines must be aligned to a word boundary. */ - unsigned long line_length = ALIGN((vid->vl_col * 32) / 8, sizeof(u32)); + uint32_t line_length = ALIGN((vid->vl_col * 32) / 8, sizeof(uint32_t)); return line_length * vid->vl_row; } -static unsigned long lcd_get_aligned_min_size(vidinfo_t *vid) +static uint32_t lcd_get_aligned_min_size(vidinfo_t *vid) { /* LCD_CTRL_BST_16 requires 16-word alignment. */ - return ALIGN(lcd_get_min_size(vid), 16 * sizeof(u32)); + return ALIGN(lcd_get_min_size(vid), 16 * sizeof(uint32_t)); } -static unsigned long lcd_get_palette_size(vidinfo_t *vid) +static uint32_t lcd_get_palette_size(vidinfo_t *vid) { if (NBITS(vid->vl_bpix) < 12) - return NCOLORS(vid->vl_bpix) * sizeof(u16); + return NCOLORS(vid->vl_bpix) * sizeof(uint16_t); else return 0; } -static unsigned long lcd_get_aligned_palette_size(vidinfo_t *vid) +static uint32_t lcd_get_aligned_palette_size(vidinfo_t *vid) { /* LCD_CTRL_BST_16 requires 16-word alignment. */ - return ALIGN(lcd_get_palette_size(vid), 16 * sizeof(u32)); + return ALIGN(lcd_get_palette_size(vid), 16 * sizeof(uint32_t)); } -static unsigned long lcd_get_descriptors_size() +static uint32_t lcd_get_descriptors_size() { return 3 * sizeof(struct jz_fb_dma_descriptor); } -static unsigned long lcd_get_total_size(vidinfo_t *vid) +static uint32_t lcd_get_total_size(vidinfo_t *vid) { - unsigned long size = lcd_get_aligned_size(vid) * lcd_get_panels(); - unsigned long min_size = lcd_get_aligned_min_size(vid); + uint32_t size = lcd_get_aligned_size(vid) * lcd_get_panels(); + uint32_t min_size = lcd_get_aligned_min_size(vid); /* Round up to nearest full page, or MMU section if defined. */ return ALIGN((size >= min_size ? size : min_size) + lcd_get_aligned_palette_size(vid) + lcd_get_descriptors_size(), PAGE_SIZE); @@ -100,19 +100,19 @@ /* Functions returning addresses of each data region. */ -static unsigned long lcd_get_palette(unsigned long addr) +static uint32_t lcd_get_palette(uint32_t addr) { /* Allocate memory at the end of the region for the palette. */ return addr - lcd_get_aligned_palette_size(&panel_info); } -static unsigned long lcd_get_descriptors(unsigned long addr) +static uint32_t lcd_get_descriptors(uint32_t addr) { /* Allocate memory before the palette for the descriptor array. */ return lcd_get_palette(addr) - lcd_get_descriptors_size(); } -static unsigned long lcd_get_framebuffer(unsigned long addr, unsigned short panel) +static uint32_t lcd_get_framebuffer(uint32_t addr, uint16_t panel) { /* Allocate pages for the frame buffer and palette. */ return addr - lcd_get_total_size(&panel_info) + (panel * lcd_get_aligned_size(&panel_info)); @@ -172,9 +172,9 @@ flush_cache_all(); } -static unsigned int jz_lcd_stn_init(unsigned int stnH) +static uint32_t jz_lcd_stn_init(uint32_t stnH) { - unsigned int val = 0; + uint32_t val = 0; switch (jzfb.bpp) { case 1: @@ -236,10 +236,10 @@ | (jzfb.vsw + jzfb.bfw + jzfb.h + jzfb.efw); } -static void jz_lcd_samsung_init(unsigned int pclk) +static void jz_lcd_samsung_init(uint32_t pclk) { - unsigned int total, tp_s, tp_e, ckv_s, ckv_e; - unsigned int rev_s, rev_e, inv_s, inv_e; + uint32_t total, tp_s, tp_e, ckv_s, ckv_e; + uint32_t rev_s, rev_e, inv_s, inv_e; jz_lcd_tft_init(); @@ -262,8 +262,8 @@ static void jz_lcd_sharp_init() { - unsigned int total, cls_s, cls_e, ps_s, ps_e; - unsigned int spl_s, spl_e, rev_s, rev_e; + uint32_t total, cls_s, cls_e, ps_s, ps_e; + uint32_t spl_s, spl_e, rev_s, rev_e; jz_lcd_tft_init(); @@ -283,9 +283,9 @@ REG_LCD_REV = (rev_s << 16) | rev_e; } -static unsigned int jz_lcd_get_pixel_clock() +static uint32_t jz_lcd_get_pixel_clock() { - unsigned int pclk; + uint32_t pclk; /* Derive pixel clock from frame clock. */ @@ -315,9 +315,9 @@ return pclk; } -static void jz_lcd_set_timing(unsigned int pclk) +static void jz_lcd_set_timing(uint32_t pclk) { - unsigned int val; + uint32_t val; #ifdef CONFIG_CPU_JZ4730 val = __cpm_get_pllout() / pclk; @@ -359,8 +359,8 @@ static int jz_lcd_hw_init(vidinfo_t *vid) { struct jz_fb_info *fbi = &vid->jz_fb; - unsigned int val = 0; - unsigned int pclk = jz_lcd_get_pixel_clock(); + uint32_t val = 0; + uint32_t pclk = jz_lcd_get_pixel_clock(); /* Setting Control register */ switch (jzfb.bpp) { @@ -442,18 +442,18 @@ /* Configure DMA. */ - REG_LCD_DA0 = (unsigned long) fbi->fdadr0; /* frame descriptor */ + REG_LCD_DA0 = (uint32_t) fbi->fdadr0; /* frame descriptor */ if (((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_DUAL) || ((jzfb.cfg & MODE_MASK) == MODE_STN_MONO_DUAL)) - REG_LCD_DA1 = (unsigned long) fbi->fdadr1; /* frame descriptor */ + REG_LCD_DA1 = (uint32_t) fbi->fdadr1; /* frame descriptor */ return 0; } -static inline u8 LCD_CODE(u8 bpp) +static inline uint8_t LCD_CODE(uint8_t bpp) { - u8 code = 0; + uint8_t code = 0; while (bpp && !(bpp & 1)) { bpp >>= 1; @@ -464,7 +464,7 @@ /* Public operations. */ -void lcd_set_bpp(u8 bpp) +void lcd_set_bpp(uint8_t bpp) { jzfb.bpp = bpp; panel_info.vl_bpix = LCD_CODE(bpp); @@ -488,21 +488,21 @@ REG_LCD_CTRL &= ~(1<<4); /* LCDCTRL.ENA, quick disable */ } -static inline u16 rgb8_to_rgb16(u8 rgb) +static inline uint16_t rgb8_to_rgb16(uint8_t rgb) { return ((((rgb & 0xe0) >> 5) * 4) << 11) | ((((rgb & 0x1c) >> 2) * 9) << 6) | ((rgb & 0x03) * 10); } -static inline u16 rgb4_to_rgb16(u8 rgb) +static inline uint16_t rgb4_to_rgb16(uint8_t rgb) { return ((((rgb & 8) >> 3) * 0x1f) << 11) | ((((rgb & 6) >> 1) * 0x15) << 5) | ((rgb & 1) * 0x1f); } static void lcd_init_palette(vidinfo_t *vid) { - u16 *palette = (u16 *) lcd_get_palette(get_memory_size()); - u16 *end = (u16 *) palette + NCOLORS(vid->vl_bpix); - u8 value = 0; + uint16_t *palette = (uint16_t *) lcd_get_palette(get_memory_size()); + uint16_t *end = (uint16_t *) palette + NCOLORS(vid->vl_bpix); + uint8_t value = 0; while (palette < end) { @@ -523,7 +523,7 @@ } } -unsigned long lcd_ctrl_init() +uint32_t lcd_ctrl_init() { struct jz_fb_info *fbi = &panel_info.jz_fb; diff -r 95be7694d999 -r 44fcbb779a70 stage2/jzlcd.h --- a/stage2/jzlcd.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/jzlcd.h Wed Jun 28 01:04:22 2017 +0200 @@ -4,7 +4,7 @@ * Copyright (C) 2001 Wolfgang Denk, DENX Software Engineering, wd@denx.de. * Copyright (C) 2005-2007, Ingenic Semiconductor Inc. * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -25,10 +25,10 @@ #ifndef __JZLCD_H__ #define __JZLCD_H__ -#include "xburst_types.h" +#include -void lcd_set_bpp(u8 bpp); -unsigned long lcd_ctrl_init(); +void lcd_set_bpp(uint8_t bpp); +uint32_t lcd_ctrl_init(); void lcd_enable(); void lcd_disable(); @@ -36,17 +36,17 @@ * Framebuffer characteristics */ struct jzfb_info { - unsigned int cfg; /* panel mode and pin usage etc. */ - unsigned int w; - unsigned int h; - unsigned int bpp; /* bit per pixel */ - unsigned int fclk; /* frame clk */ - unsigned int hsw; /* hsync width, in pclk */ - unsigned int vsw; /* vsync width, in line count */ - unsigned int elw; /* end of line, in pclk */ - unsigned int blw; /* begin of line, in pclk */ - unsigned int efw; /* end of frame, in line count */ - unsigned int bfw; /* begin of frame, in line count */ + uint32_t cfg; /* panel mode and pin usage etc. */ + uint32_t w; + uint32_t h; + uint32_t bpp; /* bit per pixel */ + uint32_t fclk; /* frame clk */ + uint32_t hsw; /* hsync width, in pclk */ + uint32_t vsw; /* vsync width, in line count */ + uint32_t elw; /* end of line, in pclk */ + uint32_t blw; /* begin of line, in pclk */ + uint32_t efw; /* end of frame, in line count */ + uint32_t bfw; /* begin of frame, in line count */ }; /* @@ -54,9 +54,9 @@ */ struct jz_fb_dma_descriptor { struct jz_fb_dma_descriptor *fdadr; /* Frame descriptor address register */ - unsigned long fsadr; /* Frame source address register */ - unsigned long fidr; /* Frame ID register */ - unsigned long ldcmd; /* Command register */ + uint32_t fsadr; /* Frame source address register */ + uint32_t fidr; /* Frame ID register */ + uint32_t ldcmd; /* Command register */ }; /* @@ -72,17 +72,17 @@ struct jz_fb_dma_descriptor *dmadesc_fbhigh; struct jz_fb_dma_descriptor *dmadesc_palette; - unsigned long screen; /* address of frame buffer */ - unsigned long palette; /* address of palette memory */ + uint32_t screen; /* address of frame buffer */ + uint32_t palette; /* address of palette memory */ }; /* * Concise display characteristics with low-level structure reference */ typedef struct vidinfo { - unsigned short vl_col; /* Number of columns (i.e. 640) */ - unsigned short vl_row; /* Number of rows (i.e. 480) */ - unsigned char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */ + uint16_t vl_col; /* Number of columns (i.e. 640) */ + uint16_t vl_row; /* Number of rows (i.e. 480) */ + uint8_t vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */ struct jz_fb_info jz_fb; } vidinfo_t; diff -r 95be7694d999 -r 44fcbb779a70 stage2/lcd.c --- a/stage2/lcd.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/lcd.c Wed Jun 28 01:04:22 2017 +0200 @@ -2,7 +2,7 @@ * Ben NanoNote LCD initialisation, based on uboot-xburst and xburst-tools. * * Copyright (C) 2001-2002 Wolfgang Denk, DENX Software Engineering, - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,6 @@ #include "board-display.h" -#include "xburst_types.h" #include "jzlcd.h" #include "sdram.h" #include "board.h" @@ -30,27 +29,27 @@ static unsigned int get_line_length() { - return ALIGN((panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8, sizeof(u32)); + return ALIGN((panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8, sizeof(uint32_t)); } -static u32 *get_pixel32(unsigned short h, unsigned short v) +static uint32_t *get_pixel32(unsigned short h, unsigned short v) { - return (u32 *) (lcd_base + v * get_line_length()) + h; + return (uint32_t *) (lcd_base + v * get_line_length()) + h; } -static u16 *get_pixel16(unsigned short h, unsigned short v) +static uint16_t *get_pixel16(unsigned short h, unsigned short v) { - return (u16 *) (lcd_base + v * get_line_length()) + h; + return (uint16_t *) (lcd_base + v * get_line_length()) + h; } -static u8 *get_pixel8(unsigned short h, unsigned short v) +static uint8_t *get_pixel8(unsigned short h, unsigned short v) { - return (u8 *) (lcd_base + v * get_line_length()) + h; + return (uint8_t *) (lcd_base + v * get_line_length()) + h; } -static u8 *get_pixel4(unsigned short h, unsigned short v) +static uint8_t *get_pixel4(unsigned short h, unsigned short v) { - return (u8 *) (lcd_base + v * get_line_length()) + h / 2; + return (uint8_t *) (lcd_base + v * get_line_length()) + h / 2; } static inline unsigned short div(unsigned short num, unsigned short denom, unsigned short scale) @@ -58,17 +57,17 @@ return (scale * num) / denom; } -static u32 pixel(u8 r, u8 g, u8 b, u8 rmax, u8 gmax, u8 bmax, u8 rshift, u8 gshift, u8 bshift) +static uint32_t pixel(uint8_t r, uint8_t g, uint8_t b, uint8_t rmax, uint8_t gmax, uint8_t bmax, uint8_t rshift, uint8_t gshift, uint8_t bshift) { return (div(r, 255, rmax) << rshift) | (div(g, 255, gmax) << gshift) | (div(b, 255, bmax) << bshift); } -u32 get_bitmap_value(unsigned short x, u32 value) +uint32_t get_bitmap_value(unsigned short x, uint32_t value) { return (value >> (((panel_info.vl_col - 1 - x) * 32) / panel_info.vl_col)) % 2 ? 0xffffffff : 0; } -static void get_colour(unsigned short h, unsigned short v, u8 rgb[], unsigned short pixel_type) +static void get_colour(unsigned short h, unsigned short v, uint8_t rgb[], unsigned short pixel_type) { unsigned short v_max = panel_info.vl_row - 1; unsigned short h_max = panel_info.vl_col - 1; @@ -78,32 +77,32 @@ rgb[(pixel_type + 1) % 3] = (rgb[0] + rgb[1]) / 2; } -static void set_pixel32(unsigned short h, unsigned short v, u32 value) +static void set_pixel32(unsigned short h, unsigned short v, uint32_t value) { - u32 *pix = get_pixel32(h, v); + uint32_t *pix = get_pixel32(h, v); *pix = value; } -static void set_pixel16_565(unsigned short h, unsigned short v, u32 value) +static void set_pixel16_565(unsigned short h, unsigned short v, uint32_t value) { - u16 *pix = get_pixel16(h, v); - *pix = (u16) value; + uint16_t *pix = get_pixel16(h, v); + *pix = (uint16_t) value; } -static void set_pixel8(unsigned short h, unsigned short v, u32 value) +static void set_pixel8(unsigned short h, unsigned short v, uint32_t value) { - u8 *pix = get_pixel8(h, v); - *pix = (u8) value; + uint8_t *pix = get_pixel8(h, v); + *pix = (uint8_t) value; } -static void set_pixel4(unsigned short h, unsigned short v, u32 value) +static void set_pixel4(unsigned short h, unsigned short v, uint32_t value) { - u8 *pix = get_pixel4(h, v); - u8 mask = h & 1 ? 0xf0 : 0x0f; - *pix = (*pix & mask) | ((u8) value); + uint8_t *pix = get_pixel4(h, v); + uint8_t mask = h & 1 ? 0xf0 : 0x0f; + *pix = (*pix & mask) | ((uint8_t) value); } -void set_pixel(unsigned short h, unsigned short v, u32 value) +void set_pixel(unsigned short h, unsigned short v, uint32_t value) { switch (panel_info.vl_bpix) { @@ -127,7 +126,7 @@ } static void test_pixel32(unsigned short h, unsigned short v, unsigned short pixel_type) { - u8 rgb[3]; + uint8_t rgb[3]; get_colour(h, v, rgb, pixel_type); set_pixel32(h, v, pixel(rgb[0], rgb[1], rgb[2], 255, 255, 255, 16, 8, 0) | get_bitmap_value(h, pixel_type)); @@ -135,7 +134,7 @@ static void test_pixel16_565(unsigned short h, unsigned short v, unsigned short pixel_type) { - u8 rgb[3]; + uint8_t rgb[3]; get_colour(h, v, rgb, pixel_type); set_pixel16_565(h, v, pixel(rgb[0], rgb[1], rgb[2], 31, 63, 31, 11, 5, 0) | get_bitmap_value(h, pixel_type)); @@ -143,7 +142,7 @@ static void test_pixel8(unsigned short h, unsigned short v, unsigned short pixel_type) { - u8 rgb[3]; + uint8_t rgb[3]; get_colour(h, v, rgb, pixel_type); set_pixel8(h, v, pixel(rgb[0], rgb[1], rgb[2], 7, 7, 3, 5, 2, 0) | get_bitmap_value(h, pixel_type)); @@ -151,7 +150,7 @@ static void test_pixel4(unsigned short h, unsigned short v, unsigned short pixel_type) { - u8 rgb[3]; + uint8_t rgb[3]; get_colour(h, v, rgb, pixel_type); set_pixel4(h, v, pixel(rgb[0], rgb[1], rgb[2], 1, 2, 1, 3, 1, 0) | get_bitmap_value(h, pixel_type)); @@ -182,26 +181,26 @@ void clear_pixel32(unsigned short h, unsigned short v) { - u32 *pix = get_pixel32(h, v); + uint32_t *pix = get_pixel32(h, v); *pix = 0; } void clear_pixel16(unsigned short h, unsigned short v) { - u16 *pix = get_pixel16(h, v); + uint16_t *pix = get_pixel16(h, v); *pix = 0; } void clear_pixel8(unsigned short h, unsigned short v) { - u8 *pix = get_pixel8(h, v); + uint8_t *pix = get_pixel8(h, v); *pix = 0; } void clear_pixel4(unsigned short h, unsigned short v) { - u8 *pix = get_pixel4(h, v); - u8 mask = h & 1 ? 0xf0 : 0x0f; + uint8_t *pix = get_pixel4(h, v); + uint8_t mask = h & 1 ? 0xf0 : 0x0f; *pix = *pix & mask; } diff -r 95be7694d999 -r 44fcbb779a70 stage2/lcd.h --- a/stage2/lcd.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/lcd.h Wed Jun 28 01:04:22 2017 +0200 @@ -1,7 +1,7 @@ #ifndef __LCD_H__ #define __LCD_H__ -#include "xburst_types.h" +#include /* Initialisation functions. */ @@ -9,8 +9,8 @@ /* Output functions. */ -u32 get_bitmap_value(unsigned short, u32); -void set_pixel(unsigned short, unsigned short, u32); +uint32_t get_bitmap_value(unsigned short, uint32_t); +void set_pixel(unsigned short, unsigned short, uint32_t); void test_pixel(unsigned short, unsigned short, unsigned short); void clear_pixel(unsigned short, unsigned short); diff -r 95be7694d999 -r 44fcbb779a70 stage2/nanonote_gpm940b0.h --- a/stage2/nanonote_gpm940b0.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/nanonote_gpm940b0.h Wed Jun 28 01:04:22 2017 +0200 @@ -2,7 +2,7 @@ * Ben NanoNote panel-specific definitions * * Copyright (C) Xiangfu Liu - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -26,10 +26,10 @@ #include "board.h" #include "nanonote.h" -static inline void __spi_write_reg1(u8 reg, u8 val) +static inline void __spi_write_reg1(uint8_t reg, uint8_t val) { - u8 no, a=reg, b=val; - u16 value; + uint8_t no, a=reg, b=val; + uint16_t value; __gpio_set_pin(SPEN); __gpio_set_pin(SPCK); diff -r 95be7694d999 -r 44fcbb779a70 stage2/paging.c --- a/stage2/paging.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/paging.c Wed Jun 28 01:04:22 2017 +0200 @@ -1,7 +1,7 @@ /* * Paging utilities. * - * Copyright (C) 2016 Paul Boddie + * Copyright (C) 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,22 +20,22 @@ #include "paging.h" #include "memory.h" -inline u32 user_address(u32 addr) +inline uint32_t user_address(uint32_t addr) { return addr & USER_ADDRESS_MASK; } -inline u32 previous_page(u32 addr, u32 pagesize) +inline uint32_t previous_page(uint32_t addr, uint32_t pagesize) { return addr - pagesize * 2; } -inline u32 next_page(u32 addr, u32 pagesize) +inline uint32_t next_page(uint32_t addr, uint32_t pagesize) { return addr + pagesize * 2; } -inline u32 page_size(u32 size) +inline uint32_t page_size(uint32_t size) { return size / 2; } diff -r 95be7694d999 -r 44fcbb779a70 stage2/paging.h --- a/stage2/paging.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/paging.h Wed Jun 28 01:04:22 2017 +0200 @@ -5,12 +5,12 @@ #ifndef __ASSEMBLER__ -#include "xburst_types.h" +#include -u32 user_address(u32 addr); -u32 previous_page(u32 addr, u32 pagesize); -u32 next_page(u32 addr, u32 pagesize); -u32 page_size(u32 size); +uint32_t user_address(uint32_t addr); +uint32_t previous_page(uint32_t addr, uint32_t pagesize); +uint32_t next_page(uint32_t addr, uint32_t pagesize); +uint32_t page_size(uint32_t size); #endif /* __ASSEMBLER__ */ diff -r 95be7694d999 -r 44fcbb779a70 stage2/task_gpio.c --- a/stage2/task_gpio.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/task_gpio.c Wed Jun 28 01:04:22 2017 +0200 @@ -1,7 +1,7 @@ /* * GPIO access for tasks. * - * Copyright (C) 2016 Paul Boddie + * Copyright (C) 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,14 +24,14 @@ #include "memory.h" #include "task_gpio.h" -void task_gpio_init(unsigned short task) +void task_gpio_init(uint8_t task) { - u32 virtual, physical; + uint32_t virtual, physical; /* Map the I/O region to the task. */ for (virtual = TASK_GPIO_BASE, physical = GPIO_BASE; - virtual < (u32) TASK_GPIO_BASE + (u32) GPIO_REGION_SIZE; + virtual < (uint32_t) TASK_GPIO_BASE + (uint32_t) GPIO_REGION_SIZE; virtual += page_size(STAGE2_PAGESIZE), physical += page_size(STAGE2_PAGESIZE)) { init_page_table(STAGE2_PAGE_TABLE_BASE, virtual, physical, @@ -39,27 +39,27 @@ } } -void task_gpio_as_input(unsigned short pin) +void task_gpio_as_input(uint8_t pin) { TASK_REG_GPIO_PXDIRC(pin / 32) = (1 << (pin % 32)); } -void task_gpio_as_output(unsigned short pin) +void task_gpio_as_output(uint8_t pin) { TASK_REG_GPIO_PXDIRS(pin / 32) = (1 << (pin % 32)); } -inline void task_gpio_set_pin(unsigned short pin) +inline void task_gpio_set_pin(uint8_t pin) { TASK_REG_GPIO_PXDATS(pin / 32) = (1 << (pin % 32)); } -inline void task_gpio_clear_pin(unsigned short pin) +inline void task_gpio_clear_pin(uint8_t pin) { TASK_REG_GPIO_PXDATC(pin / 32) = (1 << (pin % 32)); } -inline int task_gpio_get_pin(unsigned short pin) +inline int task_gpio_get_pin(uint8_t pin) { return TASK_REG_GPIO_PXPIN(pin / 32) & (1 << (pin % 32)); } diff -r 95be7694d999 -r 44fcbb779a70 stage2/task_gpio.h --- a/stage2/task_gpio.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/task_gpio.h Wed Jun 28 01:04:22 2017 +0200 @@ -24,11 +24,11 @@ #define TASK_REG_GPIO_PXDIRS(n) REG32(TASK_GPIO_PXDIRS((n))) #define TASK_REG_GPIO_PXDIRC(n) REG32(TASK_GPIO_PXDIRC((n))) -void task_gpio_init(unsigned short task); -void task_gpio_as_input(unsigned short pin); -void task_gpio_as_output(unsigned short pin); -void task_gpio_set_pin(unsigned short pin); -void task_gpio_clear_pin(unsigned short pin); -int task_gpio_get_pin(unsigned short pin); +void task_gpio_init(uint8_t task); +void task_gpio_as_input(uint8_t pin); +void task_gpio_as_output(uint8_t pin); +void task_gpio_set_pin(uint8_t pin); +void task_gpio_clear_pin(uint8_t pin); +int task_gpio_get_pin(uint8_t pin); #endif /* __TASK_GPIO_H__ */ diff -r 95be7694d999 -r 44fcbb779a70 stage2/tasks.c --- a/stage2/tasks.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/tasks.c Wed Jun 28 01:04:22 2017 +0200 @@ -1,7 +1,7 @@ /* * Task handling. * - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,20 +27,20 @@ /* Task tables and data. */ -static u32 stack_pointers[max_tasks]; -static u32 registers[max_tasks][32]; +static uint32_t stack_pointers[max_tasks]; +static uint32_t registers[max_tasks][32]; -u8 current_task; -u32 *current_stack_pointer; -u32 *current_registers; +uint8_t current_task; +uint32_t *current_stack_pointer; +uint32_t *current_registers; /* A reference to locations for the symbol tables. */ -extern u32 _got_start, _got_copy_start, _got_copy_end; +extern uint32_t _got_start, _got_copy_start, _got_copy_end; /* A reference to the start of the payload and end of memory locations. */ -extern u32 _payload_start, _memory_end; +extern uint32_t _payload_start, _memory_end; /* Task management functions. */ @@ -58,16 +58,16 @@ void start_tasks() { - void (**starter)(unsigned short); + void (**starter)(uint8_t); int i; for (i = 1, starter = initial_tasks; *starter; i++, starter++) (*starter)(i); } -void start_task(unsigned short task, void (*function)(), u32 args[], u8 nargs) +void start_task(uint8_t task, void (*function)(), uint32_t args[], uint8_t nargs) { - u32 virtual, physical, address; + uint32_t virtual, physical, address; /* Each task employs a stack at a multiple of the given start address in @@ -98,19 +98,19 @@ return address. */ - init_registers(registers[task], (u32) &_got_copy_start, function, args, nargs); + init_registers(registers[task], (uint32_t) &_got_copy_start, function, args, nargs); /* Map the global object table for the task. */ init_page_table(STAGE2_PAGE_TABLE_BASE, - user_address((u32) &_got_start), - user_address((u32) &_got_copy_start), + user_address((uint32_t) &_got_start), + user_address((uint32_t) &_got_copy_start), STAGE2_PAGESIZE, TLB_READ, task); /* Map all shared pages for the task. First, the read-only code region. */ - for (address = (u32) &_payload_start; - address < (u32) &_got_start; + for (address = (uint32_t) &_payload_start; + address < (uint32_t) &_got_start; address = next_page(address, STAGE2_PAGESIZE)) { init_page_table(STAGE2_PAGE_TABLE_BASE, @@ -121,8 +121,8 @@ /* Make the pages after the code writable. */ - for (address = next_page((u32) &_got_copy_end, STAGE2_PAGESIZE); - address < (u32) &_memory_end; + for (address = next_page((uint32_t) &_got_copy_end, STAGE2_PAGESIZE); + address < (uint32_t) &_memory_end; address = next_page(address, STAGE2_PAGESIZE)) { init_page_table(STAGE2_PAGE_TABLE_BASE, diff -r 95be7694d999 -r 44fcbb779a70 stage2/tasks.h --- a/stage2/tasks.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/tasks.h Wed Jun 28 01:04:22 2017 +0200 @@ -1,7 +1,7 @@ #ifndef __TASKS_H__ #define __TASKS_H__ -#include "xburst_types.h" +#include /* Provide a limit to the number of tasks (in a way that employs a constant). */ @@ -12,7 +12,7 @@ void init_tasks(); void init_task(); void start_tasks(); -void start_task(unsigned short, void (*)(), u32[], u8); +void start_task(uint8_t, void (*)(), uint32_t[], uint8_t); void start_task_now(); void switch_task(); diff -r 95be7694d999 -r 44fcbb779a70 stage2/tasks/example.c --- a/stage2/tasks/example.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/tasks/example.c Wed Jun 28 01:04:22 2017 +0200 @@ -1,7 +1,7 @@ /* * Example screen-updating task. * - * Copyright (C) 2015, 2016 Paul Boddie + * Copyright (C) 2015, 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ extern vidinfo_t panel_info; -void next_pixel(unsigned short *x, unsigned short *y) +void next_pixel(uint16_t *x, uint16_t *y) { (*x)++; if (*x >= panel_info.vl_col) { @@ -37,7 +37,7 @@ /* Tasks. */ -void plot_pattern(unsigned short pixel_type, unsigned short x, unsigned short y) +void plot_pattern(uint16_t pixel_type, uint16_t x, uint16_t y) { int i; @@ -48,9 +48,9 @@ } } -void start_plot_pattern(unsigned short task) +void start_plot_pattern(uint8_t task) { - u32 args[] = {task, 0, (task * (panel_info.vl_row / 4)) % panel_info.vl_row}; + uint32_t args[] = {task, 0, (task * (panel_info.vl_row / 4)) % panel_info.vl_row}; start_task(task, (void (*)()) plot_pattern, args, 3); } diff -r 95be7694d999 -r 44fcbb779a70 stage2/tasks/example.h --- a/stage2/tasks/example.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/tasks/example.h Wed Jun 28 01:04:22 2017 +0200 @@ -1,12 +1,12 @@ #ifndef __EXAMPLE_H__ #define __EXAMPLE_H__ -#include "xburst_types.h" +#include /* Example task functions. */ -void plot_pattern(unsigned short, unsigned short, unsigned short); -void plot_value(u32); -void start_plot_pattern(unsigned short); +void plot_pattern(uint16_t, uint16_t, uint16_t); +void plot_value(uint32_t); +void start_plot_pattern(uint8_t); #endif /* __EXAMPLE_H__ */ diff -r 95be7694d999 -r 44fcbb779a70 stage2/tasks/keyscan.c --- a/stage2/tasks/keyscan.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/tasks/keyscan.c Wed Jun 28 01:04:22 2017 +0200 @@ -1,7 +1,7 @@ /* * Keyboard scanning task. * - * Copyright (C) 2016 Paul Boddie + * Copyright (C) 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,10 +25,10 @@ extern vidinfo_t panel_info; -void plot_value(unsigned short xmin, unsigned short xmax, unsigned short ymin, unsigned short ymax, u8 value) +void plot_value(uint16_t xmin, uint16_t xmax, uint16_t ymin, uint16_t ymax, uint8_t value) { - unsigned short x, y; - u32 pixel; + uint16_t x, y; + uint32_t pixel; for (y = ymin; (y < panel_info.vl_row) && (y < ymax); y++) { @@ -53,10 +53,10 @@ /* Tasks. */ -void keyscan(unsigned short task) +void keyscan(uint8_t task) { int column, row; - u8 value; + uint8_t value; init_keyscan(); @@ -84,9 +84,9 @@ } } -void start_keyscan(unsigned short task) +void start_keyscan(uint8_t task) { - u32 args[] = {task}; + uint32_t args[] = {task}; task_gpio_init(task); diff -r 95be7694d999 -r 44fcbb779a70 stage2/tasks/keyscan.h --- a/stage2/tasks/keyscan.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/tasks/keyscan.h Wed Jun 28 01:04:22 2017 +0200 @@ -1,6 +1,8 @@ #ifndef __KEYSCAN_H__ #define __KEYSCAN_H__ -void start_keyscan(unsigned short); +#include + +void start_keyscan(uint8_t); #endif /* __KEYSCAN_H__ */ diff -r 95be7694d999 -r 44fcbb779a70 stage2/tasks/manifest.c --- a/stage2/tasks/manifest.c Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/tasks/manifest.c Wed Jun 28 01:04:22 2017 +0200 @@ -1,7 +1,7 @@ /* * Task manifest. * - * Copyright (C) 2016 Paul Boddie + * Copyright (C) 2016, 2017 Paul Boddie * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ /* A list of task-starting functions accepting their task identifier. */ -void (*initial_task_array[])(unsigned short) = { +void (*initial_task_array[])(uint8_t) = { start_plot_pattern, start_plot_pattern, start_keyscan, @@ -36,4 +36,4 @@ 0 }; -void (**initial_tasks)(unsigned short) = initial_task_array; +void (**initial_tasks)(uint8_t) = initial_task_array; diff -r 95be7694d999 -r 44fcbb779a70 stage2/tasks/manifest.h --- a/stage2/tasks/manifest.h Wed Jun 28 00:20:14 2017 +0200 +++ b/stage2/tasks/manifest.h Wed Jun 28 01:04:22 2017 +0200 @@ -1,6 +1,8 @@ #ifndef __TASKS_MANIFEST_H__ #define __TASKS_MANIFEST_H__ -void (**initial_tasks)(unsigned short); +#include + +void (**initial_tasks)(uint8_t); #endif /* __TASKS_MANIFEST_H__ */