X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fblackfin%2Fmach-bf548%2Fboards%2Fezkit.c;h=d5330d4f79d337f2715f0de2b68cc55c38b1945e;hb=6e668936db12550ab5a6a758f236140101e5a644;hp=2c47db494f7de50cef4858d1ee4394ec2852031a;hpb=92633b72d18ca4f25de1f28e436a882159491e7e;p=linux-2.6 diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c index 2c47db494f..d5330d4f79 100644 --- a/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/arch/blackfin/mach-bf548/boards/ezkit.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +51,7 @@ /* * Name the Board for the /proc/cpuinfo */ -char *bfin_board_name = "ADSP-BF548-EZKIT"; +const char bfin_board_name[] = "ADSP-BF548-EZKIT"; /* * Driver needs to know address, irq and flag pin. @@ -88,7 +90,7 @@ static struct platform_device bf54x_lq043_device = { #endif #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) -static int bf548_keymap[] = { +static const unsigned int bf548_keymap[] = { KEYVAL(0, 0, KEY_ENTER), KEYVAL(0, 1, KEY_HELP), KEYVAL(0, 2, KEY_0), @@ -110,8 +112,8 @@ static int bf548_keymap[] = { static struct bfin_kpad_platform_data bf54x_kpad_data = { .rows = 4, .cols = 4, - .keymap = bf548_keymap, - .keymapsize = ARRAY_SIZE(bf548_keymap), + .keymap = bf548_keymap, + .keymapsize = ARRAY_SIZE(bf548_keymap), .repeat = 0, .debounce_time = 5000, /* ns (5ms) */ .coldrive_time = 1000, /* ns (1ms) */ @@ -205,23 +207,6 @@ static struct platform_device smsc911x_device = { }; #endif -#if defined(CONFIG_USB_BF54x_HCD) || defined(CONFIG_USB_BF54x_HCD_MODULE) -static struct resource bf54x_hcd_resources[] = { - { - .start = 0xFFC03C00, - .end = 0xFFC040FF, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device bf54x_hcd = { - .name = "bf54x-hcd", - .id = 0, - .num_resources = ARRAY_SIZE(bf54x_hcd_resources), - .resource = bf54x_hcd_resources, -}; -#endif - #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) static struct resource musb_resources[] = { [0] = { @@ -242,14 +227,14 @@ static struct resource musb_resources[] = { }; static struct musb_hdrc_platform_data musb_plat = { -#ifdef CONFIG_USB_MUSB_OTG +#if defined(CONFIG_USB_MUSB_OTG) .mode = MUSB_OTG, -#elif CONFIG_USB_MUSB_HDRC_HCD +#elif defined(CONFIG_USB_MUSB_HDRC_HCD) .mode = MUSB_HOST, -#elif CONFIG_USB_GADGET_MUSB_HDRC +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC) .mode = MUSB_PERIPHERAL, #endif - .multipoint = 1, + .multipoint = 0, }; static u64 musb_dmamask = ~(u32)0; @@ -343,6 +328,44 @@ static struct platform_device bf54x_sdh_device = { }; #endif +static struct mtd_partition ezkit_partitions[] = { + { + .name = "Bootloader", + .size = 0x20000, + .offset = 0, + }, { + .name = "Kernel", + .size = 0xE0000, + .offset = MTDPART_OFS_APPEND, + }, { + .name = "RootFS", + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, + } +}; + +static struct physmap_flash_data ezkit_flash_data = { + .width = 2, + .parts = ezkit_partitions, + .nr_parts = ARRAY_SIZE(ezkit_partitions), +}; + +static struct resource ezkit_flash_resource = { + .start = 0x20000000, + .end = 0x20ffffff, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device ezkit_flash_device = { + .name = "physmap-flash", + .id = 0, + .dev = { + .platform_data = &ezkit_flash_data, + }, + .num_resources = 1, + .resource = &ezkit_flash_resource, +}; + #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) /* all SPI peripherals info goes here */ #if defined(CONFIG_MTD_M25P80) \ @@ -377,7 +400,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) static struct bfin5xx_spi_chip spi_ad7877_chip_info = { - .cs_change_per_word = 1, + .cs_change_per_word = 0, .enable_dma = 0, .bits_per_word = 16, }; @@ -397,6 +420,13 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = { }; #endif +#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) +static struct bfin5xx_spi_chip spidev_chip_info = { + .enable_dma = 0, + .bits_per_word = 8, +}; +#endif + static struct spi_board_info bf54x_spi_board_info[] __initdata = { #if defined(CONFIG_MTD_M25P80) \ || defined(CONFIG_MTD_M25P80_MODULE) @@ -422,6 +452,15 @@ static struct spi_board_info bf54x_spi_board_info[] __initdata = { .controller_data = &spi_ad7877_chip_info, }, #endif +#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) + { + .modalias = "spidev", + .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ + .bus_num = 0, + .chip_select = 1, + .controller_data = &spidev_chip_info, + }, +#endif }; /* SPI (0) */ @@ -453,9 +492,10 @@ static struct resource bfin_spi1_resource[] = { }; /* SPI controller data */ -static struct bfin5xx_spi_master bf54x_spi_master_info = { +static struct bfin5xx_spi_master bf54x_spi_master_info0 = { .num_chipselect = 8, .enable_dma = 1, /* master has the ability to do dma transfer */ + .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, }; static struct platform_device bf54x_spi_master0 = { @@ -464,17 +504,23 @@ static struct platform_device bf54x_spi_master0 = { .num_resources = ARRAY_SIZE(bfin_spi0_resource), .resource = bfin_spi0_resource, .dev = { - .platform_data = &bf54x_spi_master_info, /* Passed to driver */ + .platform_data = &bf54x_spi_master_info0, /* Passed to driver */ }, }; +static struct bfin5xx_spi_master bf54x_spi_master_info1 = { + .num_chipselect = 8, + .enable_dma = 1, /* master has the ability to do dma transfer */ + .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, +}; + static struct platform_device bf54x_spi_master1 = { .name = "bfin-spi", .id = 1, /* Bus number */ .num_resources = ARRAY_SIZE(bfin_spi1_resource), .resource = bfin_spi1_resource, .dev = { - .platform_data = &bf54x_spi_master_info, /* Passed to driver */ + .platform_data = &bf54x_spi_master_info1, /* Passed to driver */ }, }; #endif /* spi master and devices */ @@ -500,6 +546,7 @@ static struct platform_device i2c_bfin_twi0_device = { .resource = bfin_twi0_resource, }; +#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ static struct resource bfin_twi1_resource[] = { [0] = { .start = TWI1_REGBASE, @@ -520,6 +567,30 @@ static struct platform_device i2c_bfin_twi1_device = { .resource = bfin_twi1_resource, }; #endif +#endif + +#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) +#include + +static struct gpio_keys_button bfin_gpio_keys_table[] = { + {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"}, + {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"}, + {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"}, + {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"}, +}; + +static struct gpio_keys_platform_data bfin_gpio_keys_data = { + .buttons = bfin_gpio_keys_table, + .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), +}; + +static struct platform_device bfin_device_gpiokeys = { + .name = "gpio-keys", + .dev = { + .platform_data = &bfin_gpio_keys_data, + }, +}; +#endif static struct platform_device *ezkit_devices[] __initdata = { #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) @@ -538,10 +609,6 @@ static struct platform_device *ezkit_devices[] __initdata = { &smsc911x_device, #endif -#if defined(CONFIG_USB_BF54x_HCD) || defined(CONFIG_USB_BF54x_HCD_MODULE) - &bf54x_hcd, -#endif - #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) &musb_device, #endif @@ -560,7 +627,7 @@ static struct platform_device *ezkit_devices[] __initdata = { #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) &bf54x_spi_master0, -/* &bf54x_spi_master1,*/ + &bf54x_spi_master1, #endif #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) @@ -569,11 +636,18 @@ static struct platform_device *ezkit_devices[] __initdata = { #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) &i2c_bfin_twi0_device, +#if !defined(CONFIG_BF542) &i2c_bfin_twi1_device, #endif +#endif + +#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) + &bfin_device_gpiokeys, +#endif + &ezkit_flash_device, }; -static int __init stamp_init(void) +static int __init ezkit_init(void) { printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); @@ -586,4 +660,4 @@ static int __init stamp_init(void) return 0; } -arch_initcall(stamp_init); +arch_initcall(ezkit_init);