Changes since April

Clean up of build directories.
Simplifications to capability model.
This commit is contained in:
Bahadir Balban
2010-06-01 15:08:13 +03:00
parent aef14b55ec
commit 6fa4884a5a
450 changed files with 10449 additions and 7383 deletions

View File

@@ -0,0 +1,12 @@
/*
* IO functions/macros.
*
* Copyright (C) 2007 Bahadir Balban
*/
#ifndef __LIBDEV_IO_H__
#define __LIBDEV_IO_H__
#define read(address) *((volatile unsigned int *)(address))
#define write(val, address) *((volatile unsigned int *)(address)) = val
#endif /* __LIBDEV_IO_H__ */

View File

@@ -0,0 +1,26 @@
#ifndef __KMI_H__
#define __KMI_H__
/*
* Current keyboard state
*/
struct keyboard_state{
int keyup;
int shift;
int caps_lock;
};
/* Common functions */
void kmi_rx_irq_enable(unsigned long base);
int kmi_data_read(unsigned long base);
/* Keyboard specific calls */
char kmi_keyboard_read(unsigned long base, struct keyboard_state *state);
void kmi_keyboard_init(unsigned long base, unsigned int div);
/* Mouse specific calls */
void kmi_mouse_enable(unsigned long base);
void kmi_mouse_init(unsigned long base, unsigned int div);
#endif /* __KMI_H__ */

View File

@@ -0,0 +1,17 @@
/*
* Generic platform file.
*
* Copyright (C) 2010 B Labs Ltd.
*
* Author: Bahadir Balban
*/
#ifndef __LIBDEV_PLATFORM_H__
#define __LIBDEV_PLATFORM_H__
#define INC_LIBDEV_PLAT(x) <dev/platform/__PLATFORM__/x>
/* paths realtive to conts/dev/ */
#include INC_LIBDEV_PLAT(irq.h)
#include INC_LIBDEV_PLAT(platform.h)
#endif /* __LIBDEV_PLATFORM_H__ */

View File

@@ -0,0 +1,13 @@
/*
* IRQ numbers for beagle board.
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_BEAGLE_IRQ_H__
#define __LIBDEV_BEAGLE_IRQ_H__
#define IRQ_TIMER0 37
#define IRQ_TIMER1 38
#endif /* __LIBDEV_BEAGLE_IRQ_H__ */

View File

@@ -0,0 +1,13 @@
/*
* Platform offsets for beagle board.
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_PLATFORM_BEAGLE_H__
#define __LIBDEV_PLATFORM_BEAGLE_H__
#define PLATFORM_TIMER1_BASE 0x49032000 /* GPTIMER2 */
#define PLATFORM_TIMER2_BASE 0x49034000 /* GPTIMER3 */
#endif /* __LIBDEV_PLATFORM_BEAGLE_H__ */

View File

@@ -0,0 +1,22 @@
/*
* IRQ numbers for eb.
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_EB_IRQ_H__
#define __LIBDEV_EB_IRQ_H__
#if defined (CONFIG_CPU_ARM11MPCORE) || defined (CONFIG_CPU_CORTEXA9)
#define IRQ_TIMER1 34
#define IRQ_KEYBOARD0 39
#define IRQ_MOUSE0 40
#define IRQ_CLCD0 55
#else
#define IRQ_TIMER1 37
#define IRQ_KEYBOARD0 52
#define IRQ_MOUSE0 53
#define IRQ_CLCD0 55
#endif /* CONFIG_CPU_ARM11MPCORE || CONFIG_CPU_CORTEXA9 */
#endif /* __LIBDEV_EB_IRQ_H__ */

View File

@@ -0,0 +1,14 @@
/*
* Platform offsets for eb.
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_PLATFORM_EB_H__
#define __LIBDEV_PLATFORM_EB_H__
#include <dev/platform/realview/platform.h>
#define PLATFORM_CLCD0_BASE 0x10020000 /* CLCD0 */
#endif /* __LIBDEV_PLATFORM_EB_H__ */

