From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VtkYm-0008Pa-NL for mharc-grub-devel@gnu.org; Thu, 19 Dec 2013 15:51:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtkYe-0008Ml-HX for grub-devel@gnu.org; Thu, 19 Dec 2013 15:51:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtkYZ-0007cu-4g for grub-devel@gnu.org; Thu, 19 Dec 2013 15:51:00 -0500 Received: from gmmr4.centrum.cz ([2a00:da80:1:502::3]:39242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtkYY-0007co-Ps for grub-devel@gnu.org; Thu, 19 Dec 2013 15:50:55 -0500 Received: from gm-as1.cent (unknown [10.32.3.102]) by gmmr4.centrum.cz (Postfix) with ESMTP id D037E7D3 for ; Thu, 19 Dec 2013 21:50:52 +0100 (CET) Received: by gm-as1.cent (Postfix, from userid 65534) id C952F200DD53E; Thu, 19 Dec 2013 21:50:52 +0100 (CET) X-Original-From: starous@volny.cz X-Envelope-To: grub-devel@gnu.org X-Original-IP: 193.86.90.90 Received: from [192.168.6.11] (unknown [193.86.90.90]) by gm-smtp1.centrum.cz (Postfix) with ESMTPX id 3286260049965 for ; Thu, 19 Dec 2013 21:50:43 +0100 (CET) Message-ID: <52B35C26.3020009@volny.cz> Date: Thu, 19 Dec 2013 21:50:46 +0100 From: =?windows-1252?Q?Ale=9A_Nesrsta?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH]: xHCI/EHCI - Windows - BIOS bug interaction. References: In-Reply-To: X-Enigmail-Version: 1.6 OpenPGP: id=9AEF08D1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="blhC7TVRq9plK8102kwrskFI4jGkGhC2c" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:da80:1:502::3 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:51:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --blhC7TVRq9plK8102kwrskFI4jGkGhC2c Content-Type: multipart/mixed; boundary="------------050305080005090608030700" This is a multi-part message in MIME format. --------------050305080005090608030700 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Dne 19.12.2013 12:33, Melki Christian (consultant) napsal(a): >... > I'm not an USB expert. :) In this case we are two... :) According to your patch: Even if this patch looks good for me, I am afraid it is not good way to handle xHCI from EHCI module. =46rom my point of view it is maybe little bit better to prepare some "empty" skeleton of xHCI module and include it in GRUB. Such "driver": - will do the thing of your patch only - will be loaded manually only if necessary (or automatically by some hardcoded dependency on EHCI module - ? In such case it probably should include also some Product/Vendor filter or whatever else...) - could be more easily substituted by real xHCI driver module My initial simple proposal of "empty" xHCI module, based on your e-mail and patch, is included. Note: This is proposal code only, I didn't compile it nor tested... BR, Ales --------------050305080005090608030700 Content-Type: text/x-csrc; name="xhci.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xhci.c" /* xhci.c - xHCI dummy driver. */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GRUB is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GRUB. If not, see . */ #include #include #include #include #include #include #include #include #include #include #include GRUB_MOD_LICENSE ("GPLv3+"); /* This module solves only xHCI problem: * Machine is cold-booted. - > USB keyboard works in GRUB -> Windows boot= s -> * Windows does warm reboot -> USB keyboard does not work in GRUB. * This only happens in the ports marked superspeed on the machine. * The problem is that Windows seems to leave the the SS ports in SS mode= * when rebooting and a BIOS bug(?) on warm boot leads to not setting * the SS ports in 2.0 mode. */ /* Identification values */ #define GRUB_XHCI_CLASS_CODE 0x0c0330 #define GRUB_XHCI_SBRN_VALUE 0x30 #define GRUB_XHCI_PCI_XUSB2PR 0xD0 #define GRUB_XHCI_PCI_USB3_PSSEN 0xD8 /* PCI iteration function... */ static int grub_xhci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid __attribute__ ((unused)), void __attribute__ ((unused)) *data) { grub_pci_address_t addr; grub_uint32_t class_code; grub_uint8_t release; =20 addr =3D grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); class_code =3D grub_pci_read (addr) >> 8; /* If this is not an XHCI controller, just return. */ if (class_code !=3D GRUB_XHCI_CLASS_CODE) return 0; /* Check Serial Bus Release Number */ addr =3D grub_pci_make_address (dev, GRUB_XHCI_PCI_SBRN_REG); release =3D grub_pci_read_byte (addr); if (release !=3D GRUB_XHCI_SBRN_VALUE) return 0; /* Since GRUB does not currently handle xHCI we need * to make sure it is disabled and the ports put in 2.0 mode. * To be removed when xHCI is properly introduced. */ addr =3D grub_pci_make_address (dev, GRUB_XHCI_PCI_USB3_PSSEN); grub_pci_write_word (addr, 0x0); grub_pci_read_word(addr); addr =3D grub_pci_make_address (dev, GRUB_XHCI_PCI_XUSB2PR); grub_pci_write_word (addr, 0x0); grub_pci_read_word(addr); return 0; } static int grub_xhci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_da= ta) { return 0; } static grub_usb_err_t grub_xhci_setup_transfer (grub_usb_controller_t dev, grub_usb_transfer_t transfer) { if (dev && transfer) {} =20 return GRUB_USB_ERR_NONE; } static grub_usb_err_t grub_xhci_check_transfer (grub_usb_controller_t dev, grub_usb_transfer_t transfer, grub_size_t * actual) { if (dev && transfer && actual) {} return GRUB_USB_ERR_NONE; } static grub_usb_err_t grub_xhci_cancel_transfer (grub_usb_controller_t dev, grub_usb_transfer_t transfer) { if (dev && transfer) {} return GRUB_USB_ERR_NONE; } static int grub_xhci_hubports (grub_usb_controller_t dev) { if (dev) {} return 0; } static grub_usb_err_t grub_xhci_portstatus (grub_usb_controller_t dev, unsigned int port, unsigned int enable) { if (dev && port && enable) {} return GRUB_USB_ERR_NONE; } static grub_usb_speed_t grub_xhci_detect_dev (grub_usb_controller_t dev, int port, int *changed) { if (dev &&changed) {} return GRUB_USB_SPEED_NONE; } static grub_err_t grub_xhci_fini_hw (int noreturn __attribute__ ((unused))) { return GRUB_USB_ERR_NONE; } static grub_err_t grub_xhci_restore_hw (void) { return GRUB_USB_ERR_NONE; } static void grub_xhci_inithw (void) { grub_pci_iterate (grub_xhci_pci_iter, NULL); } static struct grub_usb_controller_dev usb_controller =3D { .name =3D "xhci", .iterate =3D grub_xhci_iterate, .setup_transfer =3D grub_xhci_setup_transfer, .check_transfer =3D grub_xhci_check_transfer, .cancel_transfer =3D grub_xhci_cancel_transfer, .hubports =3D grub_xhci_hubports, .portstatus =3D grub_xhci_portstatus, .detect_dev =3D grub_xhci_detect_dev, .max_bulk_tds =3D 0 }; GRUB_MOD_INIT (xhci) { grub_xhci_inithw (); } GRUB_MOD_FINI (xhci) { grub_xhci_fini_hw (0); } --------------050305080005090608030700-- --blhC7TVRq9plK8102kwrskFI4jGkGhC2c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlKzXCcACgkQT72HYprvCNFABwD+L4eIj33xROrDmX5LIF17tY9F kCBz3LW8DGbEMu9QIh4A/RhgYQ1D/N1U8o2E2u4gcLEIgF9oKmKQSxOYu2rtowuG =bhiz -----END PGP SIGNATURE----- --blhC7TVRq9plK8102kwrskFI4jGkGhC2c--