Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
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;
}
Ejemplo n.º 3
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;
}
Ejemplo n.º 4
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;
}