Commit 8ec3894c authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] ricoh performance fix

parent c452d8e6
......@@ -75,6 +75,12 @@
#define RL5C46X_BCR_3E0_ENA 0x0800
#define RL5C46X_BCR_3E2_ENA 0x1000
/* Bridge Configuration Register */
#define RL5C4XX_CONFIG 0x80 /* 16 bit */
#define RL5C4XX_CONFIG_IO_1_MODE 0x0200
#define RL5C4XX_CONFIG_IO_0_MODE 0x0100
#define RL5C4XX_CONFIG_PREFETCH 0x0001
/* Misc Control Register */
#define RL5C4XX_MISC 0x0082 /* 16 bit */
#define RL5C4XX_MISC_HW_SUSPEND_ENA 0x0002
......@@ -117,6 +123,7 @@
#define rl_ctl(socket) ((socket)->private[1])
#define rl_io(socket) ((socket)->private[2])
#define rl_mem(socket) ((socket)->private[3])
#define rl_config(socket) ((socket)->private[4])
/*
* Magic Ricoh initialization code.. Save state at
......@@ -128,9 +135,17 @@ static int ricoh_open(pci_socket_t *socket)
rl_ctl(socket) = config_readw(socket, RL5C4XX_16BIT_CTL);
rl_io(socket) = config_readw(socket, RL5C4XX_16BIT_IO_0);
rl_mem(socket) = config_readw(socket, RL5C4XX_16BIT_MEM_0);
rl_config(socket) = config_readw(socket, RL5C4XX_CONFIG);
/* Set the default timings, don't trust the original values */
rl_ctl(socket) = RL5C4XX_16CTL_IO_TIMING | RL5C4XX_16CTL_MEM_TIMING;
if(socket->dev->device < PCI_DEVICE_ID_RICOH_RL5C475) {
rl_ctl(socket) |= RL5C46X_16CTL_LEVEL_1 | RL5C46X_16CTL_LEVEL_2;
} else {
rl_config(socket) |= RL5C4XX_CONFIG_PREFETCH;
}
return 0;
}
......@@ -142,6 +157,8 @@ static int ricoh_init(pci_socket_t *socket)
config_writew(socket, RL5C4XX_16BIT_CTL, rl_ctl(socket));
config_writew(socket, RL5C4XX_16BIT_IO_0, rl_io(socket));
config_writew(socket, RL5C4XX_16BIT_MEM_0, rl_mem(socket));
config_writew(socket, RL5C4XX_CONFIG, rl_config(socket));
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment