entry.S 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*******************************************************************************
  2. EZNPS CPU startup Code
  3. Copyright(c) 2012 EZchip Technologies.
  4. This program is free software; you can redistribute it and/or modify it
  5. under the terms and conditions of the GNU General Public License,
  6. version 2, as published by the Free Software Foundation.
  7. This program is distributed in the hope it will be useful, but WITHOUT
  8. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. more details.
  11. The full GNU General Public License is included in this distribution in
  12. the file called "COPYING".
  13. *******************************************************************************/
  14. #include <linux/linkage.h>
  15. #include <asm/entry.h>
  16. #include <asm/cache.h>
  17. #include <plat/ctop.h>
  18. .cpu A7
  19. .section .init.text, "ax",@progbits
  20. .align 1024 ; HW requierment for restart first PC
  21. ENTRY(res_service)
  22. #if defined(CONFIG_EZNPS_MTM_EXT) && defined(CONFIG_EZNPS_SHARED_AUX_REGS)
  23. ; There is no work for HW thread id != 0
  24. lr r3, [CTOP_AUX_THREAD_ID]
  25. cmp r3, 0
  26. jne stext
  27. #endif
  28. #ifdef CONFIG_ARC_HAS_DCACHE
  29. ; With no cache coherency mechanism D$ need to be used very carefully.
  30. ; Address space:
  31. ; 0G-2G: We disable CONFIG_ARC_CACHE_PAGES.
  32. ; 2G-3G: We disable D$ by setting this bit.
  33. ; 3G-4G: D$ is disabled by architecture.
  34. ; FMT are huge pages for user application reside at 0-2G.
  35. ; Only FMT left as one who can use D$ where each such page got
  36. ; disable/enable bit for cachability.
  37. ; Programmer will use FMT pages for private data so cache coherency
  38. ; would not be a problem.
  39. ; First thing we invalidate D$
  40. sr 1, [ARC_REG_DC_IVDC]
  41. sr HW_COMPLY_KRN_NOT_D_CACHED, [CTOP_AUX_HW_COMPLY]
  42. #endif
  43. #ifdef CONFIG_SMP
  44. ; We set logical cpuid to be used by GET_CPUID
  45. ; We do not use physical cpuid since we want ids to be continious when
  46. ; it comes to cpus on the same quad cluster.
  47. ; This is useful for applications that used shared resources of a quad
  48. ; cluster such SRAMS.
  49. lr r3, [CTOP_AUX_CORE_ID]
  50. sr r3, [CTOP_AUX_LOGIC_CORE_ID]
  51. lr r3, [CTOP_AUX_CLUSTER_ID]
  52. ; Set logical is acheived by swap of 2 middle bits of cluster id (4 bit)
  53. ; r3 is used since we use short instruction and we need q-class reg
  54. .short CTOP_INST_MOV2B_FLIP_R3_B1_B2_INST
  55. .word CTOP_INST_MOV2B_FLIP_R3_B1_B2_LIMM
  56. sr r3, [CTOP_AUX_LOGIC_CLUSTER_ID]
  57. #endif
  58. j stext
  59. END(res_service)