Path: blob/master/arch/blackfin/mach-bf561/boards/tepla.c
10819 views
/*1* Copyright 2004-2007 Analog Devices Inc.2* 2005 National ICT Australia (NICTA)3* Aidan Williams <[email protected]>4*5* Thanks to Jamey Hicks.6*7* Only SMSC91C1111 was registered, may do more later.8*9* Licensed under the GPL-210*/1112#include <linux/device.h>13#include <linux/platform_device.h>14#include <linux/irq.h>1516const char bfin_board_name[] = "Tepla-BF561";1718/*19* Driver needs to know address, irq and flag pin.20*/21static struct resource smc91x_resources[] = {22{23.start = 0x2C000300,24.end = 0x2C000320,25.flags = IORESOURCE_MEM,26}, {27.start = IRQ_PROG_INTB,28.end = IRQ_PROG_INTB,29.flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,30}, {31.start = IRQ_PF7,32.end = IRQ_PF7,33.flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,34},35};3637static struct platform_device smc91x_device = {38.name = "smc91x",39.id = 0,40.num_resources = ARRAY_SIZE(smc91x_resources),41.resource = smc91x_resources,42};4344#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)45#ifdef CONFIG_SERIAL_BFIN_UART046static struct resource bfin_uart0_resources[] = {47{48.start = BFIN_UART_THR,49.end = BFIN_UART_GCTL+2,50.flags = IORESOURCE_MEM,51},52{53.start = IRQ_UART_RX,54.end = IRQ_UART_RX+1,55.flags = IORESOURCE_IRQ,56},57{58.start = IRQ_UART_ERROR,59.end = IRQ_UART_ERROR,60.flags = IORESOURCE_IRQ,61},62{63.start = CH_UART_TX,64.end = CH_UART_TX,65.flags = IORESOURCE_DMA,66},67{68.start = CH_UART_RX,69.end = CH_UART_RX,70.flags = IORESOURCE_DMA,71},72};7374static unsigned short bfin_uart0_peripherals[] = {75P_UART0_TX, P_UART0_RX, 076};7778static struct platform_device bfin_uart0_device = {79.name = "bfin-uart",80.id = 0,81.num_resources = ARRAY_SIZE(bfin_uart0_resources),82.resource = bfin_uart0_resources,83.dev = {84.platform_data = &bfin_uart0_peripherals, /* Passed to driver */85},86};87#endif88#endif8990#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)91#ifdef CONFIG_BFIN_SIR092static struct resource bfin_sir0_resources[] = {93{94.start = 0xFFC00400,95.end = 0xFFC004FF,96.flags = IORESOURCE_MEM,97},98{99.start = IRQ_UART0_RX,100.end = IRQ_UART0_RX+1,101.flags = IORESOURCE_IRQ,102},103{104.start = CH_UART0_RX,105.end = CH_UART0_RX+1,106.flags = IORESOURCE_DMA,107},108};109110static struct platform_device bfin_sir0_device = {111.name = "bfin_sir",112.id = 0,113.num_resources = ARRAY_SIZE(bfin_sir0_resources),114.resource = bfin_sir0_resources,115};116#endif117#endif118119static struct platform_device *tepla_devices[] __initdata = {120&smc91x_device,121122#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)123#ifdef CONFIG_SERIAL_BFIN_UART0124&bfin_uart0_device,125#endif126#endif127128#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)129#ifdef CONFIG_BFIN_SIR0130&bfin_sir0_device,131#endif132#endif133};134135static int __init tepla_init(void)136{137printk(KERN_INFO "%s(): registering device resources\n", __func__);138return platform_add_devices(tepla_devices, ARRAY_SIZE(tepla_devices));139}140141arch_initcall(tepla_init);142143static struct platform_device *tepla_early_devices[] __initdata = {144#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)145#ifdef CONFIG_SERIAL_BFIN_UART0146&bfin_uart0_device,147#endif148#endif149};150151void __init native_machine_early_platform_add_devices(void)152{153printk(KERN_INFO "register early platform devices\n");154early_platform_add_devices(tepla_early_devices,155ARRAY_SIZE(tepla_early_devices));156}157158159