Print this page
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
    loader: pxe receive cleanup
    9475 libefi: Do not return only if ReceiveFilter
    installboot: should support efi system partition
    8931 boot1.efi: scan all display modes rather than
    loader: spinconsole updates
    loader: gfx experiment to try GOP Blt() function.
    sha1 build test
    loader: add sha1 hash calculation
    common/sha1: update for loader build
    loader: biosdisk rework
    uts: 32-bit kernel FB needs mapping in low memory
    uts: add diag-device
    uts: boot console mirror with diag-device
    uts: enable very early console on ttya
    kmdb: add diag-device as input/output device
    uts: test VGA memory exclusion from mapping
    uts: clear boot mapping and protect boot pages test
    uts: add dboot map debug printf
    uts: need to release FB pages in release_bootstrap()
    uts: add screenmap ioctl
    uts: update sys/queue.h
    loader: add illumos uts/common to include path
    loader: tem/gfx font cleanup
    loader: vbe checks
    uts: gfx_private set KD_TEXT when KD_RESETTEXT is
    uts: gfx 8-bit update
    loader: gfx 8-bit fix
    loader: always set media size from partition.
    uts: MB2 support for 32-bit kernel
    loader: x86 should have tem 80x25
    uts: x86 should have tem 80x25
    uts: font update
    loader: font update
    uts: tem attributes
    loader: tem.c comment added
    uts: use font module
    loader: add font module
    loader: build rules for new font setup
    uts: gfx_private update for new font structure
    uts: early boot update for new font structure
    uts: font update
    uts: font build rules update for new fonts
    uts: tem update to new font structure
    loader: module.c needs to include tem_impl.h
    uts: gfx_private 8x16 font rework
    uts: make font_lookup public
    loader: font rework
    uts: font rework
    9259 libefi: efi_alloc_and_read should check for PMBR
    uts: tem utf-8 support
    loader: implement tem utf-8 support
    loader: tem should be able to display UTF-8
    7784 uts: console input should support utf-8
    7796 uts: ldterm default to utf-8
    uts: do not reset serial console
    uts: set up colors even if tem is not console
    uts: add type for early boot properties
    uts: gfx_private experiment with drm and vga
    uts: gfx_private should use setmode drm callback.
    uts: identify FB types and set up gfx_private based
    loader: replace gop and vesa with framebuffer
    uts: boot needs simple tem to support mdb
    uts: boot_keyboard should emit esc sequences for
    uts: gfx_private FB showuld be written by line
    kmdb: set terminal window size
    uts: gfx_private needs to keep track of early boot FB
    pnglite: move pnglite to usr/src/common
    loader: gfx_fb
    ficl-sys: add gfx primitives
    loader: add illumos.png logo
    ficl: add fb-putimage
    loader: add png support
    loader: add alpha blending for gfx_fb
    loader: use term-drawrect for menu frame
    ficl: add simple gfx words
    uts: provide fb_info via fbgattr dev_specific array.
    uts: gfx_private add alpha blending
    uts: update sys/ascii.h
    uts: tem OSC support (incomplete)
    uts: implement env module support and use data from
    uts: tem get colors from early boot data
    loader: use crc32 from libstand (libz)
    loader: optimize for size
    loader: pass tem info to the environment
    loader: import tem for loader console
    loader: UEFI loader needs to set ISADIR based on
    loader: need UEFI32 support
    8918 loader.efi: add vesa edid support
    uts: tem_safe_pix_clear_prom_output() should only
    uts: tem_safe_pix_clear_entire_screen() should use
    uts: tem_safe_check_first_time() should query cursor
    uts: tem implement cls callback & visual_io v4
    uts: gfx_vgatext use block cursor for vgatext
    uts: gfx_private implement cls callback & visual_io
    uts: gfx_private bitmap framebuffer implementation
    uts: early start frame buffer console support
    uts: font functions should check the input char
    uts: font rendering should support 16/24/32bit depths
    uts: use smallest font as fallback default.
    uts: update terminal dimensions based on selected
    7834 uts: vgatext should use gfx_private
    uts: add spacing property to 8859-1.bdf
    terminfo: add underline for sun-color
    terminfo: sun-color has 16 colors
    uts: add font load callback type
    loader: do not repeat int13 calls with error 0x20 and
    8905 loader: add skein/edonr support
    8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Revert "NEX-16819 loader UEFI support"
