init.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* linux/arch/arm/mach-s5p64x0/init.c
  2. *
  3. * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com
  5. *
  6. * S5P64X0 - Init support
  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. * published by the Free Software Foundation.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/types.h>
  14. #include <linux/init.h>
  15. #include <linux/serial_core.h>
  16. #include <mach/map.h>
  17. #include <plat/cpu.h>
  18. #include <plat/devs.h>
  19. #include <plat/s5p6440.h>
  20. #include <plat/s5p6450.h>
  21. #include <plat/regs-serial.h>
  22. static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = {
  23. [0] = {
  24. .name = "pclk_low",
  25. .divisor = 1,
  26. .min_baud = 0,
  27. .max_baud = 0,
  28. },
  29. [1] = {
  30. .name = "uclk1",
  31. .divisor = 1,
  32. .min_baud = 0,
  33. .max_baud = 0,
  34. },
  35. };
  36. /* uart registration process */
  37. void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  38. {
  39. struct s3c2410_uartcfg *tcfg = cfg;
  40. u32 ucnt;
  41. for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
  42. if (!tcfg->clocks) {
  43. tcfg->clocks = s5p64x0_serial_clocks;
  44. tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks);
  45. }
  46. }
  47. }
  48. void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  49. {
  50. int uart;
  51. for (uart = 0; uart < no; uart++) {
  52. s5p_uart_resources[uart].resources->start = S5P6440_PA_UART(uart);
  53. s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART;
  54. }
  55. s5p64x0_common_init_uarts(cfg, no);
  56. s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
  57. }
  58. void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  59. {
  60. s5p64x0_common_init_uarts(cfg, no);
  61. s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
  62. }