From: Ralf Baechle Date: Mon, 1 Dec 2008 08:16:08 +0000 (+0000) Subject: MIPS: Malta: Consolidate platform device code. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=566a3b95579c123f7711e2f98d078f370746046b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git MIPS: Malta: Consolidate platform device code. After adding the RTC platform device to malta-platform.c malta-mtd.c should get unified with the rest of the platform device code. --- diff --git a/arch/mips/mti-malta/Makefile b/arch/mips/mti-malta/Makefile index cef2db8d2225..32e847808df1 100644 --- a/arch/mips/mti-malta/Makefile +++ b/arch/mips/mti-malta/Makefile @@ -7,9 +7,8 @@ # obj-y := malta-amon.o malta-cmdline.o \ malta-display.o malta-init.o malta-int.o \ - malta-memory.o malta-mtd.o \ - malta-platform.o malta-reset.o \ - malta-setup.o malta-time.o + malta-memory.o malta-platform.o \ + malta-reset.o malta-setup.o malta-time.o obj-$(CONFIG_EARLY_PRINTK) += malta-console.o obj-$(CONFIG_PCI) += malta-pci.o diff --git a/arch/mips/mti-malta/malta-mtd.c b/arch/mips/mti-malta/malta-mtd.c deleted file mode 100644 index 8ad9bdf25dce..000000000000 --- a/arch/mips/mti-malta/malta-mtd.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2006 MIPS Technologies, Inc. - * written by Ralf Baechle - */ - -#include -#include -#include -#include -#include - -static struct mtd_partition malta_mtd_partitions[] = { - { - .name = "YAMON", - .offset = 0x0, - .size = 0x100000, - .mask_flags = MTD_WRITEABLE - }, { - .name = "User FS", - .offset = 0x100000, - .size = 0x2e0000 - }, { - .name = "Board Config", - .offset = 0x3e0000, - .size = 0x020000, - .mask_flags = MTD_WRITEABLE - } -}; - -static struct physmap_flash_data malta_flash_data = { - .width = 4, - .nr_parts = ARRAY_SIZE(malta_mtd_partitions), - .parts = malta_mtd_partitions -}; - -static struct resource malta_flash_resource = { - .start = 0x1e000000, - .end = 0x1e3fffff, - .flags = IORESOURCE_MEM -}; - -static struct platform_device malta_flash = { - .name = "physmap-flash", - .id = 0, - .dev = { - .platform_data = &malta_flash_data, - }, - .num_resources = 1, - .resource = &malta_flash_resource, -}; - -static int __init malta_mtd_init(void) -{ - platform_device_register(&malta_flash); - - return 0; -} - -module_init(malta_mtd_init) diff --git a/arch/mips/mti-malta/malta-platform.c b/arch/mips/mti-malta/malta-platform.c index 6a476f7733b3..72e32a7715be 100644 --- a/arch/mips/mti-malta/malta-platform.c +++ b/arch/mips/mti-malta/malta-platform.c @@ -3,8 +3,9 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2007 MIPS Technologies, Inc. + * Copyright (C) 2006, 07 MIPS Technologies, Inc. * written by Ralf Baechle (ralf@linux-mips.org) + * written by Ralf Baechle * * Copyright (C) 2008 Wind River Systems, Inc. * updated by Tiejun Chen @@ -20,11 +21,14 @@ * * 2. Register RTC-CMOS platform device on Malta. */ -#include #include #include #include +#include +#include +#include #include +#include #define SMC_PORT(base, int) \ { \ @@ -54,7 +58,7 @@ static struct plat_serial8250_port uart8250_data[] = { static struct platform_device malta_uart8250_device = { .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM2, + .id = PLAT8250_DEV_PLATFORM, .dev = { .platform_data = uart8250_data, }, @@ -79,9 +83,50 @@ static struct platform_device malta_rtc_device = { .num_resources = ARRAY_SIZE(malta_rtc_resources), }; +static struct mtd_partition malta_mtd_partitions[] = { + { + .name = "YAMON", + .offset = 0x0, + .size = 0x100000, + .mask_flags = MTD_WRITEABLE + }, { + .name = "User FS", + .offset = 0x100000, + .size = 0x2e0000 + }, { + .name = "Board Config", + .offset = 0x3e0000, + .size = 0x020000, + .mask_flags = MTD_WRITEABLE + } +}; + +static struct physmap_flash_data malta_flash_data = { + .width = 4, + .nr_parts = ARRAY_SIZE(malta_mtd_partitions), + .parts = malta_mtd_partitions +}; + +static struct resource malta_flash_resource = { + .start = 0x1e000000, + .end = 0x1e3fffff, + .flags = IORESOURCE_MEM +}; + +static struct platform_device malta_flash_device = { + .name = "physmap-flash", + .id = 0, + .dev = { + .platform_data = &malta_flash_data, + }, + .num_resources = 1, + .resource = &malta_flash_resource, +}; + static struct platform_device *malta_devices[] __initdata = { &malta_uart8250_device, &malta_rtc_device, + &malta_flash_device, }; static int __init malta_add_devices(void)