stmp378x_devb.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Freescale STMP378X 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/platform_device.h>
  20. #include <asm/setup.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/arch.h>
  23. #include <mach/pins.h>
  24. #include <mach/pinmux.h>
  25. #include <mach/stmp3xxx.h>
  26. #include "stmp378x.h"
  27. static struct platform_device *devices[] = {
  28. &stmp3xxx_dbguart,
  29. };
  30. static struct pin_desc dbguart_pins_0[] = {
  31. { PINID_PWM0, PIN_FUN3, },
  32. { PINID_PWM1, PIN_FUN3, },
  33. };
  34. static struct pin_group dbguart_pins[] = {
  35. [0] = {
  36. .pins = dbguart_pins_0,
  37. .nr_pins = ARRAY_SIZE(dbguart_pins_0),
  38. },
  39. };
  40. static int dbguart_pins_control(int id, int request)
  41. {
  42. int r = 0;
  43. if (request)
  44. r = stmp3xxx_request_pin_group(&dbguart_pins[id], "debug uart");
  45. else
  46. stmp3xxx_release_pin_group(&dbguart_pins[id], "debug uart");
  47. return r;
  48. }
  49. static void __init stmp378x_devb_init(void)
  50. {
  51. stmp3xxx_pinmux_init(NR_REAL_IRQS);
  52. /* init stmp3xxx platform */
  53. stmp3xxx_init();
  54. stmp3xxx_dbguart.dev.platform_data = dbguart_pins_control;
  55. /* add board's devices */
  56. platform_add_devices(devices, ARRAY_SIZE(devices));
  57. }
  58. MACHINE_START(STMP378X, "STMP378X")
  59. .phys_io = 0x80000000,
  60. .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
  61. .boot_params = 0x40000100,
  62. .map_io = stmp378x_map_io,
  63. .init_irq = stmp378x_init_irq,
  64. .timer = &stmp3xxx_timer,
  65. .init_machine = stmp378x_devb_init,
  66. MACHINE_END