]> Git Repo - J-u-boot.git/blobdiff - board/gdsys/p1022/controlcenterd.c
command: Remove the cmd_tbl_t typedef
[J-u-boot.git] / board / gdsys / p1022 / controlcenterd.c
index 81c22bc94cd3b3ea11c3d93515d3ecdf474b409c..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>
 #include <asm/cache.h>
 #include <asm/immap_85xx.h>
 #include <asm/fsl_pci.h>
-#include <asm/fsl_ddr_sdram.h>
+#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,13 +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[])
 {
-       int rcode = 0;
-
-       if (run_command(getenv("bootcmd"), flag) < 0)
-               rcode = 1;
-       return rcode;
+       return run_command(env_get("bootcmd"), flag);
 }
 
 int board_early_init_r(void)
@@ -330,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
 
@@ -386,9 +388,12 @@ static void hydra_initialize(void)
                fpga = pci_map_bar(devno, PCI_BASE_ADDRESS_0,
                        PCI_REGION_MEM);
 
-               versions = readl(fpga->versions);
-               fpga_version = readl(fpga->fpga_version);
-               fpga_features = readl(fpga->fpga_features);
+               /* disable sideband clocks */
+               writel(1, &fpga->control);
+
+               versions = readl(&fpga->versions);
+               fpga_version = readl(&fpga->fpga_version);
+               fpga_features = readl(&fpga->fpga_features);
 
                hardware_version = versions & 0xf;
                feature_uart_channels = (fpga_features >> 6) & 0x1f;
This page took 0.026451 seconds and 4 git commands to generate.