mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
Add OHCI and UHCI drivers to initrd.
USB smart card readers are most full speed devices, and there is no "rate-matching hubs" beneath the root hub on older (e.g. GM45) plat- forms, which has companion OHCI or UHCI controllers and needs cor- responding drivers to communicate with card readers directly plugged into the motherboard, otherwise a discrete USB hub should be inserted between the motherboard and the reader. This time I make inserting linux modules for OHCI and UHCI controllable with option CONFIG_LINUX_USB_COMPANION_CONTROLLER. A linux config for x200 is added as an example. Tested on my x200s and elitebook revolve 810g1.
This commit is contained in:
parent
55c4864d3d
commit
baa30a2026
2667
config/linux-x200.config
Normal file
2667
config/linux-x200.config
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Sign a valid directory of kexec params
|
||||
set -e -o pipefail
|
||||
. /etc/config
|
||||
. /etc/functions
|
||||
|
||||
rollback="n"
|
||||
|
@ -1,23 +1,9 @@
|
||||
#!/bin/sh
|
||||
# Mount a USB device
|
||||
die() { echo >&2 "!!!!! $@"; exit 1; }
|
||||
. /etc/functions
|
||||
|
||||
enable_usb
|
||||
|
||||
if ! lsmod | grep -q ehci_hcd; then
|
||||
insmod /lib/modules/ehci-hcd.ko \
|
||||
|| die "ehci_hcd: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q ehci_pci; then
|
||||
insmod /lib/modules/ehci-pci.ko \
|
||||
|| die "ehci_pci: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q xhci_hcd; then
|
||||
insmod /lib/modules/xhci-hcd.ko \
|
||||
|| die "ehci_hcd: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q xhci_pci; then
|
||||
insmod /lib/modules/xhci-pci.ko \
|
||||
|| die "ehci_pci: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q usb_storage; then
|
||||
insmod /lib/modules/usb-storage.ko \
|
||||
|| die "usb_storage: module load failed"
|
||||
|
@ -68,6 +68,41 @@ confirm_totp()
|
||||
echo
|
||||
}
|
||||
|
||||
enable_usb()
|
||||
{
|
||||
if [ "$CONFIG_LINUX_USB_COMPANION_CONTROLLER" = y ]; then
|
||||
if ! lsmod | grep -q uhci_hcd; then
|
||||
insmod /lib/modules/uhci-hcd.ko \
|
||||
|| die "uhci_hcd: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q ohci_hcd; then
|
||||
insmod /lib/modules/ohci-hcd.ko \
|
||||
|| die "ohci_hcd: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q ohci_pci; then
|
||||
insmod /lib/modules/ohci-pci.ko \
|
||||
|| die "ohci_pci: module load failed"
|
||||
fi
|
||||
fi
|
||||
if ! lsmod | grep -q ehci_hcd; then
|
||||
insmod /lib/modules/ehci-hcd.ko \
|
||||
|| die "ehci_hcd: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q ehci_pci; then
|
||||
insmod /lib/modules/ehci-pci.ko \
|
||||
|| die "ehci_pci: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q xhci_hcd; then
|
||||
insmod /lib/modules/xhci-hcd.ko \
|
||||
|| die "xhci_hcd: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q xhci_pci; then
|
||||
insmod /lib/modules/xhci-pci.ko \
|
||||
|| die "xhci_pci: module load failed"
|
||||
sleep 2
|
||||
fi
|
||||
}
|
||||
|
||||
confirm_gpg_card()
|
||||
{
|
||||
read \
|
||||
@ -84,23 +119,7 @@ confirm_gpg_card()
|
||||
fi
|
||||
|
||||
# setup the USB so we can reach the GPG card
|
||||
if ! lsmod | grep -q ehci_hcd; then
|
||||
insmod /lib/modules/ehci-hcd.ko \
|
||||
|| die "ehci_hcd: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q ehci_pci; then
|
||||
insmod /lib/modules/ehci-pci.ko \
|
||||
|| die "ehci_pci: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q xhci_hcd; then
|
||||
insmod /lib/modules/xhci-hcd.ko \
|
||||
|| die "ehci_hcd: module load failed"
|
||||
fi
|
||||
if ! lsmod | grep -q xhci_pci; then
|
||||
insmod /lib/modules/xhci-pci.ko \
|
||||
|| die "ehci_pci: module load failed"
|
||||
sleep 2
|
||||
fi
|
||||
enable_usb
|
||||
|
||||
gpg --card-status \
|
||||
|| die "gpg card read failed"
|
||||
|
@ -63,6 +63,10 @@ linux_modules-$(CONFIG_LINUX_MLX4) += drivers/net/ethernet/mellanox/mlx4/mlx4_co
|
||||
linux_modules-$(CONFIG_LINUX_MLX4) += drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko
|
||||
|
||||
# USB modules for both types of controllers
|
||||
# older boards also need ohci and uhci
|
||||
linux_modules-$(CONFIG_LINUX_USB_COMPANION_CONTROLLER) += drivers/usb/host/uhci-hcd.ko
|
||||
linux_modules-$(CONFIG_LINUX_USB_COMPANION_CONTROLLER) += drivers/usb/host/ohci-hcd.ko
|
||||
linux_modules-$(CONFIG_LINUX_USB_COMPANION_CONTROLLER) += drivers/usb/host/ohci-pci.ko
|
||||
linux_modules-$(CONFIG_LINUX_USB) += drivers/usb/host/ehci-hcd.ko
|
||||
linux_modules-$(CONFIG_LINUX_USB) += drivers/usb/host/ehci-pci.ko
|
||||
linux_modules-$(CONFIG_LINUX_USB) += drivers/usb/host/xhci-hcd.ko
|
||||
|
Loading…
Reference in New Issue
Block a user