Пример #1
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;
}
Пример #2
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;
}
Пример #3
0
BAREBOX_CMD_END

static int do_delpart(int argc, char *argv[])
{
	int i, err;

	for (i = 1; i < argc; i++) {
		err = devfs_del_partition(basename(argv[i]));
		if (err) {
			printf("cannot delete %s: %s\n", argv[i], strerror(-err));
			break;
		}
	}

	return 1;
}