Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .globl bootblock_protected_mode_entry
- bootblock_protected_mode_entry:
- /* Save the BIST value */
- movl %eax, %ebp
- post_code(POST_ENTER_PROTECTED_MODE)
- movw $ROM_DATA_SEG, %ax
- movw %ax, %ds
- movw %ax, %es
- movw %ax, %ss
- movw %ax, %fs
- movw %ax, %gs
- /* Restore the BIST value to %eax */
- movl %ebp, %eax
- /*
- * Add some test code to see if we can flash the keyboard
- * backlight as a way to try to determine if there is any
- * life at all or whether the CSE has something against us.
- *
- * The LPC device implemented in the chipset is PCI device
- * 1f.0 and the Apollo Lake documentation suggests that it
- * is enabled by default. Enable the decode of the IO ranges
- * for the EC and then send some commands to it!
- *
- * The LPC PCI device has two 16bit registers - IO decode (IOD)
- * at offset 0x80 and IO Enable (IOE) at offset 0x82. We need
- * to set bits 13..10 in the IOE register.
- */
- movl $0x8000f880 , %eax
- movw $0xcf8, %dx
- outl %eax, %dx
- movl $0x3c030000, %eax /* <-- Is this byte order correct? */
- movw $0xcfc, %dx
- outl %eax, %dx
- switch_on:
- /* Send the command to the EC to turn the keyboard backlight on */
- movb $0x81, %al /* EC write command */
- movw $0x66, %dx
- outb %al, %dx
- movb $0x19, %al /* Register 0x19 */
- movw $0x62, %dx
- outb %al, %dx
- movb $0xee, %al /* Value 0xee */
- outb %al, %dx
- /* Delay for a while */
- wait1:
- movl $0x00010000, %ecx
- nop
- loop wait1
- /* Send the command to the EC to turn the keyboard backlight off */
- movb $0x81, %al /* EC write command */
- movw $0x66, %dx
- outb %al, %dx
- movb $0x19, %al /* Register 0x19 */
- movw $0x62, %dx
- outb %al, %dx
- movb $0x00, %al /* Value 0x00 */
- outb %al, %dx
- /* Delay for a while */
- wait2:
- movl $0x00010000, %ecx
- nop
- loop wait2
- jmp switch_on
Advertisement
Add Comment
Please, Sign In to add comment