Path: blob/master/arch/m68k/platform/54xx/firebee.c
10818 views
/***************************************************************************/12/*3* firebee.c -- extra startup code support for the FireBee boards4*5* Copyright (C) 2011, Greg Ungerer ([email protected])6*/78/***************************************************************************/910#include <linux/kernel.h>11#include <linux/init.h>12#include <linux/io.h>13#include <linux/platform_device.h>14#include <linux/mtd/mtd.h>15#include <linux/mtd/partitions.h>16#include <linux/mtd/physmap.h>17#include <asm/coldfire.h>18#include <asm/mcfsim.h>1920/***************************************************************************/2122/*23* 8MB of NOR flash fitted to the FireBee board.24*/25#define FLASH_PHYS_ADDR 0xe0000000 /* Physical address of flash */26#define FLASH_PHYS_SIZE 0x00800000 /* Size of flash */2728#define PART_BOOT_START 0x00000000 /* Start at bottom of flash */29#define PART_BOOT_SIZE 0x00040000 /* 256k in size */30#define PART_IMAGE_START 0x00040000 /* Start after boot loader */31#define PART_IMAGE_SIZE 0x006c0000 /* Most of flash */32#define PART_FPGA_START 0x00700000 /* Start at offset 7MB */33#define PART_FPGA_SIZE 0x00100000 /* 1MB in size */3435static struct mtd_partition firebee_flash_parts[] = {36{37.name = "dBUG",38.offset = PART_BOOT_START,39.size = PART_BOOT_SIZE,40},41{42.name = "FPGA",43.offset = PART_FPGA_START,44.size = PART_FPGA_SIZE,45},46{47.name = "image",48.offset = PART_IMAGE_START,49.size = PART_IMAGE_SIZE,50},51};5253static struct physmap_flash_data firebee_flash_data = {54.width = 2,55.nr_parts = ARRAY_SIZE(firebee_flash_parts),56.parts = firebee_flash_parts,57};5859static struct resource firebee_flash_resource = {60.start = FLASH_PHYS_ADDR,61.end = FLASH_PHYS_ADDR + FLASH_PHYS_SIZE,62.flags = IORESOURCE_MEM,63};6465static struct platform_device firebee_flash = {66.name = "physmap-flash",67.id = 0,68.dev = {69.platform_data = &firebee_flash_data,70},71.num_resources = 1,72.resource = &firebee_flash_resource,73};7475/***************************************************************************/7677static int __init init_firebee(void)78{79platform_device_register(&firebee_flash);80return 0;81}8283arch_initcall(init_firebee);8485/***************************************************************************/868788