View File

@@ -0,0 +1,15 @@
/*
* IRQ numbers for pb926.
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_PB926_IRQ_H__
#define __LIBDEV_PB926_IRQ_H__
#define IRQ_TIMER1 5
#define IRQ_CLCD0 16
#define IRQ_KEYBOARD0 34
#define IRQ_MOUSE0 35
#endif /* __LIBDEV_PB926_IRQ_H__ */

View File

@@ -0,0 +1,15 @@
/*
* Platform offsets for pb926.
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_PLATFORM_PB926_H__
#define __LIBDEV_PLATFORM_PB926_H__
#define PLATFORM_KEYBOARD0_BASE 0x10006000 /* Keyboard */
#define PLATFORM_MOUSE0_BASE 0x10007000 /* Mouse */
#define PLATFORM_TIMER1_BASE 0x101E3000 /* Timers 2 and 3 */
#define PLATFORM_CLCD0_BASE 0x10120000 /* Color LCD */
#endif /* __LIBDEV_PLATFORM_PB926_H__ */

View File

@@ -0,0 +1,15 @@
/*
* IRQ numbers for pba9.
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_PBA9_IRQ_H__
#define __LIBDEV_PBA9_IRQ_H__
#define IRQ_TIMER1 35
#define IRQ_KEYBOARD0 44
#define IRQ_MOUSE0 45
#define IRQ_CLCD0 46
#endif /* __LIBDEV_PBA9_IRQ_H__ */

View File

@@ -0,0 +1,14 @@
/*
* Platform offsets for versatile express.
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_PLATFORM_PBA9_H__
#define __LIBDEV_PLATFORM_PBA9_H__
#include <dev/platform/realview/platform.h>
#define PLATFORM_CLCD0_BASE 0x1001F000 /* CLCD */
#endif /* __LIBDEV_PLATFORM_PBA9_H__ */

View File

@@ -0,0 +1,17 @@
/*
* Common Platform offsets for realview platforms.
* It includes:
* a. pba9
* b. eb
*
* Copyright (C) 2010 B Labs Ltd.
*
*/
#ifndef __LIBDEV_PLATFORM_REALVIEW_H__
#define __LIBDEV_PLATFORM_REALVIEW_H__
#define PLATFORM_KEYBOARD0_BASE 0x10006000 /* Keyboard */
#define PLATFORM_MOUSE0_BASE 0x10007000 /* Mouse */
#define PLATFORM_TIMER1_BASE 0x10012000 /* Timers 2 and 3 */
#endif /* __LIBDEV_PLATFORM_REALVIEW_H__ */

View File

@@ -0,0 +1,23 @@
/*
* Generic timer library API
*
* Copyright (C) 2010 B Labs Ltd.
*
* Author: Bahadir Balban
*/
#ifndef __LIBDEV_TIMER_H__
#define __LIBDEV_TIMER_H__
/*
* Simple API for the primary timer
* for userspace
*/
void timer_start(unsigned long timer_base);
void timer_load(u32 val, unsigned long timer_base);
u32 timer_read(unsigned long timer_base);
void timer_stop(unsigned long timer_base);
void timer_init_oneshot(unsigned long timer_base);
void timer_init_periodic(unsigned long timer_base, u32 load_value);
void timer_init(unsigned long timer_base, u32 load_value);
#endif /* __LIBDEV_TIMER_H__ */

View File

@@ -0,0 +1,21 @@
/*
* Generic uart API
*
* Copyright (C) 2010 B Labs Ltd.
*
* Author: Bahadir Balban
*/
#ifndef __LIBDEV_UART_H__
#define __LIBDEV_UART_H__
void uart_tx_char(unsigned long uart_base, char c);
char uart_rx_char(unsigned long uart_base);
void uart_set_baudrate(unsigned long uart_base, unsigned int val);
void uart_init(unsigned long base);
/*
* Base of primary uart used for printf
*/
extern unsigned long uart_print_base;
#endif /* __LIBDEV_UART_H__ */