diff --git a/boot-programs/devices.hhp b/boot-programs/devices.hhp new file mode 100644 index 0000000..b4bcda7 --- /dev/null +++ b/boot-programs/devices.hhp @@ -0,0 +1,9 @@ +#pypp 0 +#ifndef __IRIS_DEVICES_HH +#define __IRIS_DEVICES_HH + +// lcd driver. +#define LCD_BACKLIGHT 1 +#define LCD_RESET 2 + +#endif diff --git a/boot-programs/lcd.ccp b/boot-programs/lcd.ccp index 19ed173..2e08030 100644 --- a/boot-programs/lcd.ccp +++ b/boot-programs/lcd.ccp @@ -85,11 +85,8 @@ static void lcd_disable (): set_backlight (0) static void reset (): - // Use gpio pins as pwm. - GPIO_GPAUR (2) = (GPIO_GPAUR (2) & ~0x0fffffff) | 0x50000000 - // Use gpio pins as lcd master. - GPIO_GPALR (1) = (GPIO_GPALR (1) & ~0x0000ffff) | 0x55550000 - GPIO_GPAUR (1) = 0x556a5555 + gpio_as_pwm () + gpio_as_lcd_master () // initialize things. GPIO_GPIER (2) &= ~(PWM_ENABLE | LCD_RET | SPEN | SPCK | SPDA) @@ -126,12 +123,6 @@ static void reset (): CPM_MSCR &= ~(1 << 7) mdelay (1) -static void map_io (unsigned physical, unsigned address): - Capability page = memory_create_page (__my_memory) - alloc_physical (page, physical, 0) - memory_map (__my_memory, page, address, 1) - //drop (page) - int main (): map_gpio () map_pwm0 () @@ -140,6 +131,13 @@ int main (): reset () + while true: + for unsigned i = 0; i <= 300; i += 30: + set_backlight (i) + kdebug (0) + mdelay (50) + schedule () + while true: Message msg if !wait (&msg): diff --git a/invoke.ccp b/invoke.ccp index de314a0..4de920b 100644 --- a/invoke.ccp +++ b/invoke.ccp @@ -222,7 +222,6 @@ static void memory_invoke (unsigned target, unsigned protected_data, Capability: reply_num (0) break case CAPTYPE_PAGE: - dbg_send (1, 3) Page *ret = mem->alloc_page () if ret: reply_cap (CAPTYPE_PAGE | (rights & CAP_PAGE_ALL_RIGHTS), (unsigned)ret) @@ -268,7 +267,6 @@ static void memory_invoke (unsigned target, unsigned protected_data, Capability: // TODO break case CAP_MEMORY_MAP: - dbg_send (3, 3) // FIXME: this should work for fake pages as well. if !c->cap[0] || (unsigned)c->cap[0]->target & ~KERNEL_MASK || ((unsigned)c->cap[0]->target & CAPTYPE_MASK) != CAPTYPE_PAGE: break @@ -364,7 +362,6 @@ static void thread_invoke (unsigned target, unsigned protected_data, Capability: reply_cap (CAPTYPE_THREAD | (c->data[1] & CAP_THREAD_ALL_PRIV_RIGHTS), c->cap[0]->protected_data) break case CAP_THREAD_ALLOC_PHYSICAL: - dbg_send (2, 3) // Threads with access to this call are trusted, so no sanity checking is done. Page *page = (Page *)c->cap[0]->protected_data page->forget () diff --git a/mips/Makefile.arch b/mips/Makefile.arch index ad34a16..df779fe 100644 --- a/mips/Makefile.arch +++ b/mips/Makefile.arch @@ -35,7 +35,7 @@ uimage: mips/entry.o: $(boot_threads) mips/init.o: TARGET_FLAGS = -I/usr/include $(boot_threads): TARGET_FLAGS = -I. -$(boot_threads): boot-programs/jz4730.hh +$(boot_threads): boot-programs/jz4730.hh boot-programs/devices.hh # Transform ':' into ';' so vim doesn't think there are errors. uimage: kernel.raw.gz Makefile mips/Makefile.arch diff --git a/mips/entry.S b/mips/entry.S index 319908d..d290688 100644 --- a/mips/entry.S +++ b/mips/entry.S @@ -222,8 +222,8 @@ save_regs: .globl thread2 .balign 0x1000 thread0: - .incbin "keyboard" + .incbin "lcd" .balign 0x1000 thread1: - .incbin "lcd" + .incbin "keyboard" thread2: