Changeset 5177
- Timestamp:
- Mar 1, 2010 9:34:19 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 26 edited
-
src/Kconfig (modified) (1 diff)
-
src/arch/i386/Makefile.inc (modified) (1 diff)
-
src/devices/Kconfig (modified) (1 diff)
-
src/include/cbfs.h (modified) (2 diffs)
-
src/lib/Makefile.inc (modified) (1 diff)
-
src/lib/cbfs.c (modified) (6 diffs)
-
src/mainboard/rca/rm4100/Kconfig (modified) (1 diff)
-
src/mainboard/rca/rm4100/Makefile.inc (modified) (1 diff)
-
src/mainboard/rca/rm4100/devicetree.cb (modified) (3 diffs)
-
src/mainboard/rca/rm4100/mainboard.c (modified) (1 diff)
-
src/mainboard/rca/rm4100/mainboard_smi.c (added)
-
src/mainboard/rca/rm4100/romstage.c (modified) (3 diffs)
-
src/mainboard/thomson/ip1000/Kconfig (modified) (1 diff)
-
src/mainboard/thomson/ip1000/Makefile.inc (modified) (1 diff)
-
src/mainboard/thomson/ip1000/devicetree.cb (modified) (3 diffs)
-
src/mainboard/thomson/ip1000/mainboard.c (modified) (1 diff)
-
src/mainboard/thomson/ip1000/mainboard_smi.c (added)
-
src/mainboard/thomson/ip1000/romstage.c (modified) (3 diffs)
-
src/northbridge/intel/i82830/Makefile.inc (modified) (1 diff)
-
src/northbridge/intel/i82830/i82830_smihandler.c (added)
-
src/northbridge/intel/i82830/northbridge.c (modified) (1 diff)
-
src/northbridge/intel/i82830/raminit.c (modified) (1 diff)
-
src/northbridge/intel/i82830/vga.c (modified) (1 diff)
-
src/southbridge/intel/i82801dx/Kconfig (modified) (1 diff)
-
src/southbridge/intel/i82801dx/Makefile.inc (modified) (1 diff)
-
src/southbridge/intel/i82801dx/i82801dx_ac97.c (modified) (1 diff)
-
src/southbridge/intel/i82801dx/i82801dx_nvs.h (added)
-
src/southbridge/intel/i82801dx/i82801dx_smi.c (added)
-
src/southbridge/intel/i82801dx/i82801dx_smihandler.c (added)
-
src/southbridge/intel/i82801dx/i82801dx_tco_timer.c (added)
-
util/cbfstool/cbfs.h (modified) (1 diff)
-
util/cbfstool/common.c (modified) (1 diff)
-
util/x86emu/yabel/vbe.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Kconfig
r5171 r5177 448 448 video card (also in hex, without "0x" prefix). 449 449 450 config INTEL_MBI 451 bool "Add an MBI image" 452 depends on NORTHBRIDGE_INTEL_I82830 453 help 454 Select this option if you have an Intel MBI image that you would 455 like to add to your ROM. 456 457 You will be able to specify the location and file name of the 458 image later. 459 460 config FALLBACK_MBI_FILE 461 string "Intel MBI path and filename" 462 depends on INTEL_MBI 463 default "mbi.bin" 464 help 465 The path and filename of the file to use as VGA BIOS. 466 467 endmenu 468 469 menu "Bootsplash" 470 depends on PCI_OPTION_ROM_RUN_YABEL 471 472 config BOOTSPLASH 473 prompt "Show graphical bootsplash" 474 bool 475 depends on PCI_OPTION_ROM_RUN_YABEL 476 help 477 This option shows a graphical bootsplash screen. The grapics are 478 loaded from the CBFS file bootsplash.jpg. 479 480 config FALLBACK_BOOTSPLASH_FILE 481 string "Bootsplash path and filename" 482 depends on BOOTSPLASH 483 default "bootsplash.jpg" 484 help 485 The path and filename of the file to use as graphical bootsplash 486 screen. The file format has to be jpg. 487 488 # TODO: Turn this into a "choice". 489 config FRAMEBUFFER_VESA_MODE 490 prompt "VESA framebuffer video mode" 491 hex 492 default 0x117 493 depends on BOOTSPLASH 494 help 495 This option sets the resolution used for the coreboot framebuffer and 496 bootsplash screen. Set to 0x117 for 1024x768x16. A diligent soul will 497 some day make this a "choice". 498 499 config COREBOOT_KEEP_FRAMEBUFFER 500 prompt "Keep VESA framebuffer" 501 bool 502 depends on BOOTSPLASH 503 help 504 This option keeps the framebuffer mode set after coreboot finishes 505 execution. If this option is enabled, coreboot will pass a 506 framebuffer entry in its coreboot table and the payload will need a 507 framebuffer driver. If this option is disabled, coreboot will switch 508 back to text mode before handing control to a payload. 509 450 510 endmenu 451 511 -
trunk/src/arch/i386/Makefile.inc
r5176 r5177 29 29 $(CBFSTOOL) $(obj)/coreboot.rom add $(CONFIG_FALLBACK_VGA_BIOS_FILE) "pci$(CONFIG_FALLBACK_VGA_BIOS_ID).rom" optionrom 30 30 endif 31 ifeq ($(CONFIG_INTEL_MBI),y) 32 @printf " MBI $(CONFIG_FALLBACK_MBI_FILE)\n" 33 $(CBFSTOOL) $(obj)/coreboot.rom add $(CONFIG_FALLBACK_MBI_FILE) mbi.bin mbi 34 endif 35 ifeq ($(CONFIG_BOOTSPLASH),y) 36 @printf " BOOTSPLASH $(CONFIG_FALLBACK_BOOTSPLASH_FILE)\n" 37 $(CBFSTOOL) $(obj)/coreboot.rom add $(CONFIG_FALLBACK_BOOTSPLASH_FILE) bootsplash.jpg bootsplash 38 endif 31 39 @printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n" 32 40 $(CBFSTOOL) $(obj)/coreboot.rom print -
trunk/src/devices/Kconfig
r5146 r5177 168 168 Enable this option for a good compromise between security and speed. 169 169 170 config BOOTSPLASH171 prompt "Show graphical bootsplash"172 bool173 depends on PCI_OPTION_ROM_RUN_YABEL174 help175 This option shows a graphical bootsplash screen. The grapics are176 loaded from the CBFS file bootsplash.jpg.177 178 # TODO: Turn this into a "choice".179 config FRAMEBUFFER_VESA_MODE180 prompt "VESA framebuffer video mode"181 hex182 default 0x117183 depends on BOOTSPLASH184 help185 This option sets the resolution used for the coreboot framebuffer and186 bootsplash screen. Set to 0x117 for 1024x768x16. A diligent soul will187 some day make this a "choice".188 189 config COREBOOT_KEEP_FRAMEBUFFER190 prompt "Keep VESA framebuffer"191 bool192 depends on BOOTSPLASH193 help194 This option keeps the framebuffer mode set after coreboot finishes195 execution. If this option is enabled, coreboot will pass a196 framebuffer entry in its coreboot table and the payload will need a197 framebuffer driver. If this option is disabled, coreboot will switch198 back to text mode before handing control to a payload.199 200 170 config CONSOLE_VGA_MULTI 201 171 bool -
trunk/src/include/cbfs.h
r5146 r5177 64 64 components */ 65 65 66 #define CBFS_TYPE_STAGE 0x10 67 #define CBFS_TYPE_PAYLOAD 0x20 68 #define CBFS_TYPE_OPTIONROM 0x30 66 #define CBFS_TYPE_STAGE 0x10 67 #define CBFS_TYPE_PAYLOAD 0x20 68 #define CBFS_TYPE_OPTIONROM 0x30 69 #define CBFS_TYPE_BOOTSPLASH 0x40 70 #define CBFS_TYPE_RAW 0x50 71 #define CBFS_TYPE_VSA 0x51 72 #define CBFS_TYPE_MBI 0x52 73 #define CBFS_TYPE_MICROCODE 0x53 69 74 70 75 /** this is the master cbfs header - it need to be … … 165 170 void *cbfs_load_optionrom(u16 vendor, u16 device, void * dest); 166 171 int run_address(void *f); 167 int cbfs_decompress(int algo, void *src, void *dst, int len);168 struct cbfs_stage *cbfs_find_file(const char *name, int type);169 int cbfs_check_magic(struct cbfs_file *file);170 struct cbfs_header *cbfs_master_header(void);171 172 struct cbfs_file *cbfs_find(const char *name); 173 void *cbfs_find_file(const char *name, int type); 172 174 void cbfs_and_run_core(const char *filename, unsigned int ebp); 173 175 -
trunk/src/lib/Makefile.inc
r5135 r5177 32 32 $(obj)/lib/version.o :: $(obj)/build.h 33 33 endif 34 35 smmobj-y += memcpy.o -
trunk/src/lib/cbfs.c
r5135 r5177 25 25 #include <arch/byteorder.h> 26 26 27 int cbfs_decompress(int algo, void *src, void *dst, int len) 27 28 /** 29 * Decompression wrapper for CBFS 30 * @param algo 31 * @param src 32 * @param dst 33 * @param len 34 * @return 0 on success, -1 on failure 35 */ 36 static int cbfs_decompress(int algo, void *src, void *dst, int len) 28 37 { 29 38 switch(algo) { … … 45 54 } 46 55 47 int cbfs_check_magic(struct cbfs_file *file)56 static int cbfs_check_magic(struct cbfs_file *file) 48 57 { 49 58 return !strcmp(file->magic, CBFS_FILE_MAGIC) ? 1 : 0; 50 59 } 51 60 52 st ruct cbfs_header *cbfs_master_header(void)61 static struct cbfs_header *cbfs_master_header(void) 53 62 { 54 63 struct cbfs_header *header; … … 104 113 } 105 114 106 struct cbfs_stage*cbfs_find_file(const char *name, int type)115 void *cbfs_find_file(const char *name, int type) 107 116 { 108 117 struct cbfs_file *file = cbfs_find(name); … … 124 133 } 125 134 126 static in t tohex4(unsigned int c)135 static inline int tohex4(unsigned int c) 127 136 { 128 137 return (c<=9)?(c+'0'):(c-10+'a'); … … 206 215 } 207 216 208 void * cbfs_get_file(const char *name)209 {210 return (void *) cbfs_find(name);211 }212 213 217 int cbfs_execute_stage(const char *name) 214 218 { … … 234 238 * jumps to it, returning the result. 235 239 * @param f the address to call as a function. 236 * returnsvalue returned by the function.240 * @return value returned by the function. 237 241 */ 238 242 -
trunk/src/mainboard/rca/rm4100/Kconfig
r5167 r5177 10 10 select UDELAY_TSC 11 11 select BOARD_ROMSIZE_KB_512 12 select HAVE_SMI_HANDLER 12 13 13 14 config MAINBOARD_DIR -
trunk/src/mainboard/rca/rm4100/Makefile.inc
r5168 r5177 1 1 ROMCCFLAGS=-mcpu=p3 -O 2 3 smmobj-$(CONFIG_HAVE_SMI_HANDLER) += mainboard_smi.o 4 -
trunk/src/mainboard/rca/rm4100/devicetree.cb
r5167 r5177 1 1 chip northbridge/intel/i82830 # Northbridge 2 device apic_cluster 0 on # APIC cluster 3 chip cpu/intel/socket_PGA370 # Mobile Celeron Micro-FCBGA Socket 479 4 device apic 0 on end # APIC 5 end 6 end 2 7 device pci_domain 0 on # PCI domain 3 8 device pci 0.0 on end # Host bridge … … 20 25 device pci 1d.2 on end # USB UHCI Controller #3 21 26 device pci 1d.7 on end # USB2 EHCI Controller 22 device pci 1e.0 on # PCI bridge 23 device pci 08.0 on end # Intel 82801DB PRO/100 VE Ethernet 24 end 27 device pci 1e.0 on end # PCI bridge 25 28 device pci 1f.0 on # ISA/LPC bridge 26 29 chip superio/smsc/smscsuperio # Super I/O … … 62 65 end 63 66 end 64 device apic_cluster 0 on # APIC cluster65 chip cpu/intel/socket_PGA370 # Mobile Celeron Micro-FCBGA Socket 47966 device apic 0 on end # APIC67 end68 end69 67 end 70 68 -
trunk/src/mainboard/rca/rm4100/mainboard.c
r4249 r5177 22 22 #include "chip.h" 23 23 24 static void mainboard_init(device_t dev) 25 { 26 // TODO Switch parport LEDs again 27 } 28 29 static void mainboard_enable(device_t dev) 30 { 31 // TODO Switch parport LEDs 32 dev->ops->init = mainboard_init; 33 } 34 24 35 struct chip_operations mainboard_ops = { 36 .enable_dev = mainboard_enable, 25 37 CHIP_NAME("RCA RM4100 Mainboard") 26 38 }; -
trunk/src/mainboard/rca/rm4100/romstage.c
r5167 r5177 46 46 47 47 #include "southbridge/intel/i82801dx/i82801dx_early_smbus.c" 48 #include "southbridge/intel/i82801dx/i82801dx_tco_timer.c" 48 49 49 50 /** … … 103 104 static void main(unsigned long bist) 104 105 { 105 if (bist == 0) 106 if (bist == 0) { 106 107 early_mtrr_init(); 107 108 if (memory_initialized()) { 108 109 hard_reset(); 109 110 } 111 } 110 112 111 113 /* Set southbridge and superio gpios */ … … 119 121 report_bist_failure(bist); 120 122 123 /* disable TCO timers */ 124 i82801dx_halt_tco_timer(); 125 121 126 /* Setup mainboard specific registers */ 122 127 mb_early_setup(); -
trunk/src/mainboard/thomson/ip1000/Kconfig
r5167 r5177 10 10 select UDELAY_TSC 11 11 select BOARD_ROMSIZE_KB_512 12 select HAVE_SMI_HANDLER 12 13 13 14 config MAINBOARD_DIR -
trunk/src/mainboard/thomson/ip1000/Makefile.inc
r5168 r5177 1 1 ROMCCFLAGS=-mcpu=p3 -O 2 3 smmobj-$(CONFIG_HAVE_SMI_HANDLER) += mainboard_smi.o 4 -
trunk/src/mainboard/thomson/ip1000/devicetree.cb
r5167 r5177 1 1 chip northbridge/intel/i82830 # Northbridge 2 device apic_cluster 0 on # APIC cluster 3 chip cpu/intel/socket_PGA370 # Low Voltage PIII Micro-FCBGA Socket 479 4 device apic 0 on end # APIC 5 end 6 end 7 2 8 device pci_domain 0 on # PCI domain 3 9 device pci 0.0 on end # Host bridge … … 20 26 device pci 1d.2 on end # USB UHCI Controller #3 21 27 device pci 1d.7 on end # USB2 EHCI Controller 22 device pci 1e.0 on # PCI bridge 23 device pci 08.0 on end # Intel 82801DB PRO/100 VE Ethernet 24 end 28 device pci 1e.0 on end # PCI bridge 25 29 device pci 1f.0 on # ISA/LPC bridge 26 30 chip superio/smsc/smscsuperio # Super I/O … … 62 66 end 63 67 end 64 device apic_cluster 0 on # APIC cluster65 chip cpu/intel/socket_PGA370 # Low Voltage PIII Micro-FCBGA Socket 47966 device apic 0 on end # APIC67 end68 end69 68 end 70 69 -
trunk/src/mainboard/thomson/ip1000/mainboard.c
r3954 r5177 22 22 #include "chip.h" 23 23 24 static void mainboard_init(device_t dev) 25 { 26 // TODO Switch parport LEDs again 27 } 28 29 static void mainboard_enable(device_t dev) 30 { 31 // TODO Switch parport LEDs 32 dev->ops->init = mainboard_init; 33 } 34 24 35 struct chip_operations mainboard_ops = { 36 .enable_dev = mainboard_enable, 25 37 CHIP_NAME("THOMSON IP1000 Mainboard") 26 38 }; -
trunk/src/mainboard/thomson/ip1000/romstage.c
r5167 r5177 46 46 47 47 #include "southbridge/intel/i82801dx/i82801dx_early_smbus.c" 48 #include "southbridge/intel/i82801dx/i82801dx_tco_timer.c" 48 49 49 50 /** … … 103 104 static void main(unsigned long bist) 104 105 { 105 if (bist == 0) 106 if (bist == 0) { 106 107 early_mtrr_init(); 107 108 if (memory_initialized()) { 108 109 hard_reset(); 109 110 } 111 } 110 112 111 113 /* Set southbridge and superio gpios */ … … 119 121 report_bist_failure(bist); 120 122 123 /* disable TCO timers */ 124 i82801dx_halt_tco_timer(); 125 121 126 /* Setup mainboard specific registers */ 122 127 mb_early_setup(); -
trunk/src/northbridge/intel/i82830/Makefile.inc
r4673 r5177 1 1 driver-y += northbridge.o 2 2 driver-y += vga.o 3 4 smmobj-$(CONFIG_HAVE_SMI_HANDLER) += i82830_smihandler.o -
trunk/src/northbridge/intel/i82830/northbridge.c
r5140 r5177 117 117 tomk = ((unsigned long)pci_read_config8(mc_dev, DRB + 3)) << 15; 118 118 tomk -= igd_memory; 119 printk_debug(" Setting RAM size to %ld\n", tomk);119 printk_debug("Memory detected: %ldKB RAM\n", tomk); 120 120 121 121 /* Compute the top of low memory. */ -
trunk/src/northbridge/intel/i82830/raminit.c
r5073 r5177 537 537 value = pci_read_config16(NORTHBRIDGE, GCC1); 538 538 value |= igd_memory << 4; 539 value |= 1; // 64MB aperture 539 540 pci_write_config16(NORTHBRIDGE, GCC1, value); 540 541 -
trunk/src/northbridge/intel/i82830/vga.c
r4250 r5177 25 25 #include <device/pci.h> 26 26 #include <device/pci_ids.h> 27 #include <cbfs.h> 28 #include <x86emu/x86emu.h> 27 29 28 static void vga_init(device_t dev) { 30 static void vga_init(device_t dev) 31 { 32 printk_info("Starting Graphics Initialization\n"); 33 struct cbfs_file *file = cbfs_find("mbi.bin"); 34 void *mbi = NULL; 35 unsigned int mbi_len = 0; 29 36 30 printk_info("Starting Graphics Initialization\n"); 37 if (file) { 38 if (ntohl(file->type) != CBFS_TYPE_MBI) { 39 printk_info( "CBFS: MBI binary is of type %x instead of" 40 "type %x\n", file->type, CBFS_TYPE_MBI); 41 } else { 42 mbi = (void *) CBFS_SUBHEADER(file); 43 mbi_len = file->len; 44 } 45 } else { 46 printk_info( "Could not find MBI.\n"); 47 } 48 49 if (mbi && mbi_len) { 50 /* The GDT or coreboot table is going to live here. But 51 * a long time after we relocated the GNVS, so this is 52 * not troublesome. 53 */ 54 *(u32 *)0x500 = (u32)mbi; 55 *(u32 *)0x504 = (u32)mbi_len; 56 outb(0xeb, 0xb2); 57 } 58 31 59 pci_dev_init(dev); 32 60 printk_info("Graphics Initialization Complete\n"); 33 /* Future TV-OUT code will be called from here. */ 61 62 /* Enable TV-Out */ 63 #if defined(CONFIG_PCI_OPTION_ROM_RUN_YABEL) && CONFIG_PCI_OPTION_ROM_RUN_YABEL 64 #define PIPE_A_CRT (1 << 0) 65 #define PIPE_A_LFP (1 << 1) 66 #define PIPE_A_TV (1 << 3) 67 #define PIPE_B_CRT (1 << 8) 68 #define PIPE_B_TV (1 << 10) 69 printk_debug("Enabling TV-Out\n"); 70 void runInt10(void); 71 M.x86.R_AX = 0x5f64; 72 M.x86.R_BX = 0x0001; // Set Display Device, force execution 73 M.x86.R_CX = PIPE_A_CRT | PIPE_A_TV; 74 // M.x86.R_CX = PIPE_B_TV; 75 runInt10(); 76 switch (M.x86.R_AX) { 77 case 0x005f: 78 printk_debug("... failed.\n"); 79 break; 80 case 0x015f: 81 printk_debug("... ok.\n"); 82 break; 83 default: 84 printk_debug("... not supported.\n"); 85 break; 86 } 87 #endif 34 88 } 35 89 -
trunk/src/southbridge/intel/i82801dx/Kconfig
r5167 r5177 1 1 config SOUTHBRIDGE_INTEL_I82801DX 2 2 bool 3 select IOAPIC -
trunk/src/southbridge/intel/i82801dx/Makefile.inc
r5167 r5177 8 8 #driver-y += i82801dx_pci.o 9 9 obj-y += i82801dx_reset.o 10 11 obj-$(CONFIG_HAVE_SMI_HANDLER) += i82801dx_smi.o 12 smmobj-$(CONFIG_HAVE_SMI_HANDLER) += i82801dx_smihandler.o -
trunk/src/southbridge/intel/i82801dx/i82801dx_ac97.c
r5167 r5177 1 1 /* 2 * (C) 2003 Linux Networx 2 * This file is part of the coreboot project. 3 * 4 * Copyright (C) 2008-2009 coresystems GmbH 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; version 2 of 9 * the License. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 */ 20 4 21 #include <console/console.h> 5 22 #include <device/device.h> 6 23 #include <device/pci.h> 7 24 #include <device/pci_ids.h> 8 #include <device/pci_ops.h> 25 #include <arch/io.h> 26 #include <delay.h> 9 27 #include "i82801dx.h" 10 28 11 12 static struct device_operations ac97audio_ops = { 29 #define NAMBAR 0x10 30 #define MASTER_VOL 0x02 31 #define PAGING 0x24 32 #define EXT_AUDIO 0x28 33 #define FUNC_SEL 0x66 34 #define INFO_IO 0x68 35 #define CONNECTOR 0x6a 36 #define VENDOR_ID1 0x7c 37 #define VENDOR_ID2 0x7e 38 #define SEC_VENDOR_ID1 0xfc 39 #define SEC_VENDOR_ID2 0xfe 40 41 #define NABMBAR 0x14 42 #define GLOB_CNT 0x2c 43 #define GLOB_STA 0x30 44 #define CAS 0x34 45 46 #define MMBAR 0x10 47 #define EXT_MODEM_ID1 0x3c 48 #define EXT_MODEM_ID2 0xbc 49 50 #define MBAR 0x14 51 #define SEC_CODEC 0x40 52 53 54 /* FIXME. This table is probably mainboard specific */ 55 static u16 ac97_function[16*2][4] = { 56 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 57 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 58 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 59 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 60 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 61 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 62 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 63 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 64 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 65 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 66 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 67 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 68 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 69 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 70 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 71 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 72 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 73 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 74 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 75 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 76 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 77 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 78 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 79 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 80 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 81 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 82 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 83 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 84 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 85 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 86 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) }, 87 { (1 << 5), (2 << 11), (1 << 10), (3 << 13) } 88 }; 89 90 static u16 nabmbar; 91 static u16 nambar; 92 93 static int ac97_semaphore(void) 94 { 95 int timeout; 96 u8 reg8; 97 98 timeout = 0xffff; 99 do { 100 reg8 = inb(nabmbar + CAS); 101 timeout--; 102 } while ((reg8 & 1) && timeout); 103 if (! timeout) { 104 printk_debug("Timeout!\n"); 105 } 106 107 return (!timeout); 108 } 109 110 static void init_cnr(void) 111 { 112 // TODO 113 } 114 115 static void program_sigid(struct device *dev, u32 id) 116 { 117 pci_write_config32(dev, 0x2c, id); 118 } 119 120 static void ac97_audio_init(struct device *dev) 121 { 122 u16 reg16; 123 u32 reg32; 124 int i; 125 126 printk_debug("Initializing AC'97 Audio.\n"); 127 128 /* top 16 bits are zero, so don't read them */ 129 nabmbar = pci_read_config16(dev, NABMBAR) & 0xfffe; 130 nambar = pci_read_config16(dev, NAMBAR) & 0xfffe; 131 132 reg16 = inw(nabmbar + GLOB_CNT); 133 reg16 |= (1 << 1); /* Remove AC_RESET# */ 134 outw(reg16, nabmbar + GLOB_CNT); 135 136 /* Wait 600ms. Ouch. */ 137 udelay(600 * 1000); 138 139 init_cnr(); 140 141 /* Detect Primary AC'97 Codec */ 142 reg32 = inl(nabmbar + GLOB_STA); 143 if ((reg32 & ((1 << 28) | (1 << 9) | (1 << 8))) == 0) { 144 /* Primary Codec not found */ 145 printk_debug("No primary codec. Disabling AC'97 Audio.\n"); 146 return; 147 } 148 149 ac97_semaphore(); 150 151 /* Detect if codec is programmable */ 152 outw(0x8000, nambar + MASTER_VOL); 153 ac97_semaphore(); 154 if (inw(nambar + MASTER_VOL) != 0x8000) { 155 printk_debug("Codec not programmable. Disabling AC'97 Audio.\n"); 156 return; 157 } 158 159 /* Program Vendor IDs */ 160 reg32 = inw(nambar + VENDOR_ID1); 161 reg32 <<= 16; 162 reg32 |= (u16)inw(nambar + VENDOR_ID2); 163 164 program_sigid(dev, reg32); 165 166 /* Is Codec AC'97 2.3 compliant? */ 167 reg16 = inw(nambar + EXT_AUDIO); 168 /* [11:10] = 10b -> AC'97 2.3 */ 169 if ((reg16 & 0x0c00) != 0x0800) { 170 /* No 2.3 Codec. We're done */ 171 return; 172 } 173 174 /* Select Page 1 */ 175 reg16 = inw(nambar + PAGING); 176 reg16 &= 0xfff0; 177 reg16 |= 0x0001; 178 outw(reg16, nambar + PAGING); 179 180 for (i = 0x0a * 2; i > 0; i--) { 181 outw(i, nambar + FUNC_SEL); 182 183 /* Function could not be selected. Next one */ 184 if (inw(nambar + FUNC_SEL) != i) 185 continue; 186 187 reg16 = inw(nambar + INFO_IO); 188 189 /* Function Information present? */ 190 if (!(reg16 & (1 << 0))) 191 continue; 192 193 /* Function Information valid? */ 194 if (!(reg16 & (1 << 4))) 195 continue; 196 197 /* Program Buffer Delay [9:5] */ 198 reg16 &= 0x03e0; 199 reg16 |= ac97_function[i][0]; 200 201 /* Program Gain [15:11] */ 202 reg16 |= ac97_function[i][1]; 203 204 /* Program Inversion [10] */ 205 reg16 |= ac97_function[i][2]; 206 207 outw(reg16, nambar + INFO_IO); 208 209 /* Program Connector / Jack Location */ 210 reg16 = inw(nambar + CONNECTOR); 211 reg16 &= 0x1fff; 212 reg16 |= ac97_function[i][3]; 213 outw(reg16, nambar + CONNECTOR); 214 } 215 } 216 217 static void ac97_modem_init(struct device *dev) 218 { 219 u16 reg16; 220 u32 reg32; 221 u16 mmbar, mbar; 222 223 mmbar = pci_read_config16(dev, MMBAR) & 0xfffe; 224 mbar = pci_read_config16(dev, MBAR) & 0xfffe; 225 226 reg16 = inw(mmbar + EXT_MODEM_ID1); 227 if ((reg16 & 0xc000) != 0xc000 ) { 228 if (reg16 & (1 << 0)) { 229 reg32 = inw(mmbar + VENDOR_ID2); 230 reg32 <<= 16; 231 reg32 |= (u16)inw(mmbar + VENDOR_ID1); 232 program_sigid(dev, reg32); 233 return; 234 } 235 } 236 237 /* Secondary codec? */ 238 reg16 = inw(mbar + SEC_CODEC); 239 if ((reg16 & (1 << 9)) == 0) 240 return; 241 242 reg16 = inw(mmbar + EXT_MODEM_ID2); 243 if ((reg16 & 0xc000) == 0x4000) { 244 if (reg16 & (1 << 0)) { 245 reg32 = inw(mmbar + SEC_VENDOR_ID2); 246 reg32 <<= 16; 247 reg32 |= (u16)inw(mmbar + SEC_VENDOR_ID1); 248 program_sigid(dev, reg32); 249 return; 250 } 251 } 252 } 253 254 static struct device_operations ac97_audio_ops = { 13 255 .read_resources = pci_dev_read_resources, 14 256 .set_resources = pci_dev_set_resources, 15 257 .enable_resources = pci_dev_enable_resources, 16 258 .enable = i82801dx_enable, 17 .init = 0,259 .init = ac97_audio_init, 18 260 .scan_bus = 0, 19 261 }; 20 262 21 static const struct pci_driver ac97audio_driver __pci_driver = { 22 .ops = &ac97audio_ops, 23 .vendor = PCI_VENDOR_ID_INTEL, 24 .device = PCI_DEVICE_ID_INTEL_82801DBM_AC97_AUDIO, 25 }; 26 27 28 static struct device_operations ac97modem_ops = { 263 static struct device_operations ac97_modem_ops = { 29 264 .read_resources = pci_dev_read_resources, 30 265 .set_resources = pci_dev_set_resources, 31 266 .enable_resources = pci_dev_enable_resources, 32 267 .enable = i82801dx_enable, 33 .init = 0,268 .init = ac97_modem_init, 34 269 .scan_bus = 0, 35 270 }; 36 271 37 static const struct pci_driver ac97modem_driver __pci_driver = { 38 .ops = &ac97modem_ops, 39 .vendor = PCI_VENDOR_ID_INTEL, 40 .device = PCI_DEVICE_ID_INTEL_82801DBM_AC97_MODEM, 41 }; 272 /* 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) */ 273 static const struct pci_driver i82801db_ac97_audio __pci_driver = { 274 .ops = &ac97_audio_ops, 275 .vendor = PCI_VENDOR_ID_INTEL, 276 .device = PCI_DEVICE_ID_INTEL_82801DB_AC97_AUDIO, 277 }; 278 279 static const struct pci_driver i82801db_ac97_modem __pci_driver = { 280 .ops = &ac97_modem_ops, 281 .vendor = PCI_VENDOR_ID_INTEL, 282 .device = PCI_DEVICE_ID_INTEL_82801DB_AC97_MODEM, 283 }; 284 285 -
trunk/util/cbfstool/cbfs.h
r4630 r5177 69 69 components */ 70 70 71 #define CBFS_COMPONENT_STAGE 0x10 72 #define CBFS_COMPONENT_PAYLOAD 0x20 73 #define CBFS_COMPONENT_OPTIONROM 0x30 71 #define CBFS_COMPONENT_STAGE 0x10 72 #define CBFS_COMPONENT_PAYLOAD 0x20 73 #define CBFS_COMPONENT_OPTIONROM 0x30 74 #define CBFS_COMPONENT_BOOTSPLASH 0x40 75 #define CBFS_COMPONENT_RAW 0x50 76 #define CBFS_COMPONENT_VSA 0x51 77 #define CBFS_COMPONENT_MBI 0x52 78 #define CBFS_COMPONENT_MICROCODE 0x53 74 79 75 80 /* The deleted type is chosen to be a value -
trunk/util/cbfstool/common.c
r5112 r5177 129 129 {CBFS_COMPONENT_PAYLOAD, "payload"}, 130 130 {CBFS_COMPONENT_OPTIONROM, "optionrom"}, 131 {CBFS_COMPONENT_BOOTSPLASH, "bootsplash"}, 132 {CBFS_COMPONENT_RAW, "raw"}, 133 {CBFS_COMPONENT_VSA, "vsa"}, 134 {CBFS_COMPONENT_MBI, "mbi"}, 135 {CBFS_COMPONENT_MICROCODE, "microcode"}, 131 136 {CBFS_COMPONENT_DELETED, "deleted"}, 132 137 {CBFS_COMPONENT_NULL, "null"} -
trunk/util/x86emu/yabel/vbe.c
r5135 r5177 796 796 int imagesize = 1024*768*2; 797 797 798 struct cbfs_file *file = cbfs_find("bootsplash.jpg");799 if (! file) {798 unsigned char *jpeg = cbfs_find_file("bootsplash.jpg", CBFS_TYPE_BOOTSPLASH); 799 if (!jpeg) { 800 800 DEBUG_PRINTF_VBE("Could not find bootsplash.jpg\n"); 801 801 return; 802 802 } 803 unsigned char *jpeg = ((unsigned char *)file) + ntohl(file->offset);804 803 DEBUG_PRINTF_VBE("Splash at %08x ...\n", jpeg); 805 804 dump(jpeg, 64);
Note: See TracChangeset
for help on using the changeset viewer.
