]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/mips/cavium-octeon/executive/octeon-model.c
MIPS: Octeon: Remove unused L2C types and macros.
[karo-tx-linux.git] / arch / mips / cavium-octeon / executive / octeon-model.c
index d08a2bce653cf235cd280c3d499ddce5f64d0b48..341052387b49dbcd15833f0f802c8d71e7e22a00 100644 (file)
@@ -4,7 +4,7 @@
  * Contact: support@caviumnetworks.com
  * This file is part of the OCTEON SDK
  *
- * Copyright (c) 2003-2010 Cavium Networks
+ * Copyright (c) 2003-2017 Cavium, Inc.
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, Version 2, as
@@ -63,16 +63,15 @@ static const char *__init octeon_model_get_string_buffer(uint32_t chip_id,
        char pass[4];
        int clock_mhz;
        const char *suffix;
-       union cvmx_l2d_fus3 fus3;
        int num_cores;
        union cvmx_mio_fus_dat2 fus_dat2;
        union cvmx_mio_fus_dat3 fus_dat3;
        char fuse_model[10];
        uint32_t fuse_data = 0;
+       uint64_t l2d_fus3 = 0;
 
-       fus3.u64 = 0;
        if (OCTEON_IS_MODEL(OCTEON_CN3XXX) || OCTEON_IS_MODEL(OCTEON_CN5XXX))
-               fus3.u64 = cvmx_read_csr(CVMX_L2D_FUS3);
+               l2d_fus3 = (cvmx_read_csr(CVMX_L2D_FUS3) >> 34) & 0x3;
        fus_dat2.u64 = cvmx_read_csr(CVMX_MIO_FUS_DAT2);
        fus_dat3.u64 = cvmx_read_csr(CVMX_MIO_FUS_DAT3);
        num_cores = cvmx_octeon_num_cores();
@@ -192,7 +191,7 @@ static const char *__init octeon_model_get_string_buffer(uint32_t chip_id,
        /* Now figure out the family, the first two digits */
        switch ((chip_id >> 8) & 0xff) {
        case 0:         /* CN38XX, CN37XX or CN36XX */
-               if (fus3.cn38xx.crip_512k) {
+               if (l2d_fus3) {
                        /*
                         * For some unknown reason, the 16 core one is
                         * called 37 instead of 36.
@@ -223,7 +222,7 @@ static const char *__init octeon_model_get_string_buffer(uint32_t chip_id,
                }
                break;
        case 1:         /* CN31XX or CN3020 */
-               if ((chip_id & 0x10) || fus3.cn31xx.crip_128k)
+               if ((chip_id & 0x10) || l2d_fus3)
                        family = "30";
                else
                        family = "31";
@@ -246,7 +245,7 @@ static const char *__init octeon_model_get_string_buffer(uint32_t chip_id,
        case 2:         /* CN3010 or CN3005 */
                family = "30";
                /* A chip with half cache is an 05 */
-               if (fus3.cn30xx.crip_64k)
+               if (l2d_fus3)
                        core_model = "05";
                /*
                 * This series of chips didn't follow the standard
@@ -267,7 +266,7 @@ static const char *__init octeon_model_get_string_buffer(uint32_t chip_id,
        case 3:         /* CN58XX */
                family = "58";
                /* Special case. 4 core, half cache (CP with half cache) */
-               if ((num_cores == 4) && fus3.cn58xx.crip_1024k && !strncmp(suffix, "CP", 2))
+               if ((num_cores == 4) && l2d_fus3 && !strncmp(suffix, "CP", 2))
                        core_model = "29";
 
                /* Pass 1 uses different encodings for pass numbers */
@@ -290,7 +289,7 @@ static const char *__init octeon_model_get_string_buffer(uint32_t chip_id,
                break;
        case 4:         /* CN57XX, CN56XX, CN55XX, CN54XX */
                if (fus_dat2.cn56xx.raid_en) {
-                       if (fus3.cn56xx.crip_1024k)
+                       if (l2d_fus3)
                                family = "55";
                        else
                                family = "57";
@@ -309,7 +308,7 @@ static const char *__init octeon_model_get_string_buffer(uint32_t chip_id,
                                if (fus_dat3.cn56xx.bar2_en)
                                        suffix = "NSPB2";
                        }
-                       if (fus3.cn56xx.crip_1024k)
+                       if (l2d_fus3)
                                family = "54";
                        else
                                family = "56";
@@ -319,7 +318,7 @@ static const char *__init octeon_model_get_string_buffer(uint32_t chip_id,
                family = "50";
                break;
        case 7:         /* CN52XX */
-               if (fus3.cn52xx.crip_256k)
+               if (l2d_fus3)
                        family = "51";
                else
                        family = "52";