2 * linux/arch/arm/mach-sa1100/nanoengine.c
4 * Bright Star Engineering's nanoEngine board init code.
6 * Copyright (C) 2009 Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
14 #include <linux/init.h>
15 #include <linux/kernel.h>
16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/partitions.h>
18 #include <linux/root_dev.h>
20 #include <asm/mach-types.h>
21 #include <asm/setup.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/flash.h>
25 #include <asm/mach/map.h>
26 #include <asm/mach/serial_sa1100.h>
28 #include <mach/hardware.h>
33 static struct mtd_partition nanoengine_partitions[] = {
35 .name = "nanoEngine boot firmware and parameter table",
36 .size = 0x00010000, /* 32K */
38 .mask_flags = MTD_WRITEABLE,
40 .name = "kernel/initrd reserved",
43 .mask_flags = MTD_WRITEABLE,
45 .name = "experimental filesystem allocation",
48 .mask_flags = MTD_WRITEABLE,
52 static struct flash_platform_data nanoengine_flash_data = {
53 .map_name = "jedec_probe",
54 .parts = nanoengine_partitions,
55 .nr_parts = ARRAY_SIZE(nanoengine_partitions),
58 static struct resource nanoengine_flash_resources[] = {
60 .start = SA1100_CS0_PHYS,
61 .end = SA1100_CS0_PHYS + SZ_32M - 1,
62 .flags = IORESOURCE_MEM,
64 .start = SA1100_CS1_PHYS,
65 .end = SA1100_CS1_PHYS + SZ_32M - 1,
66 .flags = IORESOURCE_MEM,
70 static struct map_desc nanoengine_io_desc[] __initdata = {
72 /* System Registers */
73 .virtual = 0xf0000000,
74 .pfn = __phys_to_pfn(0x10000000),
78 /* Internal PCI Config Space */
79 .virtual = 0xf1000000,
80 .pfn = __phys_to_pfn(0x18A00000),
86 static void __init nanoengine_map_io(void)
89 iotable_init(nanoengine_io_desc, ARRAY_SIZE(nanoengine_io_desc));
91 sa1100_register_uart(0, 1);
92 sa1100_register_uart(1, 2);
93 sa1100_register_uart(2, 3);
94 Ser1SDCR0 |= SDCR0_UART;
95 /* disable IRDA -- UART2 is used as a normal serial port */
100 static void __init nanoengine_init(void)
102 sa11x0_register_mtd(&nanoengine_flash_data, nanoengine_flash_resources,
103 ARRAY_SIZE(nanoengine_flash_resources));
106 MACHINE_START(NANOENGINE, "BSE nanoEngine")
107 .boot_params = 0xc0000000,
108 .map_io = nanoengine_map_io,
109 .init_irq = sa1100_init_irq,
110 .timer = &sa1100_timer,
111 .init_machine = nanoengine_init,