]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Add support for CPM device tree configuration to 8560 ADS
authorAndy Fleming <afleming@freescale.com>
Tue, 8 May 2007 22:27:43 +0000 (17:27 -0500)
committerAndrew Fleming-AFLEMING <afleming@freescale.com>
Wed, 11 Jul 2007 23:17:58 +0000 (18:17 -0500)
* Adds code to modify CPM frequencies
* Cleans up the config file to #define TSEC and (for now) #undef FCC
* Adds the MII command for all 8560 ADS configurations
* Updates config file to provide convenience commands for booting
  with a device tree

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
board/mpc8560ads/mpc8560ads.c
include/configs/MPC8560ADS.h

index d19bad683533ffa822af5db2b9169c646f0993f8..41acb97af7eafd50f8fe4b6b35b3d5149bbb35cb 100644 (file)
@@ -549,9 +549,35 @@ pci_init_board(void)
 
 
 #if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+void
+ft_soc_setup(void *blob, bd_t *bd)
+{
+       u32 *p;
+       int len;
+       ulong data;
+
+       p = ft_get_prop(blob, "/" OF_SOC "/cpm@e0000000/brg-frequency", &len);
+
+       if (p != NULL)
+               *p = cpu_to_be32(bd->bi_brgfreq);
+
+       p = ft_get_prop(blob,
+                       "/" OF_SOC "/cpm@e0000000/scc@91a00/current-speed",
+                       &len);
+       if (p != NULL)
+               *p = cpu_to_be32(bd->bi_baudrate);
+
+       p = ft_get_prop(blob,
+                       "/" OF_SOC "/cpm@e0000000/scc@91a20/current-speed",
+                       &len);
+       if (p != NULL)
+               *p = cpu_to_be32(bd->bi_baudrate);
+}
+
 void
 ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+       ft_soc_setup(blob, bd);
 }
 #endif
index 043397fc21b7b5327fabe071b3f53e7ea49517b5..90fef8bc3862cc2515a141563f03ae37ae366ec9 100644 (file)
@@ -43,9 +43,7 @@
 
 #define CONFIG_PCI
 #define CONFIG_TSEC_ENET               /* tsec ethernet support */
-#undef CONFIG_TSEC_ENET                /* tsec ethernet support */
-#undef  CONFIG_ETHER_ON_FCC             /* cpm FCC ethernet support */
-#define  CONFIG_ETHER_ON_FCC             /* cpm FCC ethernet support */
+#undef CONFIG_ETHER_ON_FCC             /* cpm FCC ethernet support */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SPD_EEPROM              /* Use SPD EEPROM for DDR setup*/
 #define CONFIG_DDR_DLL                 /* possible DLL fix needed */
 #endif /* CONFIG_PCI */
 
 
-#if defined(CONFIG_TSEC_ENET)
+#ifdef CONFIG_TSEC_ENET
 
 #ifndef CONFIG_NET_MULTI
 #define CONFIG_NET_MULTI       1
 #endif
 
+#ifndef CONFIG_MII
 #define CONFIG_MII             1       /* MII PHY management */
+#endif
 #define CONFIG_TSEC1   1
 #define CONFIG_TSEC1_NAME      "TSEC0"
 #define CONFIG_TSEC2   1
 /* Options are: TSEC[0-1] */
 #define CONFIG_ETHPRIME                "TSEC0"
 
-#elif defined(CONFIG_ETHER_ON_FCC)     /* CPM FCC Ethernet */
+#endif /* CONFIG_TSEC_ENET */
+
+#ifdef CONFIG_ETHER_ON_FCC     /* CPM FCC Ethernet */
 
-#define CONFIG_ETHER_ON_FCC    /* define if ether on FCC   */
 #undef  CONFIG_ETHER_NONE      /* define if ether on something else */
 #define CONFIG_ETHER_INDEX      2       /* which channel for ether */
 
   #define FETH3_RST            0x80
 #endif                                 /* CONFIG_ETHER_INDEX */
 
-#define CONFIG_MII                     /* MII PHY management */
+#ifndef CONFIG_MII
+#define CONFIG_MII             1       /* MII PHY management */
+#endif
+
 #define CONFIG_BITBANGMII              /* bit-bang MII PHY management */
 
 /*
     #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
                                | CFG_CMD_PCI           \
                                | CFG_CMD_PING          \
+                               | CFG_CMD_MII           \
                                | CFG_CMD_I2C)
   #elif defined(CONFIG_TSEC_ENET)
     #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
                                | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
+                               | CFG_CMD_I2C           \
+                               | CFG_CMD_MII)
   #elif defined(CONFIG_ETHER_ON_FCC)
     #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
                                | CFG_CMD_MII           \
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
    "netdev=eth0\0"                                                      \
    "consoledev=ttyS0\0"                                                 \
-   "ramdiskaddr=400000\0"                                              \
-   "ramdiskfile=your.ramdisk.u-boot\0"
+   "ramdiskaddr=600000\0"                                              \
+   "ramdiskfile=your.ramdisk.u-boot\0"                                 \
+   "fdtaddr=400000\0"                                                  \
+   "fdtfile=mpc8560ads.dtb\0"
 
 #define CONFIG_NFSBOOTCOMMAND                                          \
    "setenv bootargs root=/dev/nfs rw "                                  \
       "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
       "console=$consoledev,$baudrate $othbootargs;"                     \
    "tftp $loadaddr $bootfile;"                                          \
-   "bootm $loadaddr"
+   "tftp $fdtaddr $fdtfile;"                                           \
+   "bootm $loadaddr - $fdtaddr"
 
 #define CONFIG_RAMBOOTCOMMAND \
    "setenv bootargs root=/dev/ram rw "                                  \