]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mpc8360emds/mpc8360emds.c
FSL DDR: Convert MPC8560ADS to new DDR code.
[u-boot] / board / freescale / mpc8360emds / mpc8360emds.c
index c1691ae0606105bd05569633904400d02d070b4e..5c3b5dbc934d0f98aa7e704dd99d03d7db92ecea 100644 (file)
 #include <ioports.h>
 #include <mpc83xx.h>
 #include <i2c.h>
-#include <spd.h>
 #include <miiphy.h>
 #if defined(CONFIG_PCI)
 #include <pci.h>
 #endif
-#if defined(CONFIG_SPD_EEPROM)
 #include <spd_sdram.h>
-#else
 #include <asm/mmu.h>
-#endif
 #if defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
 #endif
@@ -102,11 +98,8 @@ int board_early_init_f(void)
        /* Enable flash write */
        bcsr[0xa] &= ~0x04;
 
-       /* Disable G1TXCLK, G2TXCLK h/w buffers (rev.2 h/w bug workaround) */
-       if (immr->sysconf.spridr == SPR_8360_REV20 ||
-           immr->sysconf.spridr == SPR_8360E_REV20 ||
-           immr->sysconf.spridr == SPR_8360_REV21 ||
-           immr->sysconf.spridr == SPR_8360E_REV21)
+       /* Disable G1TXCLK, G2TXCLK h/w buffers (rev.2.x h/w bug workaround) */
+       if (REVID_MAJOR(immr->sysconf.spridr) == 2)
                bcsr[0xe] = 0x30;
 
        /* Enable second UART */
@@ -129,7 +122,7 @@ extern void ddr_enable_ecc(unsigned int dram_size);
 int fixed_sdram(void);
 void sdram_init(void);
 
-long int initdram(int board_type)
+phys_size_t initdram(int board_type)
 {
        volatile immap_t *im = (immap_t *) CFG_IMMR;
        u32 msize = 0;
@@ -312,19 +305,19 @@ void ft_board_setup(void *blob, bd_t *bd)
         * if on mpc8360ea rev. 2.1,
         * change both ucc phy-connection-types from rgmii-id to rgmii-rxid
         */
-       if (immr->sysconf.spridr == SPR_8360_REV21 ||
-           immr->sysconf.spridr == SPR_8360E_REV21) {
+       if ((REVID_MAJOR(immr->sysconf.spridr) == 2) &&
+           (REVID_MINOR(immr->sysconf.spridr) == 1)) {
                int nodeoffset;
                const char *prop;
-               const char *path;
+               int path;
 
                nodeoffset = fdt_path_offset(blob, "/aliases");
                if (nodeoffset >= 0) {
 #if defined(CONFIG_HAS_ETH0)
                        /* fixup UCC 1 if using rgmii-id mode */
-                       path = fdt_getprop(blob, nodeoffset, "ethernet0", NULL);
-                       if (path) {
-                               path = fdt_path_offset(blob, path);
+                       prop = fdt_getprop(blob, nodeoffset, "ethernet0", NULL);
+                       if (prop) {
+                               path = fdt_path_offset(blob, prop);
                                prop = fdt_getprop(blob, path,
                                                   "phy-connection-type", 0);
                                if (prop && (strcmp(prop, "rgmii-id") == 0))
@@ -336,9 +329,9 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 #if defined(CONFIG_HAS_ETH1)
                        /* fixup UCC 2 if using rgmii-id mode */
-                       path = fdt_getprop(blob, nodeoffset, "ethernet1", NULL);
-                       if (path) {
-                               path = fdt_path_offset(blob, path);
+                       prop = fdt_getprop(blob, nodeoffset, "ethernet1", NULL);
+                       if (prop) {
+                               path = fdt_path_offset(blob, prop);
                                prop = fdt_getprop(blob, path,
                                                   "phy-connection-type", 0);
                                if (prop && (strcmp(prop, "rgmii-id") == 0))