Commit graph

78 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
96f33fed86 Make PCI init in i386-qemu port more robust. 2013-04-29 15:09:39 +02:00
Vladimir 'phcoder' Serbinenko
e2f27a8c53 Enforce disabling of firmware disk drivers when native drivers kick in. 2013-04-29 12:16:46 +02:00
Vladimir 'phcoder' Serbinenko
f7bf6c31f3 * grub-core/bus/usb/uhci.c: Fix DMA handling and enable on all PCI
platforms.
2013-04-29 12:05:19 +02:00
Vladimir 'phcoder' Serbinenko
d70dbab77a * grub-core/bus/usb/ehci.c (grub_ehci_fini_hw): Ignore errors, not
much we can do about it anyway.
2013-04-12 20:51:11 +02:00
Aleš Nesrsta
51a4c3e3b0 Fix handling of split transfers. 2013-04-12 20:42:46 +02:00
Vladimir 'phcoder' Serbinenko
2cd5ce6cdb * grub-core/bus/usb/usbtrans.c (grub_usb_bulk_readwrite_packetize):
Init err.
2013-04-04 08:56:45 +02:00
Vladimir 'phcoder' Serbinenko
8fe05def12 Slight improve in USB-related boot-time checkpoints. 2013-03-20 17:21:13 +01:00
Vladimir 'phcoder' Serbinenko
ef8810e9f3 Fix a conflict between ports structures with 2 controllers of
same kind.
2013-03-20 17:07:08 +01:00
Vladimir 'phcoder' Serbinenko
f6df57d216 Initialize USB ports in parallel to speed-up boot. 2013-03-19 23:06:44 +01:00
Vladimir 'phcoder' Serbinenko
d745dda77e Fix USB devices not being detected when requested
due to delayed attach.
2013-03-19 20:35:21 +01:00
Vladimir 'phcoder' Serbinenko
e744219bb6 Implement boot time analysis framework. 2013-03-19 20:25:09 +01:00
Vladimir 'phcoder' Serbinenko
e5a2dd7b55 remove get_endpoint_descriptor and change all functions needing
descriptor to just receive it as argument rather than endpoint
	address.
2013-03-19 11:19:36 +01:00
Vladimir 'phcoder' Serbinenko
5dd6f58789 Better estimate the maximum USB transfer size. 2013-03-19 08:17:51 +01:00
Vladimir 'phcoder' Serbinenko
66a93674b2 Implement USBDebug (full USB stack variant). 2013-02-01 21:49:29 +01:00
Vladimir 'phcoder' Serbinenko
cfe1288b8d * grub-core/bus/usb/usb.c (grub_usb_device_attach): Add missing
grub_print_error.
2013-02-01 21:43:49 +01:00
Vladimir 'phcoder' Serbinenko
e42b99698c * grub-core/bus/usb/serial/common.c (grub_usbserial_attach): Fix missing
zero-out of port structure.
2013-02-01 21:32:17 +01:00
Colin Watson
5fdbaed168 Remove nested functions from USB iterators.
* include/grub/usb.h (grub_usb_iterate_hook_t): New type.
(grub_usb_controller_iterate_hook_t): Likewise.
(grub_usb_iterate): Add hook_data argument.
(grub_usb_controller_iterate): Likewise.
(struct grub_usb_controller_dev.iterate): Likewise.

