Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3617 → Rev 3618

/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
/branches/sparc/uspace/srv/kbd/arch/sparc64/src/sgcn.c
97,7 → 97,8
*/
void sgcn_init(void)
{
sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size"));
sram_virt_addr = (uintptr_t) as_get_mappable_page(
sysinfo_value("sram.area.size"));
int result = physmem_map(
(void *) sysinfo_value("sram.address.physical"),
(void *) sram_virt_addr,
143,4 → 144,4
}
 
/** @}
*/
*/
/branches/sparc/uspace/srv/fb/serial_console.c
30,7 → 30,7
 
/**
* @defgroup serial Serial console
* @brief Serial console services (putc, puts, clear screen, cursor goto,...).*
* @brief Serial console services (putc, puts, clear screen, cursor goto,...)
* @{
*/
 
107,4 → 107,4
 
/**
* @}
*/
*/
/branches/sparc/uspace/srv/fb/serial_console.h
28,7 → 28,7
 
/**
* @defgroup serial Serial console
* @brief Serial console services (putc, puts, clear screen, cursor goto,...).*
* @brief Serial console services (putc, puts, clear screen, cursor goto,...)
* @{
*/
 
49,4 → 49,4
void serial_cursor_enable(void);
void serial_console_init(putc_function_t putc_fn, uint32_t w, uint32_t h);
 
#endif
#endif
/branches/sparc/uspace/srv/fb/sgcn.c
98,6 → 98,10
/** Returns a pointer to the console buffer header. */
#define SGCN_BUFFER_HEADER (SGCN_BUFFER(sgcn_buffer_header_t, 0))
 
/**
* Pushes the character to the SGCN serial.
* @param c character to be pushed
*/
static void sgcn_putc(char c)
{
uint32_t begin = SGCN_BUFFER_HEADER->out_begin;
117,6 → 121,9
*out_wrptr_ptr = new_wrptr;
}
 
/**
* Main function of the thread serving client connections.
*/
static void sgcn_client_connection(ipc_callid_t iid, ipc_call_t *icall)
{
int retval;
211,9 → 218,13
}
}
 
/**
* Initializes the SGCN serial driver.
*/
int sgcn_init(void)
{
sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size"));
sram_virt_addr = (uintptr_t) as_get_mappable_page(
sysinfo_value("sram.area.size"));
int result = physmem_map(
(void *) sysinfo_value("sram.address.physical"),
(void *) sram_virt_addr,
236,4 → 247,4
/**
* @}
*/
/branches/sparc/boot/genarch/ofw_tree.c
234,7 → 234,8
if (ssm_node != -1) {
ssm = ofw_tree_node_alloc();
if (ssm) {
ofw_tree_node_process(ssm, root, ofw_find_device("/ssm@0,0"));
ofw_tree_node_process(
ssm, root, ofw_find_device("/ssm@0,0"));
ssm->peer = root->child;
root->child = ssm;
}
/branches/sparc/boot/genarch/ofw.c
301,9 → 301,10
unsigned int size = buf[pos + ac + sc - 1];
 
/*
* This is a hot fix of the issue which occurs on machines where there are
* holes in the physical memory (such as SunBlade 1500). Should we detect a
* hole in the physical memory, we will ignore any memory detected behind
* This is a hot fix of the issue which occurs on machines
* where there are holes in the physical memory (such as
* SunBlade 1500). Should we detect a hole in the physical
* memory, we will ignore any memory detected behind
* the hole and pretend the hole does not exist.
*/
if ((map->count > 0) &&
/branches/sparc/boot/arch/sparc64/loader/main.c
67,8 → 67,15
release, revision, timestamp);
}
 
/* the lowest ID (read from the VER register) of some US3 CPU model */
#define FIRST_US3_CPU 0x14
 
/* the greatest ID (read from the VER register) of some US3 CPU model */
#define LAST_US3_CPU 0x19
 
/**
* Sets the global variable "subarchitecture" to the correct value.
*/
static void detect_subarchitecture(void)
{
uint64_t v;
/branches/sparc/usiii.simics
1,3 → 1,8
# Assembled from the Serengeti machine. Uses a serial console output,
# graphical output is not supported. The firmware version requires
# HelenOS to be compiled with "Preserve A.OUT header in isofs.b" and
# "External ramdisk" options set to "No".
 
if not defined create_network {$create_network = "yes"}
 
$disk_size = 8513945600
9,9 → 14,9
if not defined mac_address {$mac_address = "10:10:10:10:10:24"}
if not defined disk_size {$disk_size = 2128486400}
if not defined rtc_time {$rtc_time = "2002-06-02 17:00:00 UTC"}
if not defined num_cpus {$num_cpus = 3}
if not defined num_cpus {$num_cpus = 1}
if not defined megs_per_cpu {$megs_per_cpu = 256}
if not defined cpu_class {$cpu_class = "ultrasparc-iv"}
if not defined cpu_class {$cpu_class = "ultrasparc-iii"}
 
###
 
91,7 → 96,8
 
unset eth_comp eth_cnt
 
# this script is to be run from the root HelenOS directory
$cdrom_path = "image.iso"
($scsi_cdrom.get-component-object cd).insert (new-file-cdrom $cdrom_path)
$system.set-prom-env boot-command "boot /ssm@0,0/pci@19,700000/scsi@2/disk@6,0:f"
$system.set-prom-env auto-boot? true
($scsi_cdrom.get-component-object cd).insert (new-file-cdrom $cdrom_path)
$system.set-prom-env boot-command "boot /ssm@0,0/pci@19,700000/scsi@2/disk@6,0:f"
$system.set-prom-env auto-boot? true