aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-13 10:00:22 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-13 10:00:22 -0500
commit4de3a8e101150feaefa1139611a50ff37467f33e (patch)
treedaada742542518b02d7db7c5d32e715eaa5f166d /arch/tile
parent294064f58953f9964e5945424b09c51800330a83 (diff)
parent099469502f62fbe0d7e4f0b83a2f22538367f734 (diff)
Merge branch 'master' into fixes
Diffstat (limited to 'arch/tile')
-rw-r--r--arch/tile/Kconfig1
-rw-r--r--arch/tile/include/asm/io.h3
-rw-r--r--arch/tile/include/asm/pci.h9
-rw-r--r--arch/tile/kernel/machine_kexec.c6
-rw-r--r--arch/tile/kernel/pci.c26
-rw-r--r--arch/tile/kernel/sysfs.c61
6 files changed, 42 insertions, 64 deletions
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 70a0de46cd1..11270ca22c0 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -321,6 +321,7 @@ config PCI
321 bool "PCI support" 321 bool "PCI support"
322 default y 322 default y
323 select PCI_DOMAINS 323 select PCI_DOMAINS
324 select GENERIC_PCI_IOMAP
324 ---help--- 325 ---help---
325 Enable PCI root complex support, so PCIe endpoint devices can 326 Enable PCI root complex support, so PCIe endpoint devices can
326 be attached to the Tile chip. Many, but not all, PCI devices 327 be attached to the Tile chip. Many, but not all, PCI devices
diff --git a/arch/tile/include/asm/io.h b/arch/tile/include/asm/io.h
index c9ea1652af0..d2152deb1f3 100644
--- a/arch/tile/include/asm/io.h
+++ b/arch/tile/include/asm/io.h
@@ -204,7 +204,8 @@ static inline long ioport_panic(void)
204 204
205static inline void __iomem *ioport_map(unsigned long port, unsigned int len) 205static inline void __iomem *ioport_map(unsigned long port, unsigned int len)
206{ 206{
207 return (void __iomem *) ioport_panic(); 207 pr_info("ioport_map: mapping IO resources is unsupported on tile.\n");
208 return NULL;
208} 209}
209 210
210static inline void ioport_unmap(void __iomem *addr) 211static inline void ioport_unmap(void __iomem *addr)
diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h
index 7f03cefed1b..5d5a635530b 100644
--- a/arch/tile/include/asm/pci.h
+++ b/arch/tile/include/asm/pci.h
@@ -16,6 +16,7 @@
16#define _ASM_TILE_PCI_H 16#define _ASM_TILE_PCI_H
17 17
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <asm-generic/pci_iomap.h>
19 20
20/* 21/*
21 * Structure of a PCI controller (host bridge) 22 * Structure of a PCI controller (host bridge)
@@ -49,7 +50,6 @@ struct pci_controller {
49int __devinit tile_pci_init(void); 50int __devinit tile_pci_init(void);
50int __devinit pcibios_init(void); 51int __devinit pcibios_init(void);
51 52
52void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
53static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {} 53static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}
54 54
55void __devinit pcibios_fixup_bus(struct pci_bus *bus); 55void __devinit pcibios_fixup_bus(struct pci_bus *bus);
@@ -76,13 +76,6 @@ static inline int pcibios_assign_all_busses(void)
76 return 1; 76 return 1;
77} 77}
78 78
79/*
80 * No special bus mastering setup handling.
81 */
82static inline void pcibios_set_master(struct pci_dev *dev)
83{
84}
85
86#define PCIBIOS_MIN_MEM 0 79#define PCIBIOS_MIN_MEM 0
87#define PCIBIOS_MIN_IO 0 80#define PCIBIOS_MIN_IO 0
88 81
diff --git a/arch/tile/kernel/machine_kexec.c b/arch/tile/kernel/machine_kexec.c
index e00d7179989..6255f2eab11 100644
--- a/arch/tile/kernel/machine_kexec.c
+++ b/arch/tile/kernel/machine_kexec.c
@@ -248,11 +248,11 @@ static void setup_quasi_va_is_pa(void)
248} 248}
249 249
250 250
251NORET_TYPE void machine_kexec(struct kimage *image) 251void machine_kexec(struct kimage *image)
252{ 252{
253 void *reboot_code_buffer; 253 void *reboot_code_buffer;
254 NORET_TYPE void (*rnk)(unsigned long, void *, unsigned long) 254 void (*rnk)(unsigned long, void *, unsigned long)
255 ATTRIB_NORET; 255 __noreturn;
256 256
257 /* Mask all interrupts before starting to reboot. */ 257 /* Mask all interrupts before starting to reboot. */
258 interrupt_mask_set_mask(~0ULL); 258 interrupt_mask_set_mask(~0ULL);
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index 9d610d3fb11..a1bb59eecc1 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -395,6 +395,11 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
395 /* Nothing needs to be done. */ 395 /* Nothing needs to be done. */
396} 396}
397 397
398void pcibios_set_master(struct pci_dev *dev)
399{
400 /* No special bus mastering setup handling. */
401}
402
398/* 403/*
399 * This can be called from the generic PCI layer, but doesn't need to 404 * This can be called from the generic PCI layer, but doesn't need to
400 * do anything. 405 * do anything.
@@ -466,27 +471,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
466 return 0; 471 return 0;
467} 472}
468 473
469void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
470{
471 unsigned long start = pci_resource_start(dev, bar);
472 unsigned long len = pci_resource_len(dev, bar);
473 unsigned long flags = pci_resource_flags(dev, bar);
474
475 if (!len)
476 return NULL;
477 if (max && len > max)
478 len = max;
479
480 if (!(flags & IORESOURCE_MEM)) {
481 pr_info("PCI: Trying to map invalid resource %#lx\n", flags);
482 start = 0;
483 }
484
485 return (void __iomem *)start;
486}
487EXPORT_SYMBOL(pci_iomap);
488
489
490/**************************************************************** 474/****************************************************************
491 * 475 *
492 * Tile PCI config space read/write routines 476 * Tile PCI config space read/write routines
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
index 60290826809..f862b005eb7 100644
--- a/arch/tile/kernel/sysfs.c
+++ b/arch/tile/kernel/sysfs.c
@@ -14,7 +14,7 @@
14 * /sys entry support. 14 * /sys entry support.
15 */ 15 */
16 16
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/cpu.h> 18#include <linux/cpu.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
@@ -32,55 +32,55 @@ static ssize_t get_hv_confstr(char *page, int query)
32 return n; 32 return n;
33} 33}
34 34
35static ssize_t chip_width_show(struct sysdev_class *dev, 35static ssize_t chip_width_show(struct device *dev,
36 struct sysdev_class_attribute *attr, 36 struct device_attribute *attr,
37 char *page) 37 char *page)
38{ 38{
39 return sprintf(page, "%u\n", smp_width); 39 return sprintf(page, "%u\n", smp_width);
40} 40}
41static SYSDEV_CLASS_ATTR(chip_width, 0444, chip_width_show, NULL); 41static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL);
42 42
43static ssize_t chip_height_show(struct sysdev_class *dev, 43static ssize_t chip_height_show(struct device *dev,
44 struct sysdev_class_attribute *attr, 44 struct device_attribute *attr,
45 char *page) 45 char *page)
46{ 46{
47 return sprintf(page, "%u\n", smp_height); 47 return sprintf(page, "%u\n", smp_height);
48} 48}
49static SYSDEV_CLASS_ATTR(chip_height, 0444, chip_height_show, NULL); 49static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL);
50 50
51static ssize_t chip_serial_show(struct sysdev_class *dev, 51static ssize_t chip_serial_show(struct device *dev,
52 struct sysdev_class_attribute *attr, 52 struct device_attribute *attr,
53 char *page) 53 char *page)
54{ 54{
55 return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM); 55 return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM);
56} 56}
57static SYSDEV_CLASS_ATTR(chip_serial, 0444, chip_serial_show, NULL); 57static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL);
58 58
59static ssize_t chip_revision_show(struct sysdev_class *dev, 59static ssize_t chip_revision_show(struct device *dev,
60 struct sysdev_class_attribute *attr, 60 struct device_attribute *attr,
61 char *page) 61 char *page)
62{ 62{
63 return get_hv_confstr(page, HV_CONFSTR_CHIP_REV); 63 return get_hv_confstr(page, HV_CONFSTR_CHIP_REV);
64} 64}
65static SYSDEV_CLASS_ATTR(chip_revision, 0444, chip_revision_show, NULL); 65static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL);
66 66
67 67
68static ssize_t type_show(struct sysdev_class *dev, 68static ssize_t type_show(struct device *dev,
69 struct sysdev_class_attribute *attr, 69 struct device_attribute *attr,
70 char *page) 70 char *page)
71{ 71{
72 return sprintf(page, "tilera\n"); 72 return sprintf(page, "tilera\n");
73} 73}
74static SYSDEV_CLASS_ATTR(type, 0444, type_show, NULL); 74static DEVICE_ATTR(type, 0444, type_show, NULL);
75 75
76#define HV_CONF_ATTR(name, conf) \ 76#define HV_CONF_ATTR(name, conf) \
77 static ssize_t name ## _show(struct sysdev_class *dev, \ 77 static ssize_t name ## _show(struct device *dev, \
78 struct sysdev_class_attribute *attr, \ 78 struct device_attribute *attr, \
79 char *page) \ 79 char *page) \
80 { \ 80 { \
81 return get_hv_confstr(page, conf); \ 81 return get_hv_confstr(page, conf); \
82 } \ 82 } \
83 static SYSDEV_CLASS_ATTR(name, 0444, name ## _show, NULL); 83 static DEVICE_ATTR(name, 0444, name ## _show, NULL);
84 84
85HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER) 85HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER)
86HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER) 86HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER)
@@ -96,15 +96,15 @@ HV_CONF_ATTR(mezz_description, HV_CONFSTR_MEZZ_DESC)
96HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL) 96HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL)
97 97
98static struct attribute *board_attrs[] = { 98static struct attribute *board_attrs[] = {
99 &attr_board_part.attr, 99 &dev_attr_board_part.attr,
100 &attr_board_serial.attr, 100 &dev_attr_board_serial.attr,
101 &attr_board_revision.attr, 101 &dev_attr_board_revision.attr,
102 &attr_board_description.attr, 102 &dev_attr_board_description.attr,
103 &attr_mezz_part.attr, 103 &dev_attr_mezz_part.attr,
104 &attr_mezz_serial.attr, 104 &dev_attr_mezz_serial.attr,
105 &attr_mezz_revision.attr, 105 &dev_attr_mezz_revision.attr,
106 &attr_mezz_description.attr, 106 &dev_attr_mezz_description.attr,
107 &attr_switch_control.attr, 107 &dev_attr_switch_control.attr,
108 NULL 108 NULL
109}; 109};
110 110
@@ -151,12 +151,11 @@ hvconfig_bin_read(struct file *filp, struct kobject *kobj,
151 151
152static int __init create_sysfs_entries(void) 152static int __init create_sysfs_entries(void)
153{ 153{
154 struct sysdev_class *cls = &cpu_sysdev_class;
155 int err = 0; 154 int err = 0;
156 155
157#define create_cpu_attr(name) \ 156#define create_cpu_attr(name) \
158 if (!err) \ 157 if (!err) \
159 err = sysfs_create_file(&cls->kset.kobj, &attr_##name.attr); 158 err = device_create_file(cpu_subsys.dev_root, &dev_attr_##name);
160 create_cpu_attr(chip_width); 159 create_cpu_attr(chip_width);
161 create_cpu_attr(chip_height); 160 create_cpu_attr(chip_height);
162 create_cpu_attr(chip_serial); 161 create_cpu_attr(chip_serial);
@@ -164,7 +163,7 @@ static int __init create_sysfs_entries(void)
164 163
165#define create_hv_attr(name) \ 164#define create_hv_attr(name) \
166 if (!err) \ 165 if (!err) \
167 err = sysfs_create_file(hypervisor_kobj, &attr_##name.attr); 166 err = sysfs_create_file(hypervisor_kobj, &dev_attr_##name);
168 create_hv_attr(type); 167 create_hv_attr(type);
169 create_hv_attr(version); 168 create_hv_attr(version);
170 create_hv_attr(config_version); 169 create_hv_attr(config_version);