Update all implementations and callers.
2013-01-21 21:02:24 +00:00
Vladimir 'phcoder' Serbinenko
b879aa7b47 Split long USB transfers into short ones. 2013-01-20 22:45:53 +01:00
Colin Watson
ca3a74469a Remove nested functions from PCI iterators.
* grub-core/bus/pci.c (grub_pci_iterate): Add hook_data argument,
passed to hook.  Update all callers to pass appropriate hook data.
* grub-core/bus/emu/pci.c (grub_pci_iterate): Likewise.
* include/grub/pci.h (grub_pci_iteratefunc_t): Add data argument.
Remove NESTED_FUNC_ATTR from here and from all users.
(grub_pci_iterate): Update prototype.
* grub-core/bus/cs5536.c (grub_cs5536_find: hook): Make static
instead of nested.  Rename to ...
(grub_cs5536_find_iter): ... this.
* grub-core/kern/efi/mm.c (stop_broadcom: find_card): Likewise.
* grub-core/kern/mips/loongson/init.c (init_pci: set_card):
Likewise.
* grub-core/kern/vga_init.c (grub_qemu_init_cirrus: find_card):
Likewise.
* grub-core/video/bochs.c (grub_video_bochs_setup: find_card):
Likewise.
* grub-core/video/cirrus.c (grub_video_cirrus_setup: find_card):
Likewise.
* grub-core/video/efi_uga.c (find_framebuf: find_card): Likewise.
* grub-core/video/radeon_fuloong2e.c
(grub_video_radeon_fuloong2e_setup: find_card): Likewise.
* grub-core/video/sis315pro.c (grub_video_sis315pro_setup:
find_card): Likewise.
* grub-core/video/sm712.c (grub_video_sm712_setup: find_card):
Likewise.
2013-01-13 01:10:41 +00:00
Colin Watson
33a68ac643 * grub-core/bus/usb/ehci.c (grub_ehci_pci_iter): Remove incorrect
__attribute__ ((unused)).
* grub-core/video/bochs.c (find_card): Likewise.
* grub-core/video/cirrus.c (find_card): Likewise.
* grub-core/video/radeon_fuloong2e.c (find_card): Likewise.
* grub-core/video/sis315pro.c (find_card): Likewise.
* grub-core/video/sm712.c (find_card): Likewise.
2012-12-30 09:57:58 +00:00
starous
39b27f1eaf EHCI and OHCI PCI bus master 2012-07-22 21:09:30 +02:00
Vladimir 'phcoder' Serbinenko
c8ca585593 * grub-core/bus/usb/serial/ftdi.c (real_config): Handle 1.5 stop bits.
(ftdi_hw_configure): Likewise.
	* grub-core/bus/usb/serial/pl2303.c (GRUB_PL2303_STOP_BITS_1_5): New
	define.
	(real_config): Handle 1.5 stop bits.
	(pl2303_hw_configure): Likewise.
2012-06-08 20:40:40 +02:00
Christer Weinigel
bda36bfa77 Fix EHCI low-speed.
* grub-core/bus/usb/ehci.c (GRUB_EHCI_MULT_ONE): Fix the value.
	(GRUB_EHCI_MULT_TWO): Likewise.
	(GRUB_EHCI_MULT_THREE): Likewise.
	(GRUB_EHCI_CMASK_MASK): New enum value.
	(GRUB_EHCI_SMASK_MASK): Likewise.
	(GRUB_EHCI_CMASK_OFF): Likewise.
	(GRUB_EHCI_SMASK_OFF): Likewise.
	(grub_ehci_pci_iter): Enable periodic schedule.
	(grub_ehci_parse_notrun): Likewise.
	(grub_ehci_restore_hw): Likewise.
	(grub_ehci_setup_qh): Set flags for low speed transfers.
	(grub_ehci_find_qh): Use periodic list for low speed.
	(grub_ehci_setup_transfer): Check periodic queue as well.
	(grub_ehci_check_transfer): Likewise.
	(grub_ehci_cancel_transfer): Cancel periodic transfer.