This reverts commit ec06b9fc617b99234e538bf2e7e4d02a24993e0c.
Reverting due to failures in the zfs-tests and the sharefs-tests
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
    loader: pxe receive cleanup
    9475 libefi: Do not return only if ReceiveFilter
    installboot: should support efi system partition
    8931 boot1.efi: scan all display modes rather than
    loader: spinconsole updates
    loader: gfx experiment to try GOP Blt() function.
    sha1 build test
    loader: add sha1 hash calculation
    common/sha1: update for loader build
    loader: biosdisk rework
    uts: 32-bit kernel FB needs mapping in low memory
    uts: add diag-device
    uts: boot console mirror with diag-device
    uts: enable very early console on ttya
    kmdb: add diag-device as input/output device
    uts: test VGA memory exclusion from mapping
    uts: clear boot mapping and protect boot pages test
    uts: add dboot map debug printf
    uts: need to release FB pages in release_bootstrap()
    uts: add screenmap ioctl
    uts: update sys/queue.h
    loader: add illumos uts/common to include path
    loader: tem/gfx font cleanup
    loader: vbe checks
    uts: gfx_private set KD_TEXT when KD_RESETTEXT is
    uts: gfx 8-bit update
    loader: gfx 8-bit fix
    loader: always set media size from partition.
    uts: MB2 support for 32-bit kernel
    loader: x86 should have tem 80x25
    uts: x86 should have tem 80x25
    uts: font update
    loader: font update
    uts: tem attributes
    loader: tem.c comment added
    uts: use font module
    loader: add font module
    loader: build rules for new font setup
    uts: gfx_private update for new font structure
    uts: early boot update for new font structure
    uts: font update
    uts: font build rules update for new fonts
    uts: tem update to new font structure
    loader: module.c needs to include tem_impl.h
    uts: gfx_private 8x16 font rework
    uts: make font_lookup public
    loader: font rework
    uts: font rework
    libefi: efi_alloc_and_read should check for PMBR
    uts: tem utf-8 support
    loader: implement tem utf-8 support
    loader: tem should be able to display UTF-8
    7784 uts: console input should support utf-8
    7796 uts: ldterm default to utf-8
    uts: do not reset serial console
    uts: set up colors even if tem is not console
    uts: add type for early boot properties
    uts: gfx_private experiment with drm and vga
    uts: gfx_private should use setmode drm callback.
    uts: identify FB types and set up gfx_private based
    loader: replace gop and vesa with framebuffer
    uts: boot needs simple tem to support mdb
    uts: boot_keyboard should emit esc sequences for
    uts: gfx_private FB showuld be written by line
    kmdb: set terminal window size
    uts: gfx_private needs to keep track of early boot FB
    pnglite: move pnglite to usr/src/common
    loader: gfx_fb
    ficl-sys: add gfx primitives
    loader: add illumos.png logo
    ficl: add fb-putimage
    loader: add png support
    loader: add alpha blending for gfx_fb
    loader: use term-drawrect for menu frame
    ficl: add simple gfx words
    uts: provide fb_info via fbgattr dev_specific array.
    uts: gfx_private add alpha blending
    uts: update sys/ascii.h
    uts: tem OSC support (incomplete)
    uts: implement env module support and use data from
    uts: tem get colors from early boot data
    loader: use crc32 from libstand (libz)
    loader: optimize for size
    loader: pass tem info to the environment
    loader: import tem for loader console
    loader: UEFI loader needs to set ISADIR based on
    loader: need UEFI32 support
    8918 loader.efi: add vesa edid support
    uts: tem_safe_pix_clear_prom_output() should only
    uts: tem_safe_pix_clear_entire_screen() should use
    uts: tem_safe_check_first_time() should query cursor
    uts: tem implement cls callback & visual_io v4
    uts: gfx_vgatext use block cursor for vgatext
    uts: gfx_private implement cls callback & visual_io
    uts: gfx_private bitmap framebuffer implementation
    uts: early start frame buffer console support
    uts: font functions should check the input char
    uts: font rendering should support 16/24/32bit depths
    uts: use smallest font as fallback default.
    uts: update terminal dimensions based on selected
    7834 uts: vgatext should use gfx_private
    uts: add spacing property to 8859-1.bdf
    terminfo: add underline for sun-color
    terminfo: sun-color has 16 colors
    uts: add font load callback type
    loader: do not repeat int13 calls with error 0x20 and
    8905 loader: add skein/edonr support
    8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>


  28 
  29 /*
  30  * isa-specific console configuration routines
  31  */
  32 
  33 #include <sys/types.h>
  34 #include <sys/param.h>
  35 #include <sys/cmn_err.h>
  36 #include <sys/systm.h>
  37 #include <sys/conf.h>
  38 #include <sys/debug.h>
  39 #include <sys/ddi.h>
  40 #include <sys/sunddi.h>
  41 #include <sys/sunndi.h>
  42 #include <sys/esunddi.h>
  43 #include <sys/ddi_impldefs.h>
  44 #include <sys/promif.h>
  45 #include <sys/modctl.h>
  46 #include <sys/termios.h>
  47 #include <sys/pci.h>


  48 #if defined(__xpv)
  49 #include <sys/hypervisor.h>
  50 #include <sys/boot_console.h>
  51 #endif
  52 
  53 extern int pseudo_isa;
  54 
  55 int
  56 plat_use_polled_debug()
  57 {
  58         return (0);
  59 }
  60 
  61 int
  62 plat_support_serial_kbd_and_ms()
  63 {
  64         return (0);
  65 }
  66 
  67 #define A_CNT(arr)      (sizeof (arr) / sizeof (arr[0]))
  68 
  69 #ifndef CONS_INVALID
  70 #define CONS_INVALID            -1


 515 plat_stdoutpath(void)
 516 {
 517         int tty_num = 0;
 518 
 519         switch (console_type(&tty_num)) {
 520 #if defined(__xpv)
 521         case CONS_HYPERVISOR:
 522                 return ("/xpvd/xencons@0");
 523 #endif /* __xpv */
 524         case CONS_TTY:
 525                 return (plat_ttypath(tty_num));
 526         case CONS_USBSER:
 527                 return (plat_usbser_path());
 528         case CONS_SCREEN_TEXT:
 529         default:
 530                 break;
 531         };
 532         return (plat_fbpath());
 533 }
 534 























 535 /*
 536  * If VIS_PIXEL mode will be implemented on x86, these following
 537  * functions should be re-considered. Now these functions are
 538  * unused on x86.
 539  */
 540 void







 541 plat_tem_get_inverses(int *inverse, int *inverse_screen)
 542 {
 543         *inverse = 0;
 544         *inverse_screen = 0;
 545 }
 546 
 547 void
 548 plat_tem_get_prom_font_size(int *charheight, int *windowtop)
 549 {
 550         *charheight = 0;
 551         *windowtop = 0;
 552 }
 553 
 554 /*ARGSUSED*/
 555 void
 556 plat_tem_get_prom_size(size_t *height, size_t *width)
 557 {
 558         panic("unimplemented at line %d of %s", __LINE__, __FILE__);

 559 }
 560 

 561 void
 562 plat_tem_hide_prom_cursor(void)
 563 {
 564         panic("unimplemented at line %d of %s", __LINE__, __FILE__);

 565 }
 566 
 567 /*ARGSUSED*/
 568 void
 569 plat_tem_get_prom_pos(uint32_t *row, uint32_t *col)
 570 {
 571         panic("unimplemented at line %d of %s", __LINE__, __FILE__);

 572 }


  28 
  29 /*
  30  * isa-specific console configuration routines
  31  */
  32 
  33 #include <sys/types.h>
  34 #include <sys/param.h>
  35 #include <sys/cmn_err.h>
  36 #include <sys/systm.h>
  37 #include <sys/conf.h>
  38 #include <sys/debug.h>
  39 #include <sys/ddi.h>
  40 #include <sys/sunddi.h>
  41 #include <sys/sunndi.h>
  42 #include <sys/esunddi.h>
  43 #include <sys/ddi_impldefs.h>
  44 #include <sys/promif.h>
  45 #include <sys/modctl.h>
  46 #include <sys/termios.h>
  47 #include <sys/pci.h>
  48 #include <sys/framebuffer.h>
  49 #include <sys/boot_console.h>
  50 #if defined(__xpv)
  51 #include <sys/hypervisor.h>

  52 #endif
  53 
  54 extern int pseudo_isa;
  55 
  56 int
  57 plat_use_polled_debug()
  58 {
  59         return (0);
  60 }
  61 
  62 int
  63 plat_support_serial_kbd_and_ms()
  64 {
  65         return (0);
  66 }
  67 
  68 #define A_CNT(arr)      (sizeof (arr) / sizeof (arr[0]))
  69 
  70 #ifndef CONS_INVALID
  71 #define CONS_INVALID            -1


 516 plat_stdoutpath(void)
 517 {
 518         int tty_num = 0;
 519 
 520         switch (console_type(&tty_num)) {
 521 #if defined(__xpv)
 522         case CONS_HYPERVISOR:
 523                 return ("/xpvd/xencons@0");
 524 #endif /* __xpv */
 525         case CONS_TTY:
 526                 return (plat_ttypath(tty_num));
 527         case CONS_USBSER:
 528                 return (plat_usbser_path());
 529         case CONS_SCREEN_TEXT:
 530         default:
 531                 break;
 532         };
 533         return (plat_fbpath());
 534 }
 535 
 536 char *
 537 plat_diagpath(void)
 538 {
 539         dev_info_t *root;
 540         char *diag;
 541         int tty_num = -1;
 542 
 543         root = ddi_root_node();
 544 
 545         if (ddi_prop_lookup_string(DDI_DEV_T_ANY, root, DDI_PROP_DONTPASS,
 546             "diag-device", &diag) == DDI_SUCCESS) {
 547                 if (strlen(diag) == 4 && strncmp(diag, "tty", 3) == 0 &&
 548                     diag[3] >= 'a' && diag[3] <= 'd') {
 549                         tty_num = diag[3] - 'a';
 550                 }
 551                 ddi_prop_free(diag);
 552         }
 553 
 554         if (tty_num != -1)
 555                 return (plat_ttypath(tty_num));
 556         return (NULL);
 557 }
 558 
 559 /*
 560  * If VIS_PIXEL mode will be implemented on x86, these following
 561  * functions should be re-considered. Now these functions are
 562  * unused on x86.
 563  */
 564 void
 565 plat_tem_get_colors(uint8_t *fg, uint8_t *bg)
 566 {
 567         *fg = fb_info.fg_color;
 568         *bg = fb_info.bg_color;
 569 }
 570 
 571 void
 572 plat_tem_get_inverses(int *inverse, int *inverse_screen)
 573 {
 574         *inverse = fb_info.inverse == B_TRUE? 1 : 0;
 575         *inverse_screen = fb_info.inverse_screen == B_TRUE? 1 : 0;
 576 }
 577 
 578 void
 579 plat_tem_get_prom_font_size(int *charheight, int *windowtop)
 580 {
 581         *charheight = fb_info.font_height;
 582         *windowtop = fb_info.terminal_origin.y;
 583 }
 584 
 585 /*ARGSUSED*/
 586 void
 587 plat_tem_get_prom_size(size_t *height, size_t *width)
 588 {
 589         *height = fb_info.terminal.y;
 590         *width = fb_info.terminal.x;
 591 }
 592 
 593 /* this gets called once at boot time and only in case of VIS_PIXEL */
 594 void
 595 plat_tem_hide_prom_cursor(void)
 596 {
 597         if (boot_console_type(NULL) == CONS_FRAMEBUFFER)
 598                 boot_fb_cursor(B_FALSE);
 599 }
 600 
 601 /*ARGSUSED*/
 602 void
 603 plat_tem_get_prom_pos(uint32_t *row, uint32_t *col)
 604 {
 605         *row = fb_info.cursor.pos.y;
 606         *col = fb_info.cursor.pos.x;
 607 }