MIPS: PowerTV: Add Gaia platform definitions.
[sfrench/cifs-2.6.git] / arch / mips / powertv / asic / asic_devices.c
index 8ee77887306a24986a54b27af1b3dc009011273a..095a887df39c8515339dc49a0d60be2bcf8d5041 100644 (file)
@@ -1,7 +1,6 @@
 /*
- *                   ASIC Device List Intialization
  *
- * Description:  Defines the platform resources for the SA settop.
+ * Description:  Defines the platform resources for Gaia-based settops.
  *
  * Copyright (C) 2005-2009 Scientific-Atlanta, Inc.
  *
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  *
- * Author:       Ken Eppinett
- *               David Schleef <ds@schleef.org>
- *
- * Description:  Defines the platform resources for the SA settop.
- *
  * NOTE: The bootloader allocates persistent memory at an address which is
  * 16 MiB below the end of the highest address in KSEG0. All fixed
  * address memory reservations must avoid this region.
@@ -80,8 +74,8 @@ static bool usb_configured;
  * Don't recommend to use it directly, it is usually used by kernel internally.
  * Portable code should be using interfaces such as ioremp, dma_map_single, etc.
  */
-unsigned long phys_to_bus_offset;
-EXPORT_SYMBOL(phys_to_bus_offset);
+unsigned long phys_to_dma_offset;
+EXPORT_SYMBOL(phys_to_dma_offset);
 
 /*
  *
@@ -180,9 +174,9 @@ static void __init fs_update(int pe, int md, int sdiv, int disable_div_by_3)
        val = ((sdiv << 29) | (md << 24) | (pe<<8) | (sout<<3) | (byp<<2) |
                (nsb<<1) | (disable_div_by_3<<5));
 
-       asic_write(val, usb_fs);
-       asic_write(val | (en_prg<<4), usb_fs);
-       asic_write(val | (en_prg<<4) | pwr, usb_fs);
+       asic_write(val, fs432x4b4_usb_ctl);
+       asic_write(val | (en_prg<<4), fs432x4b4_usb_ctl);
+       asic_write(val | (en_prg<<4) | pwr, fs432x4b4_usb_ctl);
 }
 
 /*
@@ -289,6 +283,9 @@ static __init noinline void platform_set_family(void)
        case BOOTLDRFAMILY('F', '1'):
                platform_family = FAMILY_1500VZF;
                break;
+       case BOOTLDRFAMILY('8', '7'):
+               platform_family = FAMILY_8700;
+               break;
        default:
                platform_family = -1;
        }
@@ -472,6 +469,9 @@ void __init configure_platform(void)
                 * it*/
                platform_features = FFS_CAPABLE | DISPLAY_CAPABLE;
 
+               /* Cronus and Cronus Lite have the same register map */
+               set_register_map(CRONUS_IO_BASE, &cronus_register_map);
+
                /* ASIC version will determine if this is a real CronusLite or
                 * Castrati(Cronus) */
                chipversion  = asic_read(chipver3) << 24;
@@ -484,8 +484,6 @@ void __init configure_platform(void)
                else
                        asic = ASIC_CRONUSLITE;
 
-               /* Cronus and Cronus Lite have the same register map */
-               set_register_map(CRONUS_IO_BASE, &cronus_register_map);
                gp_resources = non_dvr_cronuslite_resources;
                pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, "
                        "chipversion=0x%08X\n",
@@ -525,6 +523,15 @@ void __init configure_platform(void)
                        "DVR_CAPABLE\n");
                break;
 
+       case FAMILY_8700:
+               platform_features = FFS_CAPABLE | PCIE_CAPABLE;
+               asic = ASIC_GAIA;
+               set_register_map(GAIA_IO_BASE, &gaia_register_map);
+               gp_resources = dvr_gaia_resources;
+
+               pr_info("Platform: 8700 - GAIA, DVR_CAPABLE\n");
+               break;
+
        default:
                pr_crit("Platform:  UNKNOWN PLATFORM\n");
                break;
@@ -532,10 +539,10 @@ void __init configure_platform(void)
 
        switch (asic) {
        case ASIC_ZEUS:
-               phys_to_bus_offset = 0x30000000;
+               phys_to_dma_offset = 0x30000000;
                break;
        case ASIC_CALLIOPE:
-               phys_to_bus_offset = 0x10000000;
+               phys_to_dma_offset = 0x10000000;
                break;
        case ASIC_CRONUSLITE:
                /* Fall through */
@@ -545,10 +552,10 @@ void __init configure_platform(void)
                 * 0x2XXXXXXX. If 0x10000000 aliases into 0x60000000-
                 * 0x6XXXXXXX, the offset should be 0x50000000, not 0x10000000.
                 */
-               phys_to_bus_offset = 0x10000000;
+               phys_to_dma_offset = 0x10000000;
                break;
        default:
-               phys_to_bus_offset = 0x00000000;
+               phys_to_dma_offset = 0x00000000;
                break;
        }
 }
@@ -602,7 +609,7 @@ void __init platform_alloc_bootmem(void)
                int size = gp_resources[i].end - gp_resources[i].start + 1;
                if ((gp_resources[i].start != 0) &&
                        ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) {
-                       reserve_bootmem(bus_to_phys(gp_resources[i].start),
+                       reserve_bootmem(dma_to_phys(gp_resources[i].start),
                                size, 0);
                        total += gp_resources[i].end -
                                gp_resources[i].start + 1;
@@ -626,7 +633,7 @@ void __init platform_alloc_bootmem(void)
 
                        else {
                                gp_resources[i].start =
-                                       phys_to_bus(virt_to_phys(mem));
+                                       phys_to_dma(virt_to_phys(mem));
                                gp_resources[i].end =
                                        gp_resources[i].start + size - 1;
                                total += size;
@@ -690,7 +697,7 @@ static void __init pmem_setup_resource(void)
        if (resource && pmemaddr && pmemlen) {
                /* The address provided by bootloader is in kseg0. Convert to
                 * a bus address. */
-               resource->start = phys_to_bus(pmemaddr - 0x80000000);
+               resource->start = phys_to_dma(pmemaddr - 0x80000000);
                resource->end = resource->start + pmemlen - 1;
 
                pr_info("persistent memory: start=0x%x  end=0x%x\n",