command: Remove the cmd_tbl_t typedef
[oweals/u-boot.git] / board / gdsys / p1022 / controlcenterd.c
index f76d968962711a5612633b13a24b54d8ca826390..e960fa71acaa5dbc85b81b83aea346b8f46db24e 100644 (file)
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
+#include <image.h>
+#include <init.h>
+#include <net.h>
 #include <pci.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
@@ -32,7 +36,7 @@
 #include <fsl_ddr_sdram.h>
 #include <asm/fsl_serdes.h>
 #include <asm/io.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <fsl_mdio.h>
 #include <tsec.h>
@@ -44,8 +48,6 @@
 #include "../common/dp501.h"
 #include "controlcenterd-id.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
        HWVER_100 = 0,
        HWVER_110 = 1,
@@ -57,6 +59,8 @@ struct ihs_fpga {
        u32 versions;           /* 0x0004 */
        u32 fpga_version;       /* 0x0008 */
        u32 fpga_features;      /* 0x000c */
+       u32 reserved[4];        /* 0x0010 */
+       u32 control;            /* 0x0020 */
 };
 
 #ifndef CONFIG_TRAILBLAZER
@@ -219,9 +223,9 @@ void hw_watchdog_reset(void)
 }
 
 #ifdef CONFIG_TRAILBLAZER
-int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bootd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
-       return run_command(getenv("bootcmd"), flag);
+       return run_command(env_get("bootcmd"), flag);
 }
 
 int board_early_init_r(void)
@@ -326,23 +330,25 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
 
        ft_cpu_setup(blob, bd);
 
-       base = getenv_bootm_low();
-       size = getenv_bootm_size();
+       base = env_get_bootm_low();
+       size = env_get_bootm_size();
 
        fdt_fixup_memory(blob, (u64)base, (u64)size);
 
 #ifdef CONFIG_HAS_FSL_DR_USB
-       fdt_fixup_dr_usb(blob, bd);
+       fsl_fdt_fixup_dr_usb(blob, bd);
 #endif
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
@@ -382,6 +388,9 @@ static void hydra_initialize(void)
                fpga = pci_map_bar(devno, PCI_BASE_ADDRESS_0,
                        PCI_REGION_MEM);
 
+               /* disable sideband clocks */
+               writel(1, &fpga->control);
+
                versions = readl(&fpga->versions);
                fpga_version = readl(&fpga->fpga_version);
                fpga_features = readl(&fpga->fpga_features);