2 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
6 * Licensed under the GPL-2 or later.
9 #include <linux/device.h>
10 #include <linux/platform_device.h>
11 #include <linux/mtd/mtd.h>
12 #include <linux/mtd/partitions.h>
13 #include <linux/mtd/physmap.h>
14 #include <linux/spi/spi.h>
15 #include <linux/spi/flash.h>
17 #include <linux/i2c.h>
18 #include <linux/irq.h>
19 #include <linux/interrupt.h>
21 #include <asm/bfin5xx_spi.h>
22 #include <asm/reboot.h>
23 #include <asm/portmux.h>
25 #include <asm/bfin_sdh.h>
26 #include <linux/spi/ad7877.h>
30 * Name the Board for the /proc/cpuinfo
32 const char bfin_board_name[] = "ADI BF518F-EZBRD";
35 * Driver needs to know address, irq and flag pin.
38 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
39 static struct mtd_partition ezbrd_partitions[] = {
41 .name = "bootloader(nor)",
45 .name = "linux kernel(nor)",
47 .offset = MTDPART_OFS_APPEND,
49 .name = "file system(nor)",
50 .size = MTDPART_SIZ_FULL,
51 .offset = MTDPART_OFS_APPEND,
55 static struct physmap_flash_data ezbrd_flash_data = {
57 .parts = ezbrd_partitions,
58 .nr_parts = ARRAY_SIZE(ezbrd_partitions),
61 static struct resource ezbrd_flash_resource = {
63 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
68 .flags = IORESOURCE_MEM,
71 static struct platform_device ezbrd_flash_device = {
72 .name = "physmap-flash",
75 .platform_data = &ezbrd_flash_data,
78 .resource = &ezbrd_flash_resource,
82 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
83 static struct platform_device rtc_device = {
89 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
90 #include <linux/bfin_mac.h>
91 static const unsigned short bfin_mac_peripherals[] = {
105 static struct bfin_phydev_platform_data bfin_phydev_data[] = {
108 .irq = IRQ_MAC_PHYINT,
112 .irq = IRQ_MAC_PHYINT,
116 .irq = IRQ_MAC_PHYINT,
120 static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
122 .phydev_data = bfin_phydev_data,
123 .phy_mode = PHY_INTERFACE_MODE_MII,
124 .mac_peripherals = bfin_mac_peripherals,
127 static struct platform_device bfin_mii_bus = {
128 .name = "bfin_mii_bus",
130 .platform_data = &bfin_mii_bus_data,
134 static struct platform_device bfin_mac_device = {
137 .platform_data = &bfin_mii_bus,
141 #if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
142 static struct dsa_chip_data ksz8893m_switch_chip_data = {
143 .mii_bus = &bfin_mii_bus.dev,
151 static struct dsa_platform_data ksz8893m_switch_data = {
153 .netdev = &bfin_mac_device.dev,
154 .chip = &ksz8893m_switch_chip_data,
157 static struct platform_device ksz8893m_switch_device = {
161 .dev.platform_data = &ksz8893m_switch_data,
166 #if defined(CONFIG_MTD_M25P80) \
167 || defined(CONFIG_MTD_M25P80_MODULE)
168 static struct mtd_partition bfin_spi_flash_partitions[] = {
170 .name = "bootloader(spi)",
173 .mask_flags = MTD_CAP_ROM
175 .name = "linux kernel(spi)",
176 .size = MTDPART_SIZ_FULL,
177 .offset = MTDPART_OFS_APPEND,
181 static struct flash_platform_data bfin_spi_flash_data = {
183 .parts = bfin_spi_flash_partitions,
184 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
188 /* SPI flash chip (m25p64) */
189 static struct bfin5xx_spi_chip spi_flash_chip_info = {
190 .enable_dma = 0, /* use dma transfer with this chip*/
195 #if defined(CONFIG_BFIN_SPI_ADC) \
196 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
198 static struct bfin5xx_spi_chip spi_adc_chip_info = {
199 .enable_dma = 1, /* use dma transfer with this chip*/
204 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
205 #if defined(CONFIG_NET_DSA_KSZ8893M) \
206 || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
207 /* SPI SWITCH CHIP */
208 static struct bfin5xx_spi_chip spi_switch_info = {
215 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
216 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
222 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
223 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
228 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
230 .vref_delay_usecs = 50, /* internal, no capacitor */
233 .pressure_max = 1000,
235 .stopacq_polarity = 1,
236 .first_conversion_delay = 3,
237 .acquisition_time = 1,
239 .pen_down_acc_interval = 1,
243 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
244 && defined(CONFIG_SND_SOC_WM8731_SPI)
245 static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
251 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
252 static struct bfin5xx_spi_chip spidev_chip_info = {
258 static struct spi_board_info bfin_spi_board_info[] __initdata = {
259 #if defined(CONFIG_MTD_M25P80) \
260 || defined(CONFIG_MTD_M25P80_MODULE)
262 /* the modalias must be the same as spi device driver name */
263 .modalias = "m25p80", /* Name of spi_driver for this device */
264 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
265 .bus_num = 0, /* Framework bus number */
266 .chip_select = 2, /* On BF518F-EZBRD it's SPI0_SSEL2 */
267 .platform_data = &bfin_spi_flash_data,
268 .controller_data = &spi_flash_chip_info,
273 #if defined(CONFIG_BFIN_SPI_ADC) \
274 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
276 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
277 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
278 .bus_num = 0, /* Framework bus number */
279 .chip_select = 1, /* Framework chip select. */
280 .platform_data = NULL, /* No spi_driver specific config */
281 .controller_data = &spi_adc_chip_info,
285 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
286 #if defined(CONFIG_NET_DSA_KSZ8893M) \
287 || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
289 .modalias = "ksz8893m",
290 .max_speed_hz = 5000000,
293 .platform_data = NULL,
294 .controller_data = &spi_switch_info,
300 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
302 .modalias = "mmc_spi",
303 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
306 .controller_data = &mmc_spi_chip_info,
310 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
312 .modalias = "ad7877",
313 .platform_data = &bfin_ad7877_ts_info,
315 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
318 .controller_data = &spi_ad7877_chip_info,
321 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
322 && defined(CONFIG_SND_SOC_WM8731_SPI)
324 .modalias = "wm8731",
325 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
328 .controller_data = &spi_wm8731_chip_info,
332 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
334 .modalias = "spidev",
335 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
338 .controller_data = &spidev_chip_info,
341 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
343 .modalias = "bfin-lq035q1-spi",
344 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
347 .controller_data = &lq035q1_spi_chip_info,
348 .mode = SPI_CPHA | SPI_CPOL,
353 /* SPI controller data */
354 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
356 static struct bfin5xx_spi_master bfin_spi0_info = {
358 .enable_dma = 1, /* master has the ability to do dma transfer */
359 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
362 static struct resource bfin_spi0_resource[] = {
364 .start = SPI0_REGBASE,
365 .end = SPI0_REGBASE + 0xFF,
366 .flags = IORESOURCE_MEM,
371 .flags = IORESOURCE_DMA,
376 .flags = IORESOURCE_IRQ,
380 static struct platform_device bfin_spi0_device = {
382 .id = 0, /* Bus number */
383 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
384 .resource = bfin_spi0_resource,
386 .platform_data = &bfin_spi0_info, /* Passed to driver */
391 static struct bfin5xx_spi_master bfin_spi1_info = {
393 .enable_dma = 1, /* master has the ability to do dma transfer */
394 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
397 static struct resource bfin_spi1_resource[] = {
399 .start = SPI1_REGBASE,
400 .end = SPI1_REGBASE + 0xFF,
401 .flags = IORESOURCE_MEM,
406 .flags = IORESOURCE_DMA,
411 .flags = IORESOURCE_IRQ,
415 static struct platform_device bfin_spi1_device = {
417 .id = 1, /* Bus number */
418 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
419 .resource = bfin_spi1_resource,
421 .platform_data = &bfin_spi1_info, /* Passed to driver */
424 #endif /* spi master and devices */
426 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
427 #ifdef CONFIG_SERIAL_BFIN_UART0
428 static struct resource bfin_uart0_resources[] = {
432 .flags = IORESOURCE_MEM,
435 .start = IRQ_UART0_RX,
436 .end = IRQ_UART0_RX+1,
437 .flags = IORESOURCE_IRQ,
440 .start = IRQ_UART0_ERROR,
441 .end = IRQ_UART0_ERROR,
442 .flags = IORESOURCE_IRQ,
445 .start = CH_UART0_TX,
447 .flags = IORESOURCE_DMA,
450 .start = CH_UART0_RX,
452 .flags = IORESOURCE_DMA,
456 unsigned short bfin_uart0_peripherals[] = {
457 P_UART0_TX, P_UART0_RX, 0
460 static struct platform_device bfin_uart0_device = {
463 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
464 .resource = bfin_uart0_resources,
466 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
470 #ifdef CONFIG_SERIAL_BFIN_UART1
471 static struct resource bfin_uart1_resources[] = {
475 .flags = IORESOURCE_MEM,
478 .start = IRQ_UART1_RX,
479 .end = IRQ_UART1_RX+1,
480 .flags = IORESOURCE_IRQ,
483 .start = IRQ_UART1_ERROR,
484 .end = IRQ_UART1_ERROR,
485 .flags = IORESOURCE_IRQ,
488 .start = CH_UART1_TX,
490 .flags = IORESOURCE_DMA,
493 .start = CH_UART1_RX,
495 .flags = IORESOURCE_DMA,
499 unsigned short bfin_uart1_peripherals[] = {
500 P_UART1_TX, P_UART1_RX, 0
503 static struct platform_device bfin_uart1_device = {
506 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
507 .resource = bfin_uart1_resources,
509 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
515 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
516 #ifdef CONFIG_BFIN_SIR0
517 static struct resource bfin_sir0_resources[] = {
521 .flags = IORESOURCE_MEM,
524 .start = IRQ_UART0_RX,
525 .end = IRQ_UART0_RX+1,
526 .flags = IORESOURCE_IRQ,
529 .start = CH_UART0_RX,
530 .end = CH_UART0_RX+1,
531 .flags = IORESOURCE_DMA,
535 static struct platform_device bfin_sir0_device = {
538 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
539 .resource = bfin_sir0_resources,
542 #ifdef CONFIG_BFIN_SIR1
543 static struct resource bfin_sir1_resources[] = {
547 .flags = IORESOURCE_MEM,
550 .start = IRQ_UART1_RX,
551 .end = IRQ_UART1_RX+1,
552 .flags = IORESOURCE_IRQ,
555 .start = CH_UART1_RX,
556 .end = CH_UART1_RX+1,
557 .flags = IORESOURCE_DMA,
561 static struct platform_device bfin_sir1_device = {
564 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
565 .resource = bfin_sir1_resources,
570 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
571 static struct platform_device bfin_i2s = {
573 .id = CONFIG_SND_BF5XX_SPORT_NUM,
574 /* TODO: add platform data here */
578 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
579 static struct resource bfin_twi0_resource[] = {
581 .start = TWI0_REGBASE,
583 .flags = IORESOURCE_MEM,
588 .flags = IORESOURCE_IRQ,
592 static struct platform_device i2c_bfin_twi_device = {
593 .name = "i2c-bfin-twi",
595 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
596 .resource = bfin_twi0_resource,
600 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
601 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
603 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
606 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
608 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
612 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
614 I2C_BOARD_INFO("ssm2602", 0x1b),
619 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
620 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
621 static struct resource bfin_sport0_uart_resources[] = {
623 .start = SPORT0_TCR1,
624 .end = SPORT0_MRCS3+4,
625 .flags = IORESOURCE_MEM,
628 .start = IRQ_SPORT0_RX,
629 .end = IRQ_SPORT0_RX+1,
630 .flags = IORESOURCE_IRQ,
633 .start = IRQ_SPORT0_ERROR,
634 .end = IRQ_SPORT0_ERROR,
635 .flags = IORESOURCE_IRQ,
639 unsigned short bfin_sport0_peripherals[] = {
640 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
641 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
644 static struct platform_device bfin_sport0_uart_device = {
645 .name = "bfin-sport-uart",
647 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
648 .resource = bfin_sport0_uart_resources,
650 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
654 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
655 static struct resource bfin_sport1_uart_resources[] = {
657 .start = SPORT1_TCR1,
658 .end = SPORT1_MRCS3+4,
659 .flags = IORESOURCE_MEM,
662 .start = IRQ_SPORT1_RX,
663 .end = IRQ_SPORT1_RX+1,
664 .flags = IORESOURCE_IRQ,
667 .start = IRQ_SPORT1_ERROR,
668 .end = IRQ_SPORT1_ERROR,
669 .flags = IORESOURCE_IRQ,
673 unsigned short bfin_sport1_peripherals[] = {
674 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
675 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
678 static struct platform_device bfin_sport1_uart_device = {
679 .name = "bfin-sport-uart",
681 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
682 .resource = bfin_sport1_uart_resources,
684 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
690 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
691 #include <linux/input.h>
692 #include <linux/gpio_keys.h>
694 static struct gpio_keys_button bfin_gpio_keys_table[] = {
695 {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
696 {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
699 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
700 .buttons = bfin_gpio_keys_table,
701 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
704 static struct platform_device bfin_device_gpiokeys = {
707 .platform_data = &bfin_gpio_keys_data,
712 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
714 static struct bfin_sd_host bfin_sdh_data = {
716 .irq_int0 = IRQ_RSI_INT0,
717 .pin_req = {P_RSI_DATA0, P_RSI_DATA1, P_RSI_DATA2, P_RSI_DATA3, P_RSI_CMD, P_RSI_CLK, 0},
720 static struct platform_device bf51x_sdh_device = {
724 .platform_data = &bfin_sdh_data,
729 static const unsigned int cclk_vlev_datasheet[] =
731 VRPAIR(VLEV_100, 400000000),
732 VRPAIR(VLEV_105, 426000000),
733 VRPAIR(VLEV_110, 500000000),
734 VRPAIR(VLEV_115, 533000000),
735 VRPAIR(VLEV_120, 600000000),
738 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
739 .tuple_tab = cclk_vlev_datasheet,
740 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
741 .vr_settling_time = 25 /* us */,
744 static struct platform_device bfin_dpmc = {
747 .platform_data = &bfin_dmpc_vreg_data,
751 static struct platform_device *stamp_devices[] __initdata = {
755 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
759 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
762 #if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
763 &ksz8893m_switch_device,
767 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
772 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
773 #ifdef CONFIG_SERIAL_BFIN_UART0
776 #ifdef CONFIG_SERIAL_BFIN_UART1
781 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
782 #ifdef CONFIG_BFIN_SIR0
785 #ifdef CONFIG_BFIN_SIR1
790 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
791 &i2c_bfin_twi_device,
794 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
798 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
799 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
800 &bfin_sport0_uart_device,
802 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
803 &bfin_sport1_uart_device,
807 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
808 &bfin_device_gpiokeys,
811 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
815 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
820 static int __init ezbrd_init(void)
822 printk(KERN_INFO "%s(): registering device resources\n", __func__);
823 i2c_register_board_info(0, bfin_i2c_board_info,
824 ARRAY_SIZE(bfin_i2c_board_info));
825 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
826 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
827 /* setup BF518-EZBRD GPIO pin PG11 to AMS2, PG15 to AMS3. */
828 peripheral_request(P_AMS2, "ParaFlash");
829 #if !defined(CONFIG_SPI_BFIN) && !defined(CONFIG_SPI_BFIN_MODULE)
830 peripheral_request(P_AMS3, "ParaFlash");
835 arch_initcall(ezbrd_init);
837 static struct platform_device *ezbrd_early_devices[] __initdata = {
838 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
839 #ifdef CONFIG_SERIAL_BFIN_UART0
842 #ifdef CONFIG_SERIAL_BFIN_UART1
847 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
848 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
849 &bfin_sport0_uart_device,
851 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
852 &bfin_sport1_uart_device,
857 void __init native_machine_early_platform_add_devices(void)
859 printk(KERN_INFO "register early platform devices\n");
860 early_platform_add_devices(ezbrd_early_devices,
861 ARRAY_SIZE(ezbrd_early_devices));
864 void native_machine_restart(char *cmd)
866 /* workaround reboot hang when booting from SPI */
867 if ((bfin_read_SYSCR() & 0x7) == 0x3)
868 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
871 void bfin_get_ether_addr(char *addr)
873 /* the MAC is stored in OTP memory page 0xDF */
876 u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
878 ret = otp_read(0xDF, 0x00, &otp_mac);
880 char *otp_mac_p = (char *)&otp_mac;
881 for (ret = 0; ret < 6; ++ret)
882 addr[ret] = otp_mac_p[5 - ret];
885 EXPORT_SYMBOL(bfin_get_ether_addr);