diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-15 12:51:09 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-15 12:51:09 -0400 |
| commit | 723e9db7a46e328527cc3da2b478b831184fe828 (patch) | |
| tree | cdeda255633057dcb4c84097bed27b2bbf76970f /arch/powerpc/sysdev | |
| parent | ada3fa15057205b7d3f727bba5cd26b5912e350f (diff) | |
| parent | d331d8305cba713605854aab63a000fb892353a7 (diff) | |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (134 commits)
powerpc/nvram: Enable use Generic NVRAM driver for different size chips
powerpc/iseries: Fix oops reading from /proc/iSeries/mf/*/cmdline
powerpc/ps3: Workaround for flash memory I/O error
powerpc/booke: Don't set DABR on 64-bit BookE, use DAC1 instead
powerpc/perf_counters: Reduce stack usage of power_check_constraints
powerpc: Fix bug where perf_counters breaks oprofile
powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops
powerpc/irq: Improve nanodoc
powerpc: Fix some late PowerMac G5 with PCIe ATI graphics
powerpc/fsl-booke: Use HW PTE format if CONFIG_PTE_64BIT
powerpc/book3e: Add missing page sizes
powerpc/pseries: Fix to handle slb resize across migration
powerpc/powermac: Thermal control turns system off too eagerly
powerpc/pci: Merge ppc32 and ppc64 versions of phb_scan()
powerpc/405ex: support cuImage via included dtb
powerpc/405ex: provide necessary fixup function to support cuImage
powerpc/40x: Add support for the ESTeem 195E (PPC405EP) SBC
powerpc/44x: Add Eiger AMCC (AppliedMicro) PPC460SX evaluation board support.
powerpc/44x: Update Arches defconfig
powerpc/44x: Update Arches dts
...
Fix up conflicts in drivers/char/agp/uninorth-agp.c
Diffstat (limited to 'arch/powerpc/sysdev')
| -rw-r--r-- | arch/powerpc/sysdev/fsl_rio.c | 18 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 6 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/ipic.c | 7 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/mmio_nvram.c | 32 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/mpic.c | 13 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/qe_lib/gpio.c | 4 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe_ic.c | 5 |
7 files changed, 70 insertions, 15 deletions
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index cbb3bed75d3c..757a83fe5e59 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c | |||
| @@ -1057,6 +1057,10 @@ int fsl_rio_setup(struct of_device *dev) | |||
| 1057 | law_start, law_size); | 1057 | law_start, law_size); |
| 1058 | 1058 | ||
| 1059 | ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL); | 1059 | ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL); |
| 1060 | if (!ops) { | ||
| 1061 | rc = -ENOMEM; | ||
| 1062 | goto err_ops; | ||
| 1063 | } | ||
| 1060 | ops->lcread = fsl_local_config_read; | 1064 | ops->lcread = fsl_local_config_read; |
| 1061 | ops->lcwrite = fsl_local_config_write; | 1065 | ops->lcwrite = fsl_local_config_write; |
| 1062 | ops->cread = fsl_rio_config_read; | 1066 | ops->cread = fsl_rio_config_read; |
| @@ -1064,6 +1068,10 @@ int fsl_rio_setup(struct of_device *dev) | |||
| 1064 | ops->dsend = fsl_rio_doorbell_send; | 1068 | ops->dsend = fsl_rio_doorbell_send; |
| 1065 | 1069 | ||
| 1066 | port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL); | 1070 | port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL); |
| 1071 | if (!port) { | ||
| 1072 | rc = -ENOMEM; | ||
| 1073 | goto err_port; | ||
| 1074 | } | ||
| 1067 | port->id = 0; | 1075 | port->id = 0; |
| 1068 | port->index = 0; | 1076 | port->index = 0; |
| 1069 | 1077 | ||
| @@ -1071,7 +1079,7 @@ int fsl_rio_setup(struct of_device *dev) | |||
| 1071 | if (!priv) { | 1079 | if (!priv) { |
| 1072 | printk(KERN_ERR "Can't alloc memory for 'priv'\n"); | 1080 | printk(KERN_ERR "Can't alloc memory for 'priv'\n"); |
| 1073 | rc = -ENOMEM; | 1081 | rc = -ENOMEM; |
| 1074 | goto err; | 1082 | goto err_priv; |
| 1075 | } | 1083 | } |
| 1076 | 1084 | ||
| 1077 | INIT_LIST_HEAD(&port->dbells); | 1085 | INIT_LIST_HEAD(&port->dbells); |
| @@ -1169,11 +1177,13 @@ int fsl_rio_setup(struct of_device *dev) | |||
| 1169 | 1177 | ||
| 1170 | return 0; | 1178 | return 0; |
| 1171 | err: | 1179 | err: |
| 1172 | if (priv) | 1180 | iounmap(priv->regs_win); |
| 1173 | iounmap(priv->regs_win); | ||
| 1174 | kfree(ops); | ||
| 1175 | kfree(priv); | 1181 | kfree(priv); |
| 1182 | err_priv: | ||
| 1176 | kfree(port); | 1183 | kfree(port); |
| 1184 | err_port: | ||
| 1185 | kfree(ops); | ||
| 1186 | err_ops: | ||
| 1177 | return rc; | 1187 | return rc; |
| 1178 | } | 1188 | } |
| 1179 | 1189 | ||
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 95dbc643c4fc..adca4affcf1f 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
| 38 | #include <asm/time.h> | 38 | #include <asm/time.h> |
| 39 | #include <asm/prom.h> | 39 | #include <asm/prom.h> |
| 40 | #include <asm/machdep.h> | ||
| 40 | #include <sysdev/fsl_soc.h> | 41 | #include <sysdev/fsl_soc.h> |
| 41 | #include <mm/mmu_decl.h> | 42 | #include <mm/mmu_decl.h> |
| 42 | #include <asm/cpm2.h> | 43 | #include <asm/cpm2.h> |
| @@ -383,8 +384,9 @@ static int __init setup_rstcr(void) | |||
| 383 | if (!rstcr) | 384 | if (!rstcr) |
| 384 | printk (KERN_EMERG "Error: reset control register " | 385 | printk (KERN_EMERG "Error: reset control register " |
| 385 | "not mapped!\n"); | 386 | "not mapped!\n"); |
| 386 | } else | 387 | } else if (ppc_md.restart == fsl_rstcr_restart) |
| 387 | printk (KERN_INFO "rstcr compatible register does not exist!\n"); | 388 | printk(KERN_ERR "No RSTCR register, warm reboot won't work\n"); |
| 389 | |||
| 388 | if (np) | 390 | if (np) |
| 389 | of_node_put(np); | 391 | of_node_put(np); |
| 390 | return 0; | 392 | return 0; |
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 69e2630c9062..cb7689c4bfbd 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
| @@ -735,8 +735,10 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) | |||
| 735 | ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, | 735 | ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, |
| 736 | NR_IPIC_INTS, | 736 | NR_IPIC_INTS, |
| 737 | &ipic_host_ops, 0); | 737 | &ipic_host_ops, 0); |
| 738 | if (ipic->irqhost == NULL) | 738 | if (ipic->irqhost == NULL) { |
| 739 | kfree(ipic); | ||
| 739 | return NULL; | 740 | return NULL; |
| 741 | } | ||
| 740 | 742 | ||
| 741 | ipic->regs = ioremap(res.start, res.end - res.start + 1); | 743 | ipic->regs = ioremap(res.start, res.end - res.start + 1); |
| 742 | 744 | ||
| @@ -781,6 +783,9 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) | |||
| 781 | primary_ipic = ipic; | 783 | primary_ipic = ipic; |
| 782 | irq_set_default_host(primary_ipic->irqhost); | 784 | irq_set_default_host(primary_ipic->irqhost); |
| 783 | 785 | ||
| 786 | ipic_write(ipic->regs, IPIC_SIMSR_H, 0); | ||
| 787 | ipic_write(ipic->regs, IPIC_SIMSR_L, 0); | ||
| 788 | |||
| 784 | printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS, | 789 | printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS, |
| 785 | primary_ipic->regs); | 790 | primary_ipic->regs); |
| 786 | 791 | ||
diff --git a/arch/powerpc/sysdev/mmio_nvram.c b/arch/powerpc/sysdev/mmio_nvram.c index 7b49633a4bd0..207324209065 100644 --- a/arch/powerpc/sysdev/mmio_nvram.c +++ b/arch/powerpc/sysdev/mmio_nvram.c | |||
| @@ -53,6 +53,23 @@ static ssize_t mmio_nvram_read(char *buf, size_t count, loff_t *index) | |||
| 53 | return count; | 53 | return count; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | static unsigned char mmio_nvram_read_val(int addr) | ||
| 57 | { | ||
| 58 | unsigned long flags; | ||
| 59 | unsigned char val; | ||
| 60 | |||
| 61 | if (addr >= mmio_nvram_len) | ||
| 62 | return 0xff; | ||
| 63 | |||
| 64 | spin_lock_irqsave(&mmio_nvram_lock, flags); | ||
| 65 | |||
| 66 | val = ioread8(mmio_nvram_start + addr); | ||
| 67 | |||
| 68 | spin_unlock_irqrestore(&mmio_nvram_lock, flags); | ||
| 69 | |||
| 70 | return val; | ||
| 71 | } | ||
| 72 | |||
| 56 | static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index) | 73 | static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index) |
| 57 | { | 74 | { |
| 58 | unsigned long flags; | 75 | unsigned long flags; |
| @@ -72,6 +89,19 @@ static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index) | |||
| 72 | return count; | 89 | return count; |
| 73 | } | 90 | } |
| 74 | 91 | ||
| 92 | void mmio_nvram_write_val(int addr, unsigned char val) | ||
| 93 | { | ||
| 94 | unsigned long flags; | ||
| 95 | |||
| 96 | if (addr < mmio_nvram_len) { | ||
| 97 | spin_lock_irqsave(&mmio_nvram_lock, flags); | ||
| 98 | |||
| 99 | iowrite8(val, mmio_nvram_start + addr); | ||
| 100 | |||
| 101 | spin_unlock_irqrestore(&mmio_nvram_lock, flags); | ||
| 102 | } | ||
| 103 | } | ||
| 104 | |||
| 75 | static ssize_t mmio_nvram_get_size(void) | 105 | static ssize_t mmio_nvram_get_size(void) |
| 76 | { | 106 | { |
| 77 | return mmio_nvram_len; | 107 | return mmio_nvram_len; |
| @@ -114,6 +144,8 @@ int __init mmio_nvram_init(void) | |||
| 114 | printk(KERN_INFO "mmio NVRAM, %luk at 0x%lx mapped to %p\n", | 144 | printk(KERN_INFO "mmio NVRAM, %luk at 0x%lx mapped to %p\n", |
| 115 | mmio_nvram_len >> 10, nvram_addr, mmio_nvram_start); | 145 | mmio_nvram_len >> 10, nvram_addr, mmio_nvram_start); |
| 116 | 146 | ||
| 147 | ppc_md.nvram_read_val = mmio_nvram_read_val; | ||
| 148 | ppc_md.nvram_write_val = mmio_nvram_write_val; | ||
| 117 | ppc_md.nvram_read = mmio_nvram_read; | 149 | ppc_md.nvram_read = mmio_nvram_read; |
| 118 | ppc_md.nvram_write = mmio_nvram_write; | 150 | ppc_md.nvram_write = mmio_nvram_write; |
| 119 | ppc_md.nvram_size = mmio_nvram_get_size; | 151 | ppc_md.nvram_size = mmio_nvram_get_size; |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 3981ae4cb58e..30c44e6b0413 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
| @@ -230,14 +230,16 @@ static inline u32 _mpic_irq_read(struct mpic *mpic, unsigned int src_no, unsigne | |||
| 230 | { | 230 | { |
| 231 | unsigned int isu = src_no >> mpic->isu_shift; | 231 | unsigned int isu = src_no >> mpic->isu_shift; |
| 232 | unsigned int idx = src_no & mpic->isu_mask; | 232 | unsigned int idx = src_no & mpic->isu_mask; |
| 233 | unsigned int val; | ||
| 233 | 234 | ||
| 235 | val = _mpic_read(mpic->reg_type, &mpic->isus[isu], | ||
| 236 | reg + (idx * MPIC_INFO(IRQ_STRIDE))); | ||
| 234 | #ifdef CONFIG_MPIC_BROKEN_REGREAD | 237 | #ifdef CONFIG_MPIC_BROKEN_REGREAD |
| 235 | if (reg == 0) | 238 | if (reg == 0) |
| 236 | return mpic->isu_reg0_shadow[idx]; | 239 | val = (val & (MPIC_VECPRI_MASK | MPIC_VECPRI_ACTIVITY)) | |
| 237 | else | 240 | mpic->isu_reg0_shadow[src_no]; |
| 238 | #endif | 241 | #endif |
| 239 | return _mpic_read(mpic->reg_type, &mpic->isus[isu], | 242 | return val; |
| 240 | reg + (idx * MPIC_INFO(IRQ_STRIDE))); | ||
| 241 | } | 243 | } |
| 242 | 244 | ||
| 243 | static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no, | 245 | static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no, |
| @@ -251,7 +253,8 @@ static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no, | |||
| 251 | 253 | ||
| 252 | #ifdef CONFIG_MPIC_BROKEN_REGREAD | 254 | #ifdef CONFIG_MPIC_BROKEN_REGREAD |
| 253 | if (reg == 0) | 255 | if (reg == 0) |
| 254 | mpic->isu_reg0_shadow[idx] = value; | 256 | mpic->isu_reg0_shadow[src_no] = |
| 257 | value & ~(MPIC_VECPRI_MASK | MPIC_VECPRI_ACTIVITY); | ||
| 255 | #endif | 258 | #endif |
| 256 | } | 259 | } |
| 257 | 260 | ||
diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c index 3485288dce31..8e7a7767dd5c 100644 --- a/arch/powerpc/sysdev/qe_lib/gpio.c +++ b/arch/powerpc/sysdev/qe_lib/gpio.c | |||
| @@ -105,14 +105,14 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) | |||
| 105 | struct qe_gpio_chip *qe_gc = to_qe_gpio_chip(mm_gc); | 105 | struct qe_gpio_chip *qe_gc = to_qe_gpio_chip(mm_gc); |
| 106 | unsigned long flags; | 106 | unsigned long flags; |
| 107 | 107 | ||
| 108 | qe_gpio_set(gc, gpio, val); | ||
| 109 | |||
| 108 | spin_lock_irqsave(&qe_gc->lock, flags); | 110 | spin_lock_irqsave(&qe_gc->lock, flags); |
| 109 | 111 | ||
| 110 | __par_io_config_pin(mm_gc->regs, gpio, QE_PIO_DIR_OUT, 0, 0, 0); | 112 | __par_io_config_pin(mm_gc->regs, gpio, QE_PIO_DIR_OUT, 0, 0, 0); |
| 111 | 113 | ||
| 112 | spin_unlock_irqrestore(&qe_gc->lock, flags); | 114 | spin_unlock_irqrestore(&qe_gc->lock, flags); |
| 113 | 115 | ||
| 114 | qe_gpio_set(gc, gpio, val); | ||
| 115 | |||
| 116 | return 0; | 116 | return 0; |
| 117 | } | 117 | } |
| 118 | 118 | ||
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 074905c3ee5a..3faa42e03a85 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
| @@ -339,8 +339,10 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags, | |||
| 339 | 339 | ||
| 340 | qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, | 340 | qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, |
| 341 | NR_QE_IC_INTS, &qe_ic_host_ops, 0); | 341 | NR_QE_IC_INTS, &qe_ic_host_ops, 0); |
| 342 | if (qe_ic->irqhost == NULL) | 342 | if (qe_ic->irqhost == NULL) { |
| 343 | kfree(qe_ic); | ||
| 343 | return; | 344 | return; |
| 345 | } | ||
| 344 | 346 | ||
| 345 | qe_ic->regs = ioremap(res.start, res.end - res.start + 1); | 347 | qe_ic->regs = ioremap(res.start, res.end - res.start + 1); |
| 346 | 348 | ||
| @@ -352,6 +354,7 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags, | |||
| 352 | 354 | ||
| 353 | if (qe_ic->virq_low == NO_IRQ) { | 355 | if (qe_ic->virq_low == NO_IRQ) { |
| 354 | printk(KERN_ERR "Failed to map QE_IC low IRQ\n"); | 356 | printk(KERN_ERR "Failed to map QE_IC low IRQ\n"); |
| 357 | kfree(qe_ic); | ||
| 355 | return; | 358 | return; |
| 356 | } | 359 | } |
| 357 | 360 | ||
