2 * Cavium Networks CNS3420 Validation Board
4 * Copyright 2000 Deep Blue Solutions Ltd
5 * Copyright 2008 ARM Limited
6 * Copyright 2008 Cavium Networks
8 * Copyright 2010 MontaVista Software, LLC.
9 * Anton Vorontsov <avorontsov@mvista.com>
11 * This file is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License, Version 2, as
13 * published by the Free Software Foundation.
16 #include <linux/init.h>
17 #include <linux/kernel.h>
18 #include <linux/compiler.h>
20 #include <linux/serial_core.h>
21 #include <linux/serial_8250.h>
22 #include <linux/platform_device.h>
23 #include <linux/mtd/mtd.h>
24 #include <linux/mtd/physmap.h>
25 #include <linux/mtd/partitions.h>
26 #include <asm/setup.h>
27 #include <asm/mach-types.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/map.h>
30 #include <asm/mach/time.h>
31 #include <mach/hardware.h>
32 #include <mach/cns3xxx.h>
33 #include <mach/irqs.h>
39 static struct mtd_partition cns3420_nor_partitions[] = {
44 .mask_flags = MTD_WRITEABLE,
48 .offset = MTDPART_OFS_APPEND,
52 .offset = MTDPART_OFS_APPEND,
54 .name = "filesystem2",
56 .offset = MTDPART_OFS_APPEND,
59 .size = MTDPART_SIZ_FULL,
60 .offset = MTDPART_OFS_APPEND,
64 static struct physmap_flash_data cns3420_nor_pdata = {
66 .parts = cns3420_nor_partitions,
67 .nr_parts = ARRAY_SIZE(cns3420_nor_partitions),
70 static struct resource cns3420_nor_res = {
71 .start = CNS3XXX_FLASH_BASE,
72 .end = CNS3XXX_FLASH_BASE + SZ_128M - 1,
73 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
76 static struct platform_device cns3420_nor_pdev = {
77 .name = "physmap-flash",
79 .resource = &cns3420_nor_res,
82 .platform_data = &cns3420_nor_pdata,
89 static void __init cns3420_early_serial_setup(void)
91 #ifdef CONFIG_SERIAL_8250_CONSOLE
92 static struct uart_port cns3420_serial_port = {
93 .membase = (void __iomem *)CNS3XXX_UART0_BASE_VIRT,
94 .mapbase = CNS3XXX_UART0_BASE,
95 .irq = IRQ_CNS3XXX_UART0,
97 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
105 early_serial_setup(&cns3420_serial_port);
112 static struct platform_device *cns3420_pdevs[] __initdata = {
116 static void __init cns3420_init(void)
118 platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs));
120 pm_power_off = cns3xxx_power_off;
123 static struct map_desc cns3420_io_desc[] __initdata = {
125 .virtual = CNS3XXX_UART0_BASE_VIRT,
126 .pfn = __phys_to_pfn(CNS3XXX_UART0_BASE),
132 static void __init cns3420_map_io(void)
135 iotable_init(cns3420_io_desc, ARRAY_SIZE(cns3420_io_desc));
137 cns3420_early_serial_setup();
140 MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
141 .phys_io = CNS3XXX_UART0_BASE,
142 .io_pg_offst = (CNS3XXX_UART0_BASE_VIRT >> 18) & 0xfffc,
143 .boot_params = 0x00000100,
144 .map_io = cns3420_map_io,
145 .init_irq = cns3xxx_init_irq,
146 .timer = &cns3xxx_timer,
147 .init_machine = cns3420_init,