]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/freescale/mpc8313erdb/sdram.c
Merge branch 'u-boot/master' into u-boot-arm/master
[karo-tx-uboot.git] / board / freescale / mpc8313erdb / sdram.c
index 0c4fd6854d46757e9eeb96997eee2d58b2aa4257..6282c3d920e5071d5d3c5108e3ea6a49627f8273 100644 (file)
@@ -5,23 +5,7 @@
  *          Wilson.Lo@freescale.com
  *          scottwood@freescale.com
  *
- * 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+
  */
 
 #include <common.h>
@@ -74,8 +58,14 @@ static long fixed_sdram(void)
         */
        __udelay(50000);
 
-       im->ddr.csbnds[0].csbnds = (msize - 1) >> 24;
-       im->ddr.cs_config[0] = CONFIG_SYS_DDR_CONFIG;
+#if ((CONFIG_SYS_DDR_SDRAM_BASE & 0x00FFFFFF) != 0)
+#warning Chip select bounds is only configurable in 16MB increments
+#endif
+       im->ddr.csbnds[0].csbnds =
+               ((CONFIG_SYS_DDR_SDRAM_BASE >> CSBNDS_SA_SHIFT) & CSBNDS_SA) |
+               (((CONFIG_SYS_DDR_SDRAM_BASE + msize - 1) >> CSBNDS_EA_SHIFT) &
+                       CSBNDS_EA);
+       im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG;
 
        /* Currently we use only one CS, so disable the other bank. */
        im->ddr.cs_config[1] = 0;
@@ -110,7 +100,7 @@ static long fixed_sdram(void)
 phys_size_t initdram(int board_type)
 {
        volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR;
-       volatile fsl_lbus_t *lbc = &im->lbus;
+       volatile fsl_lbc_t *lbc = &im->im_lbc;
        u32 msize;
 
        if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)