stmp37xx_devb.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Freescale STMP37XX development board support
  3. *
  4. * Embedded Alley Solutions, Inc <source@embeddedalley.com>
  5. *
  6. * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
  7. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
  8. */
  9. /*
  10. * The code contained herein is licensed under the GNU General Public
  11. * License. You may obtain a copy of the GNU General Public License
  12. * Version 2 or later at the following locations:
  13. *
  14. * http://www.opensource.org/licenses/gpl-license.html
  15. * http://www.gnu.org/copyleft/gpl.html
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/device.h>
  20. #include <linux/platform_device.h>
  21. #include <asm/setup.h>
  22. #include <asm/mach-types.h>
  23. #include <asm/mach/arch.h>
  24. #include <mach/stmp3xxx.h>
  25. #include <mach/pins.h>
  26. #include <mach/pinmux.h>
  27. #include "stmp37xx.h"
  28. /*
  29. * List of STMP37xx development board specific devices
  30. */
  31. static struct platform_device *stmp37xx_devb_devices[] = {
  32. &stmp3xxx_dbguart,
  33. };
  34. static struct pin_desc dbguart_pins_0[] = {
  35. { PINID_PWM0, PIN_FUN3, },
  36. { PINID_PWM1, PIN_FUN3, },
  37. };
  38. static struct pin_group dbguart_pins[] = {
  39. [0] = {
  40. .pins = dbguart_pins_0,
  41. .nr_pins = ARRAY_SIZE(dbguart_pins_0),
  42. },
  43. };
  44. static int dbguart_pins_control(int id, int request)
  45. {
  46. int r = 0;
  47. if (request)
  48. r = stmp3xxx_request_pin_group(&dbguart_pins[id], "debug uart");
  49. else
  50. stmp3xxx_release_pin_group(&dbguart_pins[id], "debug uart");
  51. return r;
  52. }
  53. static void __init stmp37xx_devb_init(void)
  54. {
  55. stmp3xxx_pinmux_init(NR_REAL_IRQS);
  56. /* Init STMP3xxx platform */
  57. stmp3xxx_init();
  58. stmp3xxx_dbguart.dev.platform_data = dbguart_pins_control;
  59. /* Add STMP37xx development board devices */
  60. platform_add_devices(stmp37xx_devb_devices,
  61. ARRAY_SIZE(stmp37xx_devb_devices));
  62. }
  63. MACHINE_START(STMP37XX, "STMP37XX")
  64. .phys_io = 0x80000000,
  65. .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
  66. .boot_params = 0x40000100,
  67. .map_io = stmp37xx_map_io,
  68. .init_irq = stmp37xx_init_irq,
  69. .timer = &stmp3xxx_timer,
  70. .init_machine = stmp37xx_devb_init,
  71. MACHINE_END