]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/powerpc/platforms/embedded6xx/wii.c
Merge tag 'powerpc-4.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
[linux.git] / arch / powerpc / platforms / embedded6xx / wii.c
index 3fd683e40bc951ed0795e4a0b1b072936edfea1c..8bb46dcbebd845cb54cf2c303fa9c726ff5c09e3 100644 (file)
@@ -44,6 +44,7 @@
 #define HW_GPIO_BASE(idx)      (idx * 0x20)
 #define HW_GPIO_OUT(idx)       (HW_GPIO_BASE(idx) + 0)
 #define HW_GPIO_DIR(idx)       (HW_GPIO_BASE(idx) + 4)
+#define HW_GPIO_OWNER          (HW_GPIO_BASE(1) + 0x1c)
 
 #define HW_GPIO_SHUTDOWN       (1<<1)
 #define HW_GPIO_SLOT_LED       (1<<5)
@@ -79,21 +80,9 @@ void __init wii_memory_fixups(void)
        BUG_ON(memblock.memory.cnt != 2);
        BUG_ON(!page_aligned(p[0].base) || !page_aligned(p[1].base));
 
-       /* trim unaligned tail */
-       memblock_remove(ALIGN(p[1].base + p[1].size, PAGE_SIZE),
-                       (phys_addr_t)ULLONG_MAX);
-
-       /* determine hole, add & reserve them */
+       /* determine hole */
        wii_hole_start = ALIGN(p[0].base + p[0].size, PAGE_SIZE);
        wii_hole_size = p[1].base - wii_hole_start;
-       memblock_add(wii_hole_start, wii_hole_size);
-       memblock_reserve(wii_hole_start, wii_hole_size);
-
-       BUG_ON(memblock.memory.cnt != 1);
-       __memblock_dump_all();
-
-       /* allow ioremapping the address space in the hole */
-       __allow_ioremap_reserved = 1;
 }
 
 unsigned long __init wii_mmu_mapin_mem2(unsigned long top)
@@ -176,6 +165,12 @@ static void wii_power_off(void)
        local_irq_disable();
 
        if (hw_gpio) {
+               /*
+                * set the owner of the shutdown pin to ARM, because it is
+                * accessed through the registers for the ARM, below
+                */
+               clrbits32(hw_gpio + HW_GPIO_OWNER, HW_GPIO_SHUTDOWN);
+
                /* make sure that the poweroff GPIO is configured as output */
                setbits32(hw_gpio + HW_GPIO_DIR(1), HW_GPIO_SHUTDOWN);
 
@@ -239,7 +234,7 @@ static int __init wii_device_probe(void)
        if (!machine_is(wii))
                return 0;
 
-       of_platform_bus_probe(NULL, wii_of_bus, NULL);
+       of_platform_populate(NULL, wii_of_bus, NULL, NULL);
        return 0;
 }
 device_initcall(wii_device_probe);