/branches/sparc/kernel/genarch/include/fb/fb.h |
---|
38,8 → 38,34 |
#include <arch/types.h> |
#include <synch/spinlock.h> |
/** |
* Properties of the framebuffer device. |
*/ |
typedef struct fb_properties { |
/** Physical address of the framebuffer device (as returned by OBP) */ |
uintptr_t addr; |
/** |
* Address where the first (top left) pixel is mapped, |
* relative to "addr" |
*/ |
unsigned int fb_start; |
/** Screen width in pixels */ |
unsigned int x; |
/** Screen height in pixels */ |
unsigned int y; |
/** Bytes per one scanline */ |
unsigned int scan; |
/** Color model */ |
unsigned int visual; |
} fb_properties_t; |
SPINLOCK_EXTERN(fb_lock); |
void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int scan, unsigned int visual); |
void fb_init(fb_properties_t *props); |
#endif |
/branches/sparc/kernel/genarch/src/fb/fb.c |
---|
436,17 → 436,12 |
/** Initialize framebuffer as a chardev output device |
* |
* @param addr Physical address of the framebuffer |
* @param x Screen width in pixels |
* @param y Screen height in pixels |
* @param scan Bytes per one scanline |
* @param visual Color model |
* @param props properties of the framebuffer device |
* |
*/ |
void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int scan, |
unsigned int visual) |
void fb_init(fb_properties_t *props) |
{ |
switch (visual) { |
switch (props->visual) { |
case VISUAL_INDIRECT_8: |
rgb2scr = rgb_byte8; |
scr2rgb = byte8_rgb; |
486,19 → 481,20 |
panic("Unsupported visual.\n"); |
} |
unsigned int fbsize = scan * y; |
unsigned int fbsize = (props->scan) * (props->y) + (props->fb_start); |
/* Map the framebuffer */ |
fbaddress = (uint8_t *) hw_map((uintptr_t) addr, fbsize); |
fbaddress = (uint8_t *) hw_map((uintptr_t) (props->addr), fbsize); |
fbaddress += props->fb_start; |
xres = x; |
yres = y; |
scanline = scan; |
xres = props->x; |
yres = props->y; |
scanline = props->scan; |
rows = y / FONT_SCANLINES; |
columns = x / COL_WIDTH; |
rows = (props->y) / FONT_SCANLINES; |
columns = (props->x) / COL_WIDTH; |
fb_parea.pbase = (uintptr_t) addr; |
fb_parea.pbase = (uintptr_t) (props->addr); |
fb_parea.vbase = (uintptr_t) fbaddress; |
fb_parea.frames = SIZE2FRAMES(fbsize); |
fb_parea.cacheable = false; |
508,9 → 504,9 |
sysinfo_set_item_val("fb.kind", NULL, 1); |
sysinfo_set_item_val("fb.width", NULL, xres); |
sysinfo_set_item_val("fb.height", NULL, yres); |
sysinfo_set_item_val("fb.scanline", NULL, scan); |
sysinfo_set_item_val("fb.visual", NULL, visual); |
sysinfo_set_item_val("fb.address.physical", NULL, addr); |
sysinfo_set_item_val("fb.scanline", NULL, (props->scan)); |
sysinfo_set_item_val("fb.visual", NULL, (props->visual)); |
sysinfo_set_item_val("fb.address.physical", NULL, (props->addr)); |
sysinfo_set_item_val("fb.invert-colors", NULL, invert_colors); |
/* Allocate double buffer */ |
524,6 → 520,7 |
blankline = (uint8_t *) malloc(ROW_BYTES, FRAME_ATOMIC); |
if (!blankline) |
panic("Failed to allocate blank line for framebuffer."); |
unsigned int x, y; |
for (y = 0; y < FONT_SCANLINES; y++) |
for (x = 0; x < xres; x++) |
(*rgb2scr)(&blankline[POINTPOS(x, y)], COLOR(BGCOLOR)); |
/branches/sparc/kernel/genarch/src/ofw/ofw_tree.c |
---|
209,7 → 209,8 |
* |
* @return NULL if there is no such peer or pointer to the matching peer node. |
*/ |
ofw_tree_node_t *ofw_tree_find_peer_by_name(ofw_tree_node_t *node, const char *name) |
ofw_tree_node_t *ofw_tree_find_peer_by_name(ofw_tree_node_t *node, |
const char *name) |
{ |
ofw_tree_node_t *cur; |
ofw_tree_property_t *prop; |
/branches/sparc/kernel/arch/sparc64/include/mm/cache_spec.h |
---|
38,7 → 38,8 |
/* |
* The following macros are valid for the following processors: |
* |
* UltraSPARC, UltraSPARC II, UltraSPARC IIi, UltraSPARC III Cu |
* UltraSPARC, UltraSPARC II, UltraSPARC IIi, UltraSPARC III, |
* UltraSPARC III+, UltraSPARC IV, UltraSPARC IV+ |
* |
* Should we support other UltraSPARC processors, we need to make sure that |
* the macros are defined correctly for them. |
/branches/sparc/kernel/arch/sparc64/include/mm/tlb.h |
---|
176,7 → 176,6 |
/** I-/D-TLB Tag Read Register. */ |
union tlb_tag_read_reg { |
// TODO have a look at how non-8kB pages will be treated |
uint64_t value; |
struct { |
uint64_t vpn : 51; /**< Virtual Address bits 63:13. */ |
431,7 → 430,8 |
* @param entry TLB Entry index. |
* @param value Value to be written. |
*/ |
static inline void itlb_data_access_write(int tlb, index_t entry, uint64_t value) |
static inline void itlb_data_access_write(int tlb, index_t entry, |
uint64_t value) |
{ |
itlb_data_access_addr_t reg; |
465,7 → 465,8 |
* @param entry TLB Entry index. |
* @param value Value to be written. |
*/ |
static inline void dtlb_data_access_write(int tlb, index_t entry, uint64_t value) |
static inline void dtlb_data_access_write(int tlb, index_t entry, |
uint64_t value) |
{ |
dtlb_data_access_addr_t reg; |
/branches/sparc/kernel/arch/sparc64/src/smp/smp.c |
---|
119,7 → 119,8 |
if (is_us() || is_us_iii()) { |
node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu"); |
for (i = 0; node; node = ofw_tree_find_peer_by_device_type(node, "cpu"), i++) |
for (i = 0; node; |
node = ofw_tree_find_peer_by_device_type(node, "cpu"), i++) |
wakeup_cpu(node); |
} else if (is_us_iv()) { |
node = ofw_tree_find_child(cpus_parent(), "cmp"); |
/branches/sparc/kernel/arch/sparc64/src/console.c |
---|
201,6 → 201,11 |
ns16550_release(); |
break; |
#endif |
#ifdef CONFIG_SGCN |
case KBD_SGCN: |
sgcn_release(); |
break; |
#endif |
default: |
break; |
} |
/branches/sparc/kernel/arch/sparc64/src/cpu/cpu.c |
---|
99,10 → 99,12 |
node = ofw_tree_find_child(cpus_parent(), "cmp"); |
while (node) { |
int f; |
f = find_cpu_frequency(ofw_tree_find_child(node, "cpu@0")); |
f = find_cpu_frequency( |
ofw_tree_find_child(node, "cpu@0")); |
if (f != -1) |
clock_frequency = (uint32_t) f; |
f = find_cpu_frequency(ofw_tree_find_child(node, "cpu@1")); |
f = find_cpu_frequency( |
ofw_tree_find_child(node, "cpu@1")); |
if (f != -1) |
clock_frequency = (uint32_t) f; |
node = ofw_tree_find_peer_by_name(node, "cmp"); |
/branches/sparc/kernel/arch/sparc64/src/mm/tlb.c |
---|
472,9 → 472,9 |
"fv=%d\n", sfsr.asi, sfsr.ft, sfsr.e, sfsr.ct, sfsr.pr, sfsr.w, |
sfsr.ow, sfsr.fv); |
#elif defined (US3) |
printf("DTLB SFSR: nf=%d, asi=%#x, tm=%d, ft=%#x, e=%d, ct=%d, pr=%d, w=%d, ow=%d, " |
"fv=%d\n", sfsr.nf, sfsr.asi, sfsr.tm, sfsr.ft, sfsr.e, sfsr.ct, sfsr.pr, sfsr.w, |
sfsr.ow, sfsr.fv); |
printf("DTLB SFSR: nf=%d, asi=%#x, tm=%d, ft=%#x, e=%d, ct=%d, pr=%d, " |
"w=%d, ow=%d, fv=%d\n", sfsr.nf, sfsr.asi, sfsr.tm, sfsr.ft, |
sfsr.e, sfsr.ct, sfsr.pr, sfsr.w, sfsr.ow, sfsr.fv); |
#endif |
printf("DTLB SFAR: address=%p\n", sfar); |
/branches/sparc/kernel/arch/sparc64/src/drivers/scr.c |
---|
175,7 → 175,14 |
panic("Unexpected type.\n"); |
} |
fb_init(fb_addr, fb_width, fb_height, fb_scanline, visual); |
fb_properties_t props; |
props.addr = fb_addr; |
props.fb_start = 0; |
props.x = fb_width; |
props.y = fb_height; |
props.scan = fb_scanline; |
props.visual = visual; |
fb_init(&props); |
} |
/** @} |
/branches/sparc/kernel/arch/sparc64/src/drivers/sgcn.c |
---|
175,7 → 175,8 |
ddi_parea_register(&sram_parea); |
sysinfo_set_item_val("sram.area.size", NULL, MAPPED_AREA_SIZE); |
sysinfo_set_item_val("sram.address.physical", NULL, sram_begin_physical); |
sysinfo_set_item_val("sram.address.physical", NULL, |
sram_begin_physical); |
} |
/** |
/branches/sparc/kernel/arch/sparc64/src/start.S |
---|
96,7 → 96,7 |
wrpr %g0, NWINDOWS - 1, %cleanwin ! prevent needless clean_window |
! traps for kernel |
wrpr %g0, 0, %wstate ! use the default spill/fill trap |
wrpr %g0, 0, %wstate ! use default spill/fill trap |
wrpr %g0, 0, %tl ! TL = 0, primary context |
! register is used |