summaryrefslogtreecommitdiff
path: root/board/scalys/simc-t10xx/simc-t10xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/scalys/simc-t10xx/simc-t10xx.c')
-rw-r--r--board/scalys/simc-t10xx/simc-t10xx.c147
1 files changed, 147 insertions, 0 deletions
diff --git a/board/scalys/simc-t10xx/simc-t10xx.c b/board/scalys/simc-t10xx/simc-t10xx.c
new file mode 100644
index 0000000..f5b8a2c
--- /dev/null
+++ b/board/scalys/simc-t10xx/simc-t10xx.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2016 Scalys B.V.
+ * opensource@scalys.com
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <command.h>
+#include <netdev.h>
+#include <linux/compiler.h>
+#include <asm/mmu.h>
+#include <asm/processor.h>
+#include <asm/cache.h>
+#include <asm/immap_85xx.h>
+#include <asm/fsl_law.h>
+#include <asm/fsl_serdes.h>
+#include <asm/fsl_portals.h>
+#include <asm/fsl_liodn.h>
+#include <asm/fsl_pci.h>
+#include <fm_eth.h>
+#include <asm/processor.h>
+#include <asm/gpio.h>
+#include <asm/mpc8xxx_gpio.h>
+#include <dm/platform_data/gpio_mpc8xxx.h>
+#include <fsl_esdhc.h>
+#include <dm.h>
+#include "dragonfruit.h"
+#include <board_configuration_data.h>
+
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int checkboard(void)
+{
+ printf("Board: simc-t10xx\n" );
+ return 0;
+}
+
+int misc_init_r(void)
+{
+ const void* bcd_dtc_blob;
+ int serdes_config;
+ ccsr_gur_t __iomem *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+ int ret;
+ /*
+ * Initialize and set the LED's on the module to indicate u-boot is alive
+ * IFC_A30 : led green : GPIO2_30
+ * IFC_A31 : led red : GPIO2_31
+ */
+ #define MODULE_LED_RED MPC8XXX_GPIO_NR(2, 31)
+ #define MODULE_LED_GREEN MPC8XXX_GPIO_NR(2, 30)
+ gpio_request(MODULE_LED_RED, "module_led_red");
+ gpio_request(MODULE_LED_GREEN, "module_led_green");
+
+ gpio_direction_output(MODULE_LED_RED, 0);
+ gpio_direction_output(MODULE_LED_GREEN, 1);
+
+ /* SERDES configuration is determined boot time through the RCW config.
+ * It is located in the fourth RCW word (bit 128-135 of the RCW). */
+ serdes_config = ( in_be32(&gur->rcwsr[4]) >> 24);
+ scalys_carrier_setup_muxing(serdes_config);
+
+ bcd_dtc_blob = get_boardinfo_eeprom();
+ if (bcd_dtc_blob != NULL) {
+ /* Board Configuration Data is intact, ready for parsing */
+ ret = add_mac_addressess_to_env(bcd_dtc_blob);
+ if (ret != 0) {
+ printf("Error adding BCD data to environement\n");
+ }
+ }
+
+ return 0;
+}
+
+/* Platform data for the GPIOs */
+static const struct mpc8xxx_gpio_platdata gpio_platdata[] = {
+ { .regs = (ccsr_gpio_t*) CONFIG_SYS_MPC8XXX_GPIO1_ADDR,
+ .bank_name = "GPIO1_" },
+ { .regs = (ccsr_gpio_t*) CONFIG_SYS_MPC8XXX_GPIO2_ADDR,
+ .bank_name = "GPIO2_" },
+ { .regs = (ccsr_gpio_t*) CONFIG_SYS_MPC8XXX_GPIO3_ADDR,
+ .bank_name = "GPIO3_" },
+ { .regs = (ccsr_gpio_t*) CONFIG_SYS_MPC8XXX_GPIO4_ADDR,
+ .bank_name = "GPIO4_" },
+};
+
+U_BOOT_DEVICES(mpc8xxx_gpios) = {
+ { "gpio-mpc8xxx", &gpio_platdata[0] },
+ { "gpio-mpc8xxx", &gpio_platdata[1] },
+ { "gpio-mpc8xxx", &gpio_platdata[2] },
+ { "gpio-mpc8xxx", &gpio_platdata[3] },
+};
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ phys_addr_t base;
+ phys_size_t size;
+
+ debug( "ft_board_setup\n" );
+ ft_cpu_setup(blob, bd);
+
+ base = getenv_bootm_low();
+ size = getenv_bootm_size();
+
+ debug( "fdt_fixup_memory\n" );
+ fdt_fixup_memory(blob, (u64)base, (u64)size);
+
+#ifdef CONFIG_PCI
+ debug( "pci_of_setup\n" );
+ FT_FSL_PCI_SETUP;
+#endif
+ debug( "fdt_fixup_liodn\n" );
+ fdt_fixup_liodn(blob);
+
+#ifdef CONFIG_HAS_FSL_DR_USB
+ debug( "fdt_fixup_dr_usb\n" );
+ fdt_fixup_dr_usb(blob, bd);
+#endif
+
+#ifdef CONFIG_SYS_DPAA_FMAN
+ debug( "fdt_fixup_fman_ethernet\n" );
+ fdt_fixup_fman_ethernet(blob);
+#endif
+
+ return 0;
+}
+
+int board_mmc_init(bd_t *bis)
+{
+ struct fsl_esdhc_cfg *cfg;
+
+ cfg = calloc(sizeof(struct fsl_esdhc_cfg), 1);
+ cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;
+ cfg->sdhc_clk = gd->arch.sdhc_clk;
+ cfg->max_bus_width = 4;
+ return fsl_esdhc_initialize(bis, cfg);
+
+ return 0;
+}
+
+#if 0
+void board_detail(void)
+{
+ do_bcdinfo();
+}
+#endif \ No newline at end of file