Path: blob/master/arch/blackfin/mach-bf548/boards/ezkit.c
15126 views
/*1* Copyright 2004-2009 Analog Devices Inc.2* 2005 National ICT Australia (NICTA)3* Aidan Williams <[email protected]>4*5* Licensed under the GPL-2 or later.6*/78#include <linux/device.h>9#include <linux/platform_device.h>10#include <linux/mtd/mtd.h>11#include <linux/mtd/partitions.h>12#include <linux/mtd/physmap.h>13#include <linux/spi/spi.h>14#include <linux/spi/flash.h>15#include <linux/irq.h>16#include <linux/i2c.h>17#include <linux/interrupt.h>18#include <linux/usb/musb.h>19#include <asm/bfin5xx_spi.h>20#include <asm/dma.h>21#include <asm/gpio.h>22#include <asm/nand.h>23#include <asm/dpmc.h>24#include <asm/bfin_sport.h>25#include <asm/portmux.h>26#include <asm/bfin_sdh.h>27#include <mach/bf54x_keys.h>28#include <linux/input.h>29#include <linux/spi/ad7877.h>3031/*32* Name the Board for the /proc/cpuinfo33*/34const char bfin_board_name[] = "ADI BF548-EZKIT";3536/*37* Driver needs to know address, irq and flag pin.38*/3940#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)41#include <linux/usb/isp1760.h>42static struct resource bfin_isp1760_resources[] = {43[0] = {44.start = 0x2C0C0000,45.end = 0x2C0C0000 + 0xfffff,46.flags = IORESOURCE_MEM,47},48[1] = {49.start = IRQ_PG7,50.end = IRQ_PG7,51.flags = IORESOURCE_IRQ,52},53};5455static struct isp1760_platform_data isp1760_priv = {56.is_isp1761 = 0,57.bus_width_16 = 1,58.port1_otg = 0,59.analog_oc = 0,60.dack_polarity_high = 0,61.dreq_polarity_high = 0,62};6364static struct platform_device bfin_isp1760_device = {65.name = "isp1760",66.id = 0,67.dev = {68.platform_data = &isp1760_priv,69},70.num_resources = ARRAY_SIZE(bfin_isp1760_resources),71.resource = bfin_isp1760_resources,72};73#endif7475#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)7677#include <mach/bf54x-lq043.h>7879static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {80.width = 95,81.height = 54,82.xres = {480, 480, 480},83.yres = {272, 272, 272},84.bpp = {24, 24, 24},85.disp = GPIO_PE3,86};8788static struct resource bf54x_lq043_resources[] = {89{90.start = IRQ_EPPI0_ERR,91.end = IRQ_EPPI0_ERR,92.flags = IORESOURCE_IRQ,93},94};9596static struct platform_device bf54x_lq043_device = {97.name = "bf54x-lq043",98.id = -1,99.num_resources = ARRAY_SIZE(bf54x_lq043_resources),100.resource = bf54x_lq043_resources,101.dev = {102.platform_data = &bf54x_lq043_data,103},104};105#endif106107#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)108static const unsigned int bf548_keymap[] = {109KEYVAL(0, 0, KEY_ENTER),110KEYVAL(0, 1, KEY_HELP),111KEYVAL(0, 2, KEY_0),112KEYVAL(0, 3, KEY_BACKSPACE),113KEYVAL(1, 0, KEY_TAB),114KEYVAL(1, 1, KEY_9),115KEYVAL(1, 2, KEY_8),116KEYVAL(1, 3, KEY_7),117KEYVAL(2, 0, KEY_DOWN),118KEYVAL(2, 1, KEY_6),119KEYVAL(2, 2, KEY_5),120KEYVAL(2, 3, KEY_4),121KEYVAL(3, 0, KEY_UP),122KEYVAL(3, 1, KEY_3),123KEYVAL(3, 2, KEY_2),124KEYVAL(3, 3, KEY_1),125};126127static struct bfin_kpad_platform_data bf54x_kpad_data = {128.rows = 4,129.cols = 4,130.keymap = bf548_keymap,131.keymapsize = ARRAY_SIZE(bf548_keymap),132.repeat = 0,133.debounce_time = 5000, /* ns (5ms) */134.coldrive_time = 1000, /* ns (1ms) */135.keyup_test_interval = 50, /* ms (50ms) */136};137138static struct resource bf54x_kpad_resources[] = {139{140.start = IRQ_KEY,141.end = IRQ_KEY,142.flags = IORESOURCE_IRQ,143},144};145146static struct platform_device bf54x_kpad_device = {147.name = "bf54x-keys",148.id = -1,149.num_resources = ARRAY_SIZE(bf54x_kpad_resources),150.resource = bf54x_kpad_resources,151.dev = {152.platform_data = &bf54x_kpad_data,153},154};155#endif156157#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)158#include <asm/bfin_rotary.h>159160static struct bfin_rotary_platform_data bfin_rotary_data = {161/*.rotary_up_key = KEY_UP,*/162/*.rotary_down_key = KEY_DOWN,*/163.rotary_rel_code = REL_WHEEL,164.rotary_button_key = KEY_ENTER,165.debounce = 10, /* 0..17 */166.mode = ROT_QUAD_ENC | ROT_DEBE,167};168169static struct resource bfin_rotary_resources[] = {170{171.start = IRQ_CNT,172.end = IRQ_CNT,173.flags = IORESOURCE_IRQ,174},175};176177static struct platform_device bfin_rotary_device = {178.name = "bfin-rotary",179.id = -1,180.num_resources = ARRAY_SIZE(bfin_rotary_resources),181.resource = bfin_rotary_resources,182.dev = {183.platform_data = &bfin_rotary_data,184},185};186#endif187188#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)189#include <linux/input/adxl34x.h>190static const struct adxl34x_platform_data adxl34x_info = {191.x_axis_offset = 0,192.y_axis_offset = 0,193.z_axis_offset = 0,194.tap_threshold = 0x31,195.tap_duration = 0x10,196.tap_latency = 0x60,197.tap_window = 0xF0,198.tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,199.act_axis_control = 0xFF,200.activity_threshold = 5,201.inactivity_threshold = 3,202.inactivity_time = 4,203.free_fall_threshold = 0x7,204.free_fall_time = 0x20,205.data_rate = 0x8,206.data_range = ADXL_FULL_RES,207208.ev_type = EV_ABS,209.ev_code_x = ABS_X, /* EV_REL */210.ev_code_y = ABS_Y, /* EV_REL */211.ev_code_z = ABS_Z, /* EV_REL */212213.ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */214215/* .ev_code_ff = KEY_F,*/ /* EV_KEY */216/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */217.power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,218.fifo_mode = ADXL_FIFO_STREAM,219.orientation_enable = ADXL_EN_ORIENTATION_3D,220.deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,221.divisor_length = ADXL_LP_FILTER_DIVISOR_16,222/* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */223.ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},224};225#endif226227#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)228static struct platform_device rtc_device = {229.name = "rtc-bfin",230.id = -1,231};232#endif233234#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)235#ifdef CONFIG_SERIAL_BFIN_UART0236static struct resource bfin_uart0_resources[] = {237{238.start = UART0_DLL,239.end = UART0_RBR+2,240.flags = IORESOURCE_MEM,241},242{243.start = IRQ_UART0_RX,244.end = IRQ_UART0_RX+1,245.flags = IORESOURCE_IRQ,246},247{248.start = IRQ_UART0_ERROR,249.end = IRQ_UART0_ERROR,250.flags = IORESOURCE_IRQ,251},252{253.start = CH_UART0_TX,254.end = CH_UART0_TX,255.flags = IORESOURCE_DMA,256},257{258.start = CH_UART0_RX,259.end = CH_UART0_RX,260.flags = IORESOURCE_DMA,261},262};263264static unsigned short bfin_uart0_peripherals[] = {265P_UART0_TX, P_UART0_RX, 0266};267268static struct platform_device bfin_uart0_device = {269.name = "bfin-uart",270.id = 0,271.num_resources = ARRAY_SIZE(bfin_uart0_resources),272.resource = bfin_uart0_resources,273.dev = {274.platform_data = &bfin_uart0_peripherals, /* Passed to driver */275},276};277#endif278#ifdef CONFIG_SERIAL_BFIN_UART1279static struct resource bfin_uart1_resources[] = {280{281.start = UART1_DLL,282.end = UART1_RBR+2,283.flags = IORESOURCE_MEM,284},285{286.start = IRQ_UART1_RX,287.end = IRQ_UART1_RX+1,288.flags = IORESOURCE_IRQ,289},290{291.start = IRQ_UART1_ERROR,292.end = IRQ_UART1_ERROR,293.flags = IORESOURCE_IRQ,294},295{296.start = CH_UART1_TX,297.end = CH_UART1_TX,298.flags = IORESOURCE_DMA,299},300{301.start = CH_UART1_RX,302.end = CH_UART1_RX,303.flags = IORESOURCE_DMA,304},305#ifdef CONFIG_BFIN_UART1_CTSRTS306{ /* CTS pin -- 0 means not supported */307.start = GPIO_PE10,308.end = GPIO_PE10,309.flags = IORESOURCE_IO,310},311{ /* RTS pin -- 0 means not supported */312.start = GPIO_PE9,313.end = GPIO_PE9,314.flags = IORESOURCE_IO,315},316#endif317};318319static unsigned short bfin_uart1_peripherals[] = {320P_UART1_TX, P_UART1_RX,321#ifdef CONFIG_BFIN_UART1_CTSRTS322P_UART1_RTS, P_UART1_CTS,323#endif3240325};326327static struct platform_device bfin_uart1_device = {328.name = "bfin-uart",329.id = 1,330.num_resources = ARRAY_SIZE(bfin_uart1_resources),331.resource = bfin_uart1_resources,332.dev = {333.platform_data = &bfin_uart1_peripherals, /* Passed to driver */334},335};336#endif337#ifdef CONFIG_SERIAL_BFIN_UART2338static struct resource bfin_uart2_resources[] = {339{340.start = UART2_DLL,341.end = UART2_RBR+2,342.flags = IORESOURCE_MEM,343},344{345.start = IRQ_UART2_RX,346.end = IRQ_UART2_RX+1,347.flags = IORESOURCE_IRQ,348},349{350.start = IRQ_UART2_ERROR,351.end = IRQ_UART2_ERROR,352.flags = IORESOURCE_IRQ,353},354{355.start = CH_UART2_TX,356.end = CH_UART2_TX,357.flags = IORESOURCE_DMA,358},359{360.start = CH_UART2_RX,361.end = CH_UART2_RX,362.flags = IORESOURCE_DMA,363},364};365366static unsigned short bfin_uart2_peripherals[] = {367P_UART2_TX, P_UART2_RX, 0368};369370static struct platform_device bfin_uart2_device = {371.name = "bfin-uart",372.id = 2,373.num_resources = ARRAY_SIZE(bfin_uart2_resources),374.resource = bfin_uart2_resources,375.dev = {376.platform_data = &bfin_uart2_peripherals, /* Passed to driver */377},378};379#endif380#ifdef CONFIG_SERIAL_BFIN_UART3381static struct resource bfin_uart3_resources[] = {382{383.start = UART3_DLL,384.end = UART3_RBR+2,385.flags = IORESOURCE_MEM,386},387{388.start = IRQ_UART3_RX,389.end = IRQ_UART3_RX+1,390.flags = IORESOURCE_IRQ,391},392{393.start = IRQ_UART3_ERROR,394.end = IRQ_UART3_ERROR,395.flags = IORESOURCE_IRQ,396},397{398.start = CH_UART3_TX,399.end = CH_UART3_TX,400.flags = IORESOURCE_DMA,401},402{403.start = CH_UART3_RX,404.end = CH_UART3_RX,405.flags = IORESOURCE_DMA,406},407#ifdef CONFIG_BFIN_UART3_CTSRTS408{ /* CTS pin -- 0 means not supported */409.start = GPIO_PB3,410.end = GPIO_PB3,411.flags = IORESOURCE_IO,412},413{ /* RTS pin -- 0 means not supported */414.start = GPIO_PB2,415.end = GPIO_PB2,416.flags = IORESOURCE_IO,417},418#endif419};420421static unsigned short bfin_uart3_peripherals[] = {422P_UART3_TX, P_UART3_RX,423#ifdef CONFIG_BFIN_UART3_CTSRTS424P_UART3_RTS, P_UART3_CTS,425#endif4260427};428429static struct platform_device bfin_uart3_device = {430.name = "bfin-uart",431.id = 3,432.num_resources = ARRAY_SIZE(bfin_uart3_resources),433.resource = bfin_uart3_resources,434.dev = {435.platform_data = &bfin_uart3_peripherals, /* Passed to driver */436},437};438#endif439#endif440441#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)442#ifdef CONFIG_BFIN_SIR0443static struct resource bfin_sir0_resources[] = {444{445.start = 0xFFC00400,446.end = 0xFFC004FF,447.flags = IORESOURCE_MEM,448},449{450.start = IRQ_UART0_RX,451.end = IRQ_UART0_RX+1,452.flags = IORESOURCE_IRQ,453},454{455.start = CH_UART0_RX,456.end = CH_UART0_RX+1,457.flags = IORESOURCE_DMA,458},459};460static struct platform_device bfin_sir0_device = {461.name = "bfin_sir",462.id = 0,463.num_resources = ARRAY_SIZE(bfin_sir0_resources),464.resource = bfin_sir0_resources,465};466#endif467#ifdef CONFIG_BFIN_SIR1468static struct resource bfin_sir1_resources[] = {469{470.start = 0xFFC02000,471.end = 0xFFC020FF,472.flags = IORESOURCE_MEM,473},474{475.start = IRQ_UART1_RX,476.end = IRQ_UART1_RX+1,477.flags = IORESOURCE_IRQ,478},479{480.start = CH_UART1_RX,481.end = CH_UART1_RX+1,482.flags = IORESOURCE_DMA,483},484};485static struct platform_device bfin_sir1_device = {486.name = "bfin_sir",487.id = 1,488.num_resources = ARRAY_SIZE(bfin_sir1_resources),489.resource = bfin_sir1_resources,490};491#endif492#ifdef CONFIG_BFIN_SIR2493static struct resource bfin_sir2_resources[] = {494{495.start = 0xFFC02100,496.end = 0xFFC021FF,497.flags = IORESOURCE_MEM,498},499{500.start = IRQ_UART2_RX,501.end = IRQ_UART2_RX+1,502.flags = IORESOURCE_IRQ,503},504{505.start = CH_UART2_RX,506.end = CH_UART2_RX+1,507.flags = IORESOURCE_DMA,508},509};510static struct platform_device bfin_sir2_device = {511.name = "bfin_sir",512.id = 2,513.num_resources = ARRAY_SIZE(bfin_sir2_resources),514.resource = bfin_sir2_resources,515};516#endif517#ifdef CONFIG_BFIN_SIR3518static struct resource bfin_sir3_resources[] = {519{520.start = 0xFFC03100,521.end = 0xFFC031FF,522.flags = IORESOURCE_MEM,523},524{525.start = IRQ_UART3_RX,526.end = IRQ_UART3_RX+1,527.flags = IORESOURCE_IRQ,528},529{530.start = CH_UART3_RX,531.end = CH_UART3_RX+1,532.flags = IORESOURCE_DMA,533},534};535static struct platform_device bfin_sir3_device = {536.name = "bfin_sir",537.id = 3,538.num_resources = ARRAY_SIZE(bfin_sir3_resources),539.resource = bfin_sir3_resources,540};541#endif542#endif543544#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)545#include <linux/smsc911x.h>546547static struct resource smsc911x_resources[] = {548{549.name = "smsc911x-memory",550.start = 0x24000000,551.end = 0x24000000 + 0xFF,552.flags = IORESOURCE_MEM,553},554{555.start = IRQ_PE8,556.end = IRQ_PE8,557.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,558},559};560561static struct smsc911x_platform_config smsc911x_config = {562.flags = SMSC911X_USE_32BIT,563.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,564.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,565.phy_interface = PHY_INTERFACE_MODE_MII,566};567568static struct platform_device smsc911x_device = {569.name = "smsc911x",570.id = 0,571.num_resources = ARRAY_SIZE(smsc911x_resources),572.resource = smsc911x_resources,573.dev = {574.platform_data = &smsc911x_config,575},576};577#endif578579#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)580static struct resource musb_resources[] = {581[0] = {582.start = 0xFFC03C00,583.end = 0xFFC040FF,584.flags = IORESOURCE_MEM,585},586[1] = { /* general IRQ */587.start = IRQ_USB_INT0,588.end = IRQ_USB_INT0,589.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,590.name = "mc"591},592[2] = { /* DMA IRQ */593.start = IRQ_USB_DMA,594.end = IRQ_USB_DMA,595.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,596.name = "dma"597},598};599600static struct musb_hdrc_config musb_config = {601.multipoint = 0,602.dyn_fifo = 0,603.soft_con = 1,604.dma = 1,605.num_eps = 8,606.dma_channels = 8,607.gpio_vrsel = GPIO_PE7,608/* Some custom boards need to be active low, just set it to "0"609* if it is the case.610*/611.gpio_vrsel_active = 1,612.clkin = 24, /* musb CLKIN in MHZ */613};614615static struct musb_hdrc_platform_data musb_plat = {616#if defined(CONFIG_USB_MUSB_OTG)617.mode = MUSB_OTG,618#elif defined(CONFIG_USB_MUSB_HDRC_HCD)619.mode = MUSB_HOST,620#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)621.mode = MUSB_PERIPHERAL,622#endif623.config = &musb_config,624};625626static u64 musb_dmamask = ~(u32)0;627628static struct platform_device musb_device = {629.name = "musb-blackfin",630.id = 0,631.dev = {632.dma_mask = &musb_dmamask,633.coherent_dma_mask = 0xffffffff,634.platform_data = &musb_plat,635},636.num_resources = ARRAY_SIZE(musb_resources),637.resource = musb_resources,638};639#endif640641#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)642#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART643static struct resource bfin_sport0_uart_resources[] = {644{645.start = SPORT0_TCR1,646.end = SPORT0_MRCS3+4,647.flags = IORESOURCE_MEM,648},649{650.start = IRQ_SPORT0_RX,651.end = IRQ_SPORT0_RX+1,652.flags = IORESOURCE_IRQ,653},654{655.start = IRQ_SPORT0_ERROR,656.end = IRQ_SPORT0_ERROR,657.flags = IORESOURCE_IRQ,658},659};660661static unsigned short bfin_sport0_peripherals[] = {662P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,663P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0664};665666static struct platform_device bfin_sport0_uart_device = {667.name = "bfin-sport-uart",668.id = 0,669.num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),670.resource = bfin_sport0_uart_resources,671.dev = {672.platform_data = &bfin_sport0_peripherals, /* Passed to driver */673},674};675#endif676#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART677static struct resource bfin_sport1_uart_resources[] = {678{679.start = SPORT1_TCR1,680.end = SPORT1_MRCS3+4,681.flags = IORESOURCE_MEM,682},683{684.start = IRQ_SPORT1_RX,685.end = IRQ_SPORT1_RX+1,686.flags = IORESOURCE_IRQ,687},688{689.start = IRQ_SPORT1_ERROR,690.end = IRQ_SPORT1_ERROR,691.flags = IORESOURCE_IRQ,692},693};694695static unsigned short bfin_sport1_peripherals[] = {696P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,697P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0698};699700static struct platform_device bfin_sport1_uart_device = {701.name = "bfin-sport-uart",702.id = 1,703.num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),704.resource = bfin_sport1_uart_resources,705.dev = {706.platform_data = &bfin_sport1_peripherals, /* Passed to driver */707},708};709#endif710#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART711static struct resource bfin_sport2_uart_resources[] = {712{713.start = SPORT2_TCR1,714.end = SPORT2_MRCS3+4,715.flags = IORESOURCE_MEM,716},717{718.start = IRQ_SPORT2_RX,719.end = IRQ_SPORT2_RX+1,720.flags = IORESOURCE_IRQ,721},722{723.start = IRQ_SPORT2_ERROR,724.end = IRQ_SPORT2_ERROR,725.flags = IORESOURCE_IRQ,726},727};728729static unsigned short bfin_sport2_peripherals[] = {730P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS,731P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0732};733734static struct platform_device bfin_sport2_uart_device = {735.name = "bfin-sport-uart",736.id = 2,737.num_resources = ARRAY_SIZE(bfin_sport2_uart_resources),738.resource = bfin_sport2_uart_resources,739.dev = {740.platform_data = &bfin_sport2_peripherals, /* Passed to driver */741},742};743#endif744#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART745static struct resource bfin_sport3_uart_resources[] = {746{747.start = SPORT3_TCR1,748.end = SPORT3_MRCS3+4,749.flags = IORESOURCE_MEM,750},751{752.start = IRQ_SPORT3_RX,753.end = IRQ_SPORT3_RX+1,754.flags = IORESOURCE_IRQ,755},756{757.start = IRQ_SPORT3_ERROR,758.end = IRQ_SPORT3_ERROR,759.flags = IORESOURCE_IRQ,760},761};762763static unsigned short bfin_sport3_peripherals[] = {764P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS,765P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0766};767768static struct platform_device bfin_sport3_uart_device = {769.name = "bfin-sport-uart",770.id = 3,771.num_resources = ARRAY_SIZE(bfin_sport3_uart_resources),772.resource = bfin_sport3_uart_resources,773.dev = {774.platform_data = &bfin_sport3_peripherals, /* Passed to driver */775},776};777#endif778#endif779780#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)781782static unsigned short bfin_can0_peripherals[] = {783P_CAN0_RX, P_CAN0_TX, 0784};785786static struct resource bfin_can0_resources[] = {787{788.start = 0xFFC02A00,789.end = 0xFFC02FFF,790.flags = IORESOURCE_MEM,791},792{793.start = IRQ_CAN0_RX,794.end = IRQ_CAN0_RX,795.flags = IORESOURCE_IRQ,796},797{798.start = IRQ_CAN0_TX,799.end = IRQ_CAN0_TX,800.flags = IORESOURCE_IRQ,801},802{803.start = IRQ_CAN0_ERROR,804.end = IRQ_CAN0_ERROR,805.flags = IORESOURCE_IRQ,806},807};808809static struct platform_device bfin_can0_device = {810.name = "bfin_can",811.id = 0,812.num_resources = ARRAY_SIZE(bfin_can0_resources),813.resource = bfin_can0_resources,814.dev = {815.platform_data = &bfin_can0_peripherals, /* Passed to driver */816},817};818819static unsigned short bfin_can1_peripherals[] = {820P_CAN1_RX, P_CAN1_TX, 0821};822823static struct resource bfin_can1_resources[] = {824{825.start = 0xFFC03200,826.end = 0xFFC037FF,827.flags = IORESOURCE_MEM,828},829{830.start = IRQ_CAN1_RX,831.end = IRQ_CAN1_RX,832.flags = IORESOURCE_IRQ,833},834{835.start = IRQ_CAN1_TX,836.end = IRQ_CAN1_TX,837.flags = IORESOURCE_IRQ,838},839{840.start = IRQ_CAN1_ERROR,841.end = IRQ_CAN1_ERROR,842.flags = IORESOURCE_IRQ,843},844};845846static struct platform_device bfin_can1_device = {847.name = "bfin_can",848.id = 1,849.num_resources = ARRAY_SIZE(bfin_can1_resources),850.resource = bfin_can1_resources,851.dev = {852.platform_data = &bfin_can1_peripherals, /* Passed to driver */853},854};855856#endif857858#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)859static struct resource bfin_atapi_resources[] = {860{861.start = 0xFFC03800,862.end = 0xFFC0386F,863.flags = IORESOURCE_MEM,864},865{866.start = IRQ_ATAPI_ERR,867.end = IRQ_ATAPI_ERR,868.flags = IORESOURCE_IRQ,869},870};871872static struct platform_device bfin_atapi_device = {873.name = "pata-bf54x",874.id = -1,875.num_resources = ARRAY_SIZE(bfin_atapi_resources),876.resource = bfin_atapi_resources,877};878#endif879880#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)881static struct mtd_partition partition_info[] = {882{883.name = "bootloader(nand)",884.offset = 0,885.size = 0x80000,886}, {887.name = "linux kernel(nand)",888.offset = MTDPART_OFS_APPEND,889.size = 4 * 1024 * 1024,890},891{892.name = "file system(nand)",893.offset = MTDPART_OFS_APPEND,894.size = MTDPART_SIZ_FULL,895},896};897898static struct bf5xx_nand_platform bf5xx_nand_platform = {899.data_width = NFC_NWIDTH_8,900.partitions = partition_info,901.nr_partitions = ARRAY_SIZE(partition_info),902.rd_dly = 3,903.wr_dly = 3,904};905906static struct resource bf5xx_nand_resources[] = {907{908.start = 0xFFC03B00,909.end = 0xFFC03B4F,910.flags = IORESOURCE_MEM,911},912{913.start = CH_NFC,914.end = CH_NFC,915.flags = IORESOURCE_IRQ,916},917};918919static struct platform_device bf5xx_nand_device = {920.name = "bf5xx-nand",921.id = 0,922.num_resources = ARRAY_SIZE(bf5xx_nand_resources),923.resource = bf5xx_nand_resources,924.dev = {925.platform_data = &bf5xx_nand_platform,926},927};928#endif929930#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)931932static struct bfin_sd_host bfin_sdh_data = {933.dma_chan = CH_SDH,934.irq_int0 = IRQ_SDH_MASK0,935.pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},936};937938static struct platform_device bf54x_sdh_device = {939.name = "bfin-sdh",940.id = 0,941.dev = {942.platform_data = &bfin_sdh_data,943},944};945#endif946947#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)948static struct mtd_partition ezkit_partitions[] = {949{950.name = "bootloader(nor)",951.size = 0x80000,952.offset = 0,953}, {954.name = "linux kernel(nor)",955.size = 0x400000,956.offset = MTDPART_OFS_APPEND,957}, {958.name = "file system(nor)",959.size = 0x1000000 - 0x80000 - 0x400000 - 0x8000 * 4,960.offset = MTDPART_OFS_APPEND,961}, {962.name = "config(nor)",963.size = 0x8000 * 3,964.offset = MTDPART_OFS_APPEND,965}, {966.name = "u-boot env(nor)",967.size = 0x8000,968.offset = MTDPART_OFS_APPEND,969}970};971972static struct physmap_flash_data ezkit_flash_data = {973.width = 2,974.parts = ezkit_partitions,975.nr_parts = ARRAY_SIZE(ezkit_partitions),976};977978static struct resource ezkit_flash_resource = {979.start = 0x20000000,980.end = 0x21ffffff,981.flags = IORESOURCE_MEM,982};983984static struct platform_device ezkit_flash_device = {985.name = "physmap-flash",986.id = 0,987.dev = {988.platform_data = &ezkit_flash_data,989},990.num_resources = 1,991.resource = &ezkit_flash_resource,992};993#endif994995#if defined(CONFIG_MTD_M25P80) \996|| defined(CONFIG_MTD_M25P80_MODULE)997/* SPI flash chip (m25p16) */998static struct mtd_partition bfin_spi_flash_partitions[] = {999{1000.name = "bootloader(spi)",1001.size = 0x00080000,1002.offset = 0,1003.mask_flags = MTD_CAP_ROM1004}, {1005.name = "linux kernel(spi)",1006.size = MTDPART_SIZ_FULL,1007.offset = MTDPART_OFS_APPEND,1008}1009};10101011static struct flash_platform_data bfin_spi_flash_data = {1012.name = "m25p80",1013.parts = bfin_spi_flash_partitions,1014.nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),1015.type = "m25p16",1016};10171018static struct bfin5xx_spi_chip spi_flash_chip_info = {1019.enable_dma = 0, /* use dma transfer with this chip*/1020.bits_per_word = 8,1021};1022#endif10231024#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \1025|| defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)1026static struct bfin5xx_spi_chip ad1836_spi_chip_info = {1027.enable_dma = 0,1028.bits_per_word = 16,1029};1030#endif10311032#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)1033static struct bfin5xx_spi_chip spi_ad7877_chip_info = {1034.enable_dma = 0,1035.bits_per_word = 16,1036};10371038static const struct ad7877_platform_data bfin_ad7877_ts_info = {1039.model = 7877,1040.vref_delay_usecs = 50, /* internal, no capacitor */1041.x_plate_ohms = 419,1042.y_plate_ohms = 486,1043.pressure_max = 1000,1044.pressure_min = 0,1045.stopacq_polarity = 1,1046.first_conversion_delay = 3,1047.acquisition_time = 1,1048.averaging = 1,1049.pen_down_acc_interval = 1,1050};1051#endif10521053#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)1054static struct bfin5xx_spi_chip spidev_chip_info = {1055.enable_dma = 0,1056.bits_per_word = 8,1057};1058#endif10591060#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)1061static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {1062.enable_dma = 0, /* use dma transfer with this chip*/1063.bits_per_word = 8,1064};1065#endif10661067static struct spi_board_info bfin_spi_board_info[] __initdata = {1068#if defined(CONFIG_MTD_M25P80) \1069|| defined(CONFIG_MTD_M25P80_MODULE)1070{1071/* the modalias must be the same as spi device driver name */1072.modalias = "m25p80", /* Name of spi_driver for this device */1073.max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */1074.bus_num = 0, /* Framework bus number */1075.chip_select = 1, /* SPI_SSEL1*/1076.platform_data = &bfin_spi_flash_data,1077.controller_data = &spi_flash_chip_info,1078.mode = SPI_MODE_3,1079},1080#endif1081#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \1082|| defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)1083{1084.modalias = "ad183x",1085.max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */1086.bus_num = 1,1087.chip_select = 4,1088.controller_data = &ad1836_spi_chip_info,1089},1090#endif1091#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)1092{1093.modalias = "ad7877",1094.platform_data = &bfin_ad7877_ts_info,1095.irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */1096.max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */1097.bus_num = 0,1098.chip_select = 2,1099.controller_data = &spi_ad7877_chip_info,1100},1101#endif1102#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)1103{1104.modalias = "spidev",1105.max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */1106.bus_num = 0,1107.chip_select = 1,1108.controller_data = &spidev_chip_info,1109},1110#endif1111#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)1112{1113.modalias = "adxl34x",1114.platform_data = &adxl34x_info,1115.irq = IRQ_PC5,1116.max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */1117.bus_num = 1,1118.chip_select = 2,1119.controller_data = &spi_adxl34x_chip_info,1120.mode = SPI_MODE_3,1121},1122#endif1123};1124#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)1125/* SPI (0) */1126static struct resource bfin_spi0_resource[] = {1127[0] = {1128.start = SPI0_REGBASE,1129.end = SPI0_REGBASE + 0xFF,1130.flags = IORESOURCE_MEM,1131},1132[1] = {1133.start = CH_SPI0,1134.end = CH_SPI0,1135.flags = IORESOURCE_DMA,1136},1137[2] = {1138.start = IRQ_SPI0,1139.end = IRQ_SPI0,1140.flags = IORESOURCE_IRQ,1141}1142};11431144/* SPI (1) */1145static struct resource bfin_spi1_resource[] = {1146[0] = {1147.start = SPI1_REGBASE,1148.end = SPI1_REGBASE + 0xFF,1149.flags = IORESOURCE_MEM,1150},1151[1] = {1152.start = CH_SPI1,1153.end = CH_SPI1,1154.flags = IORESOURCE_DMA,1155},1156[2] = {1157.start = IRQ_SPI1,1158.end = IRQ_SPI1,1159.flags = IORESOURCE_IRQ,1160}1161};11621163/* SPI controller data */1164static struct bfin5xx_spi_master bf54x_spi_master_info0 = {1165.num_chipselect = 4,1166.enable_dma = 1, /* master has the ability to do dma transfer */1167.pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},1168};11691170static struct platform_device bf54x_spi_master0 = {1171.name = "bfin-spi",1172.id = 0, /* Bus number */1173.num_resources = ARRAY_SIZE(bfin_spi0_resource),1174.resource = bfin_spi0_resource,1175.dev = {1176.platform_data = &bf54x_spi_master_info0, /* Passed to driver */1177},1178};11791180static struct bfin5xx_spi_master bf54x_spi_master_info1 = {1181.num_chipselect = 4,1182.enable_dma = 1, /* master has the ability to do dma transfer */1183.pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},1184};11851186static struct platform_device bf54x_spi_master1 = {1187.name = "bfin-spi",1188.id = 1, /* Bus number */1189.num_resources = ARRAY_SIZE(bfin_spi1_resource),1190.resource = bfin_spi1_resource,1191.dev = {1192.platform_data = &bf54x_spi_master_info1, /* Passed to driver */1193},1194};1195#endif /* spi master and devices */11961197#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)1198static struct resource bfin_twi0_resource[] = {1199[0] = {1200.start = TWI0_REGBASE,1201.end = TWI0_REGBASE + 0xFF,1202.flags = IORESOURCE_MEM,1203},1204[1] = {1205.start = IRQ_TWI0,1206.end = IRQ_TWI0,1207.flags = IORESOURCE_IRQ,1208},1209};12101211static struct platform_device i2c_bfin_twi0_device = {1212.name = "i2c-bfin-twi",1213.id = 0,1214.num_resources = ARRAY_SIZE(bfin_twi0_resource),1215.resource = bfin_twi0_resource,1216};12171218#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */1219static struct resource bfin_twi1_resource[] = {1220[0] = {1221.start = TWI1_REGBASE,1222.end = TWI1_REGBASE + 0xFF,1223.flags = IORESOURCE_MEM,1224},1225[1] = {1226.start = IRQ_TWI1,1227.end = IRQ_TWI1,1228.flags = IORESOURCE_IRQ,1229},1230};12311232static struct platform_device i2c_bfin_twi1_device = {1233.name = "i2c-bfin-twi",1234.id = 1,1235.num_resources = ARRAY_SIZE(bfin_twi1_resource),1236.resource = bfin_twi1_resource,1237};1238#endif1239#endif12401241static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {1242};12431244#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */1245static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {1246#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)1247{1248I2C_BOARD_INFO("pcf8574_lcd", 0x22),1249},1250#endif1251#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)1252{1253I2C_BOARD_INFO("pcf8574_keypad", 0x27),1254.irq = 212,1255},1256#endif1257#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)1258{1259I2C_BOARD_INFO("adxl34x", 0x53),1260.irq = IRQ_PC5,1261.platform_data = (void *)&adxl34x_info,1262},1263#endif1264#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)1265{1266I2C_BOARD_INFO("ad5252", 0x2f),1267},1268#endif1269};1270#endif12711272#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)1273#include <linux/gpio_keys.h>12741275static struct gpio_keys_button bfin_gpio_keys_table[] = {1276{BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},1277{BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},1278{BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},1279{BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},1280};12811282static struct gpio_keys_platform_data bfin_gpio_keys_data = {1283.buttons = bfin_gpio_keys_table,1284.nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),1285};12861287static struct platform_device bfin_device_gpiokeys = {1288.name = "gpio-keys",1289.dev = {1290.platform_data = &bfin_gpio_keys_data,1291},1292};1293#endif12941295static const unsigned int cclk_vlev_datasheet[] =1296{1297/*1298* Internal VLEV BF54XSBBC15331299****temporarily using these values until data sheet is updated1300*/1301VRPAIR(VLEV_085, 150000000),1302VRPAIR(VLEV_090, 250000000),1303VRPAIR(VLEV_110, 276000000),1304VRPAIR(VLEV_115, 301000000),1305VRPAIR(VLEV_120, 525000000),1306VRPAIR(VLEV_125, 550000000),1307VRPAIR(VLEV_130, 600000000),1308};13091310static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {1311.tuple_tab = cclk_vlev_datasheet,1312.tabsize = ARRAY_SIZE(cclk_vlev_datasheet),1313.vr_settling_time = 25 /* us */,1314};13151316static struct platform_device bfin_dpmc = {1317.name = "bfin dpmc",1318.dev = {1319.platform_data = &bfin_dmpc_vreg_data,1320},1321};13221323#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \1324defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \1325defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)13261327#define SPORT_REQ(x) \1328[x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \1329P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0}13301331static const u16 bfin_snd_pin[][7] = {1332SPORT_REQ(0),1333SPORT_REQ(1),1334};13351336static struct bfin_snd_platform_data bfin_snd_data[] = {1337{1338.pin_req = &bfin_snd_pin[0][0],1339},1340{1341.pin_req = &bfin_snd_pin[1][0],1342},1343};13441345#define BFIN_SND_RES(x) \1346[x] = { \1347{ \1348.start = SPORT##x##_TCR1, \1349.end = SPORT##x##_TCR1, \1350.flags = IORESOURCE_MEM \1351}, \1352{ \1353.start = CH_SPORT##x##_RX, \1354.end = CH_SPORT##x##_RX, \1355.flags = IORESOURCE_DMA, \1356}, \1357{ \1358.start = CH_SPORT##x##_TX, \1359.end = CH_SPORT##x##_TX, \1360.flags = IORESOURCE_DMA, \1361}, \1362{ \1363.start = IRQ_SPORT##x##_ERROR, \1364.end = IRQ_SPORT##x##_ERROR, \1365.flags = IORESOURCE_IRQ, \1366} \1367}13681369static struct resource bfin_snd_resources[][4] = {1370BFIN_SND_RES(0),1371BFIN_SND_RES(1),1372};13731374static struct platform_device bfin_pcm = {1375.name = "bfin-pcm-audio",1376.id = -1,1377};1378#endif13791380#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)1381static struct platform_device bfin_ad73311_codec_device = {1382.name = "ad73311",1383.id = -1,1384};1385#endif13861387#if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)1388static struct platform_device bfin_ad1980_codec_device = {1389.name = "ad1980",1390.id = -1,1391};1392#endif13931394#if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)1395static struct platform_device bfin_i2s = {1396.name = "bfin-i2s",1397.id = CONFIG_SND_BF5XX_SPORT_NUM,1398.num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),1399.resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],1400.dev = {1401.platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],1402},1403};1404#endif14051406#if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)1407static struct platform_device bfin_tdm = {1408.name = "bfin-tdm",1409.id = CONFIG_SND_BF5XX_SPORT_NUM,1410.num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),1411.resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],1412.dev = {1413.platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],1414},1415};1416#endif14171418#if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)1419static struct platform_device bfin_ac97 = {1420.name = "bfin-ac97",1421.id = CONFIG_SND_BF5XX_SPORT_NUM,1422.num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),1423.resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],1424.dev = {1425.platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],1426},1427};1428#endif14291430static struct platform_device *ezkit_devices[] __initdata = {14311432&bfin_dpmc,14331434#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)1435&rtc_device,1436#endif14371438#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)1439#ifdef CONFIG_SERIAL_BFIN_UART01440&bfin_uart0_device,1441#endif1442#ifdef CONFIG_SERIAL_BFIN_UART11443&bfin_uart1_device,1444#endif1445#ifdef CONFIG_SERIAL_BFIN_UART21446&bfin_uart2_device,1447#endif1448#ifdef CONFIG_SERIAL_BFIN_UART31449&bfin_uart3_device,1450#endif1451#endif14521453#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)1454#ifdef CONFIG_BFIN_SIR01455&bfin_sir0_device,1456#endif1457#ifdef CONFIG_BFIN_SIR11458&bfin_sir1_device,1459#endif1460#ifdef CONFIG_BFIN_SIR21461&bfin_sir2_device,1462#endif1463#ifdef CONFIG_BFIN_SIR31464&bfin_sir3_device,1465#endif1466#endif14671468#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)1469&bf54x_lq043_device,1470#endif14711472#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)1473&smsc911x_device,1474#endif14751476#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)1477&musb_device,1478#endif14791480#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)1481&bfin_isp1760_device,1482#endif14831484#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)1485#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART1486&bfin_sport0_uart_device,1487#endif1488#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART1489&bfin_sport1_uart_device,1490#endif1491#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART1492&bfin_sport2_uart_device,1493#endif1494#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART1495&bfin_sport3_uart_device,1496#endif1497#endif14981499#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)1500&bfin_can0_device,1501&bfin_can1_device,1502#endif15031504#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)1505&bfin_atapi_device,1506#endif15071508#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)1509&bf5xx_nand_device,1510#endif15111512#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)1513&bf54x_sdh_device,1514#endif15151516#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)1517&bf54x_spi_master0,1518&bf54x_spi_master1,1519#endif15201521#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)1522&bf54x_kpad_device,1523#endif15241525#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)1526&bfin_rotary_device,1527#endif15281529#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)1530&i2c_bfin_twi0_device,1531#if !defined(CONFIG_BF542)1532&i2c_bfin_twi1_device,1533#endif1534#endif15351536#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)1537&bfin_device_gpiokeys,1538#endif15391540#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)1541&ezkit_flash_device,1542#endif15431544#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \1545defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \1546defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)1547&bfin_pcm,1548#endif15491550#if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)1551&bfin_ad1980_codec_device,1552#endif15531554#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)1555&bfin_i2s,1556#endif15571558#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)1559&bfin_tdm,1560#endif15611562#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)1563&bfin_ac97,1564#endif1565};15661567static int __init ezkit_init(void)1568{1569printk(KERN_INFO "%s(): registering device resources\n", __func__);15701571i2c_register_board_info(0, bfin_i2c_board_info0,1572ARRAY_SIZE(bfin_i2c_board_info0));1573#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */1574i2c_register_board_info(1, bfin_i2c_board_info1,1575ARRAY_SIZE(bfin_i2c_board_info1));1576#endif15771578platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));15791580spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));15811582return 0;1583}15841585arch_initcall(ezkit_init);15861587static struct platform_device *ezkit_early_devices[] __initdata = {1588#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)1589#ifdef CONFIG_SERIAL_BFIN_UART01590&bfin_uart0_device,1591#endif1592#ifdef CONFIG_SERIAL_BFIN_UART11593&bfin_uart1_device,1594#endif1595#ifdef CONFIG_SERIAL_BFIN_UART21596&bfin_uart2_device,1597#endif1598#ifdef CONFIG_SERIAL_BFIN_UART31599&bfin_uart3_device,1600#endif1601#endif16021603#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)1604#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART1605&bfin_sport0_uart_device,1606#endif1607#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART1608&bfin_sport1_uart_device,1609#endif1610#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART1611&bfin_sport2_uart_device,1612#endif1613#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART1614&bfin_sport3_uart_device,1615#endif1616#endif1617};16181619void __init native_machine_early_platform_add_devices(void)1620{1621printk(KERN_INFO "register early platform devices\n");1622early_platform_add_devices(ezkit_early_devices,1623ARRAY_SIZE(ezkit_early_devices));1624}162516261627