Changeset 7633b109 in mainline


Ignore:
Timestamp:
2006-05-19T13:14:37Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5ca586a1
Parents:
c0bc189
Message:

Change the way the framebuffer is mapped so that sparc64 is usable again.

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/Makefile.inc

    rc0bc189 r7633b109  
    6262
    6363## Compile with support for framebuffer.
     64## Mapping of the framebuffer is implemented by a sparc64-specific function.
    6465#
    6566
    6667CONFIG_FB = y
     68CONFIG_FB_MAP_ARCH = y
    6769
    6870## Compile with support for i8042 controller.
  • arch/sparc64/src/console.c

    rc0bc189 r7633b109  
    7272}
    7373
     74void fb_map_arch(__address virtaddr, __address physaddr, size_t size)
     75{
     76        dtlb_insert_mapping(virtaddr, physaddr, PAGESIZE_512K, true, false);
     77        dtlb_insert_mapping(virtaddr + 512*1024, physaddr + 512*1024, PAGESIZE_512K, true, false);
     78}
     79
    7480/** Initialize kernel console to use framebuffer and keyboard directly. */
    7581void standalone_sparc64_console_init(void)
     
    7884        stdin = NULL;
    7985
    80         dtlb_insert_mapping(FB_VIRT_ADDRESS, FB_PHYS_ADDRESS, PAGESIZE_4M, true, false);
    8186        dtlb_insert_mapping(KBD_VIRT_ADDRESS, KBD_PHYS_ADDRESS, PAGESIZE_8K, true, false);
    8287
    83         fb_init(FB_VIRT_ADDRESS, FB_X_RES, FB_Y_RES, FB_COLOR_DEPTH, FB_X_RES * FB_COLOR_DEPTH / 8);
     88        fb_init(FB_PHYS_ADDRESS, FB_X_RES, FB_Y_RES, FB_COLOR_DEPTH, FB_X_RES * FB_COLOR_DEPTH / 8);
    8489        i8042_init();
    8590}
  • genarch/Makefile.inc

    rc0bc189 r7633b109  
    6868                genarch/src/fb/fb.c
    6969        DEFS += -DCONFIG_FB
     70        ifneq ($(CONFIG_FB_MAP_ARCH),y)
     71                GENARCH_SOURCES += \
     72                        genarch/src/fb/fb_map.c
     73        endif
    7074endif
    7175
  • genarch/include/fb/fb.h

    rc0bc189 r7633b109  
    3636void fb_init(__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan);
    3737
     38/* To be implemented by architecture. */
     39void fb_map_arch(__address virtaddr, __address physaddr, size_t size);
     40
    3841#endif
  • genarch/src/fb/fb.c

    rc0bc189 r7633b109  
    3333#include <sysinfo/sysinfo.h>
    3434#include <mm/slab.h>
    35 #include <mm/as.h>
    3635#include <bitops.h>
    3736#include <align.h>
     
    361360        fbaddress = (__u8 *) PA2KA(PFN2ADDR(frame_alloc(fborder, FRAME_KA)));
    362361       
    363         pfn_t i;
    364         for (i = 0; i < ADDR2PFN(ALIGN_UP(fbsize, PAGE_SIZE)); i++)
    365                 page_mapping_insert(AS_KERNEL, (__address) fbaddress + PFN2ADDR(i), addr + PFN2ADDR(i), PAGE_NOT_CACHEABLE);
     362        fb_map_arch((__address) fbaddress, (__address) addr, fbsize);
    366363       
    367364        xres = x;
Note: See TracChangeset for help on using the changeset viewer.