ppc4xx: Fix misspelled CONFIG_440SPE/440EPX/GRX config options
[platform/kernel/u-boot.git] / board / tqm85xx / tqm85xx.c
index 13ea6f4..8fa0162 100644 (file)
  * MA 02111-1307 USA
  */
 
-
 #include <common.h>
 #include <pci.h>
 #include <asm/processor.h>
 #include <asm/immap_85xx.h>
 #include <ioports.h>
-#include <spd.h>
 #include <flash.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern flash_info_t flash_info[];      /* FLASH chips info */
 
 void local_bus_init (void);
-long int fixed_sdram (void);
 ulong flash_get_size (ulong base, int banknum);
 
+#ifdef CONFIG_PS2MULT
+void ps2mult_early_init(void);
+#endif
+
 #ifdef CONFIG_CPM2
 /*
  * I/O Port configuration table
@@ -257,9 +260,7 @@ int checkboard (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-       volatile immap_t    *immap = (immap_t *)CFG_IMMR;
-       volatile ccsr_lbc_t *memctl = &immap->im_lbc;
+       volatile ccsr_lbc_t *memctl = (void *)(CFG_MPC85xx_LBC_ADDR);
 
        /*
         * Adjust flash start and offset to detected values
@@ -296,7 +297,7 @@ int misc_init_r (void)
 
                /* Monitor protection ON by default */
                flash_protect (FLAG_PROTECT_SET,
-                              CFG_MONITOR_BASE, 0xffffffff,
+                              CFG_MONITOR_BASE, CFG_MONITOR_BASE + monitor_flash_len - 1,
                               &flash_info[CFG_MAX_FLASH_BANKS - 1]);
 
                /* Environment protection ON by default */
@@ -320,9 +321,8 @@ int misc_init_r (void)
  */
 void local_bus_init (void)
 {
-       volatile immap_t *immap = (immap_t *) CFG_IMMR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
-       volatile ccsr_lbc_t *lbc = &immap->im_lbc;
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
+       volatile ccsr_lbc_t *lbc = (void *)(CFG_MPC85xx_LBC_ADDR);
 
        uint clkdiv;
        uint lbc_hz;
@@ -404,8 +404,16 @@ static struct pci_controller hose = {
 void pci_init_board (void)
 {
 #ifdef CONFIG_PCI
-       extern void pci_mpc85xx_init (struct pci_controller *hose);
-
        pci_mpc85xx_init (&hose);
 #endif /* CONFIG_PCI */
 }
+
+#ifdef CONFIG_BOARD_EARLY_INIT_R
+int board_early_init_r (void)
+{
+#ifdef CONFIG_PS2MULT
+       ps2mult_early_init();
+#endif /* CONFIG_PS2MULT */
+       return (0);
+}
+#endif /* CONFIG_BOARD_EARLY_INIT_R */