2012-05-31 14:02:46 +02:00
Vladimir 'phcoder' Serbinenko
d61386e21d Improve string. Gettextize. 2012-02-12 15:25:25 +01:00
Vladimir 'phcoder' Serbinenko
a9cdb3cf18 * grub-core/bus/usb/ehci.c (grub_ehci_ehcc_read32): Restructure to
conserve alignment invariants.
	(grub_ehci_ehcc_read16): Likewise.
	(grub_ehci_oper_read32): Likewise.
	(grub_ehci_oper_write32): Likewise.
	(grub_ehci_pci_iter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment.
	Conserve alignment invariants.
2012-02-09 23:18:53 +01:00
Vladimir 'phcoder' Serbinenko
01783768d2 Convert UHCI to DMA framework.
* grub-core/bus/usb/uhci.c (grub_uhci): Add chunk and phys members.
	(grub_uhci_pci_iter): Fill new members
	(grub_alloc_td): Use P2V and V2P functions.
	(grub_free_queue): Likewise.
	(grub_alloc_qh): Likewise.
	(grub_uhci_setup_transfer): Likewise.
	(grub_uhci_check_transfer): Likewise.
2012-02-09 15:00:05 +01:00
Vladimir 'phcoder' Serbinenko
9c4b5c13e6 Improve gettext support. Stylistic fixes and error handling fixes while
on it.
2012-02-08 19:26:01 +01:00
Vladimir 'phcoder' Serbinenko
d3e3fab52a Fix ehci on amd64.
* grub-core/bus/usb/usbhub.c (grub_usb_hub_add_dev): Use %p to print
	pointers.
	* grub-core/bus/usb/ehci.c (grub_ehci_pci_iter): Likewise.
	(grub_ehci_setup_qh): Likewise.
	(grub_ehci_find_qh): Likewise.
	(grub_ehci_transaction): Likewise.
	(grub_ehci_setup_transfer): Likewise.
	(grub_ehci_check_transfer): Likewise.
	(grub_ehci_portstatus): Likewise.
	(grub_ehci_detect_dev): Likewise.
	(grub_ehci_transfer_controller_data): New field td_last_phys.
	(grub_ehci_setup_transfer): Fill td_last_phys.
	(grub_ehci_check_transfer): Use td_last_phys.
2012-02-01 16:13:17 +01:00
Vladimir 'phcoder' Serbinenko
08491b6a5a Fix type errors. Don't stop after first EHCI controller is found. 2012-02-01 14:08:58 +01:00
Vladimir 'phcoder' Serbinenko
cefa01261b merge mainline into ehci 2012-02-01 13:19:42 +01:00
Vladimir 'phcoder' Serbinenko
87edb8940a Replace single-linked with double-linked lists. It results in more
compact and more efficient code.

	* grub-core/kern/list.c (grub_list_push): Moved from here ...
	* include/grub/list.h (grub_list_push): ... to here. Set prev.
	(grub_list_remove): Moved from here ...
	* include/grub/list.h (grub_list_remove): ... here. Use and set prev.
	(grub_prio_list_insert): Set prev.
	* include/grub/list.h (grub_list): Add prev. All users updated.
2012-01-24 13:31:12 +01:00
Vladimir 'phcoder' Serbinenko
9c2710789f Eliminate grub_min/grub_max prone to overflow usage.
* grub-core/bus/usb/usbhub.c (grub_usb_add_hub): Eliminate grub_min.
	(poll_nonroot_hub): Likewise.
	* grub-core/fs/affs.c (grub_affs_iterate_dir): Likewise.
	(grub_affs_label): Likewise.
	* grub-core/fs/btrfs.c (grub_btrfs_lzo_decompress): Likewise.
	* grub-core/fs/hfs.c (grub_hfs_dir): Likewise.
	(grub_hfs_label): Likewise.
	* grub-core/fs/hfsplus.c (grub_hfsplus_cmp_catkey): Likewise.
	* grub-core/fs/zfs/zfs.c (MIN): Remove.
	(zap_leaf_array_equal): Use grub_size. Remove MIN.
	(zap_leaf_array_get): Likewise.
	(dnode_get_path): Likewise.
	* grub-core/io/lzopio.c (grub_lzopio_read): Eliminate grub_min.
	* grub-core/io/xzio.c (grub_xzio_read): Likewise.
	* grub-core/script/execute.c (grub_script_break): Likewise.
	* grub-core/script/lexer.c (grub_script_lexer_record): Eliminate
	grub_max.
	* grub-core/script/yylex.l (grub_lexer_yyrealloc): Likewise.
	* include/grub/misc.h (grub_min): Removed.
	(grub_max): Likewise.
2012-01-14 15:44:34 +01:00
Vladimir 'phcoder' Serbinenko
0af2346fdb * grub-core/bus/usb/ohci.c (grub_ohci_check_transfer): Add an unsigned
specification.
2011-12-13 00:29:42 +01:00
Vladimir 'phcoder' Serbinenko
74dbd24466 * include/grub/loader.h (grub_loader_register_preboot_hook):
Use struct preboot * and not void * for handle. All users updated.
	(grub_loader_unregister_preboot_hook): Likewise.
2011-12-13 00:28:14 +01:00
Szymon Janc
fcf1d67219 * grub-core/bus/usb/uhci.c (grub_uhci_setup_transfer): Fix possible
NULL pointer dereference.
2011-10-19 23:11:48 +02:00
Vladimir 'phcoder' Serbinenko
9305dd1a82 Some CS5536 code 2011-10-01 22:51:12 +02:00
Vladimir 'phcoder' Serbinenko
1333929060 Disable SMI on OS ownership failure 2011-10-01 22:01:31 +02:00
Vladimir 'phcoder' Serbinenko
81dbdc1d0a Several small fixes 2011-10-01 21:53:43 +02:00
Vladimir 'phcoder' Serbinenko
2d523c70e5 Use map range 2011-10-01 21:42:44 +02:00
Vladimir 'phcoder' Serbinenko
0a213f4cdb Move p2v and v2p to pci.h 2011-10-01 21:37:02 +02:00
Vladimir 'phcoder' Serbinenko
e5c0534f0b Fix p2v and v2p 2011-10-01 21:31:53 +02:00
starous
ce79cc99d5 @Rock changes - fixed coreboot problem 2011-10-01 21:27:29 +02:00
Vladimir 'phcoder' Serbinenko
4fbface043 Remove packed attribute. 2011-10-01 21:14:03 +02:00
Vladimir 'phcoder' Serbinenko
2877805fb0 Fix link_td to use grub_uint32_t and not the pointer type 2011-10-01 21:13:29 +02:00
Vladimir 'phcoder' Serbinenko
0e7ebb0569 run indent on ehci.c 2011-10-01 21:04:17 +02:00
Vladimir 'phcoder' Serbinenko
679cbb4020 Replace #define with enum 2011-10-01 21:03:03 +02:00
Aleš Nesrsta
2f82ea948d EHCI implementation by Aleš Nesrsta. 2011-10-01 20:18:47 +02:00
Vladimir 'phcoder' Serbinenko
5ab3f48a92 AHCI support.
* grub-core/Makefile.core.def (ata_pthru): Removed.
	(ahci): New module.
	(pata): Likewise.
	* grub-core/bus/usb/ohci.c (GRUB_MOD_FINI): Unregister preboot hook
	on unload.
	* grub-core/commands/hdparm.c (grub_hdparm_do_ata_cmd): Use ATA
	readwrite.
	(grub_hdparm_do_check_powermode_cmd): Likewise.
	(grub_hdparm_do_smart_cmd): Likewise.
	(grub_hdparm_set_val_cmd): Likewise.
	(grub_cmd_hdparm): Likewise. Check thta we have an ATA device.
	* grub-core/disk/ahci.c: New file.
	* grub-core/disk/ata.c: Factor out the low-level part into ...
	* grub-core/disk/pata.c: ... here.
	* grub-core/disk/ata_pthru.c: Contents moved to ...
	* grub-core/disk/pata.c: ... here.
	* grub-core/disk/scsi.c (grub_scsi_names): New array.
	(grub_scsi_iterate): Use grub_scsi_names.
	(grub_scsi_open): Likewise.
	* grub-core/kern/disk.c (grub_disk_ata_pass_through): Removed.
	* include/grub/ata.h (grub_ata_commands): Add DMA commands.
	(grub_ata_regs_t): New struct.
	(grub_disk_ata_pass_through_parms): Likewise.
	(grub_ata_device): Renamed to ...
	(grub_ata): ... this.
	(grub_ata_dev): New struct.
	Removed all low-level inline functions.
	* include/grub/scsi.h: Add PATA and AHCI subsystems.
	(grub_scsi_dev): Removed 'name' and 'id'. Added 'id' parameter to
	iterate hooks and open. All users updated.
	* util/grub-install.in: Handle AHCI disk module.
2011-06-24 00:07:55 +02:00
David Volgyes
e98c83e910 * grub-core/bus/usb/ohci.c (grub_ohci_pci_iter): Avoid NULL-pointer
dereference.
2011-06-23 20:28:04 +02:00
Vladimir 'phcoder' Serbinenko
e775d8edfe * grub-core/bus/usb/usbhub.c (poll_nonroot_hub): Downgrade a printf
into dprintf.
2011-05-18 15:37:18 +02:00