コード例 #1
0
ファイル: mini2440.c プロジェクト: AubrCool/barebox
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;
}
コード例 #2
0
ファイル: a9m2440.c プロジェクト: jhbsz/barebox-stm32f103x
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;
}