Skip to content

Instantly share code, notes, and snippets.

@d235j
Created January 2, 2022 19:47
Show Gist options
  • Save d235j/f6c9bca0aee59b057c2e40a5d4526299 to your computer and use it in GitHub Desktop.
Save d235j/f6c9bca0aee59b057c2e40a5d4526299 to your computer and use it in GitHub Desktop.
Kernel patches for Magma CardBus to PCI adapter
diff -Nruw linux_2_6_5_orig/drivers/pci/bus.c linux_2_6_5/drivers/pci/bus.c
--- linux_2_6_5_orig/drivers/pci/bus.c 2004-04-03 22:38:19.000000000 -0500
+++ linux_2_6_5/drivers/pci/bus.c 2004-05-14 10:56:58.000000000 -0400
@@ -125,11 +125,21 @@
void pci_enable_bridges(struct pci_bus *bus)
{
struct pci_dev *dev;
+ u16 temp;
+ u8 temp2;
list_for_each_entry(dev, &bus->devices, bus_list) {
if (dev->subordinate) {
pci_enable_device(dev);
pci_set_master(dev);
+ //enable memio, cacheline and latency on the bridges ......
+ temp = 0x0017;
+ pci_write_config_byte (dev, PCI_COMMAND, temp);
+ temp2 = 0x10;
+ pci_write_config_byte (dev, PCI_CACHE_LINE_SIZE, temp2);
+ temp2 = 0xf8;
+ pci_write_config_byte (dev, PCI_LATENCY_TIMER, temp2);
+ //end jme
pci_enable_bridges(dev->subordinate);
}
}
@@ -137,3 +147,6 @@
EXPORT_SYMBOL(pci_bus_add_devices);
EXPORT_SYMBOL(pci_enable_bridges);
+
+
+
diff -Nruw linux_2_6_5_orig/drivers/pcmcia/yenta_socket.c linux_2_6_5/drivers/pcmcia/yenta_socket.c
--- linux_2_6_5_orig/drivers/pcmcia/yenta_socket.c 2004-04-03 22:37:24.000000000 -0500
+++ linux_2_6_5/drivers/pcmcia/yenta_socket.c 2004-05-14 10:57:46.000000000 -0400
@@ -507,10 +507,12 @@
* 1/8 of the size of the io window of the parent.
* max 4 MB, min 16 kB.
*/
-#define BRIDGE_MEM_MAX 4*1024*1024
+#define BRIDGE_MEM_MAX 256*1024*1024
+//#define BRIDGE_MEM_MAX 4*1024*1024
#define BRIDGE_MEM_MIN 16*1024
-#define BRIDGE_IO_MAX 256
+#define BRIDGE_IO_MAX 8192
+//#define BRIDGE_IO_MAX 256
#define BRIDGE_IO_MIN 32
#ifndef PCIBIOS_MIN_CARDBUS_IO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment