Merge branch 'master' of git://git.denx.de/u-boot-video
[oweals/u-boot.git] / board / freescale / common / cadmus.c
index 5f86de5af22ff4129bf36898f65d25d7208b557e..dad684773bb18ecdd604038bb99ff1c95b363186 100644 (file)
@@ -1,23 +1,7 @@
 /*
- * Copyright 2004 Freescale Semiconductor.
+ * Copyright 2004, 2011 Freescale Semiconductor.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 
@@ -27,8 +11,8 @@
 /*
  * CADMUS Board System Registers
  */
-#ifndef CFG_CADMUS_BASE_REG
-#define CFG_CADMUS_BASE_REG    (CADMUS_BASE_ADDR + 0x4000)
+#ifndef CONFIG_SYS_CADMUS_BASE_REG
+#define CONFIG_SYS_CADMUS_BASE_REG     (CADMUS_BASE_ADDR + 0x4000)
 #endif
 
 typedef struct cadmus_reg {
@@ -47,7 +31,7 @@ typedef struct cadmus_reg {
 unsigned int
 get_board_version(void)
 {
-       volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CFG_CADMUS_BASE_REG;
+       volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CONFIG_SYS_CADMUS_BASE_REG;
 
        return cadmus->cm_ver;
 }
@@ -56,17 +40,17 @@ get_board_version(void)
 unsigned long
 get_clock_freq(void)
 {
-       volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CFG_CADMUS_BASE_REG;
+       volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CONFIG_SYS_CADMUS_BASE_REG;
 
        uint pci1_speed = (cadmus->cm_pci >> 2) & 0x3; /* PSPEED in [4:5] */
 
        if (pci1_speed == 0) {
-               return 33000000;
+               return 33333333;
        } else if (pci1_speed == 1) {
-               return 66000000;
+               return 66666666;
        } else {
                /* Really, unknown. Be safe? */
-               return 33000000;
+               return 33333333;
        }
 }
 
@@ -74,7 +58,7 @@ get_clock_freq(void)
 unsigned int
 get_pci_slot(void)
 {
-       volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CFG_CADMUS_BASE_REG;
+       volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CONFIG_SYS_CADMUS_BASE_REG;
 
        /*
         * PCI slot in USER bits CSR[6:7] by convention.
@@ -86,7 +70,7 @@ get_pci_slot(void)
 unsigned int
 get_pci_dual(void)
 {
-       volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CFG_CADMUS_BASE_REG;
+       volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CONFIG_SYS_CADMUS_BASE_REG;
 
        /*
         * PCI DUAL in CM_PCI[3]