1 /***************************************************************************/
4 * firebee.c -- extra startup code support for the FireBee boards
6 * Copyright (C) 2011, Greg Ungerer (gerg@snapgear.com)
9 /***************************************************************************/
11 #include <linux/kernel.h>
12 #include <linux/init.h>
14 #include <linux/platform_device.h>
15 #include <linux/mtd/mtd.h>
16 #include <linux/mtd/partitions.h>
17 #include <linux/mtd/physmap.h>
18 #include <asm/coldfire.h>
19 #include <asm/mcfsim.h>
21 /***************************************************************************/
24 * 8MB of NOR flash fitted to the FireBee board.
26 #define FLASH_PHYS_ADDR 0xe0000000 /* Physical address of flash */
27 #define FLASH_PHYS_SIZE 0x00800000 /* Size of flash */
29 #define PART_BOOT_START 0x00000000 /* Start at bottom of flash */
30 #define PART_BOOT_SIZE 0x00040000 /* 256k in size */
31 #define PART_IMAGE_START 0x00040000 /* Start after boot loader */
32 #define PART_IMAGE_SIZE 0x006c0000 /* Most of flash */
33 #define PART_FPGA_START 0x00700000 /* Start at offset 7MB */
34 #define PART_FPGA_SIZE 0x00100000 /* 1MB in size */
36 static struct mtd_partition firebee_flash_parts
[] = {
39 .offset
= PART_BOOT_START
,
40 .size
= PART_BOOT_SIZE
,
44 .offset
= PART_FPGA_START
,
45 .size
= PART_FPGA_SIZE
,
49 .offset
= PART_IMAGE_START
,
50 .size
= PART_IMAGE_SIZE
,
54 static struct physmap_flash_data firebee_flash_data
= {
56 .nr_parts
= ARRAY_SIZE(firebee_flash_parts
),
57 .parts
= firebee_flash_parts
,
60 static struct resource firebee_flash_resource
= {
61 .start
= FLASH_PHYS_ADDR
,
62 .end
= FLASH_PHYS_ADDR
+ FLASH_PHYS_SIZE
,
63 .flags
= IORESOURCE_MEM
,
66 static struct platform_device firebee_flash
= {
67 .name
= "physmap-flash",
70 .platform_data
= &firebee_flash_data
,
73 .resource
= &firebee_flash_resource
,
76 /***************************************************************************/
78 static int __init
init_firebee(void)
80 platform_device_register(&firebee_flash
);
84 arch_initcall(init_firebee
);
86 /***************************************************************************/