1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2024-12-29 19:44:16 +02:00
This commit is contained in:
Bas Wijnen 2009-06-22 16:13:00 +02:00
parent ef229121ed
commit 40a9a29c2d
5 changed files with 21 additions and 17 deletions

View File

@ -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

View File

@ -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):

View File

@ -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 ()

View File

@ -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

View File

@ -222,8 +222,8 @@ save_regs:
.globl thread2
.balign 0x1000
thread0:
.incbin "keyboard"
.incbin "lcd"
.balign 0x1000
thread1:
.incbin "lcd"
.incbin "keyboard"
thread2: