/kernel/trunk/arch/sparc64/Makefile.inc |
---|
61,6 → 61,7 |
CONFIG_ASID_FIFO = y |
## Compile with support for framebuffer. |
## Mapping of the framebuffer is implemented by a sparc64-specific function. |
# |
CONFIG_FB = y |
90,5 → 91,4 |
arch/$(ARCH)/src/trap/exception.c \ |
arch/$(ARCH)/src/trap/interrupt.c \ |
arch/$(ARCH)/src/ddi/ddi.c \ |
arch/$(ARCH)/src/drivers/tick.c \ |
arch/$(ARCH)/src/drivers/i8042.c |
arch/$(ARCH)/src/drivers/tick.c |
/kernel/trunk/arch/sparc64/src/console.c |
---|
77,8 → 77,10 |
ofw_console_active = 0; |
stdin = NULL; |
kbd_init(); |
dtlb_insert_mapping(KBD_VIRT_ADDRESS, KBD_PHYS_ADDRESS, PAGESIZE_8K, true, false); |
fb_init(FB_PHYS_ADDRESS, FB_X_RES, FB_Y_RES, FB_COLOR_DEPTH, FB_X_RES * FB_COLOR_DEPTH / 8); |
i8042_init(); |
} |
/** Write one character using OpenFirmware. |
/kernel/trunk/arch/sparc64/src/mm/page.c |
---|
31,7 → 31,6 |
#include <genarch/mm/page_ht.h> |
#include <mm/frame.h> |
#include <bitops.h> |
#include <debug.h> |
void page_arch_init(void) |
{ |
41,27 → 40,7 |
__address hw_map(__address physaddr, size_t size) |
{ |
unsigned int order; |
int i; |
struct { |
int pagesize; |
size_t increment; |
count_t count; |
} sizemap[] = { |
{ PAGESIZE_8K, 0, 1 }, /* 8K */ |
{ PAGESIZE_8K, PAGE_SIZE, 2 }, /* 16K */ |
{ PAGESIZE_8K, PAGE_SIZE, 4 }, /* 32K */ |
{ PAGESIZE_64K, 0, 1}, /* 64K */ |
{ PAGESIZE_64K, 8*PAGE_SIZE, 2 }, /* 128K */ |
{ PAGESIZE_64K, 8*PAGE_SIZE, 4 }, /* 256K */ |
{ PAGESIZE_512K, 0, 1 }, /* 512K */ |
{ PAGESIZE_512K, 64*PAGE_SIZE, 2 }, /* 1M */ |
{ PAGESIZE_512K, 64*PAGE_SIZE, 4 }, /* 2M */ |
{ PAGESIZE_4M, 0, 1 } /* 4M */ |
}; |
ASSERT(size <= 4*1024*1024); |
if (size <= FRAME_SIZE) |
order = 0; |
else |
68,11 → 47,9 |
order = (fnzb32(size - 1) + 1) - FRAME_WIDTH; |
__address virtaddr = PA2KA(PFN2ADDR(frame_alloc(order, FRAME_KA))); |
for (i = 0; i < sizemap[order].count; i++) |
dtlb_insert_mapping(virtaddr + i*sizemap[order].increment, |
physaddr + i*sizemap[order].increment, |
sizemap[order].pagesize, true, false); |
dtlb_insert_mapping(virtaddr, physaddr, PAGESIZE_512K, true, false); |
dtlb_insert_mapping(virtaddr + 512 * 1024, physaddr + 512 * 1024, PAGESIZE_512K, true, false); |
return virtaddr; |
} |
/kernel/trunk/arch/sparc64/src/drivers/i8042.c |
---|
File deleted |
/kernel/trunk/arch/sparc64/include/drivers/i8042.h |
---|
32,35 → 32,30 |
#include <arch/types.h> |
#define KBD_PHYS_ADDRESS 0x1fff8904000ULL |
#define KBD_VIRT_ADDRESS 0x000d0000000ULL |
#define STATUS_REG 4 |
#define COMMAND_REG 4 |
#define DATA_REG 6 |
#define LAST_REG DATA_REG |
extern volatile __u8 *kbd_virt_address; |
static inline void i8042_data_write(__u8 data) |
{ |
kbd_virt_address[DATA_REG] = data; |
((volatile __u8 *)(KBD_VIRT_ADDRESS))[DATA_REG] = data; |
} |
static inline __u8 i8042_data_read(void) |
{ |
return kbd_virt_address[DATA_REG]; |
return ((volatile __u8 *)(KBD_VIRT_ADDRESS))[DATA_REG]; |
} |
static inline __u8 i8042_status_read(void) |
{ |
return kbd_virt_address[STATUS_REG]; |
return ((volatile __u8 *)(KBD_VIRT_ADDRESS))[STATUS_REG]; |
} |
static inline void i8042_command_write(__u8 command) |
{ |
kbd_virt_address[COMMAND_REG] = command; |
((volatile __u8 *)(KBD_VIRT_ADDRESS))[COMMAND_REG] = command; |
} |
extern void kbd_init(void); |
#endif |