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 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 imx25_devices_init(void) { ulong val; /* * Set up the FEC_RESET_B and FEC_ENABLE GPIO pins. * Assert FEC_RESET_B, then power up the PHY by asserting * FEC_ENABLE, at the same time lifting FEC_RESET_B. * * FEC_RESET_B: gpio2[3] is ALT 5 mode of pin A17 * FEC_ENABLE_B: gpio4[8] is ALT 5 mode of pin D12 */ writel(0x8, IOMUXC_BASE_ADDR + 0x0238); /* open drain */ writel(0x0, IOMUXC_BASE_ADDR + 0x028C); /* cmos, no pu/pd */ #define GPIO2_BASE_ADDR 0x53FD0000 #define GPIO4_BASE_ADDR 0x53F9C000 #define GPIO_GDIR 0x04 #define GPIO_DR 0x00 /* make the pins output */ val = (1 << 3) | readl(GPIO2_BASE_ADDR + GPIO_GDIR); writel(val, GPIO2_BASE_ADDR + GPIO_GDIR); val = (1 << 8) | readl(GPIO4_BASE_ADDR + GPIO_GDIR); writel(val, GPIO4_BASE_ADDR + GPIO_GDIR); /* drop PHY power */ val = readl(GPIO2_BASE_ADDR + GPIO_DR) & ~(1 << 3); writel(val, GPIO2_BASE_ADDR + GPIO_DR); /* assert reset */ val = readl(GPIO4_BASE_ADDR + GPIO_DR) & ~(1 << 8); writel(val, GPIO4_BASE_ADDR + GPIO_DR); udelay(2); /* turn on power & lift reset */ val = (1 << 3) | readl(GPIO2_BASE_ADDR + GPIO_DR); writel(val, GPIO2_BASE_ADDR + GPIO_DR); val = (1 << 8) | readl(GPIO4_BASE_ADDR + GPIO_DR); writel(val, GPIO4_BASE_ADDR + GPIO_DR); #ifdef CONFIG_USB /* USB does not work yet. Don't know why. Maybe * the CPLD has to be initialized. */ imx25_usb_init(); register_device(&usbh2_dev); #endif /* FEC does only work when the CPLD is initialized. * Currently we do not do this in barebox, so it * does only work when Linux has been started after * the last powercycle. */ register_device(&fec_dev); if (readl(IMX_CCM_BASE + CCM_RCSR) & (1 << 14)) nand_info.width = 2; 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); register_device(&sram0_dev); armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_MX25_3DS); return 0; }