mirror of
https://github.com/drasko/codezero.git
synced 2026-01-11 18:33:16 +01:00
Basic codezero support for clcd device capability added.
1. We are not making a new clcd service container, as we dont want to keep separate container for each device, ultimately we will have one container managing all devices. 2. CLCD driver needs to be added.
This commit is contained in:
@@ -237,6 +237,7 @@ cont%(cn)d_cap_device_uart3 'Container %(cn)d UART3 Menu'
|
||||
cont%(cn)d_cap_device_timer1 'Container %(cn)d TIMER23 Menu'
|
||||
cont%(cn)d_cap_device_keyboard0 'Container %(cn)d KEYBOARD0 Menu'
|
||||
cont%(cn)d_cap_device_mouse0 'Container %(cn)d MOUSE0 Menu'
|
||||
cont%(cn)d_cap_device_clcd0 'Container %(cn)d CLCD0 Menu'
|
||||
|
||||
CONT%(cn)d_CAP_DEVICE_UART1_USE 'Container %(cn)d UART1 Enable'
|
||||
CONT%(cn)d_CAP_DEVICE_UART2_USE 'Container %(cn)d UART2 Enable'
|
||||
@@ -244,6 +245,7 @@ CONT%(cn)d_CAP_DEVICE_UART3_USE 'Container %(cn)d UART3 Enable'
|
||||
CONT%(cn)d_CAP_DEVICE_TIMER1_USE 'Container %(cn)d TIMER23 Enable'
|
||||
CONT%(cn)d_CAP_DEVICE_KEYBOARD0_USE 'Container %(cn)d KEYBOARD0 Enable'
|
||||
CONT%(cn)d_CAP_DEVICE_MOUSE0_USE 'Container %(cn)d MOUSE0 Enable'
|
||||
CONT%(cn)d_CAP_DEVICE_CLCD0_USE 'Container %(cn)d CLCD0 Enable'
|
||||
|
||||
default CONT%(cn)d_CAP_DEVICE_UART1_USE from n
|
||||
default CONT%(cn)d_CAP_DEVICE_UART2_USE from n
|
||||
@@ -251,6 +253,7 @@ default CONT%(cn)d_CAP_DEVICE_UART3_USE from n
|
||||
default CONT%(cn)d_CAP_DEVICE_TIMER1_USE from n
|
||||
default CONT%(cn)d_CAP_DEVICE_KEYBOARD0_USE from n
|
||||
default CONT%(cn)d_CAP_DEVICE_MOUSE0_USE from n
|
||||
default CONT%(cn)d_CAP_DEVICE_CLCD0_USE from n
|
||||
|
||||
menu cont%(cn)d_cap_device_uart1
|
||||
CONT%(cn)d_CAP_DEVICE_UART1_USE
|
||||
@@ -270,10 +273,14 @@ menu cont%(cn)d_cap_device_keyboard0
|
||||
menu cont%(cn)d_cap_device_mouse0
|
||||
CONT%(cn)d_CAP_DEVICE_MOUSE0_USE
|
||||
|
||||
menu cont%(cn)d_cap_device_clcd0
|
||||
CONT%(cn)d_CAP_DEVICE_CLCD0_USE
|
||||
|
||||
menu cont%(cn)d_device_list
|
||||
cont%(cn)d_cap_device_uart1
|
||||
cont%(cn)d_cap_device_uart2
|
||||
cont%(cn)d_cap_device_uart3
|
||||
cont%(cn)d_cap_device_clcd0
|
||||
cont%(cn)d_cap_device_timer1
|
||||
cont%(cn)d_cap_device_keyboard0
|
||||
cont%(cn)d_cap_device_mouse0
|
||||
|
||||
@@ -38,6 +38,8 @@ objects += SConscript('timer/sp804/SConscript', duplicate=0, \
|
||||
exports = {'platform' : platform, 'env' : e})
|
||||
objects += SConscript('kmi/pl050/SConscript', duplicate=0, \
|
||||
exports = {'platform' : platform, 'env' : e})
|
||||
objects += SConscript('clcd/pl110/SConscript', duplicate=0, \
|
||||
exports = {'platform' : platform, 'env' : e})
|
||||
|
||||
objects += SConscript('uart/omap/SConscript', duplicate=0, \
|
||||
exports = {'platform' : platform, 'env' : e})
|
||||
|
||||
@@ -48,6 +48,8 @@ objects += SConscript('timer/sp804/SConscript', duplicate=0, \
|
||||
exports = {'platform' : platform, 'env' : env})
|
||||
objects += SConscript('kmi/pl050/SConscript', duplicate=0, \
|
||||
exports = {'platform' : platform, 'env' : env})
|
||||
objects += SConscript('clcd/pl110/SConscript', duplicate=0, \
|
||||
exports = {'platform' : platform, 'env' : env})
|
||||
|
||||
objects += SConscript('uart/omap/SConscript', duplicate=0, \
|
||||
exports = {'platform' : platform, 'env' : env})
|
||||
|
||||
14
conts/libdev/clcd/pl110/SConscript
Normal file
14
conts/libdev/clcd/pl110/SConscript
Normal file
@@ -0,0 +1,14 @@
|
||||
Import('env', 'platform')
|
||||
|
||||
#Platforms using pl110
|
||||
plat_list = ('eb', 'pba8', 'pba9', 'pb11mpcore', 'pb926')
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
src_local = []
|
||||
|
||||
for plat_supported in plat_list:
|
||||
if plat_supported == platform:
|
||||
src_local += Glob('*.c')
|
||||
|
||||
obj = env.StaticObject(src_local)
|
||||
Return('obj')
|
||||
3
conts/libdev/clcd/pl110/clcd.c
Normal file
3
conts/libdev/clcd/pl110/clcd.c
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
|
||||
5
conts/libdev/clcd/pl110/clcd.h
Normal file
5
conts/libdev/clcd/pl110/clcd.h
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
#ifndef __CLCD_H__
|
||||
#define __CLCD_H__
|
||||
|
||||
#endif /* __CLCD_H__ */
|
||||
@@ -46,8 +46,9 @@
|
||||
*/
|
||||
#define CAP_DEVTYPE_TIMER 1
|
||||
#define CAP_DEVTYPE_UART 2
|
||||
#define CAP_DEVTYPE_KEYBOARD 3
|
||||
#define CAP_DEVTYPE_MOUSE 4
|
||||
#define CAP_DEVTYPE_KEYBOARD 3
|
||||
#define CAP_DEVTYPE_MOUSE 4
|
||||
#define CAP_DEVTYPE_CLCD 5
|
||||
#define CAP_DEVTYPE_OTHER 0xF
|
||||
#define CAP_DEVTYPE_MASK 0xFFFF
|
||||
#define CAP_DEVNUM_MASK 0xFFFF0000
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#define PLATFORM_TIMER1_VBASE (IO_AREA0_VADDR + (6 * DEVICE_PAGE))
|
||||
#define PLATFORM_KEYBOARD0_VBASE (IO_AREA0_VADDR + (7 * DEVICE_PAGE))
|
||||
#define PLATFORM_MOUSE0_VBASE (IO_AREA0_VADDR + (8 * DEVICE_PAGE))
|
||||
#define PLATFORM_CLCD0_VBASE (IO_AREA0_VADDR + (9 * DEVICE_PAGE))
|
||||
|
||||
/* The SP810 system controller offsets */
|
||||
#define SP810_BASE PLATFORM_SYSCTRL_VBASE
|
||||
@@ -61,6 +62,7 @@
|
||||
#define PLATFORM_TIMER1_SIZE 0x1000
|
||||
#define PLATFORM_KEYBOARD0_SIZE 0x1000
|
||||
#define PLATFORM_MOUSE0_SIZE 0x1000
|
||||
#define PLATFORM_CLCD0_SIZE 0x1000
|
||||
|
||||
#endif /* __PLATFORM_PB926_OFFSETS_H__ */
|
||||
|
||||
|
||||
@@ -50,7 +50,8 @@ device_suppress_sym = \
|
||||
'''\tcont${CONTID}_cap_device_${DEVNAME_LOWER}
|
||||
'''
|
||||
|
||||
devices = ['UART1', 'UART2', 'UART3', 'TIMER1', 'KEYBOARD0', 'MOUSE0']
|
||||
devices = ['UART1', 'UART2', 'UART3', 'TIMER1',
|
||||
'KEYBOARD0', 'MOUSE0', 'CLCD0']
|
||||
|
||||
#
|
||||
# When a symbol is used by a single container, sometimes it is
|
||||
|
||||
@@ -23,6 +23,25 @@
|
||||
#include <l4/generic/capability.h>
|
||||
#include <l4/generic/cap-types.h>
|
||||
|
||||
/*
|
||||
* FIXME: This is not a platform specific
|
||||
* call, we will move this out later
|
||||
*/
|
||||
void device_cap_init(struct kernel_resources *kres, int devtype,
|
||||
int devnum, unsigned long base)
|
||||
{
|
||||
struct capability *cap;
|
||||
|
||||
cap = alloc_bootmem(sizeof(*cap), 0);
|
||||
cap_set_devtype(cap, devtype);
|
||||
cap_set_devnum(cap, devnum);
|
||||
cap->start = __pfn(base);
|
||||
cap->end = cap->start + 1;
|
||||
cap->size = cap->end - cap->start;
|
||||
link_init(&cap->list);
|
||||
cap_list_insert(cap, &kres->devmem_free);
|
||||
}
|
||||
|
||||
/*
|
||||
* The devices that are used by the kernel are mapped
|
||||
* independent of these capabilities, but these provide a
|
||||
@@ -30,66 +49,13 @@
|
||||
*/
|
||||
int platform_setup_device_caps(struct kernel_resources *kres)
|
||||
{
|
||||
struct capability *uart[3], *timer[1],
|
||||
*keyboard[1], *mouse[1];
|
||||
|
||||
/* Setup capabilities for userspace uarts and timers */
|
||||
uart[0] = alloc_bootmem(sizeof(*uart[0]), 0);
|
||||
uart[0]->start = __pfn(PLATFORM_UART1_BASE);
|
||||
uart[0]->end = uart[0]->start + 1;
|
||||
uart[0]->size = uart[0]->end - uart[1]->start;
|
||||
cap_set_devtype(uart[0], CAP_DEVTYPE_UART);
|
||||
cap_set_devnum(uart[0], 1);
|
||||
link_init(&uart[0]->list);
|
||||
cap_list_insert(uart[0], &kres->devmem_free);
|
||||
|
||||
uart[1] = alloc_bootmem(sizeof(*uart[1]), 0);
|
||||
uart[1]->start = __pfn(PLATFORM_UART2_BASE);
|
||||
uart[1]->end = uart[1]->start + 1;
|
||||
uart[1]->size = uart[1]->end - uart[1]->start;
|
||||
cap_set_devtype(uart[1], CAP_DEVTYPE_UART);
|
||||
cap_set_devnum(uart[1], 2);
|
||||
link_init(&uart[1]->list);
|
||||
cap_list_insert(uart[1], &kres->devmem_free);
|
||||
|
||||
uart[2] = alloc_bootmem(sizeof(*uart[2]), 0);
|
||||
uart[2]->start = __pfn(PLATFORM_UART3_BASE);
|
||||
uart[2]->end = uart[2]->start + 1;
|
||||
uart[2]->size = uart[2]->end - uart[2]->start;
|
||||
cap_set_devtype(uart[2], CAP_DEVTYPE_UART);
|
||||
cap_set_devnum(uart[2], 3);
|
||||
link_init(&uart[2]->list);
|
||||
cap_list_insert(uart[2], &kres->devmem_free);
|
||||
|
||||
/* Setup timer1 capability as free */
|
||||
timer[0] = alloc_bootmem(sizeof(*timer[0]), 0);
|
||||
timer[0]->start = __pfn(PLATFORM_TIMER1_BASE);
|
||||
timer[0]->end = timer[0]->start + 1;
|
||||
timer[0]->size = timer[0]->end - timer[0]->start;
|
||||
cap_set_devtype(timer[0], CAP_DEVTYPE_TIMER);
|
||||
cap_set_devnum(timer[0], 1);
|
||||
link_init(&timer[0]->list);
|
||||
cap_list_insert(timer[0], &kres->devmem_free);
|
||||
|
||||
/* Setup keyboard capability as free */
|
||||
keyboard[0] = alloc_bootmem(sizeof(*keyboard[0]), 0);
|
||||
keyboard[0]->start = __pfn(PLATFORM_KEYBOARD0_BASE);
|
||||
keyboard[0]->end = keyboard[0]->start + 1;
|
||||
keyboard[0]->size = keyboard[0]->end - keyboard[0]->start;
|
||||
cap_set_devtype(keyboard[0], CAP_DEVTYPE_KEYBOARD);
|
||||
cap_set_devnum(keyboard[0], 0);
|
||||
link_init(&keyboard[0]->list);
|
||||
cap_list_insert(keyboard[0], &kres->devmem_free);
|
||||
|
||||
/* Setup mouse capability as free */
|
||||
mouse[0] = alloc_bootmem(sizeof(*mouse[0]), 0);
|
||||
mouse[0]->start = __pfn(PLATFORM_MOUSE0_BASE);
|
||||
mouse[0]->end = mouse[0]->start + 1;
|
||||
mouse[0]->size = mouse[0]->end - mouse[0]->start;
|
||||
cap_set_devtype(mouse[0], CAP_DEVTYPE_MOUSE);
|
||||
cap_set_devnum(mouse[0], 0);
|
||||
link_init(&mouse[0]->list);
|
||||
cap_list_insert(mouse[0], &kres->devmem_free);
|
||||
device_cap_init(kres, CAP_DEVTYPE_UART, 1, PLATFORM_UART1_BASE);
|
||||
device_cap_init(kres, CAP_DEVTYPE_UART, 2, PLATFORM_UART2_BASE);
|
||||
device_cap_init(kres, CAP_DEVTYPE_UART, 3, PLATFORM_UART3_BASE);
|
||||
device_cap_init(kres, CAP_DEVTYPE_TIMER, 1, PLATFORM_TIMER1_BASE);
|
||||
device_cap_init(kres, CAP_DEVTYPE_KEYBOARD, 0, PLATFORM_KEYBOARD0_BASE);
|
||||
device_cap_init(kres, CAP_DEVTYPE_MOUSE, 0, PLATFORM_MOUSE0_BASE);
|
||||
device_cap_init(kres, CAP_DEVTYPE_CLCD, 0, PLATFORM_CLCD0_BASE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -152,6 +118,9 @@ void init_platform_devices()
|
||||
add_boot_mapping(PLATFORM_MOUSE0_BASE, PLATFORM_MOUSE0_VBASE,
|
||||
PAGE_SIZE, MAP_IO_DEFAULT);
|
||||
|
||||
/* CLCD */
|
||||
add_boot_mapping(PLATFORM_CLCD0_BASE, PLATFORM_CLCD0_VBASE,
|
||||
PAGE_SIZE, MAP_IO_DEFAULT);
|
||||
}
|
||||
|
||||
/* If these bits are off, 32Khz OSC source is used */
|
||||
|
||||
Reference in New Issue
Block a user