saar.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * linux/arch/arm/mach-pxa/saar.c
  3. *
  4. * Support for the Marvell PXA930 Handheld Platform (aka SAAR)
  5. *
  6. * Copyright (C) 2007-2008 Marvell International Ltd.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * publishhed by the Free Software Foundation.
  11. */
  12. #include <linux/module.h>
  13. #include <linux/kernel.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/clk.h>
  18. #include <linux/gpio.h>
  19. #include <linux/smc91x.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <mach/hardware.h>
  23. #include <mach/pxa3xx-regs.h>
  24. #include <mach/mfp-pxa930.h>
  25. #include "devices.h"
  26. #include "generic.h"
  27. /* SAAR MFP configurations */
  28. static mfp_cfg_t saar_mfp_cfg[] __initdata = {
  29. /* Ethernet */
  30. DF_nCS1_nCS3,
  31. GPIO97_GPIO,
  32. };
  33. #define SAAR_ETH_PHYS (0x14000000)
  34. static struct resource smc91x_resources[] = {
  35. [0] = {
  36. .start = (SAAR_ETH_PHYS + 0x300),
  37. .end = (SAAR_ETH_PHYS + 0xfffff),
  38. .flags = IORESOURCE_MEM,
  39. },
  40. [1] = {
  41. .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
  42. .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
  43. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  44. }
  45. };
  46. static struct smc91x_platdata saar_smc91x_info = {
  47. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_USE_DMA,
  48. };
  49. static struct platform_device smc91x_device = {
  50. .name = "smc91x",
  51. .id = 0,
  52. .num_resources = ARRAY_SIZE(smc91x_resources),
  53. .resource = smc91x_resources,
  54. .dev = {
  55. .platform_data = &saar_smc91x_info,
  56. },
  57. };
  58. static void __init saar_init(void)
  59. {
  60. /* initialize MFP configurations */
  61. pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg));
  62. platform_device_register(&smc91x_device);
  63. }
  64. MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
  65. /* Maintainer: Eric Miao <eric.miao@marvell.com> */
  66. .phys_io = 0x40000000,
  67. .boot_params = 0xa0000100,
  68. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  69. .map_io = pxa_map_io,
  70. .init_irq = pxa3xx_init_irq,
  71. .timer = &pxa_timer,
  72. .init_machine = saar_init,
  73. MACHINE_END