static int realq7_device_init(void) { if (!of_machine_is_compatible("dmo,imx6q-edmqmx6")) return 0; gpio_direction_output(IMX_GPIO_NR(2, 22), 1); gpio_direction_output(IMX_GPIO_NR(2, 21), 1); switch (bootsource_get()) { case BOOTSOURCE_MMC: switch (bootsource_get_instance()) { case 2: of_device_enable_path("/chosen/environment-sd"); break; case 3: of_device_enable_path("/chosen/environment-emmc"); break; } break; default: case BOOTSOURCE_SPI: of_device_enable_path("/chosen/environment-spi"); break; } return 0; }
static int physom_devices_init(void) { if (!of_machine_is_compatible("phytec,am335x-som")) return 0; switch (bootsource_get()) { case BOOTSOURCE_SPI: of_device_enable_path("/chosen/environment-spi"); break; case BOOTSOURCE_MMC: if (bootsource_get_instance() == 0) omap_set_bootmmc_devname("mmc0"); else omap_set_bootmmc_devname("mmc1"); break; default: of_device_enable_path("/chosen/environment-nand"); break; } omap_set_barebox_part(&physom_barebox_part); defaultenv_append_directory(defaultenv_physom_am335x); /* Special module set up */ if (of_machine_is_compatible("phytec,phycore-am335x-som")) { armlinux_set_architecture(MACH_TYPE_PCM051); barebox_set_hostname("pcm051"); } if (of_machine_is_compatible("phytec,phyflex-am335x-som")) { armlinux_set_architecture(MACH_TYPE_PFLA03); am33xx_select_rmii2_crs_dv(); barebox_set_hostname("pfla03"); } if (of_machine_is_compatible("phytec,phycard-am335x-som")) { armlinux_set_architecture(MACH_TYPE_PCAAXS1); barebox_set_hostname("pcaaxs1"); } /* Register update handler */ am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.xload"); am33xx_bbu_spi_nor_register_handler("spi", "/dev/m25p0.barebox"); am33xx_bbu_nand_xloadslots_register_handler("MLO.nand", xloadslots, ARRAY_SIZE(xloadslots)); am33xx_bbu_nand_slots_register_handler("nand", nandslots, ARRAY_SIZE(nandslots)); if (IS_ENABLED(CONFIG_SHELL_NONE)) return am33xx_of_register_bootdevice(); return 0; }
static int e9_devices_init(void) { int ret; char *environment_path; if (!of_machine_is_compatible("embedsky,e9")) return 0; armlinux_set_architecture(3980); environment_path = basprintf("/chosen/environment-mmc%d", bootsource_get_instance()); ret = of_device_enable_path(environment_path); if (ret < 0) pr_warn("Failed to enable environment partition '%s' (%d)\n", environment_path, ret); free(environment_path); defaultenv_append_directory(defaultenv_e9); imx6_bbu_internal_mmc_register_handler("sd", "/dev/mmc1", BBU_HANDLER_FLAG_DEFAULT); imx6_bbu_internal_mmc_register_handler("emmc", "/dev/mmc3", BBU_HANDLER_FLAG_DEFAULT); return 0; }
static int tqma53_devices_init(void) { char *of_env_path; unsigned bbu_flag_emmc = 0, bbu_flag_sd = 0; if (!of_machine_is_compatible("tq,tqma53")) return 0; barebox_set_hostname("tqma53"); if (bootsource_get() == BOOTSOURCE_MMC && bootsource_get_instance() == 1) { of_env_path = "/chosen/environment-sd"; bbu_flag_sd = BBU_HANDLER_FLAG_DEFAULT; } else { of_env_path = "/chosen/environment-emmc"; bbu_flag_emmc = BBU_HANDLER_FLAG_DEFAULT; } imx53_bbu_internal_mmc_register_handler("sd", "/dev/mmc1", bbu_flag_sd); imx53_bbu_internal_mmc_register_handler("emmc", "/dev/mmc2", bbu_flag_emmc); of_device_enable_path(of_env_path); armlinux_set_architecture(MACH_TYPE_TQMA53); return 0; }
static int efikamx_usb_init(void) { if (!of_machine_is_compatible("genesi,imx51-sb")) return 0; barebox_set_hostname("efikasb"); mc13xxx_register_init_callback(efikamx_power_init); gpio_direction_output(GPIO_BLUETOOTH, 0); gpio_direction_output(GPIO_WIFI_ENABLE, 1); gpio_direction_output(GPIO_WIFI_RESET, 0); gpio_direction_output(GPIO_SMSC3317_RESET, 0); gpio_direction_output(GPIO_HUB_RESET, 0); gpio_direction_output(GPIO_BACKLIGHT_POWER, 1); mdelay(10); gpio_set_value(GPIO_HUB_RESET, 1); gpio_set_value(GPIO_SMSC3317_RESET, 1); gpio_set_value(GPIO_BLUETOOTH, 1); gpio_set_value(GPIO_WIFI_RESET, 1); mxc_iomux_v3_setup_pad(MX51_PAD_USBH1_STP__GPIO1_27); gpio_set_value(IMX_GPIO_NR(1, 27), 1); mdelay(1); mxc_iomux_v3_setup_pad(MX51_PAD_USBH1_STP__USBH1_STP); if (machine_is_efikasb()) { mxc_iomux_v3_setup_pad(MX51_PAD_EIM_A26__GPIO2_20); gpio_set_value(IMX_GPIO_NR(2, 20), 1); mdelay(1); mxc_iomux_v3_setup_pad(MX51_PAD_EIM_A26__USBH2_STP); } switch (bootsource_get()) { case BOOTSOURCE_MMC: of_device_enable_path("/chosen/environment-sd"); break; case BOOTSOURCE_SPI: default: of_device_enable_path("/chosen/environment-spi"); break; } return 0; }
static int phytec_pcaaxl3_init(void) { if (!of_machine_is_compatible("phytec,imx6q-pcaaxl3")) return 0; switch (bootsource_get()) { case BOOTSOURCE_MMC: of_device_enable_path("/chosen/environment-sd"); break; default: case BOOTSOURCE_NAND: of_device_enable_path("/chosen/environment-nand"); break; } imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT); return 0; }
static int pcm051_devices_init(void) { if (!of_machine_is_compatible("phytec,pcm051")) return 0; switch (bootsource_get()) { case BOOTSOURCE_SPI: of_device_enable_path("/chosen/environment-spi"); break; case BOOTSOURCE_MMC: omap_set_bootmmc_devname("mmc0"); break; default: of_device_enable_path("/chosen/environment-nand"); break; } omap_set_barebox_part(&pcm051_barebox_part); armlinux_set_architecture(MACH_TYPE_PCM051); am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.xload"); return 0; }
static int tqma53_devices_init(void) { char *of_env_path = "/chosen/environment-emmc"; if (!of_machine_is_compatible("tq,tqma53")) return 0; barebox_set_model("TQ tqma53"); barebox_set_hostname("tqma53"); if (bootsource_get() == BOOTSOURCE_MMC && bootsource_get_instance() == 1) of_env_path = "/chosen/environment-sd"; of_device_enable_path(of_env_path); armlinux_set_architecture(MACH_TYPE_TQMA53); return 0; }
static int board_console_init(void) { if (!of_machine_is_compatible("afi,gf")) return 0; switch (bootsource_get()) { default: case BOOTSOURCE_SPI: of_device_enable_path("/chosen/environment-spi"); break; case BOOTSOURCE_MMC: omap_set_bootmmc_devname("mmc0"); break; } defaultenv_append_directory(defaultenv_gf); am33xx_register_ethaddr(0, 0); am33xx_register_ethaddr(1, 1); barebox_set_hostname("gf"); am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.mlo"); am33xx_bbu_spi_nor_register_handler("spi", "/dev/m25p0.boot"); return 0; }