aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/smu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/smu.c')
-rw-r--r--drivers/macintosh/smu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index d531f804455d..d6f72c826c1c 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -38,6 +38,7 @@
38#include <linux/of_irq.h> 38#include <linux/of_irq.h>
39#include <linux/of_platform.h> 39#include <linux/of_platform.h>
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/memblock.h>
41 42
42#include <asm/byteorder.h> 43#include <asm/byteorder.h>
43#include <asm/io.h> 44#include <asm/io.h>
@@ -99,6 +100,7 @@ static DEFINE_MUTEX(smu_mutex);
99static struct smu_device *smu; 100static struct smu_device *smu;
100static DEFINE_MUTEX(smu_part_access); 101static DEFINE_MUTEX(smu_part_access);
101static int smu_irq_inited; 102static int smu_irq_inited;
103static unsigned long smu_cmdbuf_abs;
102 104
103static void smu_i2c_retry(unsigned long data); 105static void smu_i2c_retry(unsigned long data);
104 106
@@ -479,8 +481,13 @@ int __init smu_init (void)
479 481
480 printk(KERN_INFO "SMU: Driver %s %s\n", VERSION, AUTHOR); 482 printk(KERN_INFO "SMU: Driver %s %s\n", VERSION, AUTHOR);
481 483
484 /*
485 * SMU based G5s need some memory below 2Gb. Thankfully this is
486 * called at a time where memblock is still available.
487 */
488 smu_cmdbuf_abs = memblock_alloc_base(4096, 4096, 0x80000000UL);
482 if (smu_cmdbuf_abs == 0) { 489 if (smu_cmdbuf_abs == 0) {
483 printk(KERN_ERR "SMU: Command buffer not allocated !\n"); 490 printk(KERN_ERR "SMU: Command buffer allocation failed !\n");
484 ret = -EINVAL; 491 ret = -EINVAL;
485 goto fail_np; 492 goto fail_np;
486 } 493 }