static int cupid_devices_init(void) { uint32_t reg; gpio_direction_output(GPIO_LCD_ENABLE, 0); gpio_direction_output(GPIO_LCD_BACKLIGHT, 0); reg = readl(IMX_CCM_BASE + CCM_RCSR); /* some fuses provide us vital information about connected hardware */ if (reg & 0x20000000) nand_info.width = 2; /* 16 bit */ else nand_info.width = 1; /* 8 bit */ imx35_add_fec(&fec_info); imx35_add_nand(&nand_info); devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x80000, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); imx35_add_fb(&ipu_fb_data); imx35_add_mmc0(NULL); armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_GUF_CUPID); return 0; }
static int pcm049_devices_init(void) { i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); add_generic_device("i2c-omap", -1, NULL, 0x48070000, 0x1000, IORESOURCE_MEM, NULL); add_generic_device("omap-hsmmc", -1, NULL, 0x4809C100, SZ_4K, IORESOURCE_MEM, NULL); gpmc_generic_init(0x10); pcm049_network_init(); gpmc_generic_nand_devices_init(0, 8, OMAP_ECC_BCH8_CODE_HW); #ifdef CONFIG_PARTITION devfs_add_partition("nand0", 0x00000, SZ_128K, PARTITION_FIXED, "xload_raw"); dev_add_bb_dev("xload_raw", "xload"); devfs_add_partition("nand0", SZ_128K, SZ_256K, PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_128K + SZ_256K, SZ_128K, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_PCM049); return 0; }
static int nhk8815_devices_init(void) { writel(0xC37800F0, NOMADIK_GPIO1_BASE + 0x20); writel(0x00000000, NOMADIK_GPIO1_BASE + 0x24); writel(0x00000000, NOMADIK_GPIO1_BASE + 0x28); writel(readl(NOMADIK_SRC_BASE) | 0x8000, NOMADIK_SRC_BASE); /* Set up SMCS1 for Ethernet: sram-like, enabled, timing values */ writel(0x0000305b, FSMC_BCR(1)); writel(0x00033f33, FSMC_BTR(1)); add_generic_device("smc91c111", DEVICE_ID_DYNAMIC, NULL, 0x34000300, 16, IORESOURCE_MEM, NULL); platform_device_register(&nhk8815_nand_device); armlinux_set_architecture(MACH_TYPE_NOMADIK); armlinux_set_bootparams((void *)(0x00000100)); devfs_add_partition("nand0", 0x0000000, 0x040000, DEVFS_PARTITION_FIXED, "xloader_raw"); devfs_add_partition("nand0", 0x0040000, 0x080000, DEVFS_PARTITION_FIXED, "meminit_raw"); devfs_add_partition("nand0", 0x0080000, 0x200000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x7FE0000, 0x020000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); return 0; }
static int at91sam9n12ek_devices_init(void) { ek_add_device_spi(); ek_add_device_nand(); ek_add_device_mci(); ek_add_led(); at91_add_device_udc(&ek_udc_data); ek_add_device_i2c(); ek_add_device_ks8851(); ek_add_device_buttons(); ek_add_device_lcdc(); armlinux_set_architecture(CONFIG_MACH_AT91SAM9N12EK); devfs_add_partition("nand0", 0x00000, SZ_256K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw"); dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); devfs_add_partition("nand0", SZ_256K, SZ_256K + SZ_128K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_512K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); devfs_add_partition("nand0", SZ_512K + SZ_256K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); return 0; }
static int tx25_devices_init(void) { gpio_fec_active(); imx25_iim_register_fec_ethaddr(); imx25_add_fec(&fec_info); if (readl(MX25_CCM_BASE_ADDR + MX25_CCM_RCSR) & (1 << 14)) nand_info.width = 2; imx25_add_nand(&nand_info); devfs_add_partition("nand0", 0x00000, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_512K, SZ_512K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); add_mem_device("sram0", 0x78000000, 128 * 1024, IORESOURCE_MEM_WRITEABLE); armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_TX25); armlinux_set_serial(imx_uid()); return 0; }
static int pcm049_devices_init(void) { i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); omap44xx_add_i2c1(NULL); omap44xx_add_mmc1(NULL); gpmc_generic_init(0x10); pcm049_network_init(); omap_add_gpmc_nand_device(&nand_plat); #ifdef CONFIG_PARTITION devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "xload_raw"); dev_add_bb_dev("xload_raw", "xload"); devfs_add_partition("nand0", SZ_128K, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_128K + SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_PCM049); return 0; }
static int usb_a9260_devices_init(void) { usb_a9260_add_device_nand(); usb_a9260_add_device_mci(); usb_a9260_add_device_eth(); usb_a9260_add_spi(); usb_a9260_add_device_usb(); ek_add_device_udc(); ek_add_led(); ek_add_device_button(); usb_a9260_device_dab_mmx(); usb_a9260_set_board_type(); devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw"); dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); return 0; }
static int at91sam9x5ek_devices_init(void) { ek_add_device_w1(); ek_add_device_nand(); ek_add_device_eth(); ek_add_device_spi(); ek_add_device_mci(); ek_add_device_usb(); ek_add_led(); ek_add_device_i2c(); ek_add_device_lcdc(); armlinux_set_architecture(CONFIG_MACH_AT91SAM9X5EK); devfs_add_partition("nand0", 0x00000, SZ_256K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw"); dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); devfs_add_partition("nand0", SZ_256K, SZ_256K + SZ_128K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_512K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); devfs_add_partition("nand0", SZ_512K + SZ_256K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC)) defaultenv_append_directory(defaultenv_at91sam9x5ek); return 0; }
static int at91sam9261ek_devices_init(void) { ek_add_device_nand(); ek_add_device_dm9000(); ek_add_device_udc(); ek_add_device_buttons(); ek_device_add_leds(); devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw"); devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100)); if (machine_is_at91sam9g10ek()) armlinux_set_architecture(MACH_TYPE_AT91SAM9G10EK); else armlinux_set_architecture(MACH_TYPE_AT91SAM9261EK); return 0; }
static int imx25_3ds_devices_init(void) { #ifdef CONFIG_USB /* USB does not work yet. Don't know why. Maybe * the CPLD has to be initialized. */ imx25_usb_init(); add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, MX25_USB_OTG_BASE_ADDR + 0x400, NULL); #endif imx25_iim_register_fec_ethaddr(); imx25_add_fec(&fec_info); add_mem_device("sram0", 0x78000000, 128 * 1024, IORESOURCE_MEM_WRITEABLE); if (readl(MX25_CCM_BASE_ADDR + MX25_CCM_RCSR) & (1 << 14)) nand_info.width = 2; imx25_add_nand(&nand_info); devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); imx25_add_i2c0(NULL); armlinux_set_architecture(MACH_TYPE_MX25_3DS); armlinux_set_serial(imx_uid()); return 0; }
static int at91sam9m10g45ek_devices_init(void) { ek_add_device_nand(); ek_add_device_spi(); at91_add_device_eth(0, &macb_pdata); ek_add_device_mci(); ek_add_device_usb(); ek_device_add_leds(); ek_device_add_keyboard(); ek_add_device_lcdc(); devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw"); dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); armlinux_set_bootparams((void *)(AT91_CHIPSELECT_6 + 0x100)); armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK); ek_set_board_revision(); return 0; }
static int vincell_devices_init(void) { writel(0, MX53_M4IF_BASE_ADDR + 0xc); console_flush(); imx53_init_lowlevel(1000); clk_set_rate(clk_lookup("nfc_podf"), 66666667); imx53_add_nand(&nand_info); imx51_iim_register_fec_ethaddr(); imx53_add_fec(&fec_info); imx53_add_mmc0(NULL); i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); imx53_add_i2c0(NULL); vincell_fec_reset(); armlinux_set_bootparams((void *)0x70000100); armlinux_set_architecture(3297); devfs_add_partition("nand0", SZ_1M, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_1M + SZ_512K, SZ_512K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); imx53_bbu_internal_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT, dcd_entry, sizeof(dcd_entry), 3 * SZ_128K, 0xf8020000); return 0; }
static int at91sam9m10ihd_devices_init(void) { ek_add_device_w1(); ek_add_device_nand(); ek_add_device_eth(); ek_add_device_mci(); ek_add_device_spi(); ek_add_device_i2c(); ek_add_device_usb(); ek_add_device_lcd(); devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw"); dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); /* * The internal Atmel kernel use the SAM9M10G45EK machine id * The mainline use DT */ armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK); return 0; }
static int nhk8815_devices_init(void) { st8815_add_device_sdram(64 * 1024 *1024); writel(0xC37800F0, NOMADIK_GPIO1_BASE + 0x20); writel(0x00000000, NOMADIK_GPIO1_BASE + 0x24); writel(0x00000000, NOMADIK_GPIO1_BASE + 0x28); writel(readl(NOMADIK_SRC_BASE) | 0x8000, NOMADIK_SRC_BASE); /* Set up SMCS1 for Ethernet: sram-like, enabled, timing values */ writel(0x0000305b, FSMC_BCR(1)); writel(0x00033f33, FSMC_BTR(1)); register_device(&nhk8815_network_dev); register_device(&nhk8815_nand_device); armlinux_set_architecture(MACH_TYPE_NOMADIK); armlinux_set_bootparams((void *)(0x00000100)); devfs_add_partition("nand0", 0x0000000, 0x040000, PARTITION_FIXED, "xloader_raw"); devfs_add_partition("nand0", 0x0040000, 0x080000, PARTITION_FIXED, "meminit_raw"); devfs_add_partition("nand0", 0x0080000, 0x200000, PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x7FE0000, 0x020000, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); return 0; }
static int eukrea_cpuimx25_devices_init(void) { eukrea_cpuimx25_mmu_init(); mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx25_pads, ARRAY_SIZE(eukrea_cpuimx25_pads)); register_device(&fec_dev); nand_info.width = 1; register_device(&nand_dev); devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); register_device(&sdram0_dev); /* enable LCD */ gpio_direction_output(26, 1); gpio_set_value(26, 1); register_device(&imxfb_dev); armlinux_add_dram(&sdram0_dev); armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX25); return 0; }
static int at91sam9260ek_devices_init(void) { ek_add_device_nand(); at91sam9260ek_phy_reset(); at91_add_device_eth(0, &macb_pdata); at91_add_device_usbh_ohci(&ek_usbh_data); at91_add_device_udc(&ek_udc_data); ek_usb_add_device_mci(); ek_add_device_buttons(); ek_add_led(); armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100)); ek_set_board_type(); devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw"); dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); return 0; }
static int tny_a9260_devices_init(void) { tny_a9260_add_device_nand(); ek_add_device_macb(); ek_add_device_udc(); armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100)); tny_a9260_set_board_type(); if (machine_is_tny_a9260() || machine_is_tny_a9g20()) { spi_register_board_info(tny_a9g20_spi_devices, ARRAY_SIZE(tny_a9g20_spi_devices)); at91_add_device_spi(0, &spi_pdata); } devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw"); dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); return 0; }
static int pcm049_devices_init(void) { i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); omap44xx_add_i2c1(NULL); omap44xx_add_mmc1(NULL); gpmc_generic_init(0x10); if (IS_ENABLED(CONFIG_DRIVER_NET_SMC911X)) pcm049_network_init(); omap_add_gpmc_nand_device(&nand_plat); #ifdef CONFIG_PARTITION devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "xload_raw"); dev_add_bb_dev("xload_raw", "xload"); devfs_add_partition("nand0", SZ_128K, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_128K + SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif armlinux_set_architecture(MACH_TYPE_PCM049); if (IS_ENABLED(CONFIG_DRIVER_VIDEO_OMAP)) omap_add_display(&pcm049_fb_data); return 0; }
static int pcm043_devices_init(void) { uint32_t reg; char *envstr; unsigned long bbu_nand_flags = 0; /* CS0: Nor Flash */ imx35_setup_weimcs(5, 0x22C0CF00, 0x75000D01, 0x00000900); led_gpio_register(&led0); reg = readl(MX35_CCM_BASE_ADDR + MX35_CCM_RCSR); /* some fuses provide us vital information about connected hardware */ if (reg & 0x20000000) nand_info.width = 2; /* 16 bit */ else nand_info.width = 1; /* 8 bit */ imx35_add_fec(&fec_info); /* * This platform supports NOR and NAND */ imx35_add_nand(&nand_info); /* * Up to 32MiB NOR type flash, connected to * CS line 0, data width is 16 bit */ add_cfi_flash_device(DEVICE_ID_DYNAMIC, MX35_CS0_BASE_ADDR, 32 * 1024 * 1024, 0); switch (bootsource_get()) { case BOOTSOURCE_NAND: devfs_add_partition("nand0", 0x00000, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_512K, SZ_256K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); envstr = "NAND"; bbu_nand_flags = BBU_HANDLER_FLAG_DEFAULT; break; case BOOTSOURCE_NOR: default: devfs_add_partition("nor0", 0x00000, SZ_512K, DEVFS_PARTITION_FIXED, "self0"); /* ourself */ devfs_add_partition("nor0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env0"); /* environment */ protect_file("/dev/env0", 1); envstr = "NOR"; break; } pr_info("using environment from %s flash\n", envstr); imx35_add_fb(&ipu_fb_data); armlinux_set_architecture(MACH_TYPE_PCM043); imx_bbu_external_nand_register_handler("nand", "/dev/nand0.barebox", bbu_nand_flags); return 0; }
static int tx51_part_init(void) { devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x80000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); return 0; }
static int f3s_devices_init(void) { uint32_t reg; /* CS0: Nor Flash */ imx35_setup_weimcs(0, 0x0000cf03, 0x10000d03, 0x00720900); reg = readl(MX35_CCM_BASE_ADDR + MX35_CCM_RCSR); /* some fuses provide us vital information about connected hardware */ if (reg & 0x20000000) nand_info.width = 2; /* 16 bit */ else nand_info.width = 1; /* 8 bit */ /* * This platform supports NOR and NAND */ imx35_add_nand(&nand_info); add_cfi_flash_device(DEVICE_ID_DYNAMIC, MX35_CS0_BASE_ADDR, 64 * 1024 * 1024, 0); switch ((reg >> 25) & 0x3) { case 0x01: /* NAND is the source */ devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x80000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); break; case 0x00: /* NOR is the source */ devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self0"); devfs_add_partition("nor0", 0x40000, 0x80000, DEVFS_PARTITION_FIXED, "env0"); protect_file("/dev/env0", 1); break; } set_silicon_rev(imx_silicon_revision()); i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); imx35_add_i2c0(NULL); imx35_add_fec(&fec_info); add_generic_device("smc911x", DEVICE_ID_DYNAMIC, NULL, MX35_CS5_BASE_ADDR, MX35_CS5_SIZE, IORESOURCE_MEM, NULL); imx35_add_mmc0(NULL); imx35_add_fb(&ipu_fb_data); armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_MX35_3DS); return 0; }
static int eukrea_cpuimx25_devices_init(void) { mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx25_pads, ARRAY_SIZE(eukrea_cpuimx25_pads)); led_gpio_register(&led0); imx25_iim_register_fec_ethaddr(); imx25_add_fec(&fec_info); nand_info.width = 1; imx25_add_nand(&nand_info); devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); /* enable LCD */ gpio_direction_output(26, 1); gpio_set_value(26, 1); /* LED : default OFF */ gpio_direction_output(2 * 32 + 19, 1); /* Switch : input */ gpio_direction_input(2 * 32 + 18); imx25_add_fb(&eukrea_cpuimx25_fb_data); imx25_add_i2c0(NULL); imx25_add_mmc0(NULL); #ifdef CONFIG_USB imx25_usb_init(); add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, MX25_USB_OTG_BASE_ADDR + 0x400, NULL); #endif #ifdef CONFIG_USB_GADGET /* Workaround ENGcm09152 */ writel(readl(MX25_USB_OTG_BASE_ADDR + 0x608) | (1 << 23), MX25_USB_OTG_BASE_ADDR + 0x608); add_generic_device("fsl-udc", DEVICE_ID_DYNAMIC, NULL, MX25_USB_OTG_BASE_ADDR, 0x200, IORESOURCE_MEM, &usb_pdata); #endif armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX25SD); return 0; }
static int tx53_devices_init(void) { const char *envdev; uint32_t flag_nand = 0; uint32_t flag_mmc = 0; if (!of_machine_is_compatible("karo,tx53")) return 0; barebox_set_model("Ka-Ro TX53"); barebox_set_hostname("tx53"); switch (bootsource_get()) { case BOOTSOURCE_MMC: devfs_add_partition("mmc0", 0x00000, SZ_512K, DEVFS_PARTITION_FIXED, "self0"); devfs_add_partition("mmc0", SZ_512K, SZ_1M, DEVFS_PARTITION_FIXED, "env0"); envdev = "MMC"; flag_mmc |= BBU_HANDLER_FLAG_DEFAULT; break; case BOOTSOURCE_NAND: default: devfs_add_partition("nand0", 0x00000, 0x80000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x80000, 0x100000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); envdev = "NAND"; flag_nand |= BBU_HANDLER_FLAG_DEFAULT; break; } armlinux_set_architecture(MACH_TYPE_TX53); /* rev xx30 can boot from nand or USB */ imx53_bbu_internal_nand_register_handler("nand-xx30", flag_nand, SZ_512K); /* rev 1011 can boot from MMC/SD, other bootsource currently unknown */ imx53_bbu_internal_mmc_register_handler("mmc-1011", "/dev/mmc0", flag_mmc); if (of_machine_is_compatible("karo,tx53-1011")) imx53_init_lowlevel(1000); printf("Using environment in %s\n", envdev); return 0; }
static int eukrea_cpuimx35_devices_init(void) { #ifdef CONFIG_USB_GADGET unsigned int tmp; #endif mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads, ARRAY_SIZE(eukrea_cpuimx35_pads)); imx35_add_nand(&nand_info); devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); imx35_add_fec(&fec_info); imx35_add_fb(&ipu_fb_data); imx35_add_i2c0(NULL); imx35_add_mmc0(NULL); /* led default off */ gpio_direction_output(32 * 2 + 29, 1); /* Switch : input */ gpio_direction_input(32 * 2 + 25); /* screen default on to prevent flicker */ gpio_direction_output(4, 0); /* backlight default off */ gpio_direction_output(1, 0); #ifdef CONFIG_USB #ifndef CONFIG_USB_GADGET imx_add_usb((void *)MX35_USB_OTG_BASE_ADDR, 0, &otg_pdata); #endif imx_add_usb((void *)MX35_USB_HS_BASE_ADDR, 1, &hs_pdata); #endif #ifdef CONFIG_USB_GADGET /* Workaround ENGcm09152 */ tmp = readl(MX35_USB_OTG_BASE_ADDR + 0x608); writel(tmp | (1 << 23), MX35_USB_OTG_BASE_ADDR + 0x608); add_generic_device("fsl-udc", DEVICE_ID_DYNAMIC, NULL, MX35_USB_OTG_BASE_ADDR, 0x200, IORESOURCE_MEM, &usb_pdata); #endif armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX35SD); return 0; }
static int pcaal1_late_init(void) { #ifdef CONFIG_PARTITION devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "x-loader"); dev_add_bb_dev("self_raw", "x_loader0"); devfs_add_partition("nand0", SZ_128K, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", SZ_128K + SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif return 0; }
static int mini2440_devices_init(void) { uint32_t reg; int i; /* ----------- configure the access to the outer space ---------- */ for (i = 0; i < ARRAY_SIZE(pin_usage); i++) s3c_gpio_mode(pin_usage[i]); reg = readl(S3C_BWSCON); /* CS#4 to access the network controller */ reg &= ~0x000f0000; reg |= 0x000d0000; /* 16 bit */ writel(0x1f4c, S3C_BANKCON4); writel(reg, S3C_BWSCON); /* release the reset signal to external devices */ reg = readl(S3C_MISCCR); reg |= 0x10000; writel(reg, S3C_MISCCR); add_generic_device("s3c24x0_nand", DEVICE_ID_DYNAMIC, NULL, S3C24X0_NAND_BASE, 0, IORESOURCE_MEM, &nand_info); add_dm9000_device(0, S3C_CS4_BASE + 0x300, S3C_CS4_BASE + 0x304, IORESOURCE_MEM_16BIT, &dm9000_data); #ifdef CONFIG_NAND /* ----------- add some vital partitions -------- */ devfs_del_partition("self_raw"); devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_del_partition("env_raw"); devfs_add_partition("nand0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif add_generic_device("s3c_mci", 0, NULL, S3C2410_SDI_BASE, 0, IORESOURCE_MEM, &mci_data); add_generic_device("s3c_fb", 0, NULL, S3C2410_LCD_BASE, 0, IORESOURCE_MEM, &s3c24x0_fb_data); add_generic_device("ohci", 0, NULL, S3C2410_USB_HOST_BASE, 0x100, IORESOURCE_MEM, NULL); armlinux_set_bootparams((void*)S3C_SDRAM_BASE + 0x100); armlinux_set_architecture(MACH_TYPE_MINI2440); return 0; }
static int at91sam9m10g45ek_devices_init(void) { ek_add_device_nand(); at91_add_device_eth(&macb_pdata); ek_add_device_mci(); devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x80000, 0x20000, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); armlinux_set_bootparams((void *)(AT91_CHIPSELECT_6 + 0x100)); armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK); ek_set_board_revision(); return 0; }
static int mini2440_devices_init(void) { uint32_t reg; int i; /* ----------- configure the access to the outer space ---------- */ for (i = 0; i < ARRAY_SIZE(pin_usage); i++) s3c_gpio_mode(pin_usage[i]); reg = readl(S3C_BWSCON); /* CS#4 to access the network controller */ reg &= ~0x000f0000; reg |= 0x000d0000; /* 16 bit */ writel(0x1f4c, S3C_BANKCON4); writel(reg, S3C_BWSCON); /* release the reset signal to external devices */ reg = readl(S3C_MISCCR); reg |= 0x10000; writel(reg, S3C_MISCCR); s3c24xx_add_nand(&nand_info); add_dm9000_device(0, S3C_CS4_BASE + 0x300, S3C_CS4_BASE + 0x304, IORESOURCE_MEM_16BIT, &dm9000_data); #ifdef CONFIG_NAND /* ----------- add some vital partitions -------- */ devfs_del_partition("self_raw"); devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_del_partition("env_raw"); devfs_add_partition("nand0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); s3c24x0_bbu_nand_register_handler(); #endif s3c24xx_add_mci(&mci_data); s3c24xx_add_fb(&s3c24x0_fb_data); s3c24xx_add_ohci(); armlinux_set_architecture(MACH_TYPE_MINI2440); return 0; }
static int a9m2440_devices_init(void) { uint32_t reg; /* ----------- configure the access to the outer space ---------- */ reg = readl(S3C_BWSCON); /* CS#5 to access the network controller */ reg &= ~0x00f00000; reg |= 0x00d00000; /* 16 bit */ writel(0x1f4c, S3C_BANKCON5); writel(reg, S3C_BWSCON); #ifdef CONFIG_MACH_A9M2410DEV a9m2410dev_devices_init(); #endif /* release the reset signal to external devices */ reg = readl(S3C_MISCCR); reg |= 0x10000; writel(reg, S3C_MISCCR); /* ----------- the devices the boot loader should work with -------- */ s3c24xx_add_nand(&nand_info); /* * cs8900 network controller onboard * Connected to CS line 5 + A24 and interrupt line EINT9, * data width is 16 bit */ add_generic_device("cs8900", DEVICE_ID_DYNAMIC, NULL, S3C_CS5_BASE + (1 << 24) + 0x300, 16, IORESOURCE_MEM, NULL); #ifdef CONFIG_NAND /* ----------- add some vital partitions -------- */ devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif armlinux_set_bootparams((void*)S3C_SDRAM_BASE + 0x100); armlinux_set_architecture(MACH_TYPE_A9M2440); return 0; }
static int pm9g45_devices_init(void) { pm_add_device_nand(); pm9g45_add_device_mci(); pm9g45_phy_init(); at91_add_device_eth(0, &macb_pdata); pm9g45_add_device_usbh(); devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x40000, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); armlinux_set_bootparams((void *)(AT91_CHIPSELECT_6 + 0x100)); armlinux_set_architecture(MACH_TYPE_PM9G45); return 0; }