From: Tony Lindgren Date: Wed, 23 Feb 2011 19:43:15 +0000 (-0800) Subject: Merge branches 'devel-cleanup', 'devel-omap4', 'devel-board' and 'devel-nand' into... X-Git-Tag: firefly_0821_release~7613^2~1763^2~28 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c3bbcf5dc3a0bee9db8f82cd7d10eedf02a3b5f5;p=firefly-linux-kernel-4.4.55.git Merge branches 'devel-cleanup', 'devel-omap4', 'devel-board' and 'devel-nand' into omap-for-linus --- c3bbcf5dc3a0bee9db8f82cd7d10eedf02a3b5f5 diff --cc arch/arm/mach-omap2/board-flash.c index fd38c05bb47f,86d1020da151,fd38c05bb47f,fd38c05bb47f,a76819812019..c32c06828f08 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c @@@@@@ -246,9 -244,8 -246,9 -246,9 -251,9 +249,8 @@@@@@ void board_flash_init(struct flash_part partition_info[1].nr_parts, onenandcs); if (nandcs > GPMC_CS_NUM) - --- printk(KERN_INFO "NAND: Unable to find configuration " - --- "in GPMC\n"); + +++ pr_err("NAND: Unable to find configuration in GPMC\n"); else board_nand_init(partition_info[2].parts, ---- partition_info[2].nr_parts, nandcs); ++++ partition_info[2].nr_parts, nandcs, nand_type); } diff --cc arch/arm/mach-omap2/devices.c index 71f099b85e7c,e0f0ef952bc9,8800486f9467,71f099b85e7c,71f099b85e7c..9ee876fd367a --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@@@@@ -280,51 -279,149 -320,149 -280,51 -280,51 +321,51 @@@@@@ static inline void omap_init_audio(void #include -- #define OMAP2_MCSPI1_BASE 0x48098000 -- #define OMAP2_MCSPI2_BASE 0x4809a000 -- #define OMAP2_MCSPI3_BASE 0x480b8000 -- #define OMAP2_MCSPI4_BASE 0x480ba000 -- -- #define OMAP4_MCSPI1_BASE 0x48098100 -- #define OMAP4_MCSPI2_BASE 0x4809a100 -- #define OMAP4_MCSPI3_BASE 0x480b8100 -- #define OMAP4_MCSPI4_BASE 0x480ba100 -- -- static struct omap2_mcspi_platform_config omap2_mcspi1_config = { -- .num_cs = 4, -- }; -- -- static struct resource omap2_mcspi1_resources[] = { -- { -- .start = OMAP2_MCSPI1_BASE, -- .end = OMAP2_MCSPI1_BASE + 0xff, -- .flags = IORESOURCE_MEM, -- }, -- }; -- -- static struct platform_device omap2_mcspi1 = { -- .name = "omap2_mcspi", -- .id = 1, -- .num_resources = ARRAY_SIZE(omap2_mcspi1_resources), -- .resource = omap2_mcspi1_resources, -- .dev = { -- .platform_data = &omap2_mcspi1_config, -- }, -- }; -- -- static struct omap2_mcspi_platform_config omap2_mcspi2_config = { -- .num_cs = 2, -- }; -- -- static struct resource omap2_mcspi2_resources[] = { -- { -- .start = OMAP2_MCSPI2_BASE, -- .end = OMAP2_MCSPI2_BASE + 0xff, -- .flags = IORESOURCE_MEM, -- }, -- }; -- -- static struct platform_device omap2_mcspi2 = { -- .name = "omap2_mcspi", -- .id = 2, -- .num_resources = ARRAY_SIZE(omap2_mcspi2_resources), -- .resource = omap2_mcspi2_resources, -- .dev = { -- .platform_data = &omap2_mcspi2_config, -- }, -- }; -- -- #if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ -- defined(CONFIG_ARCH_OMAP4) -- static struct omap2_mcspi_platform_config omap2_mcspi3_config = { -- .num_cs = 2, -- }; -- -- static struct resource omap2_mcspi3_resources[] = { -- { -- .start = OMAP2_MCSPI3_BASE, -- .end = OMAP2_MCSPI3_BASE + 0xff, -- .flags = IORESOURCE_MEM, - }, - }; - - static struct platform_device omap2_mcspi3 = { - .name = "omap2_mcspi", - .id = 3, - .num_resources = ARRAY_SIZE(omap2_mcspi3_resources), - .resource = omap2_mcspi3_resources, - .dev = { - .platform_data = &omap2_mcspi3_config, - }, - }; - #endif - - #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) - static struct omap2_mcspi_platform_config omap2_mcspi4_config = { - .num_cs = 1, - }; - - static struct resource omap2_mcspi4_resources[] = { - { - .start = OMAP2_MCSPI4_BASE, - .end = OMAP2_MCSPI4_BASE + 0xff, - .flags = IORESOURCE_MEM, - }, - }; - - static struct platform_device omap2_mcspi4 = { - .name = "omap2_mcspi", - .id = 4, - .num_resources = ARRAY_SIZE(omap2_mcspi4_resources), - .resource = omap2_mcspi4_resources, - .dev = { - .platform_data = &omap2_mcspi4_config, ++ struct omap_device_pm_latency omap_mcspi_latency[] = { ++ [0] = { ++ .deactivate_func = omap_device_idle_hwmods, ++ .activate_func = omap_device_enable_hwmods, ++ .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, }, }; - #endif - static struct platform_device omap2_mcspi3 = { - .name = "omap2_mcspi", - .id = 3, - .num_resources = ARRAY_SIZE(omap2_mcspi3_resources), - .resource = omap2_mcspi3_resources, - .dev = { - .platform_data = &omap2_mcspi3_config, - }, - }; - #endif - - #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) - static struct omap2_mcspi_platform_config omap2_mcspi4_config = { - .num_cs = 1, - }; - - static struct resource omap2_mcspi4_resources[] = { - { - .start = OMAP2_MCSPI4_BASE, - .end = OMAP2_MCSPI4_BASE + 0xff, - .flags = IORESOURCE_MEM, - }, - }; - - static struct platform_device omap2_mcspi4 = { - .name = "omap2_mcspi", - .id = 4, - .num_resources = ARRAY_SIZE(omap2_mcspi4_resources), - .resource = omap2_mcspi4_resources, - .dev = { - .platform_data = &omap2_mcspi4_config, - }, - }; - #endif - -- #ifdef CONFIG_ARCH_OMAP4 -- static inline void omap4_mcspi_fixup(void) -- { -- omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; -- omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; -- omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; -- omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; -- omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; -- omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; -- omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; -- omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; -- } -- #else -- static inline void omap4_mcspi_fixup(void) ++ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) { -- } -- #endif ++ struct omap_device *od; ++ char *name = "omap2_mcspi"; ++ struct omap2_mcspi_platform_config *pdata; ++ static int spi_num; ++ struct omap2_mcspi_dev_attr *mcspi_attrib = oh->dev_attr; ++ ++ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); ++ if (!pdata) { ++ pr_err("Memory allocation for McSPI device failed\n"); ++ return -ENOMEM; ++ } -- #if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ -- defined(CONFIG_ARCH_OMAP4) -- static inline void omap2_mcspi3_init(void) -- { -- platform_device_register(&omap2_mcspi3); -- } -- #else -- static inline void omap2_mcspi3_init(void) -- { -- } -- #endif ++ pdata->num_cs = mcspi_attrib->num_chipselect; ++ switch (oh->class->rev) { ++ case OMAP2_MCSPI_REV: ++ case OMAP3_MCSPI_REV: ++ pdata->regs_offset = 0; ++ break; ++ case OMAP4_MCSPI_REV: ++ pdata->regs_offset = OMAP4_MCSPI_REG_OFFSET; ++ break; ++ default: ++ pr_err("Invalid McSPI Revision value\n"); ++ return -EINVAL; ++ } -- #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) -- static inline void omap2_mcspi4_init(void) -- { -- platform_device_register(&omap2_mcspi4); -- } -- #else -- static inline void omap2_mcspi4_init(void) -- { ++ spi_num++; ++ od = omap_device_build(name, spi_num, oh, pdata, ++ sizeof(*pdata), omap_mcspi_latency, ++ ARRAY_SIZE(omap_mcspi_latency), 0); ++ WARN(IS_ERR(od), "Cant build omap_device for %s:%s\n", ++ name, oh->name); ++ kfree(pdata); ++ return 0; } -- #endif static void omap_init_mcspi(void) {