Path: blob/master/arch/arm/mach-gemini/board-wbd222.c
10817 views
/*1* Support for Wiliboard WBD-2222*3* Copyright (C) 2009 Imre Kaloz <[email protected]>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*/10#include <linux/kernel.h>11#include <linux/init.h>12#include <linux/platform_device.h>13#include <linux/leds.h>14#include <linux/input.h>15#include <linux/skbuff.h>16#include <linux/gpio_keys.h>17#include <linux/mdio-gpio.h>18#include <linux/mtd/mtd.h>19#include <linux/mtd/partitions.h>20#include <asm/mach-types.h>21#include <asm/mach/arch.h>22#include <asm/mach/time.h>232425#include "common.h"2627static struct gpio_keys_button wbd222_keys[] = {28{29.code = KEY_SETUP,30.gpio = 5,31.active_low = 1,32.desc = "reset",33.type = EV_KEY,34},35};3637static struct gpio_keys_platform_data wbd222_keys_data = {38.buttons = wbd222_keys,39.nbuttons = ARRAY_SIZE(wbd222_keys),40};4142static struct platform_device wbd222_keys_device = {43.name = "gpio-keys",44.id = -1,45.dev = {46.platform_data = &wbd222_keys_data,47},48};4950static struct gpio_led wbd222_leds[] = {51{52.name = "L3red",53.gpio = 1,54},55{56.name = "L4green",57.gpio = 2,58},59{60.name = "L4red",61.gpio = 3,62},63{64.name = "L3green",65.gpio = 5,66},67};6869static struct gpio_led_platform_data wbd222_leds_data = {70.num_leds = ARRAY_SIZE(wbd222_leds),71.leds = wbd222_leds,72};7374static struct platform_device wbd222_leds_device = {75.name = "leds-gpio",76.id = -1,77.dev = {78.platform_data = &wbd222_leds_data,79},80};8182static struct sys_timer wbd222_timer = {83.init = gemini_timer_init,84};8586static struct mtd_partition wbd222_partitions[] = {87{88.name = "RedBoot",89.offset = 0,90.size = 0x020000,91.mask_flags = MTD_WRITEABLE,92} , {93.name = "kernel",94.offset = 0x020000,95.size = 0x100000,96} , {97.name = "rootfs",98.offset = 0x120000,99.size = 0x6a0000,100} , {101.name = "VCTL",102.offset = 0x7c0000,103.size = 0x010000,104.mask_flags = MTD_WRITEABLE,105} , {106.name = "cfg",107.offset = 0x7d0000,108.size = 0x010000,109.mask_flags = MTD_WRITEABLE,110} , {111.name = "FIS",112.offset = 0x7e0000,113.size = 0x010000,114.mask_flags = MTD_WRITEABLE,115}116};117#define wbd222_num_partitions ARRAY_SIZE(wbd222_partitions)118119static void __init wbd222_init(void)120{121gemini_gpio_init();122platform_register_uart();123platform_register_pflash(SZ_8M, wbd222_partitions,124wbd222_num_partitions);125platform_device_register(&wbd222_leds_device);126platform_device_register(&wbd222_keys_device);127platform_register_rtc();128}129130MACHINE_START(WBD222, "Wiliboard WBD-222")131.boot_params = 0x100,132.map_io = gemini_map_io,133.init_irq = gemini_init_irq,134.timer = &wbd222_timer,135.init_machine = wbd222_init,136MACHINE_END137138139