Commit 549ce8f1 authored by Zubair Lutfullah Kakakhel's avatar Zubair Lutfullah Kakakhel Committed by Greg Kroah-Hartman

misc: pch_phub: Read prefetch value from device tree if passed

The default prefetch value for the eg20t device is hard coded to
0x000affaa.

Add support for an alternative to be read from DT if available
Signed-off-by: default avatarZubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aeb83d70
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/of.h>
#define PHUB_STATUS 0x00 /* Status Register offset */ #define PHUB_STATUS 0x00 /* Status Register offset */
#define PHUB_CONTROL 0x04 /* Control Register offset */ #define PHUB_CONTROL 0x04 /* Control Register offset */
...@@ -711,6 +712,12 @@ static int pch_phub_probe(struct pci_dev *pdev, ...@@ -711,6 +712,12 @@ static int pch_phub_probe(struct pci_dev *pdev,
if (id->driver_data == 1) { /* EG20T PCH */ if (id->driver_data == 1) { /* EG20T PCH */
const char *board_name; const char *board_name;
unsigned int prefetch = 0x000affaa;
if (pdev->dev.of_node)
of_property_read_u32(pdev->dev.of_node,
"intel,eg20t-prefetch",
&prefetch);
ret = sysfs_create_file(&pdev->dev.kobj, ret = sysfs_create_file(&pdev->dev.kobj,
&dev_attr_pch_mac.attr); &dev_attr_pch_mac.attr);
...@@ -736,7 +743,7 @@ static int pch_phub_probe(struct pci_dev *pdev, ...@@ -736,7 +743,7 @@ static int pch_phub_probe(struct pci_dev *pdev,
CLKCFG_UART_MASK); CLKCFG_UART_MASK);
/* set the prefech value */ /* set the prefech value */
iowrite32(0x000affaa, chip->pch_phub_base_address + 0x14); iowrite32(prefetch, chip->pch_phub_base_address + 0x14);
/* set the interrupt delay value */ /* set the interrupt delay value */
iowrite32(0x25, chip->pch_phub_base_address + 0x44); iowrite32(0x25, chip->pch_phub_base_address + 0x44);
chip->pch_opt_rom_start_address = PCH_PHUB_ROM_START_ADDR_EG20T; chip->pch_opt_rom_start_address = PCH_PHUB_ROM_START_ADDR_EG20T;
